From 39755079847b6ac7c96e8ef1eebc4df3d6ad8f04 Mon Sep 17 00:00:00 2001 From: chirag-silabs <100861685+chirag-silabs@users.noreply.github.com> Date: Tue, 5 Sep 2023 20:34:34 +0530 Subject: [PATCH] Setting the flag correctly in the callback (#29047) --- examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c index 22032e33f4a928..8f738e36159dc6 100644 --- a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c +++ b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c @@ -162,6 +162,7 @@ int32_t wfx_rsi_disconnect() sl_status_t join_callback_handler(sl_wifi_event_t event, char * result, uint32_t result_length, void * arg) { + wfx_rsi.dev_state &= ~(WFX_RSI_ST_STA_CONNECTING); temp_reset = (wfx_wifi_scan_ext_t *) malloc(sizeof(wfx_wifi_scan_ext_t)); memset(temp_reset, 0, sizeof(wfx_wifi_scan_ext_t)); if (CHECK_IF_EVENT_FAILED(event)) @@ -169,7 +170,7 @@ sl_status_t join_callback_handler(sl_wifi_event_t event, char * result, uint32_t SILABS_LOG("F: Join Event received with %u bytes payload\n", result_length); callback_status = *(sl_status_t *) result; wfx_rsi.join_retries += 1; - wfx_rsi.dev_state &= ~(WFX_RSI_ST_STA_CONNECTING | WFX_RSI_ST_STA_CONNECTED); + wfx_rsi.dev_state &= ~(WFX_RSI_ST_STA_CONNECTED); 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) {