File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed
libraries/ESP8266WiFi/src Expand file tree Collapse file tree 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) {
106106 DEBUGV (" wifi evt: %d\n " , event->event );
107107
108108 if (event->event == EVENT_STAMODE_DISCONNECTED) {
109+ DEBUGV (" STA disconnect: %d\n " , event->event_info .disconnected .reason );
109110 WiFiClient::stopAll ();
110111 }
111112
Original file line number Diff line number Diff line change @@ -267,6 +267,15 @@ bool ESP8266WiFiSTAClass::disconnect(bool wifioff) {
267267 return ret;
268268}
269269
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+
270279/* *
271280 * Setting the ESP8266 station to connect to the AP (which is recorded)
272281 * 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 {
4444 bool reconnect ();
4545 bool disconnect (bool wifioff = false );
4646
47+ bool isConnected ();
48+
4749 bool setAutoConnect (bool autoConnect);
4850 bool getAutoConnect ();
4951
You can’t perform that action at this time.
0 commit comments