From 556005725e0cd490518dca65efe80f61cd60d469 Mon Sep 17 00:00:00 2001 From: chirag-silabs <100861685+chirag-silabs@users.noreply.github.com> Date: Tue, 9 Aug 2022 01:46:55 +0530 Subject: [PATCH] [EFR32] Added fix to change network in CNET and setting DGWIFI to correct value for security (#21718) * Added fix for change network and DGWIFI to correct value * Restyled code Co-authored-by: rosahay-silabs --- src/platform/EFR32/NetworkCommissioningWiFiDriver.cpp | 9 +++++++++ third_party/silabs/matter_support | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/platform/EFR32/NetworkCommissioningWiFiDriver.cpp b/src/platform/EFR32/NetworkCommissioningWiFiDriver.cpp index 54e38020c7949d..21de35eca234a6 100644 --- a/src/platform/EFR32/NetworkCommissioningWiFiDriver.cpp +++ b/src/platform/EFR32/NetworkCommissioningWiFiDriver.cpp @@ -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 = {}; diff --git a/third_party/silabs/matter_support b/third_party/silabs/matter_support index d5d4480eba45de..054e5c798dced6 160000 --- a/third_party/silabs/matter_support +++ b/third_party/silabs/matter_support @@ -1 +1 @@ -Subproject commit d5d4480eba45de7c84dc4ca07b6a6b7cc56ff1fb +Subproject commit 054e5c798dced6ac372eddd64b183ee9b5588c26