blob: 77b20560ca6ff5b0716cb61bd9939694ae4eea62 [file] [log] [blame]
{{> header}}
// Prevent multiple inclusion
#pragma once
#include <lib/core/CHIPConfig.h>
{{#endpoint_config allowUnknownStorageOption="false" spaceForDefaultValue=4}}
// Default values for the attributes longer than a pointer,
// in a form of a binary blob
// Separate block is generated for big-endian and little-endian cases.
#if BIGENDIAN_CPU
#define GENERATED_DEFAULTS {{endpoint_attribute_long_defaults endian="big"}}
#else // !BIGENDIAN_CPU
#define GENERATED_DEFAULTS {{endpoint_attribute_long_defaults endian="little"}}
#endif // BIGENDIAN_CPU
#define GENERATED_DEFAULTS_COUNT ({{endpoint_attribute_long_defaults_count}})
#define ZAP_TYPE(type) ZCL_ ## type ## _ATTRIBUTE_TYPE
#define ZAP_LONG_DEFAULTS_INDEX(index) { &generatedDefaults[index] }
#define ZAP_MIN_MAX_DEFAULTS_INDEX(index) { &minMaxDefaults[index] }
#define ZAP_EMPTY_DEFAULT() {(uint32_t) 0}
#define ZAP_SIMPLE_DEFAULT(x) {(uint32_t) x}
// This is an array of EmberAfAttributeMinMaxValue structures.
#define GENERATED_MIN_MAX_DEFAULT_COUNT {{endpoint_attribute_min_max_count}}
#define GENERATED_MIN_MAX_DEFAULTS {{endpoint_attribute_min_max_list}}
#define ZAP_ATTRIBUTE_MASK(mask) ATTRIBUTE_MASK_ ## mask
// This is an array of EmberAfAttributeMetadata structures.
#define GENERATED_ATTRIBUTE_COUNT {{endpoint_attribute_count}}
#define GENERATED_ATTRIBUTES {{ endpoint_attribute_list }}
// This is an array of EmberAfCluster structures.
#define ZAP_ATTRIBUTE_INDEX(index) (&generatedAttributes[index])
#define ZAP_GENERATED_COMMANDS_INDEX(index) ((chip::CommandId *) (&generatedCommands[index]))
// Cluster function static arrays
#define GENERATED_FUNCTION_ARRAYS {{chip_endpoint_generated_functions}}
{{#chip_endpoint_generated_commands_list}}
{{#first}}
// clang-format off
#define GENERATED_COMMANDS { \
{{/first}}
{{text}}
{{#last}}
}
// clang-format on
{{/last}}
{{/chip_endpoint_generated_commands_list}}
#define ZAP_CLUSTER_MASK(mask) CLUSTER_MASK_ ## mask
#define GENERATED_CLUSTER_COUNT {{endpoint_cluster_count}}
// clang-format off
#define GENERATED_CLUSTERS {{chip_endpoint_cluster_list}}
// clang-format on
#define ZAP_CLUSTER_INDEX(index) (&generatedClusters[index])
#define ZAP_FIXED_ENDPOINT_DATA_VERSION_COUNT {{chip_endpoint_data_version_count}}
// This is an array of EmberAfEndpointType structures.
#define GENERATED_ENDPOINT_TYPES {{endpoint_types_list}}
// Largest attribute size is needed for various buffers
#define ATTRIBUTE_LARGEST ({{endpoint_largest_attribute_size}})
static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE,
"ATTRIBUTE_LARGEST larger than expected");
// Total size of singleton attributes
#define ATTRIBUTE_SINGLETONS_SIZE ({{endpoint_singletons_size}})
// Total size of attribute storage
#define ATTRIBUTE_MAX_SIZE ({{endpoint_total_storage_size}})
// Number of fixed endpoints
#define FIXED_ENDPOINT_COUNT ({{endpoint_count}})
// Array of endpoints that are supported, the data inside
// the array is the endpoint number.
#define FIXED_ENDPOINT_ARRAY {{endpoint_fixed_endpoint_array}}
// Array of profile ids
#define FIXED_PROFILE_IDS {{endpoint_fixed_profile_id_array}}
// Array of device types
#define FIXED_DEVICE_TYPES {{endpoint_fixed_device_type_array}}
// Array of device type offsets
#define FIXED_DEVICE_TYPE_OFFSETS {{endpoint_fixed_device_type_array_offsets}}
// Array of device type lengths
#define FIXED_DEVICE_TYPE_LENGTHS {{endpoint_fixed_device_type_array_lengths}}
// Array of endpoint types supported on each endpoint
#define FIXED_ENDPOINT_TYPES {{endpoint_fixed_endpoint_type_array}}
// Array of networks supported on each endpoint
#define FIXED_NETWORKS {{endpoint_fixed_network_array}}
{{/endpoint_config}}