An example of creating and updating a simple GATT Service using the BLE_API
Dependencies: BLE_API mbed nRF51822 X_NUCLEO_IDB0XA1
This example creates and updates a standard Battery Level service, and a single GATT characteristic that contains the battery level.
Diff: main.cpp
- Revision:
- 14:39b4b11d9cf5
- Parent:
- 13:60e095fe4b45
- Child:
- 16:5cdd04cf1ed4
--- a/main.cpp Tue Dec 16 09:12:25 2014 +0000 +++ b/main.cpp Tue Mar 24 08:15:17 2015 +0000 @@ -50,7 +50,7 @@ /* 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.setAdvertisingInterval(1000); /* 1000ms; in multiples of 0.625ms. */ ble.startAdvertising(); while (true) {