Microbug / BLE_API

Fork of BLE_API by Bluetooth Low Energy

Revision:
63:653378e782ea
Parent:
49:03a51f0006f8
Child:
64:95529f47b782
--- a/hw/BLEDevice.h	Mon Jun 02 14:58:56 2014 +0100
+++ b/hw/BLEDevice.h	Wed Jun 04 09:36:31 2014 +0100
@@ -129,6 +129,10 @@
 
     ble_error_t disconnect(void);
 
+    void onTimeout(Gap::EventCallback_t       timeoutCallback);
+    void onConnection(Gap::EventCallback_t    connectionCallback);
+    void onDisconnection(Gap::EventCallback_t disconnectionCallback);
+
 private:
     /**
      * Internal helper to udpate the transport backend with advertising data
@@ -300,4 +304,20 @@
     return transport->getGap().startAdvertising(_advParams);
 }
 
+inline void
+BLEDevice::onTimeout(Gap::EventCallback_t timeoutCallback) {
+    transport->getGap().setOnTimeout(timeoutCallback);
+}
+
+inline void
+BLEDevice::onConnection(Gap::EventCallback_t connectionCallback) {
+    transport->getGap().setOnConnection(connectionCallback);
+}
+
+inline void
+BLEDevice::onDisconnection(Gap::EventCallback_t disconnectionCallback) {
+    transport->getGap().setOnDisconnection(disconnectionCallback);
+}
+
+
 #endif // ifndef __BLE_DEVICE_H__