mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
Add attributes of network commissioning and fix Jira https://jira.espressif.com:8443/browse/CON-1008
(cherry picked from commit 312167549510cdc41a50b8d6ecac1c67d8793ed0)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user