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
Fork of nRF51822_SimpleChat by
Revision 4:4b070c445de4, committed 2015-09-08
- Comitter:
- jemiaha
- Date:
- Tue Sep 08 18:28:50 2015 +0000
- Parent:
- 3:2b4b55b7f467
- Commit message:
- Publishing slightly modified sample code. I added the temperature and battery services.
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Wed Sep 02 14:09:36 2015 +0000 +++ b/main.cpp Tue Sep 08 18:28:50 2015 +0000 @@ -69,6 +69,7 @@ // TODO add custom service instead of Heart rate GattService temperatureService(GattService::UUID_HEART_RATE_SERVICE, temperatureChars, sizeof(temperatureChars) / sizeof(GattCharacteristic *)); + static uint8_t batteryLevel = 0xAA; GattCharacteristic batteryPercentage(GattCharacteristic::UUID_BATTERY_LEVEL_CHAR, (uint8_t *)batteryLevel, sizeof(batteryLevel), sizeof(batteryLevel), GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY);