Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BLE_API LIS3DH mbed nRF51822 BMC050 nRF51_LowPwr nRF51_Vdd
Fork of BLE_EddystoneBeacon_Service by
Revision 8:1a21308e5008, committed 2015-06-20
- Comitter:
- rgrover1
- Date:
- Sat Jun 20 23:49:59 2015 +0000
- Parent:
- 7:e9800c45e065
- Child:
- 9:7b4ba649e342
- Commit message:
- update to the newer APIs; rename BLEDevice with BLE
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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();
