Skip to content

Commit 836c7da

Browse files
tablatronixdevyte
authored andcommitted
adds getautoreconnect() (#4359)
1 parent 30155f2 commit 836c7da

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,14 @@ bool ESP8266WiFiSTAClass::setAutoReconnect(bool autoReconnect) {
356356
return wifi_station_set_reconnect_policy(autoReconnect);
357357
}
358358

359+
/**
360+
* get whether reconnect or not when the ESP8266 station is disconnected from AP.
361+
* @return autoreconnect
362+
*/
363+
bool ESP8266WiFiSTAClass::getAutoReconnect() {
364+
return wifi_station_get_reconnect_policy();
365+
}
366+
359367
/**
360368
* Wait for WiFi connection to reach a result
361369
* returns the status reached or disconnect if STA is off

libraries/ESP8266WiFi/src/ESP8266WiFiSTA.h

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class ESP8266WiFiSTAClass {
5353
bool getAutoConnect();
5454

5555
bool setAutoReconnect(bool autoReconnect);
56+
bool getAutoReconnect();
5657

5758
uint8_t waitForConnectResult();
5859

tools/sdk/include/user_interface.h

+1
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ uint8 wifi_station_get_auto_connect(void);
297297
bool wifi_station_set_auto_connect(uint8 set);
298298

299299
bool wifi_station_set_reconnect_policy(bool set);
300+
bool wifi_station_get_reconnect_policy();
300301

301302
typedef enum {
302303
STATION_IDLE = 0,

0 commit comments

Comments
 (0)