add global attribute event_list

This commit is contained in:
liyashuai
2023-08-28 14:59:11 +08:00
parent f35f645ad5
commit e2a75348ce
3 changed files with 47 additions and 0 deletions
@@ -37,6 +37,12 @@ attribute_t *create_feature_map(cluster_t *cluster, uint32_t value)
esp_matter_bitmap32(value));
}
attribute_t *create_event_list(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count)
{
return esp_matter::attribute::create(cluster, Globals::Attributes::EventList::Id, ATTRIBUTE_FLAG_NONE,
esp_matter_array(value, length, count));
}
} /* attribute */
} /* global */
@@ -30,6 +30,7 @@ namespace global {
namespace attribute {
attribute_t *create_cluster_revision(cluster_t *cluster, uint16_t value);
attribute_t *create_feature_map(cluster_t *cluster, uint32_t value);
attribute_t *create_event_list(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
} /* attribute */
} /* global */
@@ -92,6 +92,7 @@ cluster_t *create(endpoint_t *endpoint, uint8_t flags)
/* Attributes updated later */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
}
return cluster;
@@ -119,6 +120,7 @@ cluster_t *create(endpoint_t *endpoint, uint8_t flags)
/* Attributes managed internally */
global::attribute::create_cluster_revision(cluster, 1);
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
attribute::create_action_list(cluster, NULL, 0, 0);
attribute::create_endpoint_lists(cluster, NULL, 0, 0);
}
@@ -153,6 +155,7 @@ cluster_t *create(endpoint_t *endpoint, uint8_t flags)
/* Attributes updated later */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
}
return cluster;
@@ -181,6 +184,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
attribute::create_data_model_revision(cluster, 0);
attribute::create_location(cluster, NULL, 0);
attribute::create_vendor_name(cluster, NULL, 0);
@@ -229,6 +233,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
attribute::create_binding(cluster, NULL, 0, 0);
/* Attributes not managed internally */
@@ -263,6 +268,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/* Attributes not managed internally */
if (config) {
@@ -303,6 +309,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
attribute::create_default_ota_providers(cluster, NULL, 0, 0);
/* Attributes not managed internally */
@@ -343,6 +350,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
attribute::create_regulatory_config(cluster, 0);
attribute::create_location_capability(cluster, 0);
attribute::create_basic_commissioning_info(cluster, NULL, 0, 0);
@@ -397,6 +405,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
attribute::create_last_network_id(cluster, NULL, 0);
attribute::create_last_connect_error_value(cluster, nullable<int32_t>());
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/* Attributes not managed internally */
if (config) {
@@ -444,6 +453,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
attribute::create_reboot_count(cluster, 0);
attribute::create_test_event_triggers_enabled(cluster, 0);
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/* Attributes not managed internally */
if (config) {
@@ -479,6 +489,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
attribute::create_window_status(cluster, 0);
attribute::create_admin_fabric_index(cluster, 0);
attribute::create_admin_vendor_id(cluster, 0);
@@ -520,6 +531,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
attribute::create_nocs(cluster, NULL, 0, 0);
attribute::create_supported_fabrics(cluster, 0);
attribute::create_commissioned_fabrics(cluster, 0);
@@ -573,6 +585,7 @@ cluster_t *create(endpoint_t *endpoint, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
global::attribute::create_cluster_revision(cluster, 0);
attribute::create_group_key_map(cluster, NULL, 0, 0);
attribute::create_group_table(cluster, NULL, 0, 0);
@@ -612,6 +625,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
attribute::create_bssid(cluster, NULL, 0);
attribute::create_security_type(cluster, nullable<uint8_t>());
attribute::create_wifi_version(cluster, nullable<uint8_t>());
@@ -650,6 +664,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
attribute::create_channel(cluster, nullable<uint16_t>(0));
attribute::create_routing_role(cluster, nullable<uint8_t>(0));
attribute::create_network_name(cluster, NULL, 0);
@@ -703,6 +718,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/* Attributes not managed internally */
if (config) {
@@ -736,6 +752,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/* Attributes not managed internally */
if (config) {
@@ -770,6 +787,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
attribute::create_label_list(cluster, NULL, 0, 0);
/* Attributes not managed internally */
@@ -804,6 +822,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
attribute::create_label_list(cluster, NULL, 0, 0);
/* Attributes not managed internally */
@@ -845,6 +864,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/* Attributes not managed internally */
if (config) {
@@ -885,6 +905,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 1);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/* Attributes not managed internally */
if (config) {
@@ -933,6 +954,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/* Attributes not managed internally */
if (config) {
@@ -989,6 +1011,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags, uint32_
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/* Attributes not managed internally */
if (config) {
@@ -1036,6 +1059,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags, uint32_
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/* Attributes not managed internally */
if (config) {
@@ -1093,6 +1117,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags, uint32_
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/* Attributes not managed internally */
if (config) {
@@ -1162,6 +1187,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/* Attributes not managed internally */
if (config) {
@@ -1205,6 +1231,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/* Attributes not managed internally */
if (config) {
@@ -1252,6 +1279,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/* Attributes not managed internally */
if (config) {
@@ -1299,6 +1327,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags, uint32_
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/* Attributes not managed internally */
if (config) {
@@ -1350,6 +1379,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/* Attributes not managed internally */
if (config) {
@@ -1388,6 +1418,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/* Attributes not managed internally */
if (config) {
@@ -1427,6 +1458,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/* Attributes not managed internally */
if (config) {
@@ -1468,6 +1500,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/* Attributes not managed internally */
if (config) {
@@ -1507,6 +1540,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/* Attributes not managed internally */
if (config) {
@@ -1543,6 +1577,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes not managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
if (config) {
/* Attributes not managed internally */
@@ -1583,6 +1618,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags, uint32_
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes not managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
if (config) {
/* Attributes not managed internally */
@@ -1626,6 +1662,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/** Attributes not managed internally **/
if (config) {
global::attribute::create_cluster_revision(cluster, config->cluster_revision);
@@ -1665,6 +1702,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/** Attributes not managed internally **/
if (config) {
global::attribute::create_cluster_revision(cluster, config->cluster_revision);
@@ -1702,6 +1740,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/** Attributes not managed internally **/
if (config) {
global::attribute::create_cluster_revision(cluster, config->cluster_revision);
@@ -1744,6 +1783,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
if (flags & CLUSTER_FLAG_SERVER) {
/* Attributes managed internally */
global::attribute::create_feature_map(cluster, 0);
global::attribute::create_event_list(cluster, NULL, 0, 0);
/** Attributes not managed internally **/
if (config) {