1#ifndef VITROIO_SDK_MEASUREMENT_API_H
2#define VITROIO_SDK_MEASUREMENT_API_H
27#define VITROIO_MEASUREMENT_API_DEFAULT_EVENT_QUEUE_SIZE 2
40template <u
int32_t MaxParams>
72 EventQueue* targetQueue,
89 osPriority priority = osPriorityNormal,
151 Thread* evQueueThread_;
154 unsigned int pollTimeS_;
155 uint32_t parametersCount_;
158 uint32_t valuesCount_;
167#include <vitroio-sdk/measurement-api/impl/measurement_api.hpp>
Virtual class providing interface for sensor interfaces classes.
Definition: abstract_sensor_interface.h:50
Class is responsible for cycling readings of measurement data using registered sensors.
Definition: measurement_api.h:42
void setOnNewValuesCallback(OnNewValuesCallback callback)
Function sets callback which will be called when the new values are read.
MeasurementApi(osPriority priority=osPriorityNormal, uint32_t eventQueueSize=VITROIO_MEASUREMENT_API_DEFAULT_EVENT_QUEUE_SIZE)
Contructor creates internal event loop using thread with priority priority.
void stopMeasurements()
Function stops reading of measurements values.
bool isValid() const
Function allows to check whether the object is in valid state.
MeasurementApi(EventQueue *targetQueue, uint32_t eventQueueSize=VITROIO_MEASUREMENT_API_DEFAULT_EVENT_QUEUE_SIZE)
Contructor chains an internal event queue to the targetQueue.
void startMeasurements()
Function starts cycling reading of measurement values.
~MeasurementApi()
Destructor frees resources and stops event loop.
bool registerSensor(AbstractSensorInterface *sensorIf)
Function registers sensor from which the measurement data is to be read.
void setPollTime(unsigned int seconds)
Function sets interval between readings of measurement values.
Callback< void(SensorParameterValue *, int)> OnNewValuesCallback
Type defines signature of callback function which is to be called when a new measurement values are r...
Definition: measurement_api.h:48
#define VITROIO_MEASUREMENT_API_DEFAULT_EVENT_QUEUE_SIZE
Defines default size of internal event queue for MeasurementApi .
Definition: measurement_api.h:27
The namespace contains all of components of vitro-shard-sdk and components based on the sdk....
Definition: can_layer.h:9
Structure representing sensor parameters values.
Definition: abstract_sensor_interface.h:23