Skip to content

Commit

Permalink
[Silabs] [SiWx917] Bugs fixes for SiWx917 platform (#25043)
Browse files Browse the repository at this point in the history
* Small bugs fixes for SiWx917 platform

* Restyled by gn

---------

Co-authored-by: Restyled.io <commits@restyled.io>
  • Loading branch information
2 people authored and pull[bot] committed Aug 3, 2023
1 parent 18be4df commit 5716430
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
15 changes: 8 additions & 7 deletions examples/lighting-app/silabs/SiWx917/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ declare_args() {
rs91x_wpa3_only = false

#default WiFi SSID
ssid = ""
chip_default_wifi_ssid = ""

#default Wifi Password
psk = ""
chip_default_wifi_psk = ""
}

# Sanity check
Expand Down Expand Up @@ -92,15 +92,16 @@ if (chip_enable_wifi) {
disable_lcd = true
}

if (ssid != "") {
if (chip_default_wifi_ssid != "") {
defines += [
"CHIP_ONNETWORK_PAIRING = 1",
"CHIP_WIFI_SSID = $ssid",
"CHIP_WIFI_SSID=\"${chip_default_wifi_ssid}\"",
]
}
if (psk != "") {
assert(ssid != "", "ssid can't be null if psk is provided")
defines += [ "CHIP_WIFI_PSK = $psk" ]
if (chip_default_wifi_psk != "") {
assert(chip_default_wifi_ssid != "",
"ssid can't be null if psk is provided")
defines += [ "CHIP_WIFI_PSK=\"${chip_default_wifi_psk}\"" ]
}

wifi_sdk_dir = "${chip_root}/src/platform/silabs/SiWx917/wifi"
Expand Down
12 changes: 3 additions & 9 deletions examples/platform/silabs/SiWx917/SiWx917/rsi_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,12 +497,6 @@ void wfx_rsi_task(void * arg)
wfx_started_notify();

WFX_RSI_LOG("%s: starting event wait", __func__);
#ifdef CHIP_ONNETWORK_PAIRING
memcpy(&wfx_rsi.sec.ssid[0], TOSTRING(CHIP_WIFI_SSID), sizeof(TOSTRING(CHIP_WIFI_SSID)));
memcpy(&wfx_rsi.sec.passkey[0], TOSTRING(CHIP_WIFI_PSK), sizeof(TOSTRING(CHIP_WIFI_PSK)));
xEventGroupSetBits(wfx_rsi.events, WFX_EVT_STA_START_JOIN);
#endif

for (;;)
{
/*
Expand Down Expand Up @@ -858,12 +852,12 @@ void wfx_retry_interval_handler(bool is_wifi_disconnection_event, uint16_t retry
*/
if (retryJoin < MAX_JOIN_RETRIES_COUNT)
{
SILABS_LOG("%s: Next attempt after %d Seconds", __func__, CONVERT_MS_TO_SEC(WLAN_RETRY_TIMER_MS));
WFX_RSI_LOG("%s: Next attempt after %d Seconds", __func__, CONVERT_MS_TO_SEC(WLAN_RETRY_TIMER_MS));
vTaskDelay(pdMS_TO_TICKS(WLAN_RETRY_TIMER_MS));
}
else
{
SILABS_LOG("Connect failed after max %d tries", retryJoin);
WFX_RSI_LOG("Connect failed after max %d tries", retryJoin);
}
}
else
Expand All @@ -877,7 +871,7 @@ void wfx_retry_interval_handler(bool is_wifi_disconnection_event, uint16_t retry
{
retryInterval = WLAN_MAX_RETRY_TIMER_MS;
}
SILABS_LOG("%s: Next attempt after %d Seconds", __func__, CONVERT_MS_TO_SEC(retryInterval));
WFX_RSI_LOG("%s: Next attempt after %d Seconds", __func__, CONVERT_MS_TO_SEC(retryInterval));
vTaskDelay(pdMS_TO_TICKS(retryInterval));
retryInterval += retryInterval;
}
Expand Down

0 comments on commit 5716430

Please sign in to comment.