parent
c18d50cb91
commit
19ccc479c3
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user