Skip to content

Commit

Permalink
[qpg] Clear KVS on factory reset (#11180)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-s-wrk authored and pull[bot] committed Aug 16, 2022
1 parent 773a5df commit 1993218
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/platform/qpg/ConfigurationManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -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");
Expand Down

0 comments on commit 1993218

Please sign in to comment.