Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of BLE_API by
Revision 120:467527c1b943, committed 2014-09-26
- Comitter:
- Rohit Grover
- Date:
- Fri Sep 26 16:42:50 2014 +0100
- Parent:
- 119:18684018b83e
- Child:
- 121:035516234a33
- Commit message:
- Release 0.2.1
=============
Features
~~~~~~~~
- Add the 'packet' characteristic to the DFUService. This helps mimic the
layout of the actual DFU service in the dfu-bootloader. Without this, some
FOTA clients might get confused as service definitions change after handing
control over to the bootloader.
- Initialize DFUService's controlPoint characteristic to have the value
0xFFFF. This helps distinguish an application from the dfu-bootloader; since
both provide the DFU-Service.
Bugfixes
~~~~~~~~
None.
Compatibility
~~~~~~~~~~~~~
No APIs have changed between 0.2.0 and this release. Applications need not be
Changed in this revision
| services/DFUService.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/services/DFUService.h Fri Sep 26 14:28:59 2014 +0100
+++ b/services/DFUService.h Fri Sep 26 16:42:50 2014 +0100
@@ -43,6 +43,7 @@
DFUService(BLEDevice &_ble, ResetPrepare_t _handoverCallback = NULL) :
ble(_ble),
controlBytes(),
+ packetBytes(),
controlPoint(DFUServiceControlCharacteristicUUID, controlBytes, SIZEOF_CONTROL_BYTES, SIZEOF_CONTROL_BYTES,
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
packet(DFUServicePacketCharacteristicUUID, packetBytes, SIZEOF_PACKET_BYTES, SIZEOF_PACKET_BYTES,
@@ -52,6 +53,11 @@
return;
}
+ /* Set an initial value for control bytes so that the application's DFUService can
+ * be distinguished from the real DFU service provided by the bootloader. */
+ controlBytes[0] = 0xFF;
+ controlBytes[1] = 0xFF;
+
GattCharacteristic *dfuChars[] = {&controlPoint, &packet};
GattService dfuService(DFUServiceUUID, dfuChars, sizeof(dfuChars) / sizeof(GattCharacteristic *));
@@ -86,7 +92,7 @@
static const unsigned SIZEOF_CONTROL_BYTES = 2;
static const unsigned SIZEOF_PACKET_BYTES = 20;
- static ResetPrepare_t handoverCallback; /**< application specific handover callback. */
+ static ResetPrepare_t handoverCallback; /**< application specific handover callback. */
private:
BLEDevice &ble;
