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:
- 5:77ad8d8dc9c5
- Parent:
- 4:5b64235d1b85
- Child:
- 8:45beed07b093
diff -r 5b64235d1b85 -r 77ad8d8dc9c5 main.cpp
--- a/main.cpp Thu Jun 12 13:56:06 2014 +0100
+++ b/main.cpp Thu Jun 12 14:16:55 2014 +0100
@@ -36,9 +36,7 @@
uint8_t batt = 72; /* Battery level */
GattCharacteristic battLevel (GattCharacteristic::UUID_BATTERY_LEVEL_CHAR, &batt, sizeof(batt), sizeof(batt),
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY | GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ);
-GattCharacteristic *battChars[] = {
- &battLevel,
-};
+GattCharacteristic *battChars[] = {&battLevel};
GattService battService (GattService::UUID_BATTERY_SERVICE, battChars, sizeof(battChars) / sizeof(GattCharacteristic *));