From 051a0f5e276a2ddcdb66ecea86a0180894cafedc Mon Sep 17 00:00:00 2001 From: Arkadiusz Balys Date: Wed, 27 Mar 2024 10:06:52 +0100 Subject: [PATCH] [nrfconnect] Provide a workaround for nrfconnect Posix unit tests. We need to disable all dependencies to the Zephyr net_if module until we switch unit tests to it. --- src/platform/nrfconnect/BUILD.gn | 9 +++++++-- src/platform/nrfconnect/ConnectivityManagerImpl.cpp | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/platform/nrfconnect/BUILD.gn b/src/platform/nrfconnect/BUILD.gn index 5a11b4f3d0d999..9b5da9e9b2018f 100644 --- a/src/platform/nrfconnect/BUILD.gn +++ b/src/platform/nrfconnect/BUILD.gn @@ -28,8 +28,6 @@ static_library("nrfconnect") { "../Zephyr/ConfigurationManagerImpl.cpp", "../Zephyr/DiagnosticDataProviderImpl.cpp", "../Zephyr/DiagnosticDataProviderImpl.h", - "../Zephyr/InetUtils.cpp", - "../Zephyr/InetUtils.h", "../Zephyr/KeyValueStoreManagerImpl.cpp", "../Zephyr/Logging.cpp", "../Zephyr/PlatformManagerImpl.cpp", @@ -79,6 +77,13 @@ static_library("nrfconnect") { ] } + if (chip_enable_openthread || chip_enable_wifi){ + sources += [ + "../Zephyr/InetUtils.cpp", + "../Zephyr/InetUtils.h", + ] + } + if (chip_enable_openthread) { sources += [ "../OpenThread/OpenThreadUtils.cpp", diff --git a/src/platform/nrfconnect/ConnectivityManagerImpl.cpp b/src/platform/nrfconnect/ConnectivityManagerImpl.cpp index 5ede47e15db216..a73c47d3bf25fe 100644 --- a/src/platform/nrfconnect/ConnectivityManagerImpl.cpp +++ b/src/platform/nrfconnect/ConnectivityManagerImpl.cpp @@ -98,6 +98,7 @@ CHIP_ERROR ConnectivityManagerImpl::_Init() ReturnErrorOnFailure(InitWiFi()); #endif +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD || CHIP_DEVICE_CONFIG_ENABLE_WIFI UDPEndPointImplSockets::SetMulticastGroupHandler([](InterfaceId interfaceId, const IPAddress & address, bool join) { if (interfaceId.IsPresent()) { @@ -115,6 +116,7 @@ CHIP_ERROR ConnectivityManagerImpl::_Init() return CHIP_NO_ERROR; }); +#endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD || CHIP_DEVICE_CONFIG_ENABLE_WIFI return CHIP_NO_ERROR; }