Apply Upstream code (2021-03-15)
[platform/upstream/connectedhomeip.git] / examples / lock-app / lock-common / 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 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  \
30             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,                                          \
31             /* Default for cluster: "Basic", attribute: "VendorName". side: server, big-endian */ /* 32 */ 0x00, 0x00, 0x00, 0x00, \
32             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
33             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,                                                                  \
34             /* Default for cluster: "Basic", attribute: "ProductName". side: server, big-endian */ /* 64 */ 0x00, 0x00, 0x00,      \
35             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
36             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,                                                            \
37             /* Default for cluster: "Basic", attribute: "UserLabel". side: server, big-endian */ /* 96 */ 0x00, 0x00, 0x00, 0x00,  \
38             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,                                                \
39             /* Default for cluster: "Basic", attribute: "Location". side: server, big-endian */ /* 112 */ 0x00, 0x00, 0x00, 0x00,  \
40             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
41             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
42             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
43             0x00, 0x00, 0x00,                                                                                                      \
44             /* Default for cluster: "Basic", attribute: "HardwareVersionString". side: server, big-endian */ /* 176 */ 0x00, 0x00, \
45             0x00, 0x00, /* Default for cluster: "Basic", attribute: "SoftwareVersion". side: server, big-endian */ /* 180 */ 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
49             0x00, 0x00, 0x00, 0x00, 0x00,                                                                                          \
50             0x00, /* Default for cluster: "Basic", attribute: "SoftwareVersionString". side: server, big-endian */                 \
51     }
52
53 #else // !BIGENDIAN_CPU
54 #define GENERATED_DEFAULTS                                                                                                         \
55     {                                                                                                                              \
56         /* 0 */ 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,                                          \
58             /* Default for cluster: "Basic", attribute: "VendorName". side: server, little-endian */ /* 32 */ 0x00, 0x00, 0x00,    \
59             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
60             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,                                                            \
61             /* Default for cluster: "Basic", attribute: "ProductName". side: server, little-endian */ /* 64 */ 0x00, 0x00, 0x00,   \
62             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
63             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,                                                            \
64             /* Default for cluster: "Basic", attribute: "UserLabel". side: server, little-endian */ /* 96 */ 0x00, 0x00, 0x00,     \
65             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,                                          \
66             /* Default for cluster: "Basic", attribute: "Location". side: server, little-endian */ /* 112 */ 0x00, 0x00, 0x00,     \
67             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
70             0x00, 0x00, 0x00, 0x00,                                                                                                \
71             /* Default for cluster: "Basic", attribute: "HardwareVersionString". side: server, little-endian */ /* 176 */          \
72             0x00, 0x00, 0x00, 0x00,                                                                                                \
73             /* Default for cluster: "Basic", attribute: "SoftwareVersion". side: server, little-endian */ /* 180 */ 0x00, 0x00,    \
74             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
75             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
76             0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      \
77             0x00, 0x00, 0x00, 0x00,                                                                                                \
78             0x00, /* Default for cluster: "Basic", attribute: "SoftwareVersionString". side: server, little-endian */              \
79     }
80
81 #endif // BIGENDIAN_CPU
82
83 #define GENERATED_DEFAULTS_COUNT (7)
84
85 #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE
86 #define ZAP_LONG_DEFAULTS_INDEX(index)                                                                                             \
87     {                                                                                                                              \
88         (uint8_t *) (&generatedDefaults[index])                                                                                    \
89     }
90 #define ZAP_MIN_MAX_DEFAULTS_INDEX(index)                                                                                          \
91     {                                                                                                                              \
92         (uint8_t *) (&minMaxDefault[index])                                                                                        \
93     }
94
95 // This is an array of EmberAfAttributeMinMaxValue structures.
96 #define GENERATED_MIN_MAX_DEFAULT_COUNT 0
97 #define GENERATED_MIN_MAX_DEFAULTS                                                                                                 \
98     {                                                                                                                              \
99     }
100
101 #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask
102 // This is an array of EmberAfAttributeMetadata structures.
103 #define GENERATED_ATTRIBUTE_COUNT 14
104 #define GENERATED_ATTRIBUTES                                                                                                       \
105     {                                                                                                                              \
106         { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 2 } },         /* On/off (server): cluster revision */                     \
107             { 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, { (uint8_t *) 0x00 } }, /* On/off (server): on/off */                               \
108             {                                                                                                                      \
109                 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 3 }                                      \
110             }, /* Basic (server): cluster revision */                                                                              \
111             {                                                                                                                      \
112                 0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0 }                                      \
113             }, /* Basic (server): InteractionModelVersion */                                                                       \
114             {                                                                                                                      \
115                 0x0001, ZAP_TYPE(CHAR_STRING), 32, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(0) }       \
116             },                                                                                 /* Basic (server): VendorName */    \
117             { 0x0002, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0 } }, /* Basic (server): VendorID */      \
118             {                                                                                                                      \
119                 0x0003, ZAP_TYPE(CHAR_STRING), 32, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(32) }      \
120             },                                                                                 /* Basic (server): ProductName */   \
121             { 0x0004, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0 } }, /* Basic (server): ProductID */     \
122             { 0x0005,                                                                                                              \
123               ZAP_TYPE(CHAR_STRING),                                                                                               \
124               32,                                                                                                                  \
125               ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE),                                                        \
126               { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(64) } }, /* Basic (server): UserLabel */                                       \
127             { 0x0006,                                                                                                              \
128               ZAP_TYPE(CHAR_STRING),                                                                                               \
129               16,                                                                                                                  \
130               ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE),                                                        \
131               { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(96) } }, /* Basic (server): Location */                                        \
132             {                                                                                                                      \
133                 0x0007, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0x00 }                                   \
134             }, /* Basic (server): HardwareVersion */                                                                               \
135             {                                                                                                                      \
136                 0x0008, ZAP_TYPE(CHAR_STRING), 64, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(112) }     \
137             }, /* Basic (server): HardwareVersionString */                                                                         \
138             {                                                                                                                      \
139                 0x0009, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(176) }           \
140             }, /* Basic (server): SoftwareVersion */                                                                               \
141             {                                                                                                                      \
142                 0x000A, ZAP_TYPE(CHAR_STRING), 64, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(180) }     \
143             }, /* Basic (server): SoftwareVersionString */                                                                         \
144     }
145
146 // This is an array of EmberAfCluster structures.
147 #define ZAP_ATTRIBUTE_INDEX(index) ((EmberAfAttributeMetadata *) (&generatedAttributes[index]))
148
149 // Cluster function static arrays
150 #define GENERATED_FUNCTION_ARRAYS                                                                                                  \
151     const EmberAfGenericClusterFunction chipFuncArrayOnOffServer[] = {                                                             \
152         (EmberAfGenericClusterFunction) emberAfOnOffClusterServerInitCallback,                                                     \
153     };
154
155 #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask
156 #define GENERATED_CLUSTER_COUNT 2
157 #define GENERATED_CLUSTERS                                                                                                         \
158     {                                                                                                                              \
159         {                                                                                                                          \
160             0x0006,                                                                                                                \
161             ZAP_ATTRIBUTE_INDEX(0),                                                                                                \
162             2,                                                                                                                     \
163             3,                                                                                                                     \
164             ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION),                                                            \
165             chipFuncArrayOnOffServer                                                                                               \
166         }, /* Endpoint: 1, Cluster: On/off (server) */                                                                             \
167             {                                                                                                                      \
168                 0x0028, ZAP_ATTRIBUTE_INDEX(2), 12, 254, ZAP_CLUSTER_MASK(SERVER), NULL                                            \
169             }, /* Endpoint: 1, Cluster: Basic (server) */                                                                          \
170     }
171
172 #define ZAP_CLUSTER_INDEX(index) ((EmberAfCluster *) (&generatedClusters[index]))
173
174 // This is an array of EmberAfEndpointType structures.
175 #define GENERATED_ENDPOINT_TYPES                                                                                                   \
176     {                                                                                                                              \
177         { ZAP_CLUSTER_INDEX(0), 2, 257 },                                                                                          \
178     }
179
180 // Largest attribute size is needed for various buffers
181 #define ATTRIBUTE_LARGEST (64)
182
183 // Total size of singleton attributes
184 #define ATTRIBUTE_SINGLETONS_SIZE (254)
185
186 // Total size of attribute storage
187 #define ATTRIBUTE_MAX_SIZE (257)
188
189 // Number of fixed endpoints
190 #define FIXED_ENDPOINT_COUNT (1)
191
192 // Array of endpoints that are supported, the data inside
193 // the array is the endpoint number.
194 #define FIXED_ENDPOINT_ARRAY                                                                                                       \
195     {                                                                                                                              \
196         0x0001                                                                                                                     \
197     }
198
199 // Array of profile ids
200 #define FIXED_PROFILE_IDS                                                                                                          \
201     {                                                                                                                              \
202         0x0109                                                                                                                     \
203     }
204
205 // Array of device ids
206 #define FIXED_DEVICE_IDS                                                                                                           \
207     {                                                                                                                              \
208         0                                                                                                                          \
209     }
210
211 // Array of device versions
212 #define FIXED_DEVICE_VERSIONS                                                                                                      \
213     {                                                                                                                              \
214         1                                                                                                                          \
215     }
216
217 // Array of endpoint types supported on each endpoint
218 #define FIXED_ENDPOINT_TYPES                                                                                                       \
219     {                                                                                                                              \
220         0                                                                                                                          \
221     }
222
223 // Array of networks supported on each endpoint
224 #define FIXED_NETWORKS                                                                                                             \
225     {                                                                                                                              \
226         0                                                                                                                          \
227     }
228
229 // Array of EmberAfCommandMetadata structs.
230 #define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask
231 #define EMBER_AF_GENERATED_COMMAND_COUNT (6)
232 #define GENERATED_COMMANDS                                                                                                         \
233     {                                                                                                                              \
234         { 0x0006, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) },     /* On/off (server): Off */                                        \
235             { 0x0006, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On/off (server): On */                                         \
236             { 0x0006, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On/off (server): Toggle */                                     \
237             { 0x0028, 0x00, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Basic (server): StartUp */                                     \
238             { 0x0028, 0x01, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Basic (server): ShutDown */                                    \
239             { 0x0028, 0x02, ZAP_COMMAND_MASK(INCOMING_CLIENT) }, /* Basic (server): Leave */                                       \
240     }
241
242 // Array of EmberAfManufacturerCodeEntry structures for commands.
243 #define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (0)
244 #define GENERATED_COMMAND_MANUFACTURER_CODES                                                                                       \
245     {                                                                                                                              \
246         {                                                                                                                          \
247             0x00, 0x00                                                                                                             \
248         }                                                                                                                          \
249     }
250
251 // This is an array of EmberAfManufacturerCodeEntry structures for clusters.
252 #define GENERATED_CLUSTER_MANUFACTURER_CODE_COUNT (0)
253 #define GENERATED_CLUSTER_MANUFACTURER_CODES                                                                                       \
254     {                                                                                                                              \
255         {                                                                                                                          \
256             0x00, 0x00                                                                                                             \
257         }                                                                                                                          \
258     }
259
260 // This is an array of EmberAfManufacturerCodeEntry structures for attributes.
261 #define GENERATED_ATTRIBUTE_MANUFACTURER_CODE_COUNT (0)
262 #define GENERATED_ATTRIBUTE_MANUFACTURER_CODES                                                                                     \
263     {                                                                                                                              \
264         {                                                                                                                          \
265             0x00, 0x00                                                                                                             \
266         }                                                                                                                          \
267     }
268
269 // Array of EmberAfPluginReportingEntry structures.
270 #define ZRD(x) EMBER_ZCL_REPORTING_DIRECTION_##x
271 #define ZAP_REPORT_DIRECTION(x) ZRD(x)
272
273 // Use this macro to check if Reporting plugin is included
274 #define EMBER_AF_PLUGIN_REPORTING
275 // User options for plugin Reporting
276 #define EMBER_AF_PLUGIN_REPORTING_TABLE_SIZE (1)
277 #define EMBER_AF_PLUGIN_REPORTING_ENABLE_GROUP_BOUND_REPORTS
278
279 #define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS_TABLE_SIZE (1)
280 #define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS                                                                               \
281     {                                                                                                                              \
282         {                                                                                                                          \
283             ZAP_REPORT_DIRECTION(REPORTED), 0x0001, 0x0006, 0x0000, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } }          \
284         }, /* Reporting for cluster: "On/off", attribute: "on/off". side: server */                                                \
285     }