File tree 3 files changed +12
-0
lines changed
libraries/ESP8266WiFi/src
3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ void ESP8266WiFiGenericClass::_eventCallback(void* arg) {
106
106
DEBUGV (" wifi evt: %d\n " , event->event );
107
107
108
108
if (event->event == EVENT_STAMODE_DISCONNECTED) {
109
+ DEBUGV (" STA disconnect: %d\n " , event->event_info .disconnected .reason );
109
110
WiFiClient::stopAll ();
110
111
}
111
112
Original file line number Diff line number Diff line change @@ -267,6 +267,15 @@ bool ESP8266WiFiSTAClass::disconnect(bool wifioff) {
267
267
return ret;
268
268
}
269
269
270
+ /* *
271
+ * is STA interface connected?
272
+ * @return true if STA is connected to an AD
273
+ */
274
+ bool ESP8266WiFiSTAClass::isConnected () {
275
+ return (status () == WL_CONNECTED);
276
+ }
277
+
278
+
270
279
/* *
271
280
* Setting the ESP8266 station to connect to the AP (which is recorded)
272
281
* automatically or not when powered on. Enable auto-connect by default.
Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ class ESP8266WiFiSTAClass {
44
44
bool reconnect ();
45
45
bool disconnect (bool wifioff = false );
46
46
47
+ bool isConnected ();
48
+
47
49
bool setAutoConnect (bool autoConnect);
48
50
bool getAutoConnect ();
49
51
You can’t perform that action at this time.
0 commit comments