Button initiated config service
Dependencies: BLE_API_EddystoneConfigService_2 mbed nRF51822
Fork of BLE_EddystoneBeaconConfigService_3 by
Diff: main.cpp
- Revision:
- 8:1a21308e5008
- Parent:
- 7:e9800c45e065
- Child:
- 14:5a2a104a21a8
--- a/main.cpp Fri Jun 19 23:50:32 2015 +0000 +++ b/main.cpp Sat Jun 20 23:49:59 2015 +0000 @@ -21,7 +21,7 @@ #include "DeviceInformationService.h" #include "ConfigParamsPersistence.h" -BLEDevice ble; +BLE ble; ZipBeaconConfigService *zipBeaconConfig; /** @@ -45,7 +45,7 @@ state = ble.getGapState(); if (!state.connected) { /* don't switch if we're in a connected state. */ zipBeaconConfig->setupZipBeaconAdvertisements(); - 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 zipBeaconConfig - * 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 zipBeaconConfig + * service. This can then be switched to the normal URIBeacon functionality after a timeout. */ while (true) { ble.waitForEvent();