Skip to content

Commit

Permalink
ESP32: erase the chip-counters namespace when doing factory reset (#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
wqx6 authored and pull[bot] committed Jun 24, 2023
1 parent 645195b commit 2305888
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/platform/ESP32/ConfigurationManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,13 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg)
ChipLogError(DeviceLayer, "ClearNamespace(ChipConfig) failed: %s", chip::ErrorStr(err));
}

// Erase all values in the chip-counters NVS namespace.
err = ESP32Config::ClearNamespace(ESP32Config::kConfigNamespace_ChipCounters);
if (err != CHIP_NO_ERROR)
{
ChipLogError(DeviceLayer, "ClearNamespace(ChipCounters) failed: %s", chip::ErrorStr(err));
}

// Restore WiFi persistent settings to default values.
#if CHIP_DEVICE_CONFIG_ENABLE_WIFI
esp_err_t error = esp_wifi_restore();
Expand Down

0 comments on commit 2305888

Please sign in to comment.