From 3b3ba6c9dd16927efa8e2a160dc3c1def5db5f7e Mon Sep 17 00:00:00 2001 From: nikita-s-wrk Date: Fri, 29 Oct 2021 23:17:59 +0300 Subject: [PATCH] [qpg] Clear KVS on factory reset (#11180) --- src/platform/qpg/ConfigurationManagerImpl.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/platform/qpg/ConfigurationManagerImpl.cpp b/src/platform/qpg/ConfigurationManagerImpl.cpp index e74a536d0ffaab..5a85e537c6be5c 100644 --- a/src/platform/qpg/ConfigurationManagerImpl.cpp +++ b/src/platform/qpg/ConfigurationManagerImpl.cpp @@ -115,6 +115,7 @@ CHIP_ERROR ConfigurationManagerImpl::WritePersistedStorageValue(::chip::Platform void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg) { CHIP_ERROR err; + qvStatus_t qvErr; ChipLogProgress(DeviceLayer, "Performing factory reset"); @@ -124,6 +125,12 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg) ChipLogError(DeviceLayer, "FactoryResetConfig() failed: %s", ErrorStr(err)); } + qvErr = qvCHIP_KvsErasePartition(); + if (qvErr != QV_STATUS_NO_ERROR) + { + ChipLogError(DeviceLayer, "qvCHIP_KvsErasePartition() failed: %d", qvErr); + } + #if CHIP_DEVICE_CONFIG_ENABLE_THREAD ChipLogProgress(DeviceLayer, "Clearing Thread provision");