KPN Things Device SDK
senml_half_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 SENMLHALFFLOATRECORD
15#define SENMLHALFFLOATRECORD
16
17#include "senml_record_t.h"
18
26 public:
27 SenMLHalfFloatRecord(const char *name) : SenMLRecordTemplate(name){};
28 SenMLHalfFloatRecord(const char *name, SenMLUnit unit) : SenMLRecordTemplate(name, unit){};
29 SenMLHalfFloatRecord(const char *name, SenMLUnit unit, float value) : SenMLRecordTemplate(name, unit, value){};
33
41 virtual int fieldsToJson();
42
51 virtual int fieldsToCbor();
52
53 protected:
54 private:
55 float getAdjustedValue();
56};
57
58#endif // SENMLHALFFLOATRECORD
Definition: senml_half_float_record.h:25
virtual int fieldsToCbor()
Definition: senml_half_float_record.cpp:49
SenMLHalfFloatRecord(const char *name)
Definition: senml_half_float_record.h:27
virtual int fieldsToJson()
Definition: senml_half_float_record.cpp:38
SenMLHalfFloatRecord(const char *name, SenMLUnit unit)
Definition: senml_half_float_record.h:28
SenMLHalfFloatRecord(ThingsMLMeasurementIndex index)
Definition: senml_half_float_record.h:30
SenMLHalfFloatRecord(ThingsMLMeasurementIndex index, float value)
Definition: senml_half_float_record.h:31
~SenMLHalfFloatRecord()
Definition: senml_half_float_record.h:32
SenMLHalfFloatRecord(const char *name, SenMLUnit unit, float value)
Definition: senml_half_float_record.h:29
Definition: senml_record_t.h:25
SenMLUnit
Definition: senml_enums.h:97
ThingsMLMeasurementIndex
Definition: senml_enums.h:51