KPN Things Device SDK
senml_float_record.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 sensors header
12 */
13
14#ifndef SENMLFLOATRECORD
15#define SENMLFLOATRECORD
16
17#include "senml_record_t.h"
18
25 public:
26 SenMLFloatRecord(const char *name) : SenMLRecordTemplate(name){};
27 SenMLFloatRecord(const char *name, SenMLUnit unit) : SenMLRecordTemplate(name, unit){};
28 SenMLFloatRecord(const char *name, SenMLUnit unit, float value) : SenMLRecordTemplate(name, unit, value){};
30 SenMLFloatRecord(ThingsMLMeasurementIndex index, float value) : SenMLRecordTemplate(index, value){};
32
40 virtual int fieldsToJson();
41
50 virtual int fieldsToCbor();
51
52 protected:
53 private:
54 float getAdjustedValue();
55};
56
57#endif // SENMLFLOATRECORD
Definition: senml_float_record.h:24
SenMLFloatRecord(const char *name, SenMLUnit unit, float value)
Definition: senml_float_record.h:28
virtual int fieldsToCbor()
Definition: senml_float_record.cpp:49
SenMLFloatRecord(const char *name)
Definition: senml_float_record.h:26
SenMLFloatRecord(ThingsMLMeasurementIndex index, float value)
Definition: senml_float_record.h:30
SenMLFloatRecord(ThingsMLMeasurementIndex index)
Definition: senml_float_record.h:29
~SenMLFloatRecord()
Definition: senml_float_record.h:31
SenMLFloatRecord(const char *name, SenMLUnit unit)
Definition: senml_float_record.h:27
virtual int fieldsToJson()
Definition: senml_float_record.cpp:38
Definition: senml_record_t.h:25
SenMLUnit
Definition: senml_enums.h:97
ThingsMLMeasurementIndex
Definition: senml_enums.h:51