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
Diff: public/BLEDevice.h
- Revision:
- 343:4d2576324b62
- Parent:
- 342:152bd9c825d6
- Child:
- 347:20be4234c6fe
--- 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;