KPN Things Device SDK
senml_int_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 int actuators headers
12 */
13
14#ifndef SENMLINTACTUATOR
15#define SENMLINTACTUATOR
16
17#include "../record/senml_int_record.h"
18
19#define INT_ACTUATOR_SIGNATURE void (*callback)(int)
20
25 public:
26 SenMLIntActuator(const char *name, INT_ACTUATOR_SIGNATURE)
27 : SenMLIntRecord(name, SENML_UNIT_NONE, 0), callback(callback){};
28 SenMLIntActuator(const char *name, SenMLUnit unit, INT_ACTUATOR_SIGNATURE)
29 : SenMLIntRecord(name, unit, 0), callback(callback){};
30 SenMLIntActuator(const char *name, SenMLUnit unit, int value, INT_ACTUATOR_SIGNATURE)
31 : SenMLIntRecord(name, unit, value), callback(callback){};
32 SenMLIntActuator(ThingsMLMeasurementIndex index, INT_ACTUATOR_SIGNATURE)
33 : SenMLIntRecord(index), callback(callback){};
34 SenMLIntActuator(ThingsMLMeasurementIndex index, int value, INT_ACTUATOR_SIGNATURE)
35 : SenMLIntRecord(index, value), callback(callback){};
36
37 SenMLIntActuator(const char *name) : SenMLIntRecord(name){};
38 SenMLIntActuator(const char *name, SenMLUnit unit) : SenMLIntRecord(name, unit){};
39 SenMLIntActuator(const char *name, SenMLUnit unit, int value) : SenMLIntRecord(name, unit, value){};
41 SenMLIntActuator(ThingsMLMeasurementIndex index, int value) : SenMLIntRecord(index, value){};
43
44 protected:
48 virtual void actuate(const void *value, int dataLength, SenMLDataType dataType);
49
50 private:
51 INT_ACTUATOR_SIGNATURE = NULL;
52};
53
54#endif // SENMLINTACTUATOR
Definition: senml_int_actuator.h:24
SenMLIntActuator(const char *name, SenMLUnit unit)
Definition: senml_int_actuator.h:38
SenMLIntActuator(ThingsMLMeasurementIndex index, INT_ACTUATOR_SIGNATURE)
Definition: senml_int_actuator.h:32
SenMLIntActuator(const char *name, SenMLUnit unit, INT_ACTUATOR_SIGNATURE)
Definition: senml_int_actuator.h:28
virtual void actuate(const void *value, int dataLength, SenMLDataType dataType)
Definition: senml_int_actuator.cpp:18
SenMLIntActuator(const char *name, SenMLUnit unit, int value, INT_ACTUATOR_SIGNATURE)
Definition: senml_int_actuator.h:30
SenMLIntActuator(const char *name, SenMLUnit unit, int value)
Definition: senml_int_actuator.h:39
SenMLIntActuator(const char *name, INT_ACTUATOR_SIGNATURE)
Definition: senml_int_actuator.h:26
SenMLIntActuator(const char *name)
Definition: senml_int_actuator.h:37
SenMLIntActuator(ThingsMLMeasurementIndex index)
Definition: senml_int_actuator.h:40
SenMLIntActuator(ThingsMLMeasurementIndex index, int value)
Definition: senml_int_actuator.h:41
SenMLIntActuator(ThingsMLMeasurementIndex index, int value, INT_ACTUATOR_SIGNATURE)
Definition: senml_int_actuator.h:34
~SenMLIntActuator()
Definition: senml_int_actuator.h:42
Definition: senml_int_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