Basic SenML types. More...
Basic SenML types.
Definition in file senml.h.
Go to the source code of this file.
Data Structures | |
struct | senml_decfrac_t |
Decimal fraction containing a value in the form of m * 10^e. More... | |
struct | senml_numeric_t |
SenML numeric value. More... | |
struct | senml_attr_t |
SenML common record attributes. More... | |
struct | senml_value_t |
SenML string value. More... | |
struct | senml_string_value_t |
SenML string value. More... | |
struct | senml_bool_value_t |
SenML boolean value. More... | |
struct | senml_data_value_t |
SenML data value. More... | |
Macros | |
#define | CONFIG_SENML_ATTR_SUM 0 |
Enable the SenML 'sum' and 'base sum' attributes. | |
#define | CONFIG_SENML_ATTR_VERSION 0 |
Enable the SenML 'version' and 'base version' attributes. | |
#define | CONFIG_SENML_ATTR_UPDATE_TIME 0 |
Enable the SenML 'update time' attribute. | |
Functions | |
static senml_numeric_t | senml_float (float v) |
Create a floating point numeric value. | |
static void | senml_set_float (senml_numeric_t *n, float v) |
Set a floating point numeric value. | |
static senml_numeric_t | senml_double (double v) |
Create a double precision floating point numeric value. | |
static void | senml_set_double (senml_numeric_t *n, double v) |
Set a double precision floating point numeric value. | |
static senml_numeric_t | senml_int (int64_t v) |
Create an integer numeric value. | |
static void | senml_set_int (senml_numeric_t *n, int64_t v) |
Set an integer numeric value. | |
static senml_numeric_t | senml_uint (uint64_t v) |
Create an unsigned integer numeric value. | |
static void | set_senml_uint (senml_numeric_t *n, uint64_t v) |
Set an unsigned integer numeric value. | |
static senml_numeric_t | senml_decfrac (int32_t m, int32_t e) |
Create a decimal fraction numeric value in the form m*10^e . | |
static void | senml_set_decfrac (senml_numeric_t *n, int32_t m, int32_t e) |
Set a decimal fraction numeric value in the form m*10^e . | |
static senml_numeric_t | senml_duration_s (int64_t s) |
Get an integer representation of a duration in seconds. | |
static void | senml_set_duration_s (senml_numeric_t *n, int64_t s) |
Set an integer representation of a duration in seconds. | |
static senml_numeric_t | senml_duration_ms (int32_t ms) |
Get a senml_decfrac_t representation of a duration in milliseconds. | |
static void | senml_set_duration_ms (senml_numeric_t *n, int32_t ms) |
Set a senml_decfrac_t representation of a duration in milliseconds. | |
static senml_numeric_t | senml_duration_us (int32_t us) |
Get a senml_decfrac_t representation of a duration in microseconds. | |
static void | senml_set_duration_us (senml_numeric_t *n, int32_t us) |
Get a senml_decfrac_t representation of a duration in microseconds. | |
static senml_numeric_t | senml_duration_ns (int32_t ns) |
Get a senml_decfrac_t representation of a duration in nanoseconds. | |
static void | senml_set_duration_ns (senml_numeric_t *n, int32_t ns) |
Set a senml_decfrac_t representation of a duration in nanoseconds. | |
const char * | senml_unit_to_str (senml_unit_t unit) |
Convert a SenML unit to a string. | |