Class Documentation¶
SensorFacade¶
-
class
SensorFacade¶ The sensor facade holds a set of sensors and/or sensorSets.
Add all the sensors you’ll keep track on and call the begin() function. Thereafter call periodically the update() function. As last provide a callback and call ItrSensor() to read them out.
Inherits from ISensor
Public Functions
-
SensorFacade()¶ creates a sensor facade instance
-
SensorFacade(ITimeProvider *timeProvider)¶ creates a sensor facade instance with a time provider
- Parameters
timeProvider:
-
SensorFacade(void (*sensorItr)(String, Data))¶ creates a sensor facade instance with a iteration callback
- Parameters
sensorItr:
-
SensorFacade(ITimeProvider *timeProvider, void (*sensorItr)(String, Data))¶ creates a sensor facade with a time provider and a iteration callback
- Parameters
timeProvider:sensorItr:
-
void
setSensorItr(void (*sensorItr)(String, Data))¶ set a callback for the sensor iteration
- Parameters
sensorItr:
-
void
ItrSensor()¶ iterate over all the sensors using the predefined callback
-
int
size()¶ get number of sensors
- Return
-
void
update()¶ call update function of all sensors
-
void
begin()¶ call begin function of all sensors
-
SensorSet¶
-
class
SensorSet¶ A sensor set helps you to add sensor metrics to one container.
e.g. a sensor that can reads the temperature as well the pressure.
Inherits from ISensor
Public Functions
-
SensorSet()¶ creates a sensor set
-
SensorSet(ITimeProvider *timeProvider)¶ creates a sensor set with a time provider
- Parameters
timeProvider:
-
void
begin()¶ call begin function of all sensors
-
void
update()¶ call update function of all sensors
-
Sensor¶
-
class
Sensor¶ Each metric of each sensor should have an sensor implementation.
Implement the the update method or override the getData method.
Inherits from ISensor
Public Functions
-
Sensor(String name, ITimeProvider *timeProvider)¶ - Parameters
name: of the sensor instancetimeProvider:
-
Sensor(String name)¶ - Parameters
name: of the sensor instance
-
String
getName()¶ - Return
- name of the sensor instance - used for e.g. MQTT topic
-
ISensor¶
-
class
ISensor¶ an abstract sensor class
Subclassed by Sensor, SensorFacade, SensorSet