Virtual Relative Humidity Sensor Interface.
More...
#include <humidity_sensor.h>
Virtual Relative Humidity Sensor Interface.
A standard interface for a device which can measure relative humidity.
This device returns relative humdity, rounded to the nearest whole percentage.
Fundamental Assumptions
- The device produces relative humidity (RH) readings
- The device reports RH as a percentage
- The reported RH reading will be compensated for ambient temperature by the implementation if it is required.
- The device will indicate whether the current reading is valid or invalid
Implementation Notes
- This interface, at its core, appears to be blocking. However, you can still implement this interface in a non-blocking way. For example, you could always return the most recent altitude measurement, while there is another thread (or a timer) that handles updates to that measurement asynchronously.
Definition at line 60 of file humidity_sensor.h.
◆ getHumidity
bool(* HumiditySensor::getHumidity) (uint8_t *const humidity) |
Get the current relative humidity.
- Precondition
- The sensor has been properly initialized by the system.
-
The humidity parameter is not NULL.
- Postcondition
- If the measurement is valid, the data pointed to by the humidity parameter will be updated with the latest reading.
-
If the measurement is invalid, the data pointed to by the humidity parameter will remain unchanged.
- Parameters
-
[in,out] | Current | relative humidity in %. Humidity is specified as an integral perecentage. |
- Returns
- True if the sample is valid, false if invalid (e.g., an error occured)
Definition at line 76 of file humidity_sensor.h.
The documentation for this struct was generated from the following file: