Improve readability with getHandle inline
Fork of BLE_API by
Diff: services/HealthThermometerService.h
- Revision:
- 245:98f930d14515
- Parent:
- 244:0e9201b67e2f
diff -r 0e9201b67e2f -r 98f930d14515 services/HealthThermometerService.h --- a/services/HealthThermometerService.h Tue Dec 09 08:18:11 2014 +0000 +++ b/services/HealthThermometerService.h Tue Dec 09 13:15:19 2014 +0000 @@ -32,7 +32,7 @@ * @enum Sensor Location * @brief Location of sensor on the body */ - enum { + enum SensorLocation_t { LOCATION_ARMPIT = 1, /*!< armpit */ LOCATION_BODY, /*!< body */ LOCATION_EAR, /*!< ear */ @@ -80,6 +80,15 @@ } } + /** + * @brief Update the location. + * @param loc + * new location value. + */ + void updateLocation(SensorLocation_t loc) { + ble.updateCharacteristicValue(tempLocation.getValueHandle(), reinterpret_cast<uint8_t *>(&loc), sizeof(uint8_t)); + } + private: /* Private internal representation for the bytes used to work with the vaulue of the heart-rate characteristic. */ struct TemperatureValueBytes {