Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / src / app / zap-templates / templates / app / endpoint_config.zapt
1 {{> header}}
2
3 // Prevent multiple inclusion
4 #pragma once
5
6 {{#endpoint_config}}
7
8
9 // Default values for the attributes longer than a pointer,
10 // in a form of a binary blob
11 // Separate block is generated for big-endian and little-endian cases.
12 #if BIGENDIAN_CPU
13 #define GENERATED_DEFAULTS {{endpoint_attribute_long_defaults endian="big"}}
14
15 #else // !BIGENDIAN_CPU
16 #define GENERATED_DEFAULTS {{endpoint_attribute_long_defaults endian="little"}}
17 #endif // BIGENDIAN_CPU
18
19 #define GENERATED_DEFAULTS_COUNT ({{endpoint_attribute_long_defaults_count}})
20
21 #define ZAP_TYPE(type) ZCL_ ## type ## _ATTRIBUTE_TYPE
22 #define ZAP_LONG_DEFAULTS_INDEX(index) {(uint8_t*)(&generatedDefaults[index])}
23 #define ZAP_MIN_MAX_DEFAULTS_INDEX(index) {(uint8_t*)(&minMaxDefault[index])}
24 #define ZAP_EMPTY_DEFAULT() {(uint8_t*) 0}
25 #define ZAP_SIMPLE_DEFAULT(x) {(uint8_t *) x}
26
27 // This is an array of EmberAfAttributeMinMaxValue structures.
28 #define GENERATED_MIN_MAX_DEFAULT_COUNT {{endpoint_attribute_min_max_count}}
29 #define GENERATED_MIN_MAX_DEFAULTS {{endpoint_attribute_min_max_list}}
30
31 #define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_ ## mask
32 // This is an array of EmberAfAttributeMetadata structures.
33 #define GENERATED_ATTRIBUTE_COUNT {{endpoint_attribute_count}}
34 #define GENERATED_ATTRIBUTES {{ endpoint_attribute_list }}
35
36 // This is an array of EmberAfCluster structures.
37 #define ZAP_ATTRIBUTE_INDEX(index) ((EmberAfAttributeMetadata *)(&generatedAttributes[index]))
38
39 // Cluster function static arrays
40 #define GENERATED_FUNCTION_ARRAYS   {{chip_endpoint_generated_functions}}
41
42 #define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_ ## mask
43 #define GENERATED_CLUSTER_COUNT {{endpoint_cluster_count}}
44 #define GENERATED_CLUSTERS {{chip_endpoint_cluster_list}}
45
46 #define ZAP_CLUSTER_INDEX(index) ((EmberAfCluster*)(&generatedClusters[index]))
47
48
49 // This is an array of EmberAfEndpointType structures.
50 #define GENERATED_ENDPOINT_TYPES {{endpoint_types_list}}
51
52
53 // Largest attribute size is needed for various buffers
54 #define ATTRIBUTE_LARGEST ({{endpoint_largest_attribute_size}})
55
56 // Total size of singleton attributes
57 #define ATTRIBUTE_SINGLETONS_SIZE ({{endpoint_singletons_size}})
58
59 // Total size of attribute storage
60 #define ATTRIBUTE_MAX_SIZE ({{endpoint_total_storage_size}})
61
62 // Number of fixed endpoints
63 #define FIXED_ENDPOINT_COUNT ({{endpoint_count}})
64
65 // Array of endpoints that are supported, the data inside
66 // the array is the endpoint number.
67 #define FIXED_ENDPOINT_ARRAY {{endpoint_fixed_endpoint_array}}
68
69 // Array of profile ids
70 #define FIXED_PROFILE_IDS {{endpoint_fixed_profile_id_array}}
71
72 // Array of device ids
73 #define FIXED_DEVICE_IDS {{endpoint_fixed_device_id_array}}
74
75 // Array of device versions
76 #define FIXED_DEVICE_VERSIONS {{endpoint_fixed_device_version_array}}
77
78 // Array of endpoint types supported on each endpoint
79 #define FIXED_ENDPOINT_TYPES {{endpoint_fixed_endpoint_type_array}}
80
81 // Array of networks supported on each endpoint
82 #define FIXED_NETWORKS {{endpoint_fixed_network_array}}
83
84
85 // Array of EmberAfCommandMetadata structs.
86 #define ZAP_COMMAND_MASK(mask) COMMAND_MASK_ ## mask
87 #define EMBER_AF_GENERATED_COMMAND_COUNT ({{endpoint_command_count}})
88 #define GENERATED_COMMANDS {{endpoint_command_list}}
89
90 // Array of EmberAfManufacturerCodeEntry structures for commands.
91 #define GENERATED_COMMAND_MANUFACTURER_CODE_COUNT ({{endpoint_command_manufacturer_code_count}})
92 #define GENERATED_COMMAND_MANUFACTURER_CODES {{endpoint_command_manufacturer_codes}}
93
94 // This is an array of EmberAfManufacturerCodeEntry structures for clusters.
95 #define GENERATED_CLUSTER_MANUFACTURER_CODE_COUNT ({{endpoint_cluster_manufacturer_code_count}})
96 #define GENERATED_CLUSTER_MANUFACTURER_CODES {{endpoint_cluster_manufacturer_codes}}
97
98 // This is an array of EmberAfManufacturerCodeEntry structures for attributes.
99 #define GENERATED_ATTRIBUTE_MANUFACTURER_CODE_COUNT ({{endpoint_attribute_manufacturer_code_count}})
100 #define GENERATED_ATTRIBUTE_MANUFACTURER_CODES {{endpoint_attribute_manufacturer_codes}}
101
102 // Array of EmberAfPluginReportingEntry structures.
103 #define ZRD(x) EMBER_ZCL_REPORTING_DIRECTION_ ## x
104 #define ZAP_REPORT_DIRECTION(x) ZRD(x)
105
106 // User options for plugin Reporting
107 #define EMBER_AF_PLUGIN_REPORTING_TABLE_SIZE ({{endpoint_reporting_config_default_count}})
108 #define EMBER_AF_PLUGIN_REPORTING_ENABLE_GROUP_BOUND_REPORTS
109
110 #define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS_TABLE_SIZE ({{endpoint_reporting_config_default_count}})
111 #define EMBER_AF_GENERATED_REPORTING_CONFIG_DEFAULTS {{endpoint_reporting_config_defaults}}
112
113 {{/endpoint_config}}