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 mbed nRF51822
Fork of BLE_BatteryLevel by
Diff: main.cpp
- Revision:
- 13:60e095fe4b45
- Parent:
- 12:4024aa3f72b0
- Child:
- 14:39b4b11d9cf5
diff -r 4024aa3f72b0 -r 60e095fe4b45 main.cpp
--- a/main.cpp Mon Dec 15 08:10:46 2014 +0000
+++ b/main.cpp Tue Dec 16 09:12:25 2014 +0000
@@ -45,14 +45,14 @@
ble.init();
ble.onDisconnection(disconnectionCallback);
+ BatteryService batteryService(ble, batteryLevel);
+
/* setup advertising */
ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED);
ble.setAdvertisingType(GapAdvertisingParams::ADV_CONNECTABLE_UNDIRECTED);
ble.setAdvertisingInterval(Gap::MSEC_TO_ADVERTISEMENT_DURATION_UNITS(1000)); /* 1000ms; in multiples of 0.625ms. */
ble.startAdvertising();
- BatteryService batteryService(ble, batteryLevel);
-
while (true) {
ble.waitForEvent(); // this will return upon any system event (such as an interrupt or a ticker wakeup)
