Loading...
Searching...
No Matches
SenML Phydat

Functionality for converting from Phydat to SenML. More...

Detailed Description

Functionality for converting from Phydat to SenML.

The senml_phydat module contains various functions for converting Phydat values to SenML.

Files

file  phydat.h
 Functionality for converting from Phydat to SenML.
 

Functions

void phydat_to_senml_bool (senml_bool_value_t *senml, const phydat_t *phydat, const uint8_t dim)
 Create a SenML boolean value.
 
void phydat_to_senml_float (senml_value_t *senml, const phydat_t *phydat, const uint8_t dim)
 Create a SenML float value.
 
void phydat_to_senml_decimal (senml_value_t *senml, const phydat_t *phydat, const uint8_t dim)
 Create a SenML decimal fraction value.
 

Function Documentation

◆ phydat_to_senml_bool()

void phydat_to_senml_bool ( senml_bool_value_t senml,
const phydat_t phydat,
const uint8_t  dim 
)

Create a SenML boolean value.

Writes the value of the given dim of phydat as a boolean. phydat is assumed to be of UNIT_BOOL.

Note
phydat->scale must be zero.
Parameters
[out]senmlSenML value to store value in.
[in]phydatPhydat to convert.
[in]dimDimension of phydat to convert.

◆ phydat_to_senml_decimal()

void phydat_to_senml_decimal ( senml_value_t senml,
const phydat_t phydat,
const uint8_t  dim 
)

Create a SenML decimal fraction value.

Writes the value of the given dim of phydat as a decimal value. The unit of phydat is converted using the following rules:

Parameters
[out]senmlSenML value to store value in.
[in]phydatPhydat to convert.
[in]dimDimension of phydat to convert.

◆ phydat_to_senml_float()

void phydat_to_senml_float ( senml_value_t senml,
const phydat_t phydat,
const uint8_t  dim 
)

Create a SenML float value.

Writes the value of the given dim of phydat as a float. The unit of phydat is converted using the following rules:

Parameters
[out]senmlSenML value to store value in.
[in]phydatPhydat to convert.
[in]dimDimension of phydat to convert.