Skip to content

Commit 770b246

Browse files
committed
components/esp_matter: create network commissioning attributes as per
feature map scan_max_time_seconds and connect_max_time_seconds are wifi or thread only attributes so they should not be created when feature flag is ethernet.
1 parent da8ccdd commit 770b246

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

components/esp_matter/esp_matter_cluster.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -403,12 +403,16 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
403403
/* Attributes managed internally */
404404
attribute::create_max_networks(cluster, 0);
405405
attribute::create_networks(cluster, NULL, 0, 0);
406-
attribute::create_scan_max_time_seconds(cluster, 0);
407-
attribute::create_connect_max_time_seconds(cluster, 0);
408406
attribute::create_interface_enabled(cluster, 0);
409407
attribute::create_last_networking_status(cluster, nullable<uint8_t>());
410408
attribute::create_last_network_id(cluster, NULL, 0);
411409
attribute::create_last_connect_error_value(cluster, nullable<int32_t>());
410+
411+
if (config->feature_map & chip::to_underlying(NetworkCommissioning::Feature::kWiFiNetworkInterface) ||
412+
config->feature_map & chip::to_underlying(NetworkCommissioning::Feature::kThreadNetworkInterface)) {
413+
attribute::create_scan_max_time_seconds(cluster, 0);
414+
attribute::create_connect_max_time_seconds(cluster, 0);
415+
}
412416
if (config->feature_map & chip::to_underlying(NetworkCommissioning::Feature::kWiFiNetworkInterface)) {
413417
attribute::create_supported_wifi_bands(cluster, NULL, 0, 0);
414418
}

0 commit comments

Comments
 (0)