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