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.
Dependents: BLE_PowerBank_HeyFaradey
Fork of BLE_API by
Diff: services/HeartRateService.h
- Revision:
- 277:1407d2f1ce3c
- Parent:
- 243:98f930d14515
- Child:
- 338:fd32ec0ebd98
--- a/services/HeartRateService.h Thu Jan 22 09:59:43 2015 +0000
+++ b/services/HeartRateService.h Thu Jan 22 09:59:44 2015 +0000
@@ -59,10 +59,8 @@
hrmRate(GattCharacteristic::UUID_HEART_RATE_MEASUREMENT_CHAR, valueBytes.getPointer(),
valueBytes.getNumValueBytes(), HeartRateValueBytes::MAX_VALUE_BYTES,
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
- hrmLocation(GattCharacteristic::UUID_BODY_SENSOR_LOCATION_CHAR, (uint8_t *)&location, sizeof(location), sizeof(location),
- GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ),
- controlPoint(GattCharacteristic::UUID_HEART_RATE_CONTROL_POINT_CHAR, (uint8_t *)&controlPointValue,
- sizeof(controlPointValue), sizeof(controlPointValue), GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE) {
+ hrmLocation(GattCharacteristic::UUID_BODY_SENSOR_LOCATION_CHAR, &location),
+ controlPoint(GattCharacteristic::UUID_HEART_RATE_CONTROL_POINT_CHAR, &controlPointValue) {
setupService();
}
@@ -82,10 +80,8 @@
hrmRate(GattCharacteristic::UUID_HEART_RATE_MEASUREMENT_CHAR, valueBytes.getPointer(),
valueBytes.getNumValueBytes(), HeartRateValueBytes::MAX_VALUE_BYTES,
GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_NOTIFY),
- hrmLocation(GattCharacteristic::UUID_BODY_SENSOR_LOCATION_CHAR, (uint8_t *)&location, sizeof(location), sizeof(location),
- GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_READ),
- controlPoint(GattCharacteristic::UUID_HEART_RATE_CONTROL_POINT_CHAR, (uint8_t *)&controlPointValue,
- sizeof(controlPointValue), sizeof(controlPointValue), GattCharacteristic::BLE_GATT_CHAR_PROPERTIES_WRITE) {
+ hrmLocation(GattCharacteristic::UUID_BODY_SENSOR_LOCATION_CHAR, &location),
+ controlPoint(GattCharacteristic::UUID_HEART_RATE_CONTROL_POINT_CHAR, &controlPointValue) {
setupService();
}
@@ -193,11 +189,13 @@
private:
BLEDevice &ble;
+
HeartRateValueBytes valueBytes;
uint8_t controlPointValue;
- GattCharacteristic hrmRate;
- GattCharacteristic hrmLocation;
- GattCharacteristic controlPoint;
+
+ GattCharacteristic hrmRate;
+ ReadOnlyGattCharacteristic<uint8_t> hrmLocation;
+ WriteOnlyGattCharacteristic<uint8_t> controlPoint;
};
#endif /* #ifndef __BLE_HEART_RATE_SERVICE_H__*/
\ No newline at end of file
