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:
- 230:2c414d3240a8
- Parent:
- 227:5c4cb4553821
- Child:
- 244:aa639ef2f290
--- a/public/BLEDevice.h Wed Dec 03 14:38:40 2014 +0000 +++ b/public/BLEDevice.h Wed Dec 03 14:38:40 2014 +0000 @@ -36,6 +36,11 @@ ble_error_t init(); ble_error_t reset(void); + /** + * Purge the BLE stack of GATT and GAP state. init() must be called afterwards to re-instate services and GAP state. + */ + ble_error_t shutdown(void); + /* GAP specific APIs */ public: /** @@ -365,6 +370,13 @@ } inline ble_error_t +BLEDevice::shutdown(void) +{ + clearAdvertisingPayload(); + return transport->shutdown(); +} + +inline ble_error_t BLEDevice::setAddress(Gap::addr_type_t type, const Gap::address_t address) { return transport->getGap().setAddress(type, address);