41d5eeb70c4a20e4b662d2dcdbc00fa0801a5781
[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     }
30
31 #else // !BIGENDIAN_CPU
32 #define GENERATED_DEFAULTS                                                                                                         \
33     {                                                                                                                              \
34     }
35
36 #endif // BIGENDIAN_CPU
37
38 #define GENERATED_DEFAULTS_COUNT (0)
39
40 #define ZAP_TYPE(type) ZCL_##type##_ATTRIBUTE_TYPE
41 #define ZAP_LONG_DEFAULTS_INDEX(index)                                                                                             \
42     {                                                                                                                              \
43         (uint8_t *) (&generatedDefaults[index])                                                                                    \
44     }
45 #define ZAP_MIN_MAX_DEFAULTS_INDEX(index)                                                                                          \
46     {                                                                                                                              \
47         (uint8_t *) (&minMaxDefault[index])                                                                                        \
48     }
49
50 // This is an array of EmberAfAttributeMinMaxValue structures.
51 #define GENERATED_MIN_MAX_DEFAULT_COUNT 0
52 #define GENERATED_MIN_MAX_DEFAULTS                                                                                                 \
53     {                                                                                                                              \
54     }
55
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                                                                                                       \
60     {                                                                                                                              \
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 */                               \
63     }
64
65 // This is an array of EmberAfCluster structures.
66 #define ZAP_ATTRIBUTE_INDEX(index) ((EmberAfAttributeMetadata *) (&generatedAttributes[index]))
67
68 // Cluster function static arrays
69 #define GENERATED_FUNCTION_ARRAYS                                                                                                  \
70     const EmberAfGenericClusterFunction chipFuncArrayOnOffServer[] = {                                                             \
71         (EmberAfGenericClusterFunction) emberAfOnOffClusterServerInitCallback,                                                     \
72     };
73
74 #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_##mask
75 #define GENERATED_CLUSTER_COUNT 1
76 #define GENERATED_CLUSTERS                                                                                                         \
77     {                                                                                                                              \
78         {                                                                                                                          \
79             0x0006,                                                                                                                \
80             ZAP_ATTRIBUTE_INDEX(0),                                                                                                \
81             2,                                                                                                                     \
82             3,                                                                                                                     \
83             ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION),                                                            \
84             chipFuncArrayOnOffServer                                                                                               \
85         }, /* Endpoint: 1, Cluster: On/off (server) */                                                                             \
86     }
87
88 #define ZAP_CLUSTER_INDEX(index) ((EmberAfCluster *) (&generatedClusters[index]))
89
90 // This is an array of EmberAfEndpointType structures.
91 #define GENERATED_ENDPOINT_TYPES                                                                                                   \
92     {                                                                                                                              \
93         { ZAP_CLUSTER_INDEX(0), 1, 3 },                                                                                            \
94     }
95
96 // Largest attribute size is needed for various buffers
97 #define ATTRIBUTE_LARGEST (3)
98
99 // Total size of singleton attributes
100 #define ATTRIBUTE_SINGLETONS_SIZE (0)
101
102 // Total size of attribute storage
103 #define ATTRIBUTE_MAX_SIZE (3)
104
105 // Number of fixed endpoints
106 #define FIXED_ENDPOINT_COUNT (1)
107
108 // Array of endpoints that are supported, the data inside
109 // the array is the endpoint number.
110 #define FIXED_ENDPOINT_ARRAY                                                                                                       \
111     {                                                                                                                              \
112         0x0001                                                                                                                     \
113     }
114
115 // Array of profile ids
116 #define FIXED_PROFILE_IDS                                                                                                          \
117     {                                                                                                                              \
118         0x0109                                                                                                                     \
119     }
120
121 // Array of device ids
122 #define FIXED_DEVICE_IDS                                                                                                           \
123     {                                                                                                                              \
124         0                                                                                                                          \
125     }
126
127 // Array of device versions
128 #define FIXED_DEVICE_VERSIONS                                                                                                      \
129     {                                                                                                                              \
130         1                                                                                                                          \
131     }
132
133 // Array of endpoint types supported on each endpoint
134 #define FIXED_ENDPOINT_TYPES                                                                                                       \
135     {                                                                                                                              \
136         0                                                                                                                          \
137     }
138
139 // Array of networks supported on each endpoint
140 #define FIXED_NETWORKS                                                                                                             \
141     {                                                                                                                              \
142         0                                                                                                                          \
143     }
144
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                                                                                                         \
149     {                                                                                                                              \
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 */                                     \
153     }
154
155 // Array of EmberAfManufacturerCodeEntry structures for commands.
156 #define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT (0)
157 #define GENERATED_COMMAND_MANUFACTURER_CODES                                                                                       \
158     {                                                                                                                              \
159         {                                                                                                                          \
160             0x00, 0x00                                                                                                             \
161         }                                                                                                                          \
162     }
163
164 // This is an array of EmberAfManufacturerCodeEntry structures for clusters.
165 #define GENERATED_CLUSTER_MANUFACTURER_CODE_COUNT (0)
166 #define GENERATED_CLUSTER_MANUFACTURER_CODES                                                                                       \
167     {                                                                                                                              \
168         {                                                                                                                          \
169             0x00, 0x00                                                                                                             \
170         }                                                                                                                          \
171     }
172
173 // This is an array of EmberAfManufacturerCodeEntry structures for attributes.
174 #define GENERATED_ATTRIBUTE_MANUFACTURER_CODE_COUNT (0)
175 #define GENERATED_ATTRIBUTE_MANUFACTURER_CODES                                                                                     \
176     {                                                                                                                              \
177         {                                                                                                                          \
178             0x00, 0x00                                                                                                             \
179         }                                                                                                                          \
180     }
181
182 // Array of EmberAfPluginReportingEntry structures.
183 #define ZRD(x) EMBER_ZCL_REPORTING_DIRECTION_##x
184 #define ZAP_REPORT_DIRECTION(x) ZRD(x)
185
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
191
192 #define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS_TABLE_SIZE (1)
193 #define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS                                                                               \
194     {                                                                                                                              \
195         {                                                                                                                          \
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 */                                                \
198     }