Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Silabs] Adds fix for Wi-Fi task loop, BLE task priority, BLE indication soft timer expiry #34095

Merged
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
83637d2
Adds fix for WiFi task looping
rosahay-silabs Jun 27, 2024
2722546
Adds fix for BLE task priority and indication soft timer expiry
rosahay-silabs Jun 27, 2024
7beadcf
Adds fix for return check
rosahay-silabs Jun 27, 2024
0bfb03b
Remove unused cred and add length check
rosahay-silabs Jul 3, 2024
90a604a
aligned include
brosahay Jul 4, 2024
408b6b6
Replace `lx` with `x` for all sl_status_t logging
brosahay Jul 4, 2024
3fdacb5
Refactor posting of events to the end of the codeblock
brosahay Jul 4, 2024
f814e47
Adds `BLE_DRIVER_TASK_PRIORITY`
brosahay Jul 4, 2024
d2272b5
Adds static_cast for status in ChipLogging
rosahay-silabs Jul 4, 2024
04a575b
chore: Refactor show_scan_results function to improve readability and…
rosahay-silabs Jul 4, 2024
6774115
chore: Update WiFi join function to use strnlen for SSID length calcu…
rosahay-silabs Jul 4, 2024
a207694
chore: Update WiFi join function to use strnlen for SSID length calcu…
rosahay-silabs Jul 4, 2024
62a805d
chore: Update BSSID array size in WiFi scan result struct
rosahay-silabs Jul 4, 2024
c53d0dc
chore: Update SLAAC OK log message to use formatted IPv6 address
rosahay-silabs Jul 4, 2024
5497861
Refactor show_scan_results function for improved readability and main…
rosahay-silabs Jul 4, 2024
d74c69c
Refactor show_scan_results function to fix null termination bug
rosahay-silabs Jul 4, 2024
7f78bb0
Refactor show_scan_results function to fix null termination bug
rosahay-silabs Jul 4, 2024
b573460
Adds fix for NCP macros
rosahay-silabs Jul 4, 2024
19d1c1f
Revert BLE timer changes
rosahay-silabs Jul 4, 2024
5e86b90
Fix passkey length validation in sl_wifi_if.cpp
rosahay-silabs Jul 4, 2024
48a20c5
Refactor BLEManagerImpl::_OnPlatformEvent for improved code readabili…
rosahay-silabs Jul 4, 2024
9f1b180
Refactor BLEManagerImpl::_OnPlatformEvent for improved code readabili…
rosahay-silabs Jul 5, 2024
77eddc9
Revert "Refactor BLEManagerImpl::_OnPlatformEvent for improved code r…
rosahay-silabs Jul 5, 2024
d55fcc0
Added locks to avoid race conditions
rosahay-silabs Jul 5, 2024
3c861d4
Addressed comments
rosahay-silabs Jul 5, 2024
a3c6b4f
Refactor sl_wifi_if.cpp for improved code readability and maintainabi…
rosahay-silabs Jul 8, 2024
4d82d34
Fix passkey length validation in sl_wifi_if.cpp
rosahay-silabs Jul 8, 2024
b0cd461
Fix BSSID length in wfx_rsi_get_ap_info and wfx_rsi_save_ap_info
rosahay-silabs Jul 8, 2024
a4fb44b
Refactor log statement after length checks
rosahay-silabs Jul 8, 2024
8681fa9
Adds missing replace
rosahay-silabs Jul 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replace lx with x for all sl_status_t logging
brosahay committed Jul 4, 2024
commit 408b6b601dea85598766df44ada1e61e3e5f9f3b
30 changes: 15 additions & 15 deletions examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.cpp
Original file line number Diff line number Diff line change
@@ -246,7 +246,7 @@ sl_status_t join_callback_handler(sl_wifi_event_t event, char * result, uint32_t
if (SL_WIFI_CHECK_IF_EVENT_FAILED(event))
{
callback_status = *(sl_status_t *) result;
ChipLogError(DeviceLayer, "join_callback_handler: failed: 0x%lx", callback_status);
ChipLogError(DeviceLayer, "join_callback_handler: failed: 0x%x", callback_status);
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)
@@ -329,14 +329,14 @@ int32_t wfx_rsi_power_save(rsi_power_save_profile_mode_t sl_si91x_ble_state, sl_
status = rsi_bt_power_save_profile(sl_si91x_ble_state, 0);
if (status != RSI_SUCCESS)
{
ChipLogError(DeviceLayer, "rsi_bt_power_save_profile failed: 0x%lx", status);
ChipLogError(DeviceLayer, "rsi_bt_power_save_profile failed: 0x%x", status);
return status;
}
sl_wifi_performance_profile_t wifi_profile = { .profile = sl_si91x_wifi_state };
status = sl_wifi_set_performance_profile(&wifi_profile);
if (status != RSI_SUCCESS)
{
ChipLogError(DeviceLayer, "sl_wifi_set_performance_profile failed: 0x%lx", status);
ChipLogError(DeviceLayer, "sl_wifi_set_performance_profile failed: 0x%x", status);
return status;
}
if (sl_si91x_wifi_state == HIGH_PERFORMANCE)
@@ -413,7 +413,7 @@ static sl_status_t wfx_rsi_init(void)
status = wfx_wifi_rsi_init();
if (status != SL_STATUS_OK)
{
ChipLogError(DeviceLayer, "wfx_rsi_init failed: 0x%lx", status);
ChipLogError(DeviceLayer, "wfx_rsi_init failed: 0x%x", status);
return status;
}
#else // For SoC
@@ -422,7 +422,7 @@ static sl_status_t wfx_rsi_init(void)
status = sl_si91x_m4_ta_secure_handshake(SL_SI91X_ENABLE_XTAL, 1, &xtal_enable, 0, NULL);
if (status != SL_STATUS_OK)
{
ChipLogError(DeviceLayer, "sl_si91x_m4_ta_secure_handshake failed: 0x%lx", status);
ChipLogError(DeviceLayer, "sl_si91x_m4_ta_secure_handshake failed: 0x%x", status);
return status;
}
#endif /* CHIP_CONFIG_ENABLE_ICD_SERVER */
@@ -432,15 +432,15 @@ static sl_status_t wfx_rsi_init(void)
status = sl_wifi_get_firmware_version(&version);
if (status != SL_STATUS_OK)
{
ChipLogError(DeviceLayer, "sl_wifi_get_firmware_version failed: 0x%lx", status);
ChipLogError(DeviceLayer, "sl_wifi_get_firmware_version failed: 0x%x", status);
return status;
}
sl_print_firmware_version(&version);

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)
{
ChipLogDetail(DeviceLayer, "sl_wifi_get_mac_address failed: 0x%lx", status);
ChipLogDetail(DeviceLayer, "sl_wifi_get_mac_address failed: 0x%x", status);
return status;
}

@@ -451,15 +451,15 @@ static sl_status_t wfx_rsi_init(void)
status = sl_si91x_trng_entropy();
if (status != SL_STATUS_OK)
{
ChipLogError(DeviceLayer, "sl_si91x_trng_entropy failed: 0x%lx", status);
ChipLogError(DeviceLayer, "sl_si91x_trng_entropy failed: 0x%x", status);
return status;
}

// Initiate and program the key required for TRNG hardware engine
status = sl_si91x_trng_program_key((uint32_t *) trngKey, TRNG_KEY_SIZE);
if (status != SL_STATUS_OK)
{
ChipLogError(DeviceLayer, "sl_si91x_trng_program_key failed: 0x%lx", status);
ChipLogError(DeviceLayer, "sl_si91x_trng_program_key failed: 0x%x", status);
return status;
}
#endif // SL_MBEDTLS_USE_TINYCRYPT
@@ -488,7 +488,7 @@ sl_status_t scan_callback_handler(sl_wifi_event_t event, sl_wifi_scan_result_t *
if (SL_WIFI_CHECK_IF_EVENT_FAILED(event))
{
callback_status = *(sl_status_t *) scan_result;
ChipLogError(DeviceLayer, "scan_callback_handler: failed: 0x%lx", callback_status);
ChipLogError(DeviceLayer, "scan_callback_handler: failed: 0x%x", callback_status);
scan_results_complete = true;
#if WIFI_ENABLE_SECURITY_WPA3_TRANSITION
wfx_rsi.sec.security = WFX_SEC_WPA3;
@@ -688,7 +688,7 @@ static sl_status_t wfx_rsi_do_join(void)
ReturnErrorCodeIf((status == SL_STATUS_OK || status == SL_STATUS_IN_PROGRESS), status);

// failure only happens when the firmware returns an error
ChipLogError(DeviceLayer, "wfx_rsi_do_join: sl_wifi_connect failed: 0x%lx", status);
ChipLogError(DeviceLayer, "wfx_rsi_do_join: sl_wifi_connect failed: 0x%x", status);
VerifyOrReturnError((is_wifi_disconnection_event || wfx_rsi.join_retries <= MAX_JOIN_RETRIES_COUNT), status);

wfx_rsi.dev_state &= ~(WFX_RSI_ST_STA_CONNECTING | WFX_RSI_ST_STA_CONNECTED);
@@ -758,7 +758,7 @@ void WfxPostEvent(WfxEvent_t * event)

if (status != osOK)
{
ChipLogError(DeviceLayer, "WfxPostEvent: failed to post event: 0x%lx", status);
ChipLogError(DeviceLayer, "WfxPostEvent: failed to post event: 0x%x", status);
// TODO: Handle error, requeue event depending on queue size or notify relevant task, Chipdie, etc.
}
}
@@ -836,7 +836,7 @@ void ProcessEvent(WfxEvent_t inEvent)
if (SL_STATUS_OK != status)
{
// TODO: Seems like Chipdie should be called here, the device should be initialized here
ChipLogError(DeviceLayer, "sl_wifi_set_advanced_scan_configuration failed: 0x%lx", status);
ChipLogError(DeviceLayer, "sl_wifi_set_advanced_scan_configuration failed: 0x%x", status);
return;
}

@@ -899,7 +899,7 @@ void wfx_rsi_task(void * arg)
WfxEvent_t wfxEvent;
if (status != RSI_SUCCESS)
{
ChipLogError(DeviceLayer, "wfx_rsi_task: wfx_rsi_init failed: 0x%lx", status);
ChipLogError(DeviceLayer, "wfx_rsi_task: wfx_rsi_init failed: 0x%x", status);
return;
}
wfx_lwip_start();
@@ -915,7 +915,7 @@ void wfx_rsi_task(void * arg)
}
else
{
ChipLogError(DeviceLayer, "wfx_rsi_task: get event failed: 0x%lx", status);
ChipLogError(DeviceLayer, "wfx_rsi_task: get event failed: 0x%x", status);
}
}
}