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.
Diff: EnvironmentalService.h
- Revision:
- 15:aac1b3950a9e
- Parent:
- 14:c5578b5edabe
- Child:
- 16:eed9a9ba319c
--- a/EnvironmentalService.h Tue Apr 02 09:51:34 2019 +0000
+++ b/EnvironmentalService.h Tue Apr 16 07:22:47 2019 +0000
@@ -6,7 +6,10 @@
class EnvironmentalService {
public:
- //typedef int8_t BatteryLevelType_t;
+
+ typedef uint32_t PressureType_t;
+ typedef int16_t TemperatureType_t;
+ typedef uint16_t HumidityType_t;
/**
* @brief BatteryService constructor.
@@ -24,17 +27,21 @@
* @brief Update battery level characteristic.
* @param newBatteryLevelVal New battery level measurement.
*/
- void updateEnvironmentalService(/*BatteryLevelType_t newBatteryLevelVal*/);
+ void updateEnvironmentalService(PressureType_t newPressure, TemperatureType_t newTemperature, HumidityType_t newHumidity);
private:
// data members
BLE& m_ble;
bool m_serviceAdded;
- //BatteryLevelType_t m_batteryLevel;
+ PressureType_t m_pressure;
+ TemperatureType_t m_temperature;
+ HumidityType_t m_humidity;
// characteristics belonging to the service
- //ReadOnlyGattCharacteristic<BatteryLevelType_t> m_batteryLevelCharacteristic;
+ ReadOnlyGattCharacteristic<PressureType_t> m_pressureCharacteristic;
+ ReadOnlyGattCharacteristic<TemperatureType_t> m_temperatureCharacteristic;
+ ReadOnlyGattCharacteristic<HumidityType_t> m_humidityCharacteristic;
// logger instance
Logger& m_logger;