abc

Fork of BLE_API by Bluetooth Low Energy

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)
 {