@@ -181,6 +181,7 @@ int32_t wfx_rsi_disconnect()
181
181
return status ;
182
182
}
183
183
184
+ #if CHIP_DEVICE_CONFIG_ENABLE_SED
184
185
/******************************************************************
185
186
* @fn wfx_rsi_power_save()
186
187
* @brief
@@ -190,16 +191,29 @@ int32_t wfx_rsi_disconnect()
190
191
* @return
191
192
* None
192
193
*********************************************************************/
193
- void wfx_rsi_power_save ()
194
+ int32_t wfx_rsi_power_save ()
194
195
{
195
- int32_t status = rsi_wlan_power_save_profile (RSI_SLEEP_MODE_2 , RSI_MAX_PSP );
196
+ int32_t status ;
197
+ #ifdef RSI_BLE_ENABLE
198
+ status = rsi_bt_power_save_profile (RSI_SLEEP_MODE_2 , RSI_MAX_PSP );
199
+ if (status != RSI_SUCCESS )
200
+ {
201
+ SILABS_LOG ("BT Powersave Config Failed, Error Code : 0x%lX" , status );
202
+ return status ;
203
+ }
204
+ #endif /* RSI_BLE_ENABLE */
205
+
206
+ status = rsi_wlan_power_save_profile (RSI_SLEEP_MODE_2 , RSI_MAX_PSP );
196
207
if (status != RSI_SUCCESS )
197
208
{
198
209
SILABS_LOG ("Powersave Config Failed, Error Code : 0x%lX" , status );
199
- return ;
210
+ return status ;
200
211
}
201
212
SILABS_LOG ("Powersave Config Success" );
213
+ return status ;
202
214
}
215
+ #endif /* CHIP_DEVICE_CONFIG_ENABLE_SED */
216
+
203
217
/******************************************************************
204
218
* @fn wfx_rsi_join_cb(uint16_t status, const uint8_t *buf, const uint16_t len)
205
219
* @brief
@@ -596,13 +610,6 @@ void wfx_rsi_task(void * arg)
596
610
{
597
611
wfx_dhcp_got_ipv4 ((uint32_t ) sta_netif -> ip_addr .u_addr .ip4 .addr );
598
612
hasNotifiedIPV4 = true;
599
- #if CHIP_DEVICE_CONFIG_ENABLE_SED
600
- #ifndef RSI_BLE_ENABLE
601
- // enabling the power save mode for RS9116 if sleepy device is enabled
602
- // if BLE is used on the rs9116 then powersave config is done after ble disconnect event
603
- wfx_rsi_power_save ();
604
- #endif /* RSI_BLE_ENABLE */
605
- #endif /* CHIP_DEVICE_CONFIG_ENABLE_SED */
606
613
if (!hasNotifiedWifiConnectivity )
607
614
{
608
615
wfx_connected_notify (CONNECTION_STATUS_SUCCESS , & wfx_rsi .ap_mac );
@@ -622,13 +629,6 @@ void wfx_rsi_task(void * arg)
622
629
{
623
630
wfx_ipv6_notify (GET_IPV6_SUCCESS );
624
631
hasNotifiedIPV6 = true;
625
- #if CHIP_DEVICE_CONFIG_ENABLE_SED
626
- #ifndef RSI_BLE_ENABLE
627
- // enabling the power save mode for RS9116 if sleepy device is enabled
628
- // if BLE is used on the rs9116 then powersave config is done after ble disconnect event
629
- wfx_rsi_power_save ();
630
- #endif /* RSI_BLE_ENABLE */
631
- #endif /* CHIP_DEVICE_CONFIG_ENABLE_SED */
632
632
if (!hasNotifiedWifiConnectivity )
633
633
{
634
634
wfx_connected_notify (CONNECTION_STATUS_SUCCESS , & wfx_rsi .ap_mac );
0 commit comments