only notify needed (#1562)

* only notify needed

* added docs
This commit is contained in:
Peli de Halleux 2018-10-30 19:57:01 -07:00 committed by GitHub
parent 198f423f5a
commit 7bc7d2f2ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 1 deletions

View File

@ -0,0 +1,19 @@
# Bluetooth HF2
The Bluetooth HF2 service implements a subset of [HF2](https://github.com/Microsoft/uf2/blob/master/hf2.md), namely the serial message logging.
## Service
### HF2 service
* UUID: ``b112f5e6-2679-30da-a26e-0273b6043849``
### TX Characteristic
* Optional
* UUDI: ``b112f5e6-2679-30da-a26e-0273b604384a``
* NOTIFY only
This characteristic mostly emits HF2 serial messages. The first byte contains the type of message and length in the lower 6 bits. The message contains up to 19 bytes.
This service is supported by the MakeCode editor to receive messages.

View File

@ -7,7 +7,7 @@ BLEHF2Service::BLEHF2Service(BLEDevice &_ble) :
ble(_ble)
{
GattCharacteristic txCharacteristic(BLEHF2TxCharacteristicUUID, (uint8_t *)&txCharacteristicMessage, 0,
sizeof(txCharacteristicMessage), GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY);
sizeof(txCharacteristicMessage), GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY);
// Initialise our characteristic values.
memset(&txCharacteristicMessage, 0, sizeof(txCharacteristicMessage));