Functionality for encoding SenML values as CBOR. More...
Functionality for encoding SenML values as CBOR.
The senml_cbor
module contains functionality for encoding SenML values to CBOR using NanoCBOR library.
Files | |
file | cbor.h |
Functionality for encoding SenML values as CBOR. | |
Enumerations | |
enum | senml_cbor_label_t { SENML_LABEL_BASE_VERSION = -1 , SENML_LABEL_BASE_NAME = -2 , SENML_LABEL_BASE_TIME = -3 , SENML_LABEL_BASE_UNIT = -4 , SENML_LABEL_BASE_VALUE = -5 , SENML_LABEL_BASE_SUM = -6 , SENML_LABEL_NAME = 0 , SENML_LABEL_UNIT = 1 , SENML_LABEL_VALUE = 2 , SENML_LABEL_STRING_VALUE = 3 , SENML_LABEL_BOOLEAN_VALUE = 4 , SENML_LABEL_SUM = 5 , SENML_LABEL_TIME = 6 , SENML_LABEL_UPDATE_TIME = 7 , SENML_LABEL_DATA_VALUE = 8 } |
SenML CBOR labels. More... | |
Functions | |
int | senml_encode_sum_cbor (nanocbor_encoder_t *enc, const senml_attr_t *attr) |
Encode senml_attr_t containing sum as CBOR. | |
int | senml_encode_bool_cbor (nanocbor_encoder_t *enc, const senml_bool_value_t *val) |
Encode senml_bool_value_t as CBOR. | |
int | senml_encode_value_cbor (nanocbor_encoder_t *enc, const senml_value_t *val) |
Encode senml_value_t as CBOR. | |
int | senml_encode_string_cbor (nanocbor_encoder_t *enc, const senml_string_value_t *val) |
Encode senml_string_value_t as CBOR. | |
int | senml_encode_data_cbor (nanocbor_encoder_t *enc, const senml_data_value_t *val) |
Encode senml_data_value_t as CBOR. | |
enum senml_cbor_label_t |
int senml_encode_bool_cbor | ( | nanocbor_encoder_t * | enc, |
const senml_bool_value_t * | val | ||
) |
Encode senml_bool_value_t as CBOR.
enc | NanoCBOR encoder. |
val | value to encode. |
int senml_encode_data_cbor | ( | nanocbor_encoder_t * | enc, |
const senml_data_value_t * | val | ||
) |
Encode senml_data_value_t as CBOR.
enc | NanoCBOR encoder. |
val | value to encode. |
int senml_encode_string_cbor | ( | nanocbor_encoder_t * | enc, |
const senml_string_value_t * | val | ||
) |
Encode senml_string_value_t as CBOR.
enc | NanoCBOR encoder. |
val | value to encode. |
int senml_encode_sum_cbor | ( | nanocbor_encoder_t * | enc, |
const senml_attr_t * | attr | ||
) |
Encode senml_attr_t containing sum
as CBOR.
Requires the sum
attribute to be enabled by setting CONFIG_SENML_ATTR_SUM
to 1.
enc | NanoCBOR encoder. |
attr | Attributes (including sum ) to encode. |
int senml_encode_value_cbor | ( | nanocbor_encoder_t * | enc, |
const senml_value_t * | val | ||
) |
Encode senml_value_t as CBOR.
enc | NanoCBOR encoder. |
val | value to encode. |