From 06eeb3bf505461654d628d3b0dcea79625b9c9de Mon Sep 17 00:00:00 2001 From: Rohit Jadhav Date: Tue, 6 Feb 2024 12:00:12 +0530 Subject: [PATCH] Add attributes of network commissioning and fix Jira https://jira.espressif.com:8443/browse/CON-1008 (cherry picked from commit 312167549510cdc41a50b8d6ecac1c67d8793ed0) --- components/esp_matter/esp_matter_attribute.cpp | 18 ++++++++++++++++++ components/esp_matter/esp_matter_attribute.h | 3 +++ components/esp_matter/esp_matter_cluster.cpp | 7 +++++++ components/esp_matter/esp_matter_cluster.h | 2 +- 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/components/esp_matter/esp_matter_attribute.cpp b/components/esp_matter/esp_matter_attribute.cpp index 867f02c9e..116d5670e 100644 --- a/components/esp_matter/esp_matter_attribute.cpp +++ b/components/esp_matter/esp_matter_attribute.cpp @@ -411,6 +411,24 @@ attribute_t *create_last_connect_error_value(cluster_t *cluster, nullable value); attribute_t *create_last_network_id(cluster_t *cluster, uint8_t *value, uint16_t length); attribute_t *create_last_connect_error_value(cluster_t *cluster, nullable value); +attribute_t *create_supported_wifi_bands(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count); +attribute_t *create_supported_thread_features(cluster_t *cluster, uint16_t value); +attribute_t *create_thread_version(cluster_t *cluster, uint16_t value); } /* attribute */ } /* network_commissioning */ diff --git a/components/esp_matter/esp_matter_cluster.cpp b/components/esp_matter/esp_matter_cluster.cpp index 02dc0b790..d40c710e2 100644 --- a/components/esp_matter/esp_matter_cluster.cpp +++ b/components/esp_matter/esp_matter_cluster.cpp @@ -467,6 +467,13 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) attribute::create_last_networking_status(cluster, nullable()); attribute::create_last_network_id(cluster, NULL, 0); attribute::create_last_connect_error_value(cluster, nullable()); +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI + attribute::create_supported_wifi_bands(cluster, NULL, 0, 0); +#endif +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD + attribute::create_supported_thread_features(cluster, 0); + attribute::create_thread_version(cluster, 0); +#endif global::attribute::create_feature_map(cluster, 0); #if CHIP_CONFIG_ENABLE_EVENTLIST_ATTRIBUTE global::attribute::create_event_list(cluster, NULL, 0, 0); diff --git a/components/esp_matter/esp_matter_cluster.h b/components/esp_matter/esp_matter_cluster.h index 9309f2020..b4cf691b8 100644 --- a/components/esp_matter/esp_matter_cluster.h +++ b/components/esp_matter/esp_matter_cluster.h @@ -120,7 +120,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags); namespace network_commissioning { typedef struct config { uint16_t cluster_revision; - config() : cluster_revision(1) {} + config() : cluster_revision(2) {} } config_t; cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags);