diff --git a/examples/platform/silabs/SiWx917/SiWx917/rsi_if.c b/examples/platform/silabs/SiWx917/SiWx917/rsi_if.c index d2e3a5124695dc..e491e0f93682e5 100644 --- a/examples/platform/silabs/SiWx917/SiWx917/rsi_if.c +++ b/examples/platform/silabs/SiWx917/SiWx917/rsi_if.c @@ -473,8 +473,8 @@ static void wfx_rsi_do_join(void) /* Call rsi connect call with given ssid and password * And check there is a success */ - if ((status = rsi_wlan_connect_async((int8_t *) &wfx_rsi.sec.ssid[0], (rsi_security_mode_t) wfx_rsi.sec.security, - &wfx_rsi.sec.passkey[0], wfx_rsi_join_cb)) != RSI_SUCCESS) + if ((status = rsi_wlan_connect_async((int8_t *) &wfx_rsi.sec.ssid[0], connect_security_mode, &wfx_rsi.sec.passkey[0], + wfx_rsi_join_cb)) != RSI_SUCCESS) { wfx_rsi.dev_state &= ~WFX_RSI_ST_STA_CONNECTING; diff --git a/src/platform/silabs/NetworkCommissioningWiFiDriver.cpp b/src/platform/silabs/NetworkCommissioningWiFiDriver.cpp index 65931fce7059bb..f3a745773d8092 100644 --- a/src/platform/silabs/NetworkCommissioningWiFiDriver.cpp +++ b/src/platform/silabs/NetworkCommissioningWiFiDriver.cpp @@ -194,22 +194,22 @@ void SlWiFiDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * callback } } -chip::BitFlags SlWiFiDriver::ConvertSecuritytype(uint8_t security) +chip::BitFlags SlWiFiDriver::ConvertSecuritytype(wfx_sec_t security) { chip::BitFlags securityType; if (security == WFX_SEC_NONE) { securityType = WiFiSecurity::kUnencrypted; } - else if (security & WFX_SEC_WEP) + else if (security == WFX_SEC_WEP) { securityType = WiFiSecurity::kWep; } - else if (security & WFX_SEC_WPA) + else if (security == WFX_SEC_WPA) { securityType = WiFiSecurity::kWpaPersonal; } - else if (security & WFX_SEC_WPA2) + else if (security == WFX_SEC_WPA2) { securityType = WiFiSecurity::kWpa2Personal; } diff --git a/src/platform/silabs/NetworkCommissioningWiFiDriver.h b/src/platform/silabs/NetworkCommissioningWiFiDriver.h index d311b11dda43a7..7e7dad3f3e9cdc 100644 --- a/src/platform/silabs/NetworkCommissioningWiFiDriver.h +++ b/src/platform/silabs/NetworkCommissioningWiFiDriver.h @@ -120,7 +120,7 @@ class SlWiFiDriver final : public WiFiDriver CHIP_ERROR ConnectWiFiNetwork(const char * ssid, uint8_t ssidLen, const char * key, uint8_t keyLen); - chip::BitFlags ConvertSecuritytype(uint8_t security); + chip::BitFlags ConvertSecuritytype(wfx_sec_t security); void OnConnectWiFiNetwork(); static SlWiFiDriver & GetInstance()