Skip to content

Commit 9b86dec

Browse files
committed
Merge branch 'cherry-pick-31216754' into 'main'
[Release v1.3/TE2] Add attributes of network commissioning cluster See merge request app-frameworks/esp-matter!638
2 parents b5c2a0f + 06eeb3b commit 9b86dec

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

components/esp_matter/esp_matter_attribute.cpp

+18
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,24 @@ attribute_t *create_last_connect_error_value(cluster_t *cluster, nullable<int32_
411411
ATTRIBUTE_FLAG_NULLABLE, esp_matter_nullable_int32(value));
412412
}
413413

414+
attribute_t *create_supported_wifi_bands(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count)
415+
{
416+
return esp_matter::attribute::create(cluster, NetworkCommissioning::Attributes::SupportedWiFiBands::Id,
417+
ATTRIBUTE_FLAG_NONE, esp_matter_array(value, length, count));
418+
}
419+
420+
attribute_t *create_supported_thread_features(cluster_t *cluster, uint16_t value)
421+
{
422+
return esp_matter::attribute::create(cluster, NetworkCommissioning::Attributes::SupportedThreadFeatures::Id,
423+
ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value));
424+
}
425+
426+
attribute_t *create_thread_version(cluster_t *cluster, uint16_t value)
427+
{
428+
return esp_matter::attribute::create(cluster, NetworkCommissioning::Attributes::ThreadVersion::Id,
429+
ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value));
430+
}
431+
414432
} /* attribute */
415433
} /* network_commissioning */
416434

components/esp_matter/esp_matter_attribute.h

+3
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ attribute_t *create_interface_enabled(cluster_t *cluster, bool value);
129129
attribute_t *create_last_networking_status(cluster_t *cluster, nullable<uint8_t> value);
130130
attribute_t *create_last_network_id(cluster_t *cluster, uint8_t *value, uint16_t length);
131131
attribute_t *create_last_connect_error_value(cluster_t *cluster, nullable<int32_t> value);
132+
attribute_t *create_supported_wifi_bands(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
133+
attribute_t *create_supported_thread_features(cluster_t *cluster, uint16_t value);
134+
attribute_t *create_thread_version(cluster_t *cluster, uint16_t value);
132135
} /* attribute */
133136
} /* network_commissioning */
134137

components/esp_matter/esp_matter_cluster.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,13 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
467467
attribute::create_last_networking_status(cluster, nullable<uint8_t>());
468468
attribute::create_last_network_id(cluster, NULL, 0);
469469
attribute::create_last_connect_error_value(cluster, nullable<int32_t>());
470+
#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
471+
attribute::create_supported_wifi_bands(cluster, NULL, 0, 0);
472+
#endif
473+
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
474+
attribute::create_supported_thread_features(cluster, 0);
475+
attribute::create_thread_version(cluster, 0);
476+
#endif
470477
global::attribute::create_feature_map(cluster, 0);
471478
#if CHIP_CONFIG_ENABLE_EVENTLIST_ATTRIBUTE
472479
global::attribute::create_event_list(cluster, NULL, 0, 0);

components/esp_matter/esp_matter_cluster.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags);
120120
namespace network_commissioning {
121121
typedef struct config {
122122
uint16_t cluster_revision;
123-
config() : cluster_revision(1) {}
123+
config() : cluster_revision(2) {}
124124
} config_t;
125125

126126
cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags);

0 commit comments

Comments
 (0)