Skip to content

Commit 047591c

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 047591c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/platform/Zephyr/ConfigurationManagerImpl.cpp

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

61+
// TODO: Remove this workaround after proper API is added
62+
__weak bool AppFactoryResetHandler()
63+
{
64+
return true;
65+
}
66+
6167
namespace chip {
6268
namespace DeviceLayer {
6369

@@ -238,8 +244,14 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg)
238244
{
239245
ChipLogError(DeviceLayer, "Factory reset failed: %" CHIP_ERROR_FORMAT, err.Format());
240246
}
247+
241248
#endif // CONFIG_CHIP_FACTORY_RESET_ERASE_SETTINGS
242249

250+
if (!AppFactoryResetHandler())
251+
{
252+
ChipLogError(DeviceLayer, "Factory reset failed, AppFactoryReset failed");
253+
}
254+
243255
PlatformMgr().Shutdown();
244256
}
245257

0 commit comments

Comments
 (0)