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.
Fork of BLE_API by
Diff: services/HeartRateService.h
- Revision:
- 255:80135bd6a519
- Parent:
- 242:0e9201b67e2f
diff -r 0e9201b67e2f -r 80135bd6a519 services/HeartRateService.h
--- a/services/HeartRateService.h Tue Dec 09 08:18:11 2014 +0000
+++ b/services/HeartRateService.h Tue Feb 16 13:58:09 2016 +0000
@@ -115,9 +115,13 @@
* This callback allows the HeartRateService to receive updates to the
* controlPoint Characteristic.
*
+ * @param[in] params
+ * Information about the characterisitc being updated.
*/
- virtual void onDataWritten(const GattCharacteristicWriteCBParams *params) {
- if (params->charHandle == controlPoint.getValueAttribute().getHandle()) {
+ virtual void onDataWritten(const GattCharacteristicWriteCBParams *params)
+ {
+ if (params->charHandle == controlPoint.getValueAttribute().getHandle())
+ {
/* Do something here if the new value is 1; else you can override this method by
* extending this class.
* @NOTE: if you are extending this class, be sure to also call
@@ -128,7 +132,8 @@
}
private:
- void setupService(void) {
+ void setupService(void)
+ {
static bool serviceAdded = false; /* We should only ever need to add the heart rate service once. */
if (serviceAdded) {
return;
@@ -190,12 +195,12 @@
};
private:
- BLEDevice &ble;
+ BLEDevice &ble;
HeartRateValueBytes valueBytes;
- uint8_t controlPointValue;
GattCharacteristic hrmRate;
GattCharacteristic hrmLocation;
GattCharacteristic controlPoint;
+ uint8_t controlPointValue;
};
#endif /* #ifndef __BLE_HEART_RATE_SERVICE_H__*/
\ No newline at end of file
