Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ameba] dont store wifi info in kvs if ssid is empty #24719

Merged
merged 1 commit into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/platform/Ameba/AmebaUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ CHIP_ERROR AmebaUtils::EnableStationMode(void)
CHIP_ERROR AmebaUtils::SetWiFiConfig(rtw_wifi_config_t * config)
{
CHIP_ERROR err = CHIP_NO_ERROR;
// don't store if ssid is null
if (config->ssid[0] == 0)
{
return CHIP_NO_ERROR;
}

/* Store Wi-Fi Configurations in Storage */
err = PersistedStorage::KeyValueStoreMgr().Put(kWiFiSSIDKeyName, config->ssid, sizeof(config->ssid));
SuccessOrExit(err);
Expand Down
4 changes: 2 additions & 2 deletions src/platform/Ameba/NetworkCommissioningDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ class AmebaWiFiDriver final : public WiFiDriver
bool NetworkMatch(const WiFiNetwork & network, ByteSpan networkId);
CHIP_ERROR StartScanWiFiNetworks(ByteSpan ssid);

WiFiNetwork mSavedNetwork;
WiFiNetwork mStagingNetwork;
WiFiNetwork mSavedNetwork = { 0 };
WiFiNetwork mStagingNetwork = { 0 };
ScanCallback * mpScanCallback;
ConnectCallback * mpConnectCallback;
NetworkStatusChangeCallback * mpStatusChangeCallback = nullptr;
Expand Down