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
This commit is contained in:
Hrishikesh Dhayagude
2024-02-26 16:35:59 +08:00
4 changed files with 29 additions and 1 deletions
@@ -411,6 +411,24 @@ attribute_t *create_last_connect_error_value(cluster_t *cluster, nullable<int32_
ATTRIBUTE_FLAG_NULLABLE, esp_matter_nullable_int32(value));
}
attribute_t *create_supported_wifi_bands(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count)
{
return esp_matter::attribute::create(cluster, NetworkCommissioning::Attributes::SupportedWiFiBands::Id,
ATTRIBUTE_FLAG_NONE, esp_matter_array(value, length, count));
}
attribute_t *create_supported_thread_features(cluster_t *cluster, uint16_t value)
{
return esp_matter::attribute::create(cluster, NetworkCommissioning::Attributes::SupportedThreadFeatures::Id,
ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value));
}
attribute_t *create_thread_version(cluster_t *cluster, uint16_t value)
{
return esp_matter::attribute::create(cluster, NetworkCommissioning::Attributes::ThreadVersion::Id,
ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value));
}
} /* attribute */
} /* network_commissioning */
@@ -129,6 +129,9 @@ attribute_t *create_interface_enabled(cluster_t *cluster, bool value);
attribute_t *create_last_networking_status(cluster_t *cluster, nullable<uint8_t> 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<int32_t> 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 */
@@ -467,6 +467,13 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
attribute::create_last_networking_status(cluster, nullable<uint8_t>());
attribute::create_last_network_id(cluster, NULL, 0);
attribute::create_last_connect_error_value(cluster, nullable<int32_t>());
#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);
+1 -1
View File
@@ -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);