From 8b416c62935f302ab416c2d6f277f848c1e6c334 Mon Sep 17 00:00:00 2001 From: Patryk Lipinski Date: Fri, 1 Mar 2024 11:31:46 +0100 Subject: [PATCH] [nrf noup] Clear srp implementation. This commit implements the host srp clear, using cherry-picked upstream solution. Signed-off-by: Patryk Lipinski --- src/platform/Zephyr/ConfigurationManagerImpl.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/platform/Zephyr/ConfigurationManagerImpl.cpp b/src/platform/Zephyr/ConfigurationManagerImpl.cpp index 15017bb800..e68d4153ee 100644 --- a/src/platform/Zephyr/ConfigurationManagerImpl.cpp +++ b/src/platform/Zephyr/ConfigurationManagerImpl.cpp @@ -42,7 +42,7 @@ #ifdef CONFIG_NET_L2_OPENTHREAD #include -#endif +#endif namespace chip { namespace DeviceLayer { @@ -181,6 +181,12 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg) { ChipLogProgress(DeviceLayer, "Performing factory reset"); +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT + ThreadStackMgr().WaitOnSrpClearAllComplete(); + ThreadStackMgr().ClearAllSrpHostAndServices(); + ThreadStackMgr().NotifySrpClearAllComplete(); +#endif // CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT + // Lock the Thread stack to avoid unwanted interaction with settings NVS during factory reset. #ifdef CONFIG_NET_L2_OPENTHREAD ThreadStackMgr().LockThreadStack();