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_iBeacon by
Revision 74:7754bf460f52, committed 2015-11-06
- Comitter:
- rgrover1
- Date:
- Fri Nov 06 13:12:00 2015 +0000
- Parent:
- 73:abad114618b5
- Child:
- 75:b0385b4fdc3e
- Commit message:
- updating to the latest of the underlying libraries.
Changed in this revision
--- a/BLE_API.lib Tue Sep 29 09:45:56 2015 +0000 +++ b/BLE_API.lib Fri Nov 06 13:12:00 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#d494ad3e87bd +http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#a097e1be76f4
--- a/main.cpp Tue Sep 29 09:45:56 2015 +0000
+++ b/main.cpp Fri Nov 06 13:12:00 2015 +0000
@@ -18,11 +18,16 @@
#include "ble/services/iBeacon.h"
BLE ble;
-
-int main(void)
+
+void bleInitComplete(BLE::InitializationCompleteCallbackContext *params)
{
- ble.init();
+ BLE &ble = params->ble;
+ ble_error_t error = params->error;
+ if (error != BLE_ERROR_NONE) {
+ return;
+ }
+
/**
* The Beacon payload has the following composition:
* 128-Bit / 16byte UUID = E2 0A 39 F4 73 F5 4B C4 A1 2F 17 D1 AD 07 A9 61
@@ -36,10 +41,15 @@
uint16_t majorNumber = 1122;
uint16_t minorNumber = 3344;
uint16_t txPower = 0xC8;
- iBeacon ibeacon(ble, uuid, majorNumber, minorNumber, txPower);
+ iBeacon *ibeacon = new iBeacon(ble, uuid, majorNumber, minorNumber, txPower);
ble.gap().setAdvertisingInterval(1000); /* 1000ms. */
ble.gap().startAdvertising();
+}
+
+int main(void)
+{
+ ble.init(bleInitComplete);
while (true) {
ble.waitForEvent(); // allows or low power operation
--- a/mbed.bld Tue Sep 29 09:45:56 2015 +0000 +++ b/mbed.bld Fri Nov 06 13:12:00 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/users/mbed_official/code/mbed/builds/4f6c30876dfa \ No newline at end of file +http://mbed.org/users/mbed_official/code/mbed/builds/9296ab0bfc11 \ No newline at end of file
--- a/nRF51822.lib Tue Sep 29 09:45:56 2015 +0000 +++ b/nRF51822.lib Fri Nov 06 13:12:00 2015 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#088f5738bf18 +http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#bf85bf7e73d5
