KPN Things Device SDK
senml_float_actuator.h
Go to the documentation of this file.
1/* _ __ ____ _ _
2 * | |/ / | _ \ | \ | |
3 * | ' / | |_) | | \| |
4 * | . \ | __/ | |\ |
5 * |_|\_\ |_| |_| \_|
6 *
7 * (c) 2020 KPN
8 * License: MIT License.
9 * Author: Joseph Verburg, Jan Bogaerts
10 *
11 * support for float actuators headers
12 */
13
14#ifndef SENMLFLOATACTUATOR
15#define SENMLFLOATACTUATOR
16
17#include "../record/senml_float_record.h"
18
19#define FLOAT_ACTUATOR_SIGNATURE void (*callback)(float)
20
25 public:
26 SenMLFloatActuator(const char *name, FLOAT_ACTUATOR_SIGNATURE)
27 : SenMLFloatRecord(name, SENML_UNIT_NONE, 0.0), callback(callback){};
28 SenMLFloatActuator(const char *name, SenMLUnit unit, FLOAT_ACTUATOR_SIGNATURE)
29 : SenMLFloatRecord(name, unit, 0.0), callback(callback){};
30 SenMLFloatActuator(const char *name, SenMLUnit unit, float value, FLOAT_ACTUATOR_SIGNATURE)
31 : SenMLFloatRecord(name, unit, value), callback(callback){};
32 SenMLFloatActuator(ThingsMLMeasurementIndex index, FLOAT_ACTUATOR_SIGNATURE)
33 : SenMLFloatRecord(index), callback(callback){};
34 SenMLFloatActuator(ThingsMLMeasurementIndex index, float value, FLOAT_ACTUATOR_SIGNATURE)
35 : SenMLFloatRecord(index, value), callback(callback){};
36
37 SenMLFloatActuator(const char *name) : SenMLFloatRecord(name){};
38 SenMLFloatActuator(const char *name, SenMLUnit unit) : SenMLFloatRecord(name, unit){};
39 SenMLFloatActuator(const char *name, SenMLUnit unit, float value) : SenMLFloatRecord(name, unit, value){};
41 SenMLFloatActuator(ThingsMLMeasurementIndex index, float value) : SenMLFloatRecord(index, value){};
43
44 protected:
45 // called while parsing a senml message, when the parser found the value for an SenMLJsonListener
46 virtual void actuate(const void *value, int dataLength, SenMLDataType dataType);
47
48 private:
49 FLOAT_ACTUATOR_SIGNATURE = NULL;
50};
51
52#endif // SENMLFLOATACTUATOR
Definition: senml_float_actuator.h:24
SenMLFloatActuator(ThingsMLMeasurementIndex index)
Definition: senml_float_actuator.h:40
SenMLFloatActuator(const char *name, FLOAT_ACTUATOR_SIGNATURE)
Definition: senml_float_actuator.h:26
SenMLFloatActuator(const char *name, SenMLUnit unit, float value)
Definition: senml_float_actuator.h:39
SenMLFloatActuator(ThingsMLMeasurementIndex index, float value, FLOAT_ACTUATOR_SIGNATURE)
Definition: senml_float_actuator.h:34
SenMLFloatActuator(ThingsMLMeasurementIndex index, float value)
Definition: senml_float_actuator.h:41
SenMLFloatActuator(const char *name, SenMLUnit unit, FLOAT_ACTUATOR_SIGNATURE)
Definition: senml_float_actuator.h:28
SenMLFloatActuator(const char *name, SenMLUnit unit, float value, FLOAT_ACTUATOR_SIGNATURE)
Definition: senml_float_actuator.h:30
virtual void actuate(const void *value, int dataLength, SenMLDataType dataType)
Definition: senml_float_actuator.cpp:18
SenMLFloatActuator(const char *name, SenMLUnit unit)
Definition: senml_float_actuator.h:38
~SenMLFloatActuator()
Definition: senml_float_actuator.h:42
SenMLFloatActuator(const char *name)
Definition: senml_float_actuator.h:37
SenMLFloatActuator(ThingsMLMeasurementIndex index, FLOAT_ACTUATOR_SIGNATURE)
Definition: senml_float_actuator.h:32
Definition: senml_float_record.h:24
SenMLUnit
Definition: senml_enums.h:97
@ SENML_UNIT_NONE
Definition: senml_enums.h:98
ThingsMLMeasurementIndex
Definition: senml_enums.h:51
SenMLDataType
Definition: senml_enums.h:25