Skip to content

Commit

Permalink
[Ameba] ClearWiFiConfig bug fix (#25571)
Browse files Browse the repository at this point in the history
* Update AmebaUtils.cpp

fix clear wifi config

* cleanup

* fix compile error

* restyle
  • Loading branch information
pankore authored and pull[bot] committed Aug 16, 2023
1 parent cf54c9d commit 1405120
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/platform/Ameba/AmebaUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 1405120

Please sign in to comment.