3 * Copyright (c) 2021 Project CHIP Authors
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 // THIS FILE IS GENERATED BY ZAP
20 // Prevent multiple inclusion
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.
27 #define GENERATED_DEFAULTS \
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, \
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 */ \
53 #else // !BIGENDIAN_CPU
54 #define GENERATED_DEFAULTS \
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 */ \
81 #endif // BIGENDIAN_CPU
83 #define GENERATED_DEFAULTS_COUNT (7)
85 #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE
86 #define ZAP_LONG_DEFAULTS_INDEX(index) \
88 (uint8_t *) (&generatedDefaults[index]) \
90 #define ZAP_MIN_MAX_DEFAULTS_INDEX(index) \
92 (uint8_t *) (&minMaxDefault[index]) \
95 // This is an array of EmberAfAttributeMinMaxValue structures.
96 #define GENERATED_MIN_MAX_DEFAULT_COUNT 0
97 #define GENERATED_MIN_MAX_DEFAULTS \
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 \
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 */ \
109 0xFFFD, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 3 } \
110 }, /* Basic (server): cluster revision */ \
112 0x0000, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0 } \
113 }, /* Basic (server): InteractionModelVersion */ \
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 */ \
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 */ \
123 ZAP_TYPE(CHAR_STRING), \
125 ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \
126 { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(64) } }, /* Basic (server): UserLabel */ \
128 ZAP_TYPE(CHAR_STRING), \
130 ZAP_ATTRIBUTE_MASK(SINGLETON) | ZAP_ATTRIBUTE_MASK(WRITABLE), \
131 { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(96) } }, /* Basic (server): Location */ \
133 0x0007, ZAP_TYPE(INT16U), 2, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) 0x00 } \
134 }, /* Basic (server): HardwareVersion */ \
136 0x0008, ZAP_TYPE(CHAR_STRING), 64, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(112) } \
137 }, /* Basic (server): HardwareVersionString */ \
139 0x0009, ZAP_TYPE(INT32U), 4, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(176) } \
140 }, /* Basic (server): SoftwareVersion */ \
142 0x000A, ZAP_TYPE(CHAR_STRING), 64, ZAP_ATTRIBUTE_MASK(SINGLETON), { (uint8_t *) ZAP_LONG_DEFAULTS_INDEX(180) } \
143 }, /* Basic (server): SoftwareVersionString */ \
146 // This is an array of EmberAfCluster structures.
147 #define ZAP_ATTRIBUTE_INDEX(index) ((EmberAfAttributeMetadata *) (&generatedAttributes[index]))
149 // Cluster function static arrays
150 #define GENERATED_FUNCTION_ARRAYS \
151 const EmberAfGenericClusterFunction chipFuncArrayOnOffServer[] = { \
152 (EmberAfGenericClusterFunction) emberAfOnOffClusterServerInitCallback, \
155 #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask
156 #define GENERATED_CLUSTER_COUNT 2
157 #define GENERATED_CLUSTERS \
161 ZAP_ATTRIBUTE_INDEX(0), \
164 ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
165 chipFuncArrayOnOffServer \
166 }, /* Endpoint: 1, Cluster: On/off (server) */ \
168 0x0028, ZAP_ATTRIBUTE_INDEX(2), 12, 254, ZAP_CLUSTER_MASK(SERVER), NULL \
169 }, /* Endpoint: 1, Cluster: Basic (server) */ \
172 #define ZAP_CLUSTER_INDEX(index) ((EmberAfCluster *) (&generatedClusters[index]))
174 // This is an array of EmberAfEndpointType structures.
175 #define GENERATED_ENDPOINT_TYPES \
177 { ZAP_CLUSTER_INDEX(0), 2, 257 }, \
180 // Largest attribute size is needed for various buffers
181 #define ATTRIBUTE_LARGEST (64)
183 // Total size of singleton attributes
184 #define ATTRIBUTE_SINGLETONS_SIZE (254)
186 // Total size of attribute storage
187 #define ATTRIBUTE_MAX_SIZE (257)
189 // Number of fixed endpoints
190 #define FIXED_ENDPOINT_COUNT (1)
192 // Array of endpoints that are supported, the data inside
193 // the array is the endpoint number.
194 #define FIXED_ENDPOINT_ARRAY \
199 // Array of profile ids
200 #define FIXED_PROFILE_IDS \
205 // Array of device ids
206 #define FIXED_DEVICE_IDS \
211 // Array of device versions
212 #define FIXED_DEVICE_VERSIONS \
217 // Array of endpoint types supported on each endpoint
218 #define FIXED_ENDPOINT_TYPES \
223 // Array of networks supported on each endpoint
224 #define FIXED_NETWORKS \
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 \
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 */ \
242 // Array of EmberAfManufacturerCodeEntry structures for commands.
243 #define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (0)
244 #define GENERATED_COMMAND_MANUFACTURER_CODES \
251 // This is an array of EmberAfManufacturerCodeEntry structures for clusters.
252 #define GENERATED_CLUSTER_MANUFACTURER_CODE_COUNT (0)
253 #define GENERATED_CLUSTER_MANUFACTURER_CODES \
260 // This is an array of EmberAfManufacturerCodeEntry structures for attributes.
261 #define GENERATED_ATTRIBUTE_MANUFACTURER_CODE_COUNT (0)
262 #define GENERATED_ATTRIBUTE_MANUFACTURER_CODES \
269 // Array of EmberAfPluginReportingEntry structures.
270 #define ZRD(x) EMBER_ZCL_REPORTING_DIRECTION_##x
271 #define ZAP_REPORT_DIRECTION(x) ZRD(x)
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
279 #define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS_TABLE_SIZE (1)
280 #define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS \
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 */ \