diff --git a/src/platform/Ameba/AmebaUtils.cpp b/src/platform/Ameba/AmebaUtils.cpp index 1d202ccd53f644..72d0e7fda0c4cc 100644 --- a/src/platform/Ameba/AmebaUtils.cpp +++ b/src/platform/Ameba/AmebaUtils.cpp @@ -116,11 +116,15 @@ CHIP_ERROR AmebaUtils::GetWiFiConfig(rtw_wifi_config_t * config) CHIP_ERROR AmebaUtils::ClearWiFiConfig() { - // Clear Ameba WiFi station config + /* Clear Wi-Fi Configurations in Storage */ CHIP_ERROR err = CHIP_NO_ERROR; - rtw_wifi_config_t wifiConfig; - memset(&wifiConfig, 0, sizeof(wifiConfig)); - err = SetWiFiConfig(&wifiConfig); + err = PersistedStorage::KeyValueStoreMgr().Delete(kWiFiSSIDKeyName); + SuccessOrExit(err); + + err = PersistedStorage::KeyValueStoreMgr().Delete(kWiFiCredentialsKeyName); + SuccessOrExit(err); + +exit: return err; }