project for eddystone

Dependencies:   BLE_API mbed nRF51822

Fork of BLE_URIBeacon by Bluetooth Low Energy

Revision:
24:2c2555bb5cba
Parent:
23:001aebcbac9a
Child:
26:a2396234b4a8
--- a/main.cpp	Fri Jun 19 23:38:48 2015 +0000
+++ b/main.cpp	Sat Jun 20 23:48:06 2015 +0000
@@ -21,7 +21,7 @@
 #include "DeviceInformationService.h"
 #include "ConfigParamsPersistence.h"
 
-BLEDevice ble;
+BLE ble;
 URIBeaconConfigService *uriBeaconConfig;
 
 /**
@@ -45,7 +45,7 @@
     state = ble.getGapState();
     if (!state.connected) { /* don't switch if we're in a connected state. */
         uriBeaconConfig->setupURIBeaconAdvertisements();
-        ble.startAdvertising();
+        ble.gap().startAdvertising();
 
         configAdvertisementTimeoutTicker.detach(); /* disable the callback from the timeout Ticker. */
     }
@@ -56,13 +56,13 @@
  */
 void disconnectionCallback(Gap::Handle_t handle, Gap::DisconnectionReason_t reason)
 {
-    ble.startAdvertising();
+    ble.gap().startAdvertising();
 }
 
 int main(void)
 {
     ble.init();
-    ble.onDisconnection(disconnectionCallback);
+    ble.gap().onDisconnection(disconnectionCallback);
 
     /*
      * Load parameters from (platform specific) persistent storage. Parameters
@@ -86,8 +86,8 @@
     DFUService dfu(ble);
     DeviceInformationService deviceInfo(ble, "ARM", "UriBeacon", "SN1", "hw-rev1", "fw-rev1", "soft-rev1");
 
-    ble.startAdvertising(); /* Set the whole thing in motion. After this call a GAP central can scan the URIBeaconConfig
-                             * service. This can then be switched to the normal URIBeacon functionality after a timeout. */
+    ble.gap().startAdvertising(); /* Set the whole thing in motion. After this call a GAP central can scan the URIBeaconConfig
+                                   * service. This can then be switched to the normal URIBeacon functionality after a timeout. */
 
     while (true) {
         ble.waitForEvent();