File tree 2 files changed +15
-0
lines changed
2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -639,6 +639,20 @@ bool WiFiGenericClass::setSleep(bool enable)
639
639
return esp_wifi_set_ps (enable?WIFI_PS_MIN_MODEM:WIFI_PS_NONE) == ESP_OK;
640
640
}
641
641
642
+ /* *
643
+ * control modem sleep when only in STA mode
644
+ * @param mode wifi_ps_type_t
645
+ * @return ok
646
+ */
647
+ bool WiFiGenericClass::setSleep (wifi_ps_type_t mode)
648
+ {
649
+ if ((getMode () & WIFI_MODE_STA) == 0 ){
650
+ log_w (" STA has not been started" );
651
+ return false ;
652
+ }
653
+ return esp_wifi_set_ps (mode) == ESP_OK;
654
+ }
655
+
642
656
/* *
643
657
* get modem sleep enabled
644
658
* @return true if modem sleep is enabled
Original file line number Diff line number Diff line change @@ -108,6 +108,7 @@ class WiFiGenericClass
108
108
bool enableAP (bool enable);
109
109
110
110
bool setSleep (bool enable);
111
+ bool setSleep (wifi_ps_type_t mode);
111
112
bool getSleep ();
112
113
113
114
bool setTxPower (wifi_power_t power);
You can’t perform that action at this time.
0 commit comments