arduino / arduino/ArduinoCore-API

BLE central API

Abierto
#7 41 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
C++
Estrellas
306
Forks
150
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Based on the outcome of the API meeting, I've added a first draft of a BLE central API in the [api/BLE/central](https://github.com/arduino/ArduinoCore-API/tree/master/api/BLE/central) folder.

It's probably best to review the examples in the following order:
- [scan.ino](https://github.com/arduino/ArduinoCore-API/blob/master/api/BLE/central/examples/scan/scan.ino): Starts scanning for peripherals and prints out advertisement info. of discovered peripheral
- [scan_callback.ino](https://github.com/arduino/ArduinoCore-API/blob/master/api/BLE/central/examples/scan_callback/scan_callback.ino): Similar to `scan.ino` but callback style
- [led_control.ino](https://github.com/arduino/ArduinoCore-API/blob/master/api/BLE/central/examples/led_control/led_control.ino): Controls the LED on the [101 BLE LED example](https://github.com/01org/corelibs-arduino101/blob/master/libraries/CurieBLE/examples/LED/LED.ino) using a local button
- [sensortag_button.ino](https://github.com/arduino/ArduinoCore-API/blob/master/api/BLE/central/examples/sensortag_button/sensortag_button.ino): Listens to simple key notifications from a TI SensorTag and prints out events to the serial monitor. Similar to Tom's [Node.js sensorTagSlideshow example](https://github.com/tigoe/BluetoothLE-Examples/tree/master/sensorTag/sensorTagSlideshow).
- [peripheral_explorer.ino](https://github.com/arduino/ArduinoCore-API/blob/master/api/BLE/central/examples/peripheral_explorer/peripheral_explorer.ino): Connects to a peripheral and prints out it's services, characteristics, and descriptors. Similar to Tom's [Node.js exploreAsync example](https://github.com/tigoe/BluetoothLE-Examples/blob/master/noble/exploreAsync/explore.js).

Other item's to discuss:
1. Are there too many API's to access attributes of a peripheral? I've added a few to cater for various use cases, however I understand this might make documentation more difficult.
2. Is there a nicer way to handle reading and writing attributes with values (characteristics and descriptors). See [BLERemotePeripheralAttributeWithValue.h](https://github.com/arduino/ArduinoCore-API/blob/master/api/BLE/central/BLERemotePeripheralAttributeWithValue.h). Maybe we can re-use the [UDP](https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/cores/arduino/Udp.h) style, with `beginWrite`, `Print` API's, and `endWrite`.
3. Class names, they are long now, mostly to avoid clashes with the BLEPeripheral API. In case there are use cases for using both peripheral and central mode at the same time in the future.

cc/ @tigoe @damellis @cmaglie @agdl

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Revisa el borrador en api/BLE/central y los ejemplos de scan.ino, scan_callback.ino, led_control.ino, sensortag_button.ino y peripheral_explorer.ino. Empieza leyendo los ejemplos y BLERemotePeripheralAttributeWithValue.h y, después, resuelve las cuestiones abiertas sobre la API, la lectura/escritura de atributos y los nombres de las clases. Se considerará terminado cuando el diseño de la API central esté acordado y el borrador refleje esa decisión.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
cpp
Área
api, embedded-iot
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.