From 3e4a1e994796451be976f413b4c3e2ebc1c31789 Mon Sep 17 00:00:00 2001 From: Shubham Patil Date: Tue, 29 Oct 2024 16:39:40 +0530 Subject: [PATCH] OpenThread: ClearAllSrpHostAndServices should be guarded with CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT The code block added in #35065 should be guarded, if the thread stack manager is not pulled in then this function is not available and breaks the compilation. --- .../OpenThread/GenericNetworkCommissioningThreadDriver.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/platform/OpenThread/GenericNetworkCommissioningThreadDriver.cpp b/src/platform/OpenThread/GenericNetworkCommissioningThreadDriver.cpp index 0c1d482f84c751..fe5bd40a0afb42 100644 --- a/src/platform/OpenThread/GenericNetworkCommissioningThreadDriver.cpp +++ b/src/platform/OpenThread/GenericNetworkCommissioningThreadDriver.cpp @@ -189,6 +189,7 @@ void GenericThreadDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * c status = Status::kUnknownError; } +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT if (status == Status::kSuccess && ThreadStackMgrImpl().IsThreadAttached()) { Thread::OperationalDataset currentDataset; @@ -206,6 +207,7 @@ void GenericThreadDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * c status = Status::kUnknownError; } } +#endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT if (status == Status::kSuccess && DeviceLayer::ThreadStackMgrImpl().AttachToThreadNetwork(mStagingNetwork, callback) != CHIP_NO_ERROR)