Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / examples / temperature-measurement-app / esp32 / main / gen / endpoint_config.h
1 /*
2  *
3  *    Copyright (c) 2021 Project CHIP Authors
4  *
5  *    Licensed under the Apache License, Version 2.0 (the "License");
6  *    you may not use this file except in compliance with the License.
7  *    You may obtain a copy of the License at
8  *
9  *        http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *    Unless required by applicable law or agreed to in writing, software
12  *    distributed under the License is distributed on an "AS IS" BASIS,
13  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *    See the License for the specific language governing permissions and
15  *    limitations under the License.
16  */
17
18 // THIS FILE IS GENERATED BY ZAP
19
20 // Prevent multiple inclusion
21 #pragma once
22
23 // Default values for the attributes longer than a pointer,
24 // in a form of a binary blob
25 // Separate block is generated for big-endian and little-endian cases.
26 #if BIGENDIAN_CPU
27 #define GENERATED_DEFAULTS                                                                                                         \
28     {                                                                                                                              \
29         /* 0 - Default for cluster: "Basic", attribute: "VendorName". side: server, big-endian */                                  \
30         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,    \
31             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,                                                \
32                                                                                                                                    \
33             /* 32 - Default for cluster: "Basic", attribute: "ProductName". side: server, big-endian */                            \
34             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
35             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,                                          \
36                                                                                                                                    \
37             /* 64 - Default for cluster: "Basic", attribute: "UserLabel". side: server, big-endian */                              \
38             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
39             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,                                          \
40                                                                                                                                    \
41             /* 96 - Default for cluster: "Basic", attribute: "Location". side: server, big-endian */                               \
42             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,                        \
43                                                                                                                                    \
44             /* 112 - Default for cluster: "Basic", attribute: "HardwareVersionString". side: server, big-endian */                 \
45             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
46             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
47             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
48             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,                                                                              \
49                                                                                                                                    \
50             /* 176 - Default for cluster: "Basic", attribute: "SoftwareVersion". side: server, big-endian */                       \
51             0x00, 0x00, 0x00, 0x00,                                                                                                \
52                                                                                                                                    \
53             /* 180 - Default for cluster: "Basic", attribute: "SoftwareVersionString". side: server, big-endian */                 \
54             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
55             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
56             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
57             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,                                                                              \
58     }
59
60 #else // !BIGENDIAN_CPU
61 #define GENERATED_DEFAULTS                                                                                                         \
62     {                                                                                                                              \
63         /* 0 - Default for cluster: "Basic", attribute: "VendorName". side: server, little-endian */                               \
64         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,    \
65             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,                                                \
66                                                                                                                                    \
67             /* 32 - Default for cluster: "Basic", attribute: "ProductName". side: server, little-endian */                         \
68             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
69             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,                                          \
70                                                                                                                                    \
71             /* 64 - Default for cluster: "Basic", attribute: "UserLabel". side: server, little-endian */                           \
72             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
73             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,                                          \
74                                                                                                                                    \
75             /* 96 - Default for cluster: "Basic", attribute: "Location". side: server, little-endian */                            \
76             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,                        \
77                                                                                                                                    \
78             /* 112 - Default for cluster: "Basic", attribute: "HardwareVersionString". side: server, little-endian */              \
79             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
80             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
81             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
82             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,                                                                              \
83                                                                                                                                    \
84             /* 176 - Default for cluster: "Basic", attribute: "SoftwareVersion". side: server, little-endian */                    \
85             0x00, 0x00, 0x00, 0x00,                                                                                                \
86                                                                                                                                    \
87             /* 180 - Default for cluster: "Basic", attribute: "SoftwareVersionString". side: server, little-endian */              \
88             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
89             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
90             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
91             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,                                                                              \
92     }
93
94 #endif // BIGENDIAN_CPU
95
96 #define GENERATED_DEFAULTS_COUNT (7)
97
98 #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE
99 #define ZAP_LONG_DEFAULTS_INDEX(index)                                                                                             \
100     {                                                                                                                              \
101         (uint8_t *) (&generatedDefaults[index])                                                                                    \
102     }
103 #define ZAP_MIN_MAX_DEFAULTS_INDEX(index)                                                                                          \
104     {                                                                                                                              \
105         (uint8_t *) (&minMaxDefault[index])                                                                                        \
106     }
107 #define ZAP_EMPTY_DEFAULT()                                                                                                        \
108     {                                                                                                                              \
109         (uint8_t *) 0                                                                                                              \
110     }
111 #define ZAP_SIMPLE_DEFAULT(x)                                                                                                      \
112     {                                                                                                                              \
113         (uint8_t *) x                                                                                                              \
114     }
115
116 // This is an array of EmberAfAttributeMinMaxValue structures.
117 #define GENERATED_MIN_MAX_DEFAULT_COUNT 0
118 #define GENERATED_MIN_MAX_DEFAULTS                                                                                                 \
119     {                                                                                                                              \
120     }
121
122 #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask
123 // This is an array of EmberAfAttributeMetadata structures.
124 #define GENERATED_ATTRIBUTE_COUNT 17
125 #define GENERATED_ATTRIBUTES                                                                                                       \
126     {                                                                                                                              \
127         { 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON),                                                              \
128           ZAP_SIMPLE_DEFAULT(3) }, /* Basic (server): cluster revision */                                                          \
129             { 0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON),                                                          \
130               ZAP_EMPTY_DEFAULT() }, /* Basic (server): InteractionModelVersion */                                                 \
131             { 0x0001, ZAP_TYPE(CHAR_STRING), 32, ZAP_ATTRIBUTE_MASK(SINGLETON),                                                    \
132               ZAP_LONG_DEFAULTS_INDEX(0) },                                                      /* Basic (server): VendorName */  \
133             { 0x0002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* Basic (server): VendorID */    \
134             { 0x0003, ZAP_TYPE(CHAR_STRING), 32, ZAP_ATTRIBUTE_MASK(SINGLETON),                                                    \
135               ZAP_LONG_DEFAULTS_INDEX(32) },                                                     /* Basic (server): ProductName */ \
136             { 0x0004, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), ZAP_EMPTY_DEFAULT() }, /* Basic (server): ProductID */   \
137             { 0x0005, ZAP_TYPE(CHAR_STRING), 32, ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE),                     \
138               ZAP_LONG_DEFAULTS_INDEX(64) }, /* Basic (server): UserLabel */                                                       \
139             { 0x0006, ZAP_TYPE(CHAR_STRING), 16, ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE),                     \
140               ZAP_LONG_DEFAULTS_INDEX(96) }, /* Basic (server): Location */                                                        \
141             { 0x0007, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON),                                                          \
142               ZAP_SIMPLE_DEFAULT(0x00) }, /* Basic (server): HardwareVersion */                                                    \
143             { 0x0008, ZAP_TYPE(CHAR_STRING), 64, ZAP_ATTRIBUTE_MASK(SINGLETON),                                                    \
144               ZAP_LONG_DEFAULTS_INDEX(112) }, /* Basic (server): HardwareVersionString */                                          \
145             { 0x0009, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(SINGLETON),                                                          \
146               ZAP_LONG_DEFAULTS_INDEX(176) }, /* Basic (server): SoftwareVersion */                                                \
147             { 0x000A, ZAP_TYPE(CHAR_STRING), 64, ZAP_ATTRIBUTE_MASK(SINGLETON),                                                    \
148               ZAP_LONG_DEFAULTS_INDEX(180) },                               /* Basic (server): SoftwareVersionString */            \
149             { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(0x0001) }, /* Network Commissioning (server): cluster revision */ \
150             { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, ZAP_SIMPLE_DEFAULT(3) }, /* Temperature Measurement (server): cluster revision */    \
151             { 0x0000, ZAP_TYPE(INT16S), 2, 0, ZAP_SIMPLE_DEFAULT(0x8000) }, /* Temperature Measurement (server): measured value */ \
152             { 0x0001, ZAP_TYPE(INT16S), 2, 0,                                                                                      \
153               ZAP_SIMPLE_DEFAULT(0x8000) }, /* Temperature Measurement (server): min measured value */                             \
154             { 0x0002, ZAP_TYPE(INT16S), 2, 0,                                                                                      \
155               ZAP_SIMPLE_DEFAULT(0x8000) }, /* Temperature Measurement (server): max measured value */                             \
156     }
157
158 // This is an array of EmberAfCluster structures.
159 #define ZAP_ATTRIBUTE_INDEX(index) ((EmberAfAttributeMetadata *) (&generatedAttributes[index]))
160
161 // Cluster function static arrays
162 #define GENERATED_FUNCTION_ARRAYS
163
164 #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask
165 #define GENERATED_CLUSTER_COUNT 3
166 #define GENERATED_CLUSTERS                                                                                                         \
167     {                                                                                                                              \
168         { 0x0028, ZAP_ATTRIBUTE_INDEX(0), 12, 254, ZAP_CLUSTER_MASK(SERVER), NULL }, /* Endpoint: 1, Cluster: Basic (server) */    \
169             {                                                                                                                      \
170                 0x0031, ZAP_ATTRIBUTE_INDEX(12), 1, 2, ZAP_CLUSTER_MASK(SERVER), NULL                                              \
171             }, /* Endpoint: 1, Cluster: Network Commissioning (server) */                                                          \
172             {                                                                                                                      \
173                 0x0402, ZAP_ATTRIBUTE_INDEX(13), 4, 8, ZAP_CLUSTER_MASK(SERVER), NULL                                              \
174             }, /* Endpoint: 1, Cluster: Temperature Measurement (server) */                                                        \
175     }
176
177 #define ZAP_CLUSTER_INDEX(index) ((EmberAfCluster *) (&generatedClusters[index]))
178
179 // This is an array of EmberAfEndpointType structures.
180 #define GENERATED_ENDPOINT_TYPES                                                                                                   \
181     {                                                                                                                              \
182         { ZAP_CLUSTER_INDEX(0), 3, 264 },                                                                                          \
183     }
184
185 // Largest attribute size is needed for various buffers
186 #define ATTRIBUTE_LARGEST (65)
187
188 // Total size of singleton attributes
189 #define ATTRIBUTE_SINGLETONS_SIZE (254)
190
191 // Total size of attribute storage
192 #define ATTRIBUTE_MAX_SIZE (264)
193
194 // Number of fixed endpoints
195 #define FIXED_ENDPOINT_COUNT (1)
196
197 // Array of endpoints that are supported, the data inside
198 // the array is the endpoint number.
199 #define FIXED_ENDPOINT_ARRAY                                                                                                       \
200     {                                                                                                                              \
201         0x0001                                                                                                                     \
202     }
203
204 // Array of profile ids
205 #define FIXED_PROFILE_IDS                                                                                                          \
206     {                                                                                                                              \
207         0x0105                                                                                                                     \
208     }
209
210 // Array of device ids
211 #define FIXED_DEVICE_IDS                                                                                                           \
212     {                                                                                                                              \
213         0                                                                                                                          \
214     }
215
216 // Array of device versions
217 #define FIXED_DEVICE_VERSIONS                                                                                                      \
218     {                                                                                                                              \
219         1                                                                                                                          \
220     }
221
222 // Array of endpoint types supported on each endpoint
223 #define FIXED_ENDPOINT_TYPES                                                                                                       \
224     {                                                                                                                              \
225         0                                                                                                                          \
226     }
227
228 // Array of networks supported on each endpoint
229 #define FIXED_NETWORKS                                                                                                             \
230     {                                                                                                                              \
231         0                                                                                                                          \
232     }
233
234 // Array of EmberAfCommandMetadata structs.
235 #define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask
236 #define EMBER_AF_GENERATED_COMMAND_COUNT (20)
237 #define GENERATED_COMMANDS                                                                                                         \
238     {                                                                                                                              \
239         { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) },     /* Basic (server): StartUp */                                     \
240             { 0x0028, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Basic (server): ShutDown */                                    \
241             { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Basic (server): Leave */                                       \
242             { 0x0031, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): ScanNetworks */                \
243             { 0x0031, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Network Commissioning (server): ScanNetworksResponse */        \
244             { 0x0031, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): AddWiFiNetwork */              \
245             { 0x0031, 0x03, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* Network Commissioning (server): AddWiFiNetworkResponse */      \
246             { 0x0031, 0x04, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): UpdateWiFiNetwork */           \
247             { 0x0031, 0x05, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* Network Commissioning (server): UpdateWiFiNetworkResponse */   \
248             { 0x0031, 0x06, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): AddThreadNetwork */            \
249             { 0x0031, 0x07, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* Network Commissioning (server): AddThreadNetworkResponse */    \
250             { 0x0031, 0x08, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): UpdateThreadNetwork */         \
251             { 0x0031, 0x09, ZAP_COMMAND_MASK(OUTGOING_SERVER) }, /* Network Commissioning (server): UpdateThreadNetworkResponse */ \
252             { 0x0031, 0x0A, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): RemoveNetwork */               \
253             { 0x0031, 0x0B, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Network Commissioning (server): RemoveNetworkResponse */       \
254             { 0x0031, 0x0C, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): EnableNetwork */               \
255             { 0x0031, 0x0D, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Network Commissioning (server): EnableNetworkResponse */       \
256             { 0x0031, 0x0E, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): DisableNetwork */              \
257             { 0x0031, 0x0F, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Network Commissioning (server): DisableNetworkResponse */      \
258             { 0x0031, 0x10,                                                                                                        \
259               ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* Network Commissioning (server): GetLastNetworkCommissioningResult */         \
260     }
261
262 // Array of EmberAfManufacturerCodeEntry structures for commands.
263 #define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (0)
264 #define GENERATED_COMMAND_MANUFACTURER_CODES                                                                                       \
265     {                                                                                                                              \
266         {                                                                                                                          \
267             0x00, 0x00                                                                                                             \
268         }                                                                                                                          \
269     }
270
271 // This is an array of EmberAfManufacturerCodeEntry structures for clusters.
272 #define GENERATED_CLUSTER_MANUFACTURER_CODE_COUNT (0)
273 #define GENERATED_CLUSTER_MANUFACTURER_CODES                                                                                       \
274     {                                                                                                                              \
275         {                                                                                                                          \
276             0x00, 0x00                                                                                                             \
277         }                                                                                                                          \
278     }
279
280 // This is an array of EmberAfManufacturerCodeEntry structures for attributes.
281 #define GENERATED_ATTRIBUTE_MANUFACTURER_CODE_COUNT (0)
282 #define GENERATED_ATTRIBUTE_MANUFACTURER_CODES                                                                                     \
283     {                                                                                                                              \
284         {                                                                                                                          \
285             0x00, 0x00                                                                                                             \
286         }                                                                                                                          \
287     }
288
289 // Array of EmberAfPluginReportingEntry structures.
290 #define ZRD(x) EMBER_ZCL_REPORTING_DIRECTION_##x
291 #define ZAP_REPORT_DIRECTION(x) ZRD(x)
292
293 // User options for plugin Reporting
294 #define EMBER_AF_PLUGIN_REPORTING_TABLE_SIZE (1)
295 #define EMBER_AF_PLUGIN_REPORTING_ENABLE_GROUP_BOUND_REPORTS
296
297 #define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS_TABLE_SIZE (1)
298 #define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS                                                                               \
299     {                                                                                                                              \
300         {                                                                                                                          \
301             ZAP_REPORT_DIRECTION(REPORTED), 0x0001, 0x0402, 0x0000, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } }          \
302         }, /* Reporting for cluster: "Temperature Measurement", attribute: "measured value". side: server */                       \
303     }