Skip to content

Commit

Permalink
[Silabs][WiFi] Added fix for commissioning failing with power cycle o…
Browse files Browse the repository at this point in the history
…n board 917 NCP (#29884)

* Added changes for the power cycle issue

* Added changes for only 917 NCP and firmware version print

* fix for build errors

* Removed the changes for dissconnect event

* Restyled by whitespace

* Restyled by clang-format

---------

Co-authored-by: yap <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
3 people authored Oct 23, 2023
1 parent 70e256b commit 12dd39a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,12 @@ static sl_status_t wfx_rsi_init(void)
return status;
}
#endif

status = sl_wifi_get_mac_address(SL_WIFI_CLIENT_INTERFACE, (sl_mac_address_t *) &wfx_rsi.sta_mac.octet[0]);
if (status != SL_STATUS_OK)
{
SILABS_LOG("sl_wifi_get_mac_address failed: %x", status);
return status;
}

wfx_rsi.events = xEventGroupCreateStatic(&rsiDriverEventGroup);
wfx_rsi.dev_state |= WFX_RSI_ST_DEV_READY;
osSemaphoreRelease(sl_rs_ble_init_sem);
Expand Down Expand Up @@ -400,14 +398,19 @@ static void wfx_rsi_save_ap_info() // translation
return;
}
wfx_rsi.dev_state |= WFX_RSI_ST_SCANSTARTED;
sl_status_t status = SL_STATUS_OK;
sl_status_t status = SL_STATUS_OK;
#ifndef EXP_BOARD // TODO: this changes will be reverted back after the SDK team fix the scan API
sl_wifi_scan_configuration_t wifi_scan_configuration = { 0 };
wifi_scan_configuration = default_wifi_scan_configuration;
#endif
sl_wifi_ssid_t ssid_arg;
ssid_arg.length = strlen(wfx_rsi.sec.ssid);
memcpy(ssid_arg.value, (int8_t *) &wfx_rsi.sec.ssid[0], ssid_arg.length);
sl_wifi_set_scan_callback(scan_callback_handler, NULL);
#ifndef EXP_BOARD
// TODO: this changes will be reverted back after the SDK team fix the scan API
status = sl_wifi_start_scan(SL_WIFI_CLIENT_2_4GHZ_INTERFACE, &ssid_arg, &wifi_scan_configuration);
#endif
if (SL_STATUS_IN_PROGRESS == status)
{
const uint32_t start = osKernelGetTickCount();
Expand Down Expand Up @@ -510,6 +513,7 @@ static sl_status_t wfx_rsi_do_join(void)
{
while (is_wifi_disconnection_event || wfx_rsi.join_retries <= WFX_RSI_CONFIG_MAX_JOIN)
{
SILABS_LOG("%s: Wifi connect failed with status: %x", __func__, status);
SILABS_LOG("%s: failed. retry: %d", __func__, wfx_rsi.join_retries);
wfx_retry_interval_handler(is_wifi_disconnection_event, wfx_rsi.join_retries++);
if (is_wifi_disconnection_event || wfx_rsi.join_retries <= WFX_RSI_CONFIG_MAX_JOIN)
Expand Down

0 comments on commit 12dd39a

Please sign in to comment.