Unverified Commit 19ccc479 authored by lbernstone's avatar lbernstone Committed by GitHub

WIFI_PS_MAX_MODEM feature requested #3896 (#3900)

parent c18d50cb
......@@ -639,6 +639,20 @@ bool WiFiGenericClass::setSleep(bool enable)
return esp_wifi_set_ps(enable?WIFI_PS_MIN_MODEM:WIFI_PS_NONE) == ESP_OK;
}
/**
* control modem sleep when only in STA mode
* @param mode wifi_ps_type_t
* @return ok
*/
bool WiFiGenericClass::setSleep(wifi_ps_type_t mode)
{
if((getMode() & WIFI_MODE_STA) == 0){
log_w("STA has not been started");
return false;
}
return esp_wifi_set_ps(mode) == ESP_OK;
}
/**
* get modem sleep enabled
* @return true if modem sleep is enabled
......
......@@ -108,6 +108,7 @@ class WiFiGenericClass
bool enableAP(bool enable);
bool setSleep(bool enable);
bool setSleep(wifi_ps_type_t mode);
bool getSleep();
bool setTxPower(wifi_power_t power);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment