1diff --git a/subsys/net/lib/lwm2m/lwm2m_senml_cbor_decode.c b/subsys/net/lib/lwm2m/lwm2m_senml_cbor_decode.c 2index f8006525d79..0bd686d8174 100644 3--- a/subsys/net/lib/lwm2m/lwm2m_senml_cbor_decode.c 4+++ b/subsys/net/lib/lwm2m/lwm2m_senml_cbor_decode.c 5@@ -4,7 +4,7 @@ 6 * SPDX-License-Identifier: Apache-2.0 7 * 8 * Generated using zcbor version 0.9.0 9- * https://github.com/NordicSemiconductor/zcbor 10+ * https://github.com/zephyrproject-rtos/zcbor 11 * Generated with a --default-max-qty of 99 12 */ 13 14@@ -16,10 +16,6 @@ 15 #include "lwm2m_senml_cbor_decode.h" 16 #include "zcbor_print.h" 17 18-#if DEFAULT_MAX_QTY != 99 19-#error "The type file was generated with a different default_max_qty than this file" 20-#endif 21- 22 #define log_result(state, result, func) do { \ 23 if (!result) { \ 24 zcbor_trace_file(state); \ 25@@ -162,7 +158,7 @@ static bool decode_record( 26 && zcbor_present_decode(&((*result).record_n_present), (zcbor_decoder_t *)decode_repeated_record_n, state, (&(*result).record_n)) 27 && zcbor_present_decode(&((*result).record_t_present), (zcbor_decoder_t *)decode_repeated_record_t, state, (&(*result).record_t)) 28 && zcbor_present_decode(&((*result).record_union_present), (zcbor_decoder_t *)decode_repeated_record_union, state, (&(*result).record_union)) 29- && zcbor_multi_decode(0, 5, &(*result).record_key_value_pair_m_count, (zcbor_decoder_t *)decode_repeated_record_key_value_pair_m, state, (*&(*result).record_key_value_pair_m), sizeof(struct record_key_value_pair_m))) || (zcbor_list_map_end_force_decode(state), false)) && zcbor_map_end_decode(state)))); 30+ && zcbor_multi_decode(0, ZCBOR_ARRAY_SIZE(result->record_key_value_pair_m), &(*result).record_key_value_pair_m_count, (zcbor_decoder_t *)decode_repeated_record_key_value_pair_m, state, (*&(*result).record_key_value_pair_m), sizeof(struct record_key_value_pair_m))) || (zcbor_list_map_end_force_decode(state), false)) && zcbor_map_end_decode(state)))); 31 32 if (false) { 33 /* For testing that the types of the arguments are correct. 34@@ -184,7 +180,7 @@ static bool decode_lwm2m_senml( 35 { 36 zcbor_log("%s\r\n", __func__); 37 38- bool res = (((zcbor_list_start_decode(state) && ((zcbor_multi_decode(1, 99, &(*result).lwm2m_senml_record_m_count, (zcbor_decoder_t *)decode_record, state, (*&(*result).lwm2m_senml_record_m), sizeof(struct record))) || (zcbor_list_map_end_force_decode(state), false)) && zcbor_list_end_decode(state)))); 39+ bool res = (((zcbor_list_start_decode(state) && ((zcbor_multi_decode(1, ZCBOR_ARRAY_SIZE(result->lwm2m_senml_record_m), &(*result).lwm2m_senml_record_m_count, (zcbor_decoder_t *)decode_record, state, (*&(*result).lwm2m_senml_record_m), sizeof(struct record))) || (zcbor_list_map_end_force_decode(state), false)) && zcbor_list_end_decode(state)))); 40 41 if (false) { 42 /* For testing that the types of the arguments are correct. 43diff --git a/subsys/net/lib/lwm2m/lwm2m_senml_cbor_decode.h b/subsys/net/lib/lwm2m/lwm2m_senml_cbor_decode.h 44index f9d34fad2e3..636fbd0b500 100644 45--- a/subsys/net/lib/lwm2m/lwm2m_senml_cbor_decode.h 46+++ b/subsys/net/lib/lwm2m/lwm2m_senml_cbor_decode.h 47@@ -4,7 +4,7 @@ 48 * SPDX-License-Identifier: Apache-2.0 49 * 50 * Generated using zcbor version 0.9.0 51- * https://github.com/NordicSemiconductor/zcbor 52+ * https://github.com/zephyrproject-rtos/zcbor 53 * Generated with a --default-max-qty of 99 54 */ 55 56@@ -21,11 +21,6 @@ 57 extern "C" { 58 #endif 59 60-#if DEFAULT_MAX_QTY != 99 61-#error "The type file was generated with a different default_max_qty than this file" 62-#endif 63- 64- 65 int cbor_decode_lwm2m_senml( 66 const uint8_t *payload, size_t payload_len, 67 struct lwm2m_senml *result, 68diff --git a/subsys/net/lib/lwm2m/lwm2m_senml_cbor_encode.c b/subsys/net/lib/lwm2m/lwm2m_senml_cbor_encode.c 69index 851cf994c6d..4ec898e656d 100644 70--- a/subsys/net/lib/lwm2m/lwm2m_senml_cbor_encode.c 71+++ b/subsys/net/lib/lwm2m/lwm2m_senml_cbor_encode.c 72@@ -4,7 +4,7 @@ 73 * SPDX-License-Identifier: Apache-2.0 74 * 75 * Generated using zcbor version 0.9.0 76- * https://github.com/NordicSemiconductor/zcbor 77+ * https://github.com/zephyrproject-rtos/zcbor 78 * Generated with a --default-max-qty of 99 79 */ 80 81@@ -16,10 +16,6 @@ 82 #include "lwm2m_senml_cbor_encode.h" 83 #include "zcbor_print.h" 84 85-#if DEFAULT_MAX_QTY != 99 86-#error "The type file was generated with a different default_max_qty than this file" 87-#endif 88- 89 #define log_result(state, result, func) do { \ 90 if (!result) { \ 91 zcbor_trace_file(state); \ 92@@ -157,12 +153,12 @@ static bool encode_record( 93 { 94 zcbor_log("%s\r\n", __func__); 95 96- bool res = (((zcbor_map_start_encode(state, 10) && (((!(*input).record_bn_present || encode_repeated_record_bn(state, (&(*input).record_bn))) 97+ bool res = (((zcbor_map_start_encode(state, ZCBOR_ARRAY_SIZE(input->record_key_value_pair_m)) && (((!(*input).record_bn_present || encode_repeated_record_bn(state, (&(*input).record_bn))) 98 && (!(*input).record_bt_present || encode_repeated_record_bt(state, (&(*input).record_bt))) 99 && (!(*input).record_n_present || encode_repeated_record_n(state, (&(*input).record_n))) 100 && (!(*input).record_t_present || encode_repeated_record_t(state, (&(*input).record_t))) 101 && (!(*input).record_union_present || encode_repeated_record_union(state, (&(*input).record_union))) 102- && zcbor_multi_encode_minmax(0, 5, &(*input).record_key_value_pair_m_count, (zcbor_encoder_t *)encode_repeated_record_key_value_pair_m, state, (*&(*input).record_key_value_pair_m), sizeof(struct record_key_value_pair_m))) || (zcbor_list_map_end_force_encode(state), false)) && zcbor_map_end_encode(state, 10)))); 103+ && zcbor_multi_encode_minmax(0, ZCBOR_ARRAY_SIZE(input->record_key_value_pair_m), &(*input).record_key_value_pair_m_count, (zcbor_encoder_t *)encode_repeated_record_key_value_pair_m, state, (*&(*input).record_key_value_pair_m), sizeof(struct record_key_value_pair_m))) || (zcbor_list_map_end_force_encode(state), false)) && zcbor_map_end_encode(state, ZCBOR_ARRAY_SIZE(input->record_key_value_pair_m))))); 104 105 log_result(state, res, __func__); 106 return res; 107@@ -173,7 +169,7 @@ static bool encode_lwm2m_senml( 108 { 109 zcbor_log("%s\r\n", __func__); 110 111- bool res = (((zcbor_list_start_encode(state, 99) && ((zcbor_multi_encode_minmax(1, 99, &(*input).lwm2m_senml_record_m_count, (zcbor_encoder_t *)encode_record, state, (*&(*input).lwm2m_senml_record_m), sizeof(struct record))) || (zcbor_list_map_end_force_encode(state), false)) && zcbor_list_end_encode(state, 99)))); 112+ bool res = (((zcbor_list_start_encode(state, ZCBOR_ARRAY_SIZE(input->lwm2m_senml_record_m)) && ((zcbor_multi_encode_minmax(1, ZCBOR_ARRAY_SIZE(input->lwm2m_senml_record_m), &(*input).lwm2m_senml_record_m_count, (zcbor_encoder_t *)encode_record, state, (*&(*input).lwm2m_senml_record_m), sizeof(struct record))) || (zcbor_list_map_end_force_encode(state), false)) && zcbor_list_end_encode(state, ZCBOR_ARRAY_SIZE(input->lwm2m_senml_record_m))))); 113 114 log_result(state, res, __func__); 115 return res; 116diff --git a/subsys/net/lib/lwm2m/lwm2m_senml_cbor_encode.h b/subsys/net/lib/lwm2m/lwm2m_senml_cbor_encode.h 117index de7399bedc7..1a643a6d2ca 100644 118--- a/subsys/net/lib/lwm2m/lwm2m_senml_cbor_encode.h 119+++ b/subsys/net/lib/lwm2m/lwm2m_senml_cbor_encode.h 120@@ -4,7 +4,7 @@ 121 * SPDX-License-Identifier: Apache-2.0 122 * 123 * Generated using zcbor version 0.9.0 124- * https://github.com/NordicSemiconductor/zcbor 125+ * https://github.com/zephyrproject-rtos/zcbor 126 * Generated with a --default-max-qty of 99 127 */ 128 129@@ -21,11 +21,6 @@ 130 extern "C" { 131 #endif 132 133-#if DEFAULT_MAX_QTY != 99 134-#error "The type file was generated with a different default_max_qty than this file" 135-#endif 136- 137- 138 int cbor_encode_lwm2m_senml( 139 uint8_t *payload, size_t payload_len, 140 const struct lwm2m_senml *input, 141diff --git a/subsys/net/lib/lwm2m/lwm2m_senml_cbor_types.h b/subsys/net/lib/lwm2m/lwm2m_senml_cbor_types.h 142index d8bb8ad74cc..98570bdd52e 100644 143--- a/subsys/net/lib/lwm2m/lwm2m_senml_cbor_types.h 144+++ b/subsys/net/lib/lwm2m/lwm2m_senml_cbor_types.h 145@@ -4,7 +4,7 @@ 146 * SPDX-License-Identifier: Apache-2.0 147 * 148 * Generated using zcbor version 0.9.0 149- * https://github.com/NordicSemiconductor/zcbor 150+ * https://github.com/zephyrproject-rtos/zcbor 151 * Generated with a --default-max-qty of 99 152 */ 153 154@@ -20,14 +20,17 @@ 155 extern "C" { 156 #endif 157 158-/** Which value for --default-max-qty this file was created with. 159- * 160- * The define is used in the other generated file to do a build-time 161- * compatibility check. 162- * 163- * See `zcbor --help` for more information about --default-max-qty 164- */ 165-#define DEFAULT_MAX_QTY 99 166+enum lwm2m_senml_cbor_key { 167+ lwm2m_senml_cbor_key_bn = -2, 168+ lwm2m_senml_cbor_key_bt = -3, 169+ lwm2m_senml_cbor_key_n = 0, 170+ lwm2m_senml_cbor_key_t = 6, 171+ lwm2m_senml_cbor_key_vi = 2, 172+ lwm2m_senml_cbor_key_vf = 2, 173+ lwm2m_senml_cbor_key_vs = 3, 174+ lwm2m_senml_cbor_key_vb = 4, 175+ lwm2m_senml_cbor_key_vd = 8, 176+}; 177 178 struct record_bn { 179 struct zcbor_string record_bn; 180@@ -104,21 +107,21 @@ struct record_key_value_pair_m { 181 182 struct record { 183 struct record_bn record_bn; 184- bool record_bn_present; 185 struct record_bt record_bt; 186- bool record_bt_present; 187 struct record_n record_n; 188- bool record_n_present; 189 struct record_t record_t; 190- bool record_t_present; 191 struct record_union_r record_union; 192- bool record_union_present; 193 struct record_key_value_pair_m record_key_value_pair_m[5]; 194 size_t record_key_value_pair_m_count; 195+ bool record_bn_present; 196+ bool record_bt_present; 197+ bool record_n_present; 198+ bool record_t_present; 199+ bool record_union_present; 200 }; 201 202 struct lwm2m_senml { 203- struct record lwm2m_senml_record_m[99]; 204+ struct record lwm2m_senml_record_m[CONFIG_LWM2M_RW_SENML_CBOR_RECORDS]; 205 size_t lwm2m_senml_record_m_count; 206 }; 207 208