KPN Things Device SDK
SenMLHalfFloatRecord Class Reference

#include <senml_half_float_record.h>

Inheritance diagram for SenMLHalfFloatRecord:
SenMLRecordTemplate< float > SenMLRecord SenMLBase SenMLHalfFloatActuator

Public Member Functions

 SenMLHalfFloatRecord (const char *name)
 
 SenMLHalfFloatRecord (const char *name, SenMLUnit unit)
 
 SenMLHalfFloatRecord (const char *name, SenMLUnit unit, float value)
 
 SenMLHalfFloatRecord (ThingsMLMeasurementIndex index)
 
 SenMLHalfFloatRecord (ThingsMLMeasurementIndex index, float value)
 
 ~SenMLHalfFloatRecord ()
 
virtual int fieldsToJson ()
 
virtual int fieldsToCbor ()
 
- Public Member Functions inherited from SenMLRecordTemplate< float >
 SenMLRecordTemplate (const char *name)
 
 SenMLRecordTemplate (const char *name, SenMLUnit unit)
 
 SenMLRecordTemplate (const char *name, SenMLUnit unit, float value)
 
 SenMLRecordTemplate (ThingsMLMeasurementIndex index)
 
 SenMLRecordTemplate (ThingsMLMeasurementIndex index, float value)
 
float get ()
 
bool asSum ()
 
bool set (float value, double time=(double) NAN, bool asSum=false)
 
- Public Member Functions inherited from SenMLRecord
 SenMLRecord ()
 
 SenMLRecord (const char *name)
 
 SenMLRecord (ThingsMLMeasurementIndex index)
 
 SenMLRecord (const char *name, SenMLUnit unit)
 
double getTime ()
 
bool setTime (double value, bool absolute=true)
 
void setTimeDirect (double value)
 
const char * getName ()
 
ThingsMLMeasurementIndex getIndex ()
 
void setName (const char *name)
 
double getUpdateTime ()
 
bool setUpdateTime (double value, bool absolute=true)
 
SenMLUnit getUnit ()
 
void setUnit (SenMLUnit value)
 
virtual int fieldsToJson ()
 
virtual int fieldsToCbor ()
 
- Public Member Functions inherited from SenMLBase
 SenMLBase ()
 
 ~SenMLBase ()
 
SenMLBasegetNext ()
 
SenMLBasegetRoot ()
 
virtual void adjustToBaseTime (double prev, double time)
 
virtual int fieldsToJson ()=0
 
virtual int fieldsToCbor ()=0
 

Additional Inherited Members

- Protected Member Functions inherited from SenMLRecord
virtual int contentToJson ()
 
virtual int contentToCbor ()
 
virtual void adjustToBaseTime (double prev, double time)
 
virtual void actuate (const void *value, int dataLength, SenMLDataType dataType)
 
int getFieldLength ()
 
- Protected Member Functions inherited from SenMLBase
virtual int contentToJson ()=0
 
void setNext (SenMLBase *value)
 
void setPrev (SenMLBase *value)
 
SenMLBasegetPrev ()
 
virtual bool isPack ()
 
virtual int contentToCbor ()=0
 
virtual int getArrayLength ()
 
virtual int getFieldLength ()=0
 

Detailed Description

A SenMLRecord that stores half float data. Actual storage of half float only happens when exporting to cbor. This type of object can only be used for sensor data. If actuation is needed, use SenMLFloatActuator instead.

Constructor & Destructor Documentation

◆ SenMLHalfFloatRecord() [1/5]

SenMLHalfFloatRecord::SenMLHalfFloatRecord ( const char *  name)
inline

◆ SenMLHalfFloatRecord() [2/5]

SenMLHalfFloatRecord::SenMLHalfFloatRecord ( const char *  name,
SenMLUnit  unit 
)
inline

◆ SenMLHalfFloatRecord() [3/5]

SenMLHalfFloatRecord::SenMLHalfFloatRecord ( const char *  name,
SenMLUnit  unit,
float  value 
)
inline

◆ SenMLHalfFloatRecord() [4/5]

SenMLHalfFloatRecord::SenMLHalfFloatRecord ( ThingsMLMeasurementIndex  index)
inline

◆ SenMLHalfFloatRecord() [5/5]

SenMLHalfFloatRecord::SenMLHalfFloatRecord ( ThingsMLMeasurementIndex  index,
float  value 
)
inline

◆ ~SenMLHalfFloatRecord()

SenMLHalfFloatRecord::~SenMLHalfFloatRecord ( )
inline

Member Function Documentation

◆ fieldsToCbor()

int SenMLHalfFloatRecord::fieldsToCbor ( )
virtual

renders all the fields to cbor format. renders all the fields of the object without the length info at the beginning note: this is public so that custom implementations for the record object can use other objects internally and render to json using this function (ex: coordinatesRecord using 3 floatRecrods for lat, lon & alt.

Returns
: The number of bytes that were written.

Reimplemented from SenMLRecord.

◆ fieldsToJson()

int SenMLHalfFloatRecord::fieldsToJson ( )
virtual

renders all the fields to json, without the starting and ending brackets. Inheriters can extend this function if they want to add extra fields to the json output note: this is public so that custom implementations for the record object can use other objects internally and render to json using this function (ex: coordinatesRecord using 3 floatRecrods for lat, lon & alt.

Returns
: The number of bytes that were written.

Reimplemented from SenMLRecord.


The documentation for this class was generated from the following files: