VitroIO SDK
Software development kit for Vitro Shard.
Loading...
Searching...
No Matches
vitroio::sdk::MeasurementApi< MaxParams > Class Template Reference

Class is responsible for cycling readings of measurement data using registered sensors. More...

#include <measurement_api.h>

Inheritance diagram for vitroio::sdk::MeasurementApi< MaxParams >:
Collaboration diagram for vitroio::sdk::MeasurementApi< MaxParams >:

Public Types

typedef Callback< void(SensorParameterValue *, int)> OnNewValuesCallback
 Type defines signature of callback function which is to be called when a new measurement values are read.
 

Public Member Functions

 MeasurementApi (EventQueue *targetQueue, uint32_t eventQueueSize=VITROIO_MEASUREMENT_API_DEFAULT_EVENT_QUEUE_SIZE)
 Contructor chains an internal event queue to the targetQueue.
 
 MeasurementApi (osPriority priority=osPriorityNormal, uint32_t eventQueueSize=VITROIO_MEASUREMENT_API_DEFAULT_EVENT_QUEUE_SIZE)
 Contructor creates internal event loop using thread with priority priority.
 
 ~MeasurementApi ()
 Destructor frees resources and stops event loop.
 
bool isValid () const
 Function allows to check whether the object is in valid state.
 
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.
 
void setOnNewValuesCallback (OnNewValuesCallback callback)
 Function sets callback which will be called when the new values are read.
 
void startMeasurements ()
 Function starts cycling reading of measurement values.
 
void stopMeasurements ()
 Function stops reading of measurements values.
 

Detailed Description

template<uint32_t MaxParams>
class vitroio::sdk::MeasurementApi< MaxParams >

Class is responsible for cycling readings of measurement data using registered sensors.

The class uses an event loop for handling events. The event queue can be managed by external queue specified by user or by internal queue with thread of specified priority.

Template Parameters
MaxParamsSpecifies maximum number of sensors parameters that can be handled

Member Typedef Documentation

◆ OnNewValuesCallback

template<uint32_t MaxParams>
Callback<void(SensorParameterValue*, int)> vitroio::sdk::MeasurementApi< MaxParams >::OnNewValuesCallback

Type defines signature of callback function which is to be called when a new measurement values are read.