Skip to content

Commit

Permalink
Fix Circular dependency OpenThreadPlatform (project-chip#30607)
Browse files Browse the repository at this point in the history
  • Loading branch information
jepenven-silabs authored Nov 22, 2023
1 parent 971e060 commit 41971ba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
10 changes: 10 additions & 0 deletions src/app/server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@
#include <app/data-model/Encode.h>

#include <limits>
#if CHIP_SYSTEM_CONFIG_USE_OPEN_THREAD_ENDPOINT
#include <app/server/Server.h>
#endif // CHIP_SYSTEM_CONFIG_USE_OPEN_THREAD_ENDPOINT
extern "C" void otSysProcessDrivers(otInstance * aInstance);

#if CHIP_DEVICE_CONFIG_THREAD_ENABLE_CLI
Expand Down Expand Up @@ -210,15 +207,6 @@ void GenericThreadStackManagerImpl_OpenThread<ImplClass>::_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
Expand Down
8 changes: 1 addition & 7 deletions src/platform/silabs/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 41971ba

Please sign in to comment.