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 May 5, 2023
1 parent c4aba80 commit 3b3ba6c
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 3b3ba6c

Please sign in to comment.