From 41971bae8fa8017a90501de4bf1d6c67803e0e25 Mon Sep 17 00:00:00 2001 From: Jean-Francois Penven <67962328+jepenven-silabs@users.noreply.github.com> Date: Tue, 21 Nov 2023 23:13:56 -0500 Subject: [PATCH] Fix Circular dependency OpenThreadPlatform (#30607) --- src/app/server/Server.cpp | 10 ++++++++++ .../GenericThreadStackManagerImpl_OpenThread.hpp | 12 ------------ src/platform/silabs/efr32/BUILD.gn | 8 +------- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index 8aa1d37a99122e..65a45192728833 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -408,6 +408,16 @@ void Server::OnPlatformEvent(const DeviceLayer::ChipDeviceEvent & event) ResumeSubscriptions(); #endif break; +#if CHIP_SYSTEM_CONFIG_USE_OPEN_THREAD_ENDPOINT + case DeviceEventType::kThreadConnectivityChange: + if (event.ThreadConnectivityChange.Result == kConnectivity_Established) + { + // Refresh Multicast listening + ChipLogDetail(DeviceLayer, "Thread Attached updating Multicast address"); + RejoinExistingMulticastGroups(); + } + break; +#endif // CHIP_SYSTEM_CONFIG_USE_OPEN_THREAD_ENDPOINT default: break; } diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp index 0d19ae192b5e36..7bc357f0705cc9 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp @@ -65,9 +65,6 @@ #include #include -#if CHIP_SYSTEM_CONFIG_USE_OPEN_THREAD_ENDPOINT -#include -#endif // CHIP_SYSTEM_CONFIG_USE_OPEN_THREAD_ENDPOINT extern "C" void otSysProcessDrivers(otInstance * aInstance); #if CHIP_DEVICE_CONFIG_THREAD_ENABLE_CLI @@ -210,15 +207,6 @@ void GenericThreadStackManagerImpl_OpenThread::_OnPlatformEvent(const } } -#if CHIP_SYSTEM_CONFIG_USE_OPEN_THREAD_ENDPOINT - if (event->ThreadStateChange.AddressChanged && isThreadAttached) - { - // Refresh Multicast listening - ChipLogDetail(DeviceLayer, "Thread Attached updating Multicast address"); - Server::GetInstance().RejoinExistingMulticastGroups(); - } -#endif // CHIP_SYSTEM_CONFIG_USE_OPEN_THREAD_ENDPOINT - #if CHIP_DETAIL_LOGGING LogOpenThreadStateChange(mOTInst, event->ThreadStateChange.OpenThread.Flags); #endif // CHIP_DETAIL_LOGGING diff --git a/src/platform/silabs/efr32/BUILD.gn b/src/platform/silabs/efr32/BUILD.gn index 5c7eef17f65875..e244ad178a9848 100644 --- a/src/platform/silabs/efr32/BUILD.gn +++ b/src/platform/silabs/efr32/BUILD.gn @@ -124,13 +124,7 @@ static_library("efr32") { deps += [ "${chip_root}/src/lib/dnssd:platform_header" ] } - # TODO: platform should NOT depend on default_address_resolve_config. This should - # be removed. See https://github.com/project-chip/connectedhomeip/issues/30596 - # - # Currently this exists because OpenThread platform includes src/app/Server.h - public_configs = [ - "${chip_root}/src/lib/address_resolve:default_address_resolve_config", - ] + public_configs = [] } if (chip_enable_wifi) {