Skip to content

Commit 1993218

Browse files
nikita-s-wrkpull[bot]
authored andcommitted
[qpg] Clear KVS on factory reset (#11180)
1 parent 773a5df commit 1993218

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/platform/qpg/ConfigurationManagerImpl.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ CHIP_ERROR ConfigurationManagerImpl::WritePersistedStorageValue(::chip::Platform
115115
void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg)
116116
{
117117
CHIP_ERROR err;
118+
qvStatus_t qvErr;
118119

119120
ChipLogProgress(DeviceLayer, "Performing factory reset");
120121

@@ -124,6 +125,12 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg)
124125
ChipLogError(DeviceLayer, "FactoryResetConfig() failed: %s", ErrorStr(err));
125126
}
126127

128+
qvErr = qvCHIP_KvsErasePartition();
129+
if (qvErr != QV_STATUS_NO_ERROR)
130+
{
131+
ChipLogError(DeviceLayer, "qvCHIP_KvsErasePartition() failed: %d", qvErr);
132+
}
133+
127134
#if CHIP_DEVICE_CONFIG_ENABLE_THREAD
128135

129136
ChipLogProgress(DeviceLayer, "Clearing Thread provision");

0 commit comments

Comments
 (0)