Skip to content

Commit

Permalink
[EFR32] Added fix to change network in CNET and setting DGWIFI to cor…
Browse files Browse the repository at this point in the history
…rect value for security (#21718)

* Added fix for change network and DGWIFI to correct value

* Restyled code

Co-authored-by: rosahay-silabs <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Dec 5, 2023
1 parent 610315e commit 5560057
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/platform/EFR32/NetworkCommissioningWiFiDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,15 @@ Status SlWiFiDriver::ReorderNetwork(ByteSpan networkId, uint8_t index, MutableCh

CHIP_ERROR SlWiFiDriver::ConnectWiFiNetwork(const char * ssid, uint8_t ssidLen, const char * key, uint8_t keyLen)
{
if (ConnectivityMgr().IsWiFiStationProvisioned())
{
ChipLogProgress(DeviceLayer, "Disconecting for current wifi");
int32_t status = wfx_sta_discon();
if (status != 0)
{
return CHIP_ERROR_INTERNAL;
}
}
ReturnErrorOnFailure(ConnectivityMgr().SetWiFiStationMode(ConnectivityManager::kWiFiStationMode_Disabled));
// Set the wifi configuration
wfx_wifi_provision_t wifiConfig = {};
Expand Down

0 comments on commit 5560057

Please sign in to comment.