Skip to content

Commit 6ce9516

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 6ce9516

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,8 +243,14 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg)
238243
{
239244
ChipLogError(DeviceLayer, "Factory reset failed: %" CHIP_ERROR_FORMAT, err.Format());
240245
}
246+
241247
#endif // CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS
242248

249+
if (!AppFactoryResetHandler())
250+
{
251+
ChipLogError(DeviceLayer, "Factory reset failed, AppFactoryReset failed");
252+
}
253+
243254
PlatformMgr().Shutdown();
244255
}
245256

0 commit comments

Comments
 (0)