Button initiated config service

Dependencies:   BLE_API_EddystoneConfigService_2 mbed nRF51822

Fork of BLE_EddystoneBeaconConfigService_3 by URIBeacon

Revision:
50:52a8b18d5bf1
Parent:
44:0e27ee7800b8
Child:
51:d77639d7a3e4
--- a/main.cpp	Mon Sep 14 16:22:02 2015 +0000
+++ b/main.cpp	Mon Sep 14 20:13:56 2015 +0000
@@ -33,7 +33,7 @@
  *
  * The following help with this switch.
  */
-static const int CONFIG_ADVERTISEMENT_TIMEOUT_SECONDS = 30;  // Duration after power-on that config service is available.
+static const int CONFIG_ADVERTISEMENT_TIMEOUT_SECONDS = 60  ;  // Duration after power-on that config service is available.
 Ticker configAdvertisementTimeout;
 
 /**
@@ -44,9 +44,9 @@
     Gap::GapState_t state;
     state = ble.getGapState();
     if (!state.connected) { /* don't switch if we're in a connected state. */
-        EddystoneBeaconConfig->setupEddystoneAdvertisements();
         configAdvertisementTimeout.detach(); /* disable the callback from the timeout Ticker. */
         printf("removing config service\r\n");
+        EddystoneBeaconConfig->setupEddystoneAdvertisements();        
     }
 }
 
@@ -90,8 +90,8 @@
     static EddystoneConfigService::PowerLevels_t defaultAdvPowerLevels = {-20, -4, 0, 10}; // Values for ADV packets related to firmware levels
     EddystoneBeaconConfig = new EddystoneConfigService(ble, params, defaultAdvPowerLevels);
     EddystoneBeaconConfig->setDefaultURIFrameData("http://mbed.org",1000);
-    EddystoneBeaconConfig->setDefaultUIDFrameData(&uidNamespaceID, &uidInstanceID,10);
-    EddystoneBeaconConfig->setDefaultTLMFrameData(tlmVersion,1);
+    //EddystoneBeaconConfig->setDefaultUIDFrameData(&uidNamespaceID, &uidInstanceID,10);
+    //EddystoneBeaconConfig->setDefaultTLMFrameData(tlmVersion,1);
     EddystoneBeaconConfig->start(!fetchedFromPersistentStorage);
     
     if (!EddystoneBeaconConfig->initSuccessfully()) {