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:
- 349:b8b2b3973c47
- Parent:
- 347:20be4234c6fe
- Child:
- 353:5ed63cda3038
--- a/public/BLEDevice.h Fri May 08 15:35:45 2015 +0100 +++ b/public/BLEDevice.h Fri May 08 15:35:46 2015 +0100 @@ -331,6 +331,32 @@ void onRadioNotification(Gap::RadioNotificationEventCallback_t callback); /** + * Setup a callback for when the security procedure for a link has started. + */ + void setOnSecuritySetupStarted(Gap::HandleSpecificEvent_t callback); + + /** + * Setup a callback for when the security procedure for a link has + * completed. + */ + void setOnSecuritySetupCompleted(Gap::HandleSpecificEvent_t callback); + + /** + * Setup a callback for when a link with the peer is secured. For bonded + * devices, subsequent reconnections with bonded peer will result only in + * this callback when the link is secured and setup procedures will not + * occur unless the bonding information is either lost or deleted on either + * or both sides. + */ + void setOnLinkSecured(Gap::HandleSpecificEvent_t callback); + + /** + * Setup a callback for bonding; i.e. that link-specific security context + * is stored persistently for a peer device. + */ + void setOnSecurityContextStored(Gap::HandleSpecificEvent_t callback); + + /** * Add a service declaration to the local server ATT table. Also add the * characteristics contained within. */ @@ -709,6 +735,30 @@ transport->getGap().setOnRadioNotification(callback); } +inline void +BLEDevice::setOnSecuritySetupStarted(Gap::HandleSpecificEvent_t callback) +{ + transport->getGap().setOnSecuritySetupStarted(callback); +} + +inline void +BLEDevice::setOnSecuritySetupCompleted(Gap::HandleSpecificEvent_t callback) +{ + transport->getGap().setOnSecuritySetupCompleted(callback); +} + +inline void +BLEDevice::setOnLinkSecured(Gap::HandleSpecificEvent_t callback) +{ + transport->getGap().setOnLinkSecured(callback); +} + +inline void +BLEDevice::setOnSecurityContextStored(Gap::HandleSpecificEvent_t callback) +{ + transport->getGap().setOnSecurityContextStored(callback); +} + inline ble_error_t BLEDevice::addService(GattService &service) {