Functionality for converting from Phydat to SenML. More...
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.  More... | |
| void | phydat_to_senml_float (senml_value_t *senml, const phydat_t *phydat, const uint8_t dim) | 
| Create a SenML float value.  More... | |
| void | phydat_to_senml_decimal (senml_value_t *senml, const phydat_t *phydat, const uint8_t dim) | 
| Create a SenML decimal fraction value.  More... | |
| 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.
phydat->scale must be zero.| [out] | senml | SenML value to store value in. | 
| [in] | phydat | Phydat to convert. | 
| [in] | dim | Dimension of phydat to convert.  | 
| 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:
| [out] | senml | SenML value to store value in. | 
| [in] | phydat | Phydat to convert. | 
| [in] | dim | Dimension of phydat to convert.  | 
| 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:
| [out] | senml | SenML value to store value in. | 
| [in] | phydat | Phydat to convert. | 
| [in] | dim | Dimension of phydat to convert.  |