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 343:4d2576324b62, committed 2015-04-30
- Comitter:
- rgrover1
- Date:
- Thu Apr 30 08:37:21 2015 +0100
- Parent:
- 342:152bd9c825d6
- Child:
- 344:241987ac6b8b
- Commit message:
- Synchronized with git rev d1cdeb31
Author: Rohit Grover
fixes #36: add API for clearScanResponse()
Changed in this revision
| public/BLEDevice.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/public/BLEDevice.h Thu Apr 30 08:37:21 2015 +0100
+++ b/public/BLEDevice.h Thu Apr 30 08:37:21 2015 +0100
@@ -147,6 +147,9 @@
/**
* Reset any advertising payload prepared from prior calls to
* accumulateAdvertisingPayload().
+ *
+ * Note: This should be followed by a call to setAdvertisingPayload() or
+ * startAdvertising() before the update takes effect.
*/
void clearAdvertisingPayload(void);
@@ -208,6 +211,15 @@
ble_error_t accumulateScanResponse(GapAdvertisingData::DataType type, const uint8_t *data, uint8_t len);
/**
+ * Reset any scan response prepared from prior calls to
+ * accumulateScanResponse().
+ *
+ * Note: This should be followed by a call to setAdvertisingPayload() or
+ * startAdvertising() before the update takes effect.
+ */
+ void clearScanResponse(void);
+
+ /**
* Start advertising (GAP Discoverable, Connectable modes, Broadcast
* Procedure).
*/
@@ -570,6 +582,13 @@
return scanResponse.addData(type, data, len);
}
+inline void
+BLEDevice::clearScanResponse(void)
+{
+ needToSetAdvPayload = true;
+ scanResponse.clear();
+}
+
inline ble_error_t
BLEDevice::setAdvertisingPayload(void) {
needToSetAdvPayload = false;
