1 /*
2  * Copyright (c) 2023 Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Generated using zcbor version 0.7.0
7  * https://github.com/zephyrproject-rtos/zcbor
8  * Generated with a --default-max-qty of 99
9  */
10 
11 #ifndef LWM2M_SENML_CBOR_TYPES_H__
12 #define LWM2M_SENML_CBOR_TYPES_H__
13 
14 #include <stdint.h>
15 #include <stdbool.h>
16 #include <stddef.h>
17 #include <zcbor_common.h>
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 enum lwm2m_senml_cbor_key {
24 	lwm2m_senml_cbor_key_bn = -2,
25 	lwm2m_senml_cbor_key_bt = -3,
26 	lwm2m_senml_cbor_key_n = 0,
27 	lwm2m_senml_cbor_key_t = 6,
28 	lwm2m_senml_cbor_key_vi = 2,
29 	lwm2m_senml_cbor_key_vf = 2,
30 	lwm2m_senml_cbor_key_vs = 3,
31 	lwm2m_senml_cbor_key_vb = 4,
32 	lwm2m_senml_cbor_key_vd = 8,
33 };
34 
35 /** Which value for --default-max-qty this file was created with.
36  *
37  *  The define is used in the other generated file to do a build-time
38  *  compatibility check.
39  *
40  *  See `zcbor --help` for more information about --default-max-qty
41  */
42 #define DEFAULT_MAX_QTY CONFIG_LWM2M_RW_SENML_CBOR_RECORDS
43 
44 struct record_bn {
45 	struct zcbor_string _record_bn;
46 };
47 
48 struct record_bt {
49 	int64_t _record_bt;
50 };
51 
52 struct record_n {
53 	struct zcbor_string _record_n;
54 };
55 
56 struct record_t {
57 	int64_t _record_t;
58 };
59 
60 /* The union members and enum members have the same names.
61  * This is intentional so we need to ignore -Wshadow to avoid
62  * compiler complaining about them.
63  */
64 #pragma GCC diagnostic push
65 #pragma GCC diagnostic ignored "-Wshadow"
66 
67 struct record_union_ {
68 	union {
69 		struct {
70 			int64_t _union_vi;
71 		};
72 		struct {
73 			double _union_vf;
74 		};
75 		struct {
76 			struct zcbor_string _union_vs;
77 		};
78 		struct {
79 			bool _union_vb;
80 		};
81 		struct {
82 			struct zcbor_string _union_vd;
83 		};
84 		struct {
85 			struct zcbor_string _union_vlo;
86 		};
87 	};
88 	enum {
89 		_union_vi,
90 		_union_vf,
91 		_union_vs,
92 		_union_vb,
93 		_union_vd,
94 		_union_vlo,
95 	} _record_union_choice;
96 };
97 
98 struct value_ {
99 	union {
100 		struct zcbor_string _value_tstr;
101 		struct zcbor_string _value_bstr;
102 		int64_t _value_int;
103 		double _value_float;
104 		bool _value_bool;
105 	};
106 	enum {
107 		_value_tstr,
108 		_value_bstr,
109 		_value_int,
110 		_value_float,
111 		_value_bool,
112 	} _value_choice;
113 };
114 
115 #pragma GCC diagnostic pop
116 
117 struct key_value_pair {
118 	int32_t _key_value_pair_key;
119 	struct value_ _key_value_pair;
120 };
121 
122 struct record__key_value_pair {
123 	struct key_value_pair _record__key_value_pair;
124 };
125 
126 struct record {
127 	struct record_bn _record_bn;
128 	bool _record_bn_present;
129 	struct record_bt _record_bt;
130 	bool _record_bt_present;
131 	struct record_n _record_n;
132 	bool _record_n_present;
133 	struct record_t _record_t;
134 	bool _record_t_present;
135 	struct record_union_ _record_union;
136 	bool _record_union_present;
137 	struct record__key_value_pair _record__key_value_pair[5];
138 	size_t _record__key_value_pair_count;
139 };
140 
141 struct lwm2m_senml {
142 	struct record _lwm2m_senml__record[DEFAULT_MAX_QTY];
143 	size_t _lwm2m_senml__record_count;
144 };
145 
146 #ifdef __cplusplus
147 }
148 #endif
149 
150 #endif /* LWM2M_SENML_CBOR_TYPES_H__ */
151