Odometry Pedometer using nRF51822 and ADXL345
Dependencies: ADXL345 BLE_API mbed nRF51822
Fork of BLE_CycleSpeedCadence by
Revision 26:e6ad33b227c6, committed 2014-07-03
- Comitter:
- Rohit Grover
- Date:
- Thu Jul 03 11:44:59 2014 +0100
- Parent:
- 25:b3e91851d9e2
- Child:
- 27:97adf2b76b9c
- Commit message:
- add deviceInformationService to the basic HRM demo
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Jun 26 14:11:57 2014 +0000
+++ b/main.cpp Thu Jul 03 11:44:59 2014 +0100
@@ -30,6 +30,14 @@
#define DEBUG(...) /* nothing */
#endif /* #if NEED_CONSOLE_OUTPUT */
+/* Device Information service */
+const char deviceName[] = { 'm', 'b', 'e', 'd' };
+GattCharacteristic deviceManufacturer(GattCharacteristic::UUID_MANUFACTURER_NAME_STRING_CHAR, (uint8_t *)deviceName, sizeof(deviceName), sizeof(deviceName),
+ GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ);
+GattCharacteristic *deviceInformationChars[] = {&deviceManufacturer};
+GattService deviceInformationService(GattService::UUID_DEVICE_INFORMATION_SERVICE, deviceInformationChars,
+ sizeof(deviceInformationChars) / sizeof(GattCharacteristic *));
+
/* Heart Rate Service */
/* Service: https://developer.bluetooth.org/gatt/services/Pages/ServiceViewer.aspx?u=org.bluetooth.service.heart_rate.xml */
/* HRM Char: https://developer.bluetooth.org/gatt/characteristics/Pages/CharacteristicViewer.aspx?u=org.bluetooth.characteristic.heart_rate_measurement.xml */
@@ -89,6 +97,7 @@
ble.setAdvertisingInterval(160); /* 100ms; in multiples of 0.625ms. */
ble.startAdvertising();
+ ble.addService(deviceInformationService);
ble.addService(hrmService);
while (true) {
