Skip to content

Commit

Permalink
[RSDK-8591] move wifi power save setting logic to after connection (#296
Browse files Browse the repository at this point in the history
)
  • Loading branch information
gvaradarajan authored Aug 21, 2024
1 parent b216027 commit 28d02f9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions micro-rdk/src/esp32/conn/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ impl Esp32WifiNetwork {
});
let mut wifi = esp32_get_wifi()?.lock().await;

crate::esp32::esp_idf_svc::sys::esp!(unsafe {
esp_wifi_set_ps(crate::esp32::esp_idf_svc::sys::wifi_ps_type_t_WIFI_PS_NONE)
})?;

wifi.stop().await?;
wifi.set_configuration(&config)?;

Expand Down Expand Up @@ -127,6 +123,10 @@ impl Esp32WifiNetwork {
wifi.connect().await?;
wifi.wait_netif_up().await?;

crate::esp32::esp_idf_svc::sys::esp!(unsafe {
esp_wifi_set_ps(crate::esp32::esp_idf_svc::sys::wifi_ps_type_t_WIFI_PS_NONE)
})?;

let sl_stack = esp32_get_system_event_loop()?;

let subscription = sl_stack.subscribe::<WifiEvent, _>(move |event: WifiEvent| {
Expand Down

0 comments on commit 28d02f9

Please sign in to comment.