Skip to content

Commit c3c0ebb

Browse files
committed
[nrf noup] Add AppFactoryResetHandler
Add weak `AppFactoryResetHandler` to handle application specific cleanup. Signed-off-by: Adrian Gielniewski <adrian.gielniewski@nordicsemi.no>
1 parent 4c46941 commit c3c0ebb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/platform/Zephyr/ConfigurationManagerImpl.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@
5858
#include <mpsl/mpsl_lib.h>
5959
#endif // CONFIG_SOC_FLASH_NRF_RADIO_SYNC_MPSL
6060

61+
__weak bool AppFactoryResetHandler()
62+
{
63+
return true;
64+
}
65+
6166
namespace chip {
6267
namespace DeviceLayer {
6368

@@ -238,6 +243,12 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg)
238243
{
239244
ChipLogError(DeviceLayer, "Factory reset failed: %" CHIP_ERROR_FORMAT, err.Format());
240245
}
246+
247+
if (!AppFactoryResetHandler())
248+
{
249+
ChipLogError(DeviceLayer, "Factory reset failed, AppFactoryReset failed");
250+
}
251+
241252
#endif // CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS
242253

243254
PlatformMgr().Shutdown();

0 commit comments

Comments
 (0)