From 588322c8920f7bac4437b6f347811d5f6e03639b Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Wed, 8 Apr 2026 11:27:49 +0530 Subject: [PATCH] components/esp_matter: gate network diagnostics clusters on transport config WiFi and Thread network diagnostics clusters were unconditionally created on the root node when their Kconfig flags were enabled, regardless of the actual transport. A Thread-only device would incorrectly include the WiFi Network Diagnostics cluster. Gate cluster creation on transport-level defines so that WiFi diagnostics are only added when WiFi is enabled, and Thread diagnostics only when Thread is enabled. Fixes https://github.com/espressif/esp-matter/issues/1649 --- components/esp_matter/data_model/esp_matter_endpoint.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/esp_matter/data_model/esp_matter_endpoint.cpp b/components/esp_matter/data_model/esp_matter_endpoint.cpp index 8959bcfb2..910fe8569 100644 --- a/components/esp_matter/data_model/esp_matter_endpoint.cpp +++ b/components/esp_matter/data_model/esp_matter_endpoint.cpp @@ -89,12 +89,15 @@ esp_err_t add(endpoint_t *endpoint, config_t *config) #endif // CHIP_CONFIG_ENABLE_ICD_LIT } #endif // CHIP_CONFIG_ENABLE_ICD_SERVER -#if defined(CONFIG_SUPPORT_WIFI_NETWORK_DIAGNOSTICS_CLUSTER) + +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI && defined(CONFIG_SUPPORT_WIFI_NETWORK_DIAGNOSTICS_CLUSTER) wifi_network_diagnostics::create(endpoint, nullptr, CLUSTER_FLAG_SERVER); #endif -#if defined(CONFIG_SUPPORT_THREAD_NETWORK_DIAGNOSTICS_CLUSTER) + +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD && defined(CONFIG_SUPPORT_THREAD_NETWORK_DIAGNOSTICS_CLUSTER) thread_network_diagnostics::create(endpoint, nullptr, CLUSTER_FLAG_SERVER); #endif + return ESP_OK; } } /* root_node */