lwm2m_senml_cbor: Regenerate code files using zcbor 0.7.0
and the _regenerate.sh script. Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
This commit is contained in:
parent
e9eb61bd14
commit
d0c278af78
|
@ -2,9 +2,8 @@
|
||||||
* Copyright (c) 2023 Nordic Semiconductor ASA
|
* Copyright (c) 2023 Nordic Semiconductor ASA
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*
|
||||||
/*
|
* Generated using zcbor version 0.7.0
|
||||||
* Generated using zcbor version 0.6.0
|
|
||||||
* https://github.com/zephyrproject-rtos/zcbor
|
* https://github.com/zephyrproject-rtos/zcbor
|
||||||
* Generated with a --default-max-qty of 99
|
* Generated with a --default-max-qty of 99
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2,9 +2,8 @@
|
||||||
* Copyright (c) 2023 Nordic Semiconductor ASA
|
* Copyright (c) 2023 Nordic Semiconductor ASA
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*
|
||||||
/*
|
* Generated using zcbor version 0.7.0
|
||||||
* Generated using zcbor version 0.6.0
|
|
||||||
* https://github.com/zephyrproject-rtos/zcbor
|
* https://github.com/zephyrproject-rtos/zcbor
|
||||||
* Generated with a --default-max-qty of 99
|
* Generated with a --default-max-qty of 99
|
||||||
*/
|
*/
|
||||||
|
@ -16,10 +15,17 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "zcbor_decode.h"
|
|
||||||
#include "lwm2m_senml_cbor_types.h"
|
#include "lwm2m_senml_cbor_types.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
int cbor_decode_lwm2m_senml(const uint8_t *payload, size_t payload_len, struct lwm2m_senml *result,
|
int cbor_decode_lwm2m_senml(const uint8_t *payload, size_t payload_len, struct lwm2m_senml *result,
|
||||||
size_t *payload_len_out);
|
size_t *payload_len_out);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* LWM2M_SENML_CBOR_DECODE_H__ */
|
#endif /* LWM2M_SENML_CBOR_DECODE_H__ */
|
||||||
|
|
|
@ -2,9 +2,8 @@
|
||||||
* Copyright (c) 2023 Nordic Semiconductor ASA
|
* Copyright (c) 2023 Nordic Semiconductor ASA
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*
|
||||||
/*
|
* Generated using zcbor version 0.7.0
|
||||||
* Generated using zcbor version 0.6.0
|
|
||||||
* https://github.com/zephyrproject-rtos/zcbor
|
* https://github.com/zephyrproject-rtos/zcbor
|
||||||
* Generated with a --default-max-qty of 99
|
* Generated with a --default-max-qty of 99
|
||||||
*/
|
*/
|
||||||
|
@ -15,7 +14,6 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "zcbor_encode.h"
|
#include "zcbor_encode.h"
|
||||||
#include "lwm2m_senml_cbor_encode.h"
|
#include "lwm2m_senml_cbor_encode.h"
|
||||||
#include "lwm2m_senml_cbor_types.h"
|
|
||||||
|
|
||||||
static bool encode_repeated_record_bn(zcbor_state_t *state, const struct record_bn *input);
|
static bool encode_repeated_record_bn(zcbor_state_t *state, const struct record_bn *input);
|
||||||
static bool encode_repeated_record_bt(zcbor_state_t *state, const struct record_bt *input);
|
static bool encode_repeated_record_bt(zcbor_state_t *state, const struct record_bt *input);
|
||||||
|
@ -103,37 +101,37 @@ static bool encode_repeated_record_union(zcbor_state_t *state, const struct reco
|
||||||
((*input)._union_vi <= INT64_MAX)) ||
|
((*input)._union_vi <= INT64_MAX)) ||
|
||||||
(zcbor_error(state, ZCBOR_ERR_WRONG_RANGE), false)) &&
|
(zcbor_error(state, ZCBOR_ERR_WRONG_RANGE), false)) &&
|
||||||
(zcbor_int64_encode(state, (&(*input)._union_vi))))
|
(zcbor_int64_encode(state, (&(*input)._union_vi))))
|
||||||
: (((*input)._record_union_choice == _union_vf)
|
: (((*input)._record_union_choice == _union_vf)
|
||||||
? (((zcbor_uint32_put(state, (2)))) &&
|
? (((zcbor_uint32_put(state, (2)))) &&
|
||||||
(zcbor_float64_encode(state, (&(*input)._union_vf))))
|
(zcbor_float64_encode(state, (&(*input)._union_vf))))
|
||||||
: (((*input)._record_union_choice == _union_vs)
|
: (((*input)._record_union_choice == _union_vs)
|
||||||
? (((zcbor_uint32_put(state, (3)))) &&
|
? (((zcbor_uint32_put(state, (3)))) &&
|
||||||
(zcbor_tstr_encode(state, (&(*input)._union_vs))))
|
(zcbor_tstr_encode(state, (&(*input)._union_vs))))
|
||||||
: (((*input)._record_union_choice == _union_vb)
|
: (((*input)._record_union_choice == _union_vb)
|
||||||
? (((zcbor_uint32_put(state, (4)))) &&
|
? (((zcbor_uint32_put(state, (4)))) &&
|
||||||
(zcbor_bool_encode(
|
(zcbor_bool_encode(
|
||||||
state, (&(*input)._union_vb))))
|
state, (&(*input)._union_vb))))
|
||||||
: (((*input)._record_union_choice ==
|
: (((*input)._record_union_choice ==
|
||||||
_union_vd)
|
_union_vd)
|
||||||
? (((zcbor_uint32_put(state,
|
? (((zcbor_uint32_put(state,
|
||||||
(8)))) &&
|
(8)))) &&
|
||||||
(zcbor_bstr_encode(
|
(zcbor_bstr_encode(
|
||||||
state,
|
state,
|
||||||
(&(*input)._union_vd))))
|
(&(*input)._union_vd))))
|
||||||
: (((*input)._record_union_choice ==
|
: (((*input)._record_union_choice ==
|
||||||
_union_vlo)
|
_union_vlo)
|
||||||
? (((zcbor_tstr_encode(
|
? (((zcbor_tstr_encode(
|
||||||
state,
|
state,
|
||||||
((tmp_str.value =
|
((tmp_str.value =
|
||||||
(uint8_t *)"vlo",
|
(uint8_t *)"vlo",
|
||||||
tmp_str.len =
|
tmp_str.len =
|
||||||
sizeof("vlo") -
|
sizeof("vlo") -
|
||||||
1,
|
1,
|
||||||
&tmp_str))))) &&
|
&tmp_str))))) &&
|
||||||
(zcbor_tstr_encode(
|
(zcbor_tstr_encode(
|
||||||
state,
|
state,
|
||||||
(&(*input)._union_vlo))))
|
(&(*input)._union_vlo))))
|
||||||
: false))))))));
|
: false))))))));
|
||||||
|
|
||||||
if (!tmp_result) {
|
if (!tmp_result) {
|
||||||
zcbor_trace();
|
zcbor_trace();
|
||||||
|
@ -151,22 +149,22 @@ static bool encode_value(zcbor_state_t *state, const struct value_ *input)
|
||||||
? ((zcbor_tstr_encode(state, (&(*input)._value_tstr))))
|
? ((zcbor_tstr_encode(state, (&(*input)._value_tstr))))
|
||||||
: (((*input)._value_choice == _value_bstr)
|
: (((*input)._value_choice == _value_bstr)
|
||||||
? ((zcbor_bstr_encode(state, (&(*input)._value_bstr))))
|
? ((zcbor_bstr_encode(state, (&(*input)._value_bstr))))
|
||||||
: (((*input)._value_choice == _value_int)
|
: (((*input)._value_choice == _value_int)
|
||||||
? (((((*input)._value_int >= INT64_MIN) &&
|
? (((((*input)._value_int >= INT64_MIN) &&
|
||||||
((*input)._value_int <= INT64_MAX)) ||
|
((*input)._value_int <= INT64_MAX)) ||
|
||||||
(zcbor_error(state, ZCBOR_ERR_WRONG_RANGE),
|
(zcbor_error(state, ZCBOR_ERR_WRONG_RANGE),
|
||||||
false)) &&
|
false)) &&
|
||||||
(zcbor_int64_encode(state,
|
(zcbor_int64_encode(state,
|
||||||
(&(*input)._value_int))))
|
(&(*input)._value_int))))
|
||||||
: (((*input)._value_choice == _value_float)
|
: (((*input)._value_choice == _value_float)
|
||||||
? ((zcbor_float64_encode(
|
? ((zcbor_float64_encode(
|
||||||
state,
|
state,
|
||||||
(&(*input)._value_float))))
|
(&(*input)._value_float))))
|
||||||
: (((*input)._value_choice == _value_bool)
|
: (((*input)._value_choice == _value_bool)
|
||||||
? ((zcbor_bool_encode(
|
? ((zcbor_bool_encode(
|
||||||
state,
|
state,
|
||||||
(&(*input)._value_bool))))
|
(&(*input)._value_bool))))
|
||||||
: false)))))));
|
: false)))))));
|
||||||
|
|
||||||
if (!tmp_result) {
|
if (!tmp_result) {
|
||||||
zcbor_trace();
|
zcbor_trace();
|
||||||
|
@ -207,33 +205,31 @@ static bool encode_record(zcbor_state_t *state, const struct record *input)
|
||||||
{
|
{
|
||||||
zcbor_print("%s\r\n", __func__);
|
zcbor_print("%s\r\n", __func__);
|
||||||
|
|
||||||
bool tmp_result =
|
bool tmp_result = ((
|
||||||
(((zcbor_map_start_encode(state,
|
(zcbor_map_start_encode(state, ZCBOR_ARRAY_SIZE(input->_record__key_value_pair)) &&
|
||||||
ZCBOR_ARRAY_SIZE(input->_record__key_value_pair) + 5) &&
|
((zcbor_present_encode(&((*input)._record_bn_present),
|
||||||
((zcbor_present_encode(&((*input)._record_bn_present),
|
(zcbor_encoder_t *)encode_repeated_record_bn, state,
|
||||||
(zcbor_encoder_t *)encode_repeated_record_bn, state,
|
(&(*input)._record_bn)) &&
|
||||||
(&(*input)._record_bn)) &&
|
zcbor_present_encode(&((*input)._record_bt_present),
|
||||||
zcbor_present_encode(&((*input)._record_bt_present),
|
(zcbor_encoder_t *)encode_repeated_record_bt, state,
|
||||||
(zcbor_encoder_t *)encode_repeated_record_bt, state,
|
(&(*input)._record_bt)) &&
|
||||||
(&(*input)._record_bt)) &&
|
zcbor_present_encode(&((*input)._record_n_present),
|
||||||
zcbor_present_encode(&((*input)._record_n_present),
|
(zcbor_encoder_t *)encode_repeated_record_n, state,
|
||||||
(zcbor_encoder_t *)encode_repeated_record_n, state,
|
(&(*input)._record_n)) &&
|
||||||
(&(*input)._record_n)) &&
|
zcbor_present_encode(&((*input)._record_t_present),
|
||||||
zcbor_present_encode(&((*input)._record_t_present),
|
(zcbor_encoder_t *)encode_repeated_record_t, state,
|
||||||
(zcbor_encoder_t *)encode_repeated_record_t, state,
|
(&(*input)._record_t)) &&
|
||||||
(&(*input)._record_t)) &&
|
zcbor_present_encode(&((*input)._record_union_present),
|
||||||
zcbor_present_encode(&((*input)._record_union_present),
|
(zcbor_encoder_t *)encode_repeated_record_union, state,
|
||||||
(zcbor_encoder_t *)encode_repeated_record_union, state,
|
(&(*input)._record_union)) &&
|
||||||
(&(*input)._record_union)) &&
|
zcbor_multi_encode_minmax(
|
||||||
zcbor_multi_encode_minmax(
|
0, ZCBOR_ARRAY_SIZE(input->_record__key_value_pair),
|
||||||
0, ZCBOR_ARRAY_SIZE(input->_record__key_value_pair),
|
&(*input)._record__key_value_pair_count,
|
||||||
&(*input)._record__key_value_pair_count,
|
(zcbor_encoder_t *)encode_repeated_record__key_value_pair, state,
|
||||||
(zcbor_encoder_t *)encode_repeated_record__key_value_pair, state,
|
(&(*input)._record__key_value_pair),
|
||||||
(&(*input)._record__key_value_pair),
|
sizeof(struct record__key_value_pair))) ||
|
||||||
sizeof(struct record__key_value_pair))) ||
|
(zcbor_list_map_end_force_encode(state), false)) &&
|
||||||
(zcbor_list_map_end_force_encode(state), false)) &&
|
zcbor_map_end_encode(state, ZCBOR_ARRAY_SIZE(input->_record__key_value_pair)))));
|
||||||
zcbor_map_end_encode(state,
|
|
||||||
ZCBOR_ARRAY_SIZE(input->_record__key_value_pair) + 5))));
|
|
||||||
|
|
||||||
if (!tmp_result) {
|
if (!tmp_result) {
|
||||||
zcbor_trace();
|
zcbor_trace();
|
||||||
|
|
|
@ -2,9 +2,8 @@
|
||||||
* Copyright (c) 2023 Nordic Semiconductor ASA
|
* Copyright (c) 2023 Nordic Semiconductor ASA
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*
|
||||||
/*
|
* Generated using zcbor version 0.7.0
|
||||||
* Generated using zcbor version 0.6.0
|
|
||||||
* https://github.com/zephyrproject-rtos/zcbor
|
* https://github.com/zephyrproject-rtos/zcbor
|
||||||
* Generated with a --default-max-qty of 99
|
* Generated with a --default-max-qty of 99
|
||||||
*/
|
*/
|
||||||
|
@ -16,10 +15,17 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "zcbor_encode.h"
|
|
||||||
#include "lwm2m_senml_cbor_types.h"
|
#include "lwm2m_senml_cbor_types.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
int cbor_encode_lwm2m_senml(uint8_t *payload, size_t payload_len, const struct lwm2m_senml *input,
|
int cbor_encode_lwm2m_senml(uint8_t *payload, size_t payload_len, const struct lwm2m_senml *input,
|
||||||
size_t *payload_len_out);
|
size_t *payload_len_out);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* LWM2M_SENML_CBOR_ENCODE_H__ */
|
#endif /* LWM2M_SENML_CBOR_ENCODE_H__ */
|
||||||
|
|
|
@ -2,9 +2,8 @@
|
||||||
* Copyright (c) 2023 Nordic Semiconductor ASA
|
* Copyright (c) 2023 Nordic Semiconductor ASA
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*
|
||||||
/*
|
* Generated using zcbor version 0.7.0
|
||||||
* Generated using zcbor version 0.6.0
|
|
||||||
* https://github.com/zephyrproject-rtos/zcbor
|
* https://github.com/zephyrproject-rtos/zcbor
|
||||||
* Generated with a --default-max-qty of 99
|
* Generated with a --default-max-qty of 99
|
||||||
*/
|
*/
|
||||||
|
@ -15,8 +14,11 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <string.h>
|
#include <zcbor_common.h>
|
||||||
#include "zcbor_common.h"
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
enum lwm2m_senml_cbor_key {
|
enum lwm2m_senml_cbor_key {
|
||||||
lwm2m_senml_cbor_key_bn = -2,
|
lwm2m_senml_cbor_key_bn = -2,
|
||||||
|
@ -114,22 +116,26 @@ struct record__key_value_pair {
|
||||||
|
|
||||||
struct record {
|
struct record {
|
||||||
struct record_bn _record_bn;
|
struct record_bn _record_bn;
|
||||||
uint_fast32_t _record_bn_present;
|
bool _record_bn_present;
|
||||||
struct record_bt _record_bt;
|
struct record_bt _record_bt;
|
||||||
uint_fast32_t _record_bt_present;
|
bool _record_bt_present;
|
||||||
struct record_n _record_n;
|
struct record_n _record_n;
|
||||||
uint_fast32_t _record_n_present;
|
bool _record_n_present;
|
||||||
struct record_t _record_t;
|
struct record_t _record_t;
|
||||||
uint_fast32_t _record_t_present;
|
bool _record_t_present;
|
||||||
struct record_union_ _record_union;
|
struct record_union_ _record_union;
|
||||||
uint_fast32_t _record_union_present;
|
bool _record_union_present;
|
||||||
struct record__key_value_pair _record__key_value_pair[5];
|
struct record__key_value_pair _record__key_value_pair[5];
|
||||||
uint_fast32_t _record__key_value_pair_count;
|
size_t _record__key_value_pair_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct lwm2m_senml {
|
struct lwm2m_senml {
|
||||||
struct record _lwm2m_senml__record[DEFAULT_MAX_QTY];
|
struct record _lwm2m_senml__record[DEFAULT_MAX_QTY];
|
||||||
uint_fast32_t _lwm2m_senml__record_count;
|
size_t _lwm2m_senml__record_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* LWM2M_SENML_CBOR_TYPES_H__ */
|
#endif /* LWM2M_SENML_CBOR_TYPES_H__ */
|
||||||
|
|
Loading…
Reference in a new issue