From 78195e39b6ff14a6bc620cc878c0770270617212 Mon Sep 17 00:00:00 2001 From: WanqQixiang Date: Thu, 23 Sep 2021 10:37:26 +0800 Subject: [PATCH] bugfix: remove srp service register in on_device_event function --- examples/light/main/app_matter.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/examples/light/main/app_matter.cpp b/examples/light/main/app_matter.cpp index 596ae9a57..f53d402dc 100644 --- a/examples/light/main/app_matter.cpp +++ b/examples/light/main/app_matter.cpp @@ -85,12 +85,6 @@ static void on_device_event(const ChipDeviceEvent *event, intptr_t arg) if (event->Type == PublicEventTypes::kInterfaceIpAddressChanged) { chip::app::Mdns::StartServer(); } -#if CHIP_DEVICE_CONFIG_ENABLE_THREAD - if (event->Type == PublicEventTypes::kThreadStateChange) { - chip::app::Mdns::StartServer(); - } -#endif - ESP_LOGI(APP_LOG_TAG, "Current free heap: %zu", heap_caps_get_free_size(MALLOC_CAP_8BIT)); } @@ -193,7 +187,9 @@ esp_err_t app_matter_init() } #endif InitServer(); - +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD + chip::app::Mdns::StartServer(); +#endif app_driver_register_src(APP_DRIVER_SRC_MATTER, &callbacks); return ESP_OK;