Embedded Artistry C Interfaces
A reference collection of abstract interfaces in C.
|
Virtual Relative Humidity Sensor Interface with Callback Support. More...
#include <humidity_sensor.h>
Public Attributes | |
bool(* | readHumidity )(uint8_t *const humidity) |
Get the current relative humidity. More... | |
void(* | registerNewSampleCb )(const NewHumiditySampleCb callback) |
Register a NewHumiditySampleCb function. More... | |
void(* | unregisterNewSampleCb )(const NewHumiditySampleCb callback) |
Remove a registered NewHumiditySampleCb function. More... | |
void(* | registerErrorCb )(const HumidityErrorCb callback) |
Register a HumidityErrorCb function. More... | |
void(* | unregisterErrorCb )(const HumidityErrorCb callback) |
Remove a registered HumidityErrorCb function. More... | |
Virtual Relative Humidity Sensor Interface with Callback Support.
A standard interface for a device which can measure relative humidity. Interested parties can receive callbacks when new samples are available.
This device returns relative humdity, rounded to the nearest whole percentage.
Definition at line 141 of file humidity_sensor.h.
bool(* HumiditySensor_withCb::readHumidity) (uint8_t *const humidity) |
Get the current relative humidity.
[in,out] | humidity | Current relative humidity in %. If humidity is NULL, the function will only supply the humidity sample to registered callback functions. |
Humidity is specified as an integral perecentage.
Definition at line 163 of file humidity_sensor.h.
void(* HumiditySensor_withCb::registerErrorCb) (const HumidityErrorCb callback) |
Register a HumidityErrorCb function.
This function will add the callback input to a list of functions to execute when a humidity sensor error occurs.
[in] | callback | The callback function pointer to register on the "error" callback list. |
Definition at line 202 of file humidity_sensor.h.
void(* HumiditySensor_withCb::registerNewSampleCb) (const NewHumiditySampleCb callback) |
Register a NewHumiditySampleCb function.
This function will add the callback input to a list of functions to execute when a new and valid sample is available.
[in] | callback | The callback function pointer to register on the "new sample" callback list. |
Definition at line 176 of file humidity_sensor.h.
void(* HumiditySensor_withCb::unregisterErrorCb) (const HumidityErrorCb callback) |
Remove a registered HumidityErrorCb function.
This function will remove a callback function from the registered list of "error" callbacks. If the function has not been previously registered, the parameter will be ignored and the list will be unchanged.
[in] | callback | The callback function pointer to remove from the "error" callback list. |
Definition at line 215 of file humidity_sensor.h.
void(* HumiditySensor_withCb::unregisterNewSampleCb) (const NewHumiditySampleCb callback) |
Remove a registered NewHumiditySampleCb function.
This function will remove a callback function from the registered list of "new sample" callbacks. If the function has not been previously registered, the parameter will be ignored and the list will be unchanged.
[in] | callback | The callback function pointer to remove from the "new sample" callback list. |
Definition at line 189 of file humidity_sensor.h.