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 \
31 #else // !BIGENDIAN_CPU
32 #define GENERATED_DEFAULTS \
36 #endif // BIGENDIAN_CPU
38 #define GENERATED_DEFAULTS_COUNT (0)
40 #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE
41 #define ZAP_LONG_DEFAULTS_INDEX(index) \
43 (uint8_t *) (&generatedDefaults[index]) \
45 #define ZAP_MIN_MAX_DEFAULTS_INDEX(index) \
47 (uint8_t *) (&minMaxDefault[index]) \
50 // This is an array of EmberAfAttributeMinMaxValue structures.
51 #define GENERATED_MIN_MAX_DEFAULT_COUNT 0
52 #define GENERATED_MIN_MAX_DEFAULTS \
56 #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_##mask
57 // This is an array of EmberAfAttributeMetadata structures.
58 #define GENERATED_ATTRIBUTE_COUNT 2
59 #define GENERATED_ATTRIBUTES \
61 { 0xFFFD, ZAP_TYPE(INT16U), 2, 0, { (uint8_t *) 2 } }, /* On/off (server): cluster revision */ \
62 { 0x0000, ZAP_TYPE(BOOLEAN), 1, 0, { (uint8_t *) 0x00 } }, /* On/off (server): on/off */ \
65 // This is an array of EmberAfCluster structures.
66 #define ZAP_ATTRIBUTE_INDEX(index) ((EmberAfAttributeMetadata *) (&generatedAttributes[index]))
68 // Cluster function static arrays
69 #define GENERATED_FUNCTION_ARRAYS \
70 const EmberAfGenericClusterFunction chipFuncArrayOnOffServer[] = { \
71 (EmberAfGenericClusterFunction) emberAfOnOffClusterServerInitCallback, \
74 #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask
75 #define GENERATED_CLUSTER_COUNT 1
76 #define GENERATED_CLUSTERS \
80 ZAP_ATTRIBUTE_INDEX(0), \
83 ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \
84 chipFuncArrayOnOffServer \
85 }, /* Endpoint: 1, Cluster: On/off (server) */ \
88 #define ZAP_CLUSTER_INDEX(index) ((EmberAfCluster *) (&generatedClusters[index]))
90 // This is an array of EmberAfEndpointType structures.
91 #define GENERATED_ENDPOINT_TYPES \
93 { ZAP_CLUSTER_INDEX(0), 1, 3 }, \
96 // Largest attribute size is needed for various buffers
97 #define ATTRIBUTE_LARGEST (3)
99 // Total size of singleton attributes
100 #define ATTRIBUTE_SINGLETONS_SIZE (0)
102 // Total size of attribute storage
103 #define ATTRIBUTE_MAX_SIZE (3)
105 // Number of fixed endpoints
106 #define FIXED_ENDPOINT_COUNT (1)
108 // Array of endpoints that are supported, the data inside
109 // the array is the endpoint number.
110 #define FIXED_ENDPOINT_ARRAY \
115 // Array of profile ids
116 #define FIXED_PROFILE_IDS \
121 // Array of device ids
122 #define FIXED_DEVICE_IDS \
127 // Array of device versions
128 #define FIXED_DEVICE_VERSIONS \
133 // Array of endpoint types supported on each endpoint
134 #define FIXED_ENDPOINT_TYPES \
139 // Array of networks supported on each endpoint
140 #define FIXED_NETWORKS \
145 // Array of EmberAfCommandMetadata structs.
146 #define ZAP_COMMAND_MASK(mask) COMMAND_MASK_##mask
147 #define EMBER_AF_GENERATED_COMMAND_COUNT (3)
148 #define GENERATED_COMMANDS \
150 { 0x0006, 0x00, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On/off (server): Off */ \
151 { 0x0006, 0x01, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On/off (server): On */ \
152 { 0x0006, 0x02, ZAP_COMMAND_MASK(INCOMING_SERVER) }, /* On/off (server): Toggle */ \
155 // Array of EmberAfManufacturerCodeEntry structures for commands.
156 #define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (0)
157 #define GENERATED_COMMAND_MANUFACTURER_CODES \
164 // This is an array of EmberAfManufacturerCodeEntry structures for clusters.
165 #define GENERATED_CLUSTER_MANUFACTURER_CODE_COUNT (0)
166 #define GENERATED_CLUSTER_MANUFACTURER_CODES \
173 // This is an array of EmberAfManufacturerCodeEntry structures for attributes.
174 #define GENERATED_ATTRIBUTE_MANUFACTURER_CODE_COUNT (0)
175 #define GENERATED_ATTRIBUTE_MANUFACTURER_CODES \
182 // Array of EmberAfPluginReportingEntry structures.
183 #define ZRD(x) EMBER_ZCL_REPORTING_DIRECTION_##x
184 #define ZAP_REPORT_DIRECTION(x) ZRD(x)
186 // Use this macro to check if Reporting plugin is included
187 #define EMBER_AF_PLUGIN_REPORTING
188 // User options for plugin Reporting
189 #define EMBER_AF_PLUGIN_REPORTING_TABLE_SIZE (1)
190 #define EMBER_AF_PLUGIN_REPORTING_ENABLE_GROUP_BOUND_REPORTS
192 #define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS_TABLE_SIZE (1)
193 #define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS \
196 ZAP_REPORT_DIRECTION(REPORTED), 0x0001, 0x0006, 0x0000, ZAP_CLUSTER_MASK(SERVER), 0x0000, { { 0, 65344, 0 } } \
197 }, /* Reporting for cluster: "On/off", attribute: "on/off". side: server */ \