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 X_NUCLEO_IDB0XA1
Fork of BLE_iBeacon by
Revision 48:2f0f293a4966, committed 2014-11-28
- Comitter:
- rgrover1
- Date:
- Fri Nov 28 14:17:32 2014 +0000
- Parent:
- 47:447eb23e67e2
- Child:
- 49:2d05e684f9c3
- Commit message:
- updating to 0.2.5 of the BLE_API
Changed in this revision
--- a/BLE_API.lib Wed Nov 05 14:16:16 2014 +0000 +++ b/BLE_API.lib Fri Nov 28 14:17:32 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#fede41ce9407 +http://mbed.org/teams/Bluetooth-Low-Energy/code/BLE_API/#933961a2ac6f
--- a/main.cpp Wed Nov 05 14:16:16 2014 +0000
+++ b/main.cpp Fri Nov 28 14:17:32 2014 +0000
@@ -19,16 +19,6 @@
BLEDevice ble;
-#define NEED_CONSOLE_OUTPUT 0 /* Set this if you need debug messages on the console;
- * it will have an impact on code-size and power consumption. */
-
-#if NEED_CONSOLE_OUTPUT
-Serial pc(USBTX, USBRX);
-#define DEBUG(...) { pc.printf(__VA_ARGS__); }
-#else
-#define DEBUG(...) /* nothing */
-#endif /* #if NEED_CONSOLE_OUTPUT */
-
/*
* For this demo application, populate the beacon advertisement payload
* with 2 AD structures: FLAG and MSD (manufacturer specific data).
@@ -52,30 +42,21 @@
0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef, 0xf0,
0x00, 0x00,
0x00, 0x00,
- 0xC7
+ 0xC8
};
int main(void)
{
- DEBUG("Initialising BTLE transport\n\r");
ble.init();
ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED | GapAdvertisingData::LE_GENERAL_DISCOVERABLE);
ble.accumulateAdvertisingPayload(GapAdvertisingData::MANUFACTURER_SPECIFIC_DATA, beaconPayload, sizeof(beaconPayload));
ble.setAdvertisingType(GapAdvertisingParams::ADV_NON_CONNECTABLE_UNDIRECTED);
- ble.setAdvertisingInterval(1600); /* 1s; in multiples of 0.625ms. */
+ ble.setAdvertisingInterval(Gap::MSEC_TO_ADVERTISEMENT_DURATION_UNITS(1000));
ble.startAdvertising();
for (;;) {
ble.waitForEvent();
}
-
- // An alternative to the above:
- //
- // DigitalOut mainloopLED(LED1);
- // for (;;) {
- // mainloopLED = !mainloopLED;
- // ble.waitForEvent();
- // }
}
--- a/nRF51822.lib Wed Nov 05 14:16:16 2014 +0000 +++ b/nRF51822.lib Fri Nov 28 14:17:32 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#61da91a52bd6 +http://mbed.org/teams/Nordic-Semiconductor/code/nRF51822/#9a5ba2c5d53c
