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
Revision 1:db5fcf988f53, committed 2015-01-28
- Comitter:
- JonnyA
- Date:
- Wed Jan 28 01:01:47 2015 +0000
- Parent:
- 0:e2b2b6bdb2dc
- Commit message:
- The default advertising period seems too slow for the name to show up fast.; ; As that's the sole point of this example, let's decrease the interval
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r e2b2b6bdb2dc -r db5fcf988f53 main.cpp --- a/main.cpp Wed Jan 28 00:50:59 2015 +0000 +++ b/main.cpp Wed Jan 28 01:01:47 2015 +0000 @@ -25,9 +25,13 @@ { ble.init(); - /* Setup advertising. */ + /* Setup the data to go into the advertising packets. */ ble.accumulateAdvertisingPayload(GapAdvertisingData::BREDR_NOT_SUPPORTED | GapAdvertisingData::LE_GENERAL_DISCOVERABLE); ble.accumulateAdvertisingPayload(GapAdvertisingData::COMPLETE_LOCAL_NAME, (uint8_t *)DEVICE_NAME, sizeof(DEVICE_NAME)); + + /* The default advertising period is a little low - increase it */ + ble.setAdvertisingInterval(Gap::MSEC_TO_ADVERTISEMENT_DURATION_UNITS(1000)); + ble.startAdvertising(); while (true) {