diff --git a/src/platform/silabs/rs911x/BLEManagerImpl.cpp b/src/platform/silabs/rs911x/BLEManagerImpl.cpp index 272c4eeef2..90d018e59d 100644 --- a/src/platform/silabs/rs911x/BLEManagerImpl.cpp +++ b/src/platform/silabs/rs911x/BLEManagerImpl.cpp @@ -535,6 +535,7 @@ CHIP_ERROR BLEManagerImpl::MapBLEError(int bleErr) void BLEManagerImpl::DriveBLEState(void) { + ChipLogDetail(DeviceLayer, "[DBG] DriveBLEState"); CHIP_ERROR err = CHIP_NO_ERROR; // Check if BLE stack is initialized ( TODO ) @@ -636,10 +637,7 @@ CHIP_ERROR BLEManagerImpl::ConfigureAdvertisingData(void) ChipLogError(DeviceLayer, "rsi_ble_set_advertise_data() failed: %ld", result); ExitNow(); } - else - { - ChipLogError(DeviceLayer, "rsi_ble_set_advertise_data() success: %ld", result); - } + index = 0; responseData[index++] = 0x02; // length responseData[index++] = CHIP_ADV_DATA_TYPE_FLAGS; // AD type : flags @@ -724,7 +722,10 @@ CHIP_ERROR BLEManagerImpl::StartAdvertising(void) exit: // TODO: Add MapBLEError to return the correct error code - ChipLogError(DeviceLayer, "StartAdvertising() End error: %s", ErrorStr(err)); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "StartAdvertising() End error: %s", ErrorStr(err)); + } return err; } @@ -763,7 +764,7 @@ CHIP_ERROR BLEManagerImpl::StopAdvertising(void) { // Since DriveBLEState is not called the device is still advertising status = rsi_ble_stop_advertising(); - if (status != RSI_SUCCESS) + if (status == RSI_SUCCESS || status == 0x4E0C) { mFlags.Clear(Flags::kAdvertising).Clear(Flags::kRestartAdvertising); mFlags.Set(Flags::kFastAdvertisingEnabled, true); diff --git a/src/platform/silabs/wifi/SiWx/WifiInterface.cpp b/src/platform/silabs/wifi/SiWx/WifiInterface.cpp index eb08ab5c02..e75e717538 100644 --- a/src/platform/silabs/wifi/SiWx/WifiInterface.cpp +++ b/src/platform/silabs/wifi/SiWx/WifiInterface.cpp @@ -475,7 +475,7 @@ sl_status_t JoinWifiNetwork(void) // failure only happens when the firmware returns an error ChipLogError(DeviceLayer, "sl_net_up failed: 0x%lx", static_cast(status)); - //Deactivate the network interface before activating it on the next retry. + // Deactivate the network interface before activating it on the next retry. if ((status == SL_STATUS_SI91X_SCAN_ISSUED_IN_ASSOCIATED_STATE) || (status == SL_STATUS_SI91X_COMMAND_GIVEN_IN_INVALID_STATE)) { status = sl_net_down((sl_net_interface_t) SL_NET_WIFI_CLIENT_INTERFACE); @@ -918,7 +918,7 @@ void wfx_dhcp_got_ipv4(uint32_t ip) sl_status_t ConfigurePowerSave(rsi_power_save_profile_mode_t sl_si91x_ble_state, sl_si91x_performance_profile_t sl_si91x_wifi_state, uint32_t listenInterval) { - int32_t error = rsi_bt_power_save_profile(sl_si91x_ble_state, 0); + int32_t error = rsi_bt_power_save_profile(sl_si91x_ble_state, RSI_MAX_PSP); VerifyOrReturnError(error == RSI_SUCCESS, SL_STATUS_FAIL, ChipLogError(DeviceLayer, "rsi_bt_power_save_profile failed: %ld", error)); diff --git a/src/platform/silabs/wifi/icd/WifiSleepManager.cpp b/src/platform/silabs/wifi/icd/WifiSleepManager.cpp index e5c92b58a5..38eb473449 100644 --- a/src/platform/silabs/wifi/icd/WifiSleepManager.cpp +++ b/src/platform/silabs/wifi/icd/WifiSleepManager.cpp @@ -16,6 +16,7 @@ */ #include +#include #include #include #include @@ -162,7 +163,7 @@ CHIP_ERROR WifiSleepManager::VerifyAndTransitionToLowPowerMode() VerifyOrReturnError(ConfigurePowerSave() == SL_STATUS_OK, CHIP_ERROR_INTERNAL); #endif // CHIP_CONFIG_ENABLE_ICD_SERVER return CHIP_NO_ERROR; -#else // wf200 +#else // wf200 return CHIP_NO_ERROR; #endif } diff --git a/src/platform/silabs/wifi/rs911x/WifiInterface.cpp b/src/platform/silabs/wifi/rs911x/WifiInterface.cpp index fb1bd3836c..a25febc5c2 100644 --- a/src/platform/silabs/wifi/rs911x/WifiInterface.cpp +++ b/src/platform/silabs/wifi/rs911x/WifiInterface.cpp @@ -943,9 +943,6 @@ int32_t wfx_rsi_send_data(void * p, uint16_t len) sl_status_t ConfigurePowerSave(void) { int32_t status; - // RSI_SLEEP_2 is supported for associated stations only - // RSI_SLEEP_8 is non-associated sleep. - // FW will switch modes automatically #ifdef RSI_BLE_ENABLE status = rsi_bt_power_save_profile(RSI_SLEEP_MODE_2, RSI_MAX_PSP); if (status != RSI_SUCCESS)