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 23:b66fa312e926, committed 2014-05-23
- Comitter:
- Rohit Grover
- Date:
- Fri May 23 17:04:34 2014 +0100
- Parent:
- 22:080d9bf2f5c0
- Child:
- 24:9bcd0dbf0f41
- Commit message:
- using simplified API to accumulate adv payload
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri May 23 16:17:13 2014 +0100
+++ b/main.cpp Fri May 23 17:04:34 2014 +0100
@@ -61,18 +61,14 @@
ble.init();
ble.reset();
- /* Setup advertising data. This includes AD structures in the payload of
- * advertising packets. */
- {
- GapAdvertisingData advData;
- advData.addFlags(GapAdvertisingData::BREDR_NOT_SUPPORTED);
- advData.addData(GapAdvertisingData::MANUFACTURER_SPECIFIC_DATA,
- beaconPayload,
- sizeof(beaconPayload));
- ble.setAdvertisingData(advData);
- }
+ ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED);
+ ble.accumulateAdvertisingPayload(GapAdvertisingData::MANUFACTURER_SPECIFIC_DATA,
+ beaconPayload,
+ sizeof(beaconPayload));
ble.setAdvertisingType(GapAdvertisingParams::ADV_NON_CONNECTABLE_UNDIRECTED);
+ ble.setAdvertisingTimeout(0); /* disable timeout. */
+ ble.setAdvertisingInterval(160); /* 100ms; in multiples of 0.625ms. */
ble.startAdvertising();
/* Do blinky on mainloopLED while we're waiting for BLE events */
