diff --git a/components/esp_matter/data_model/legacy/esp_matter_endpoint.cpp b/components/esp_matter/data_model/legacy/esp_matter_endpoint.cpp index 067e34a0a..621976ff8 100644 --- a/components/esp_matter/data_model/legacy/esp_matter_endpoint.cpp +++ b/components/esp_matter/data_model/legacy/esp_matter_endpoint.cpp @@ -91,12 +91,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 */