Skip to content

Commit d025a70

Browse files
committed
Add correct network status for disconnect
1 parent 3b49dcb commit d025a70

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libraries/WiFi/src/WiFi.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,14 @@ void arduino::WiFiClass::end() {
109109
}
110110

111111
int arduino::WiFiClass::disconnect() {
112+
_currentNetworkStatus = WL_DISCONNECTED;
113+
112114
if (_softAP != nullptr) {
113115
static_cast<WhdSoftAPInterface*>(_softAP)->unregister_event_handler();
114116
return static_cast<WhdSoftAPInterface*>(_softAP)->stop();
115117
} else {
116118
return wifi_if->disconnect();
117119
}
118-
_currentNetworkStatus = WL_IDLE_STATUS;
119120
}
120121

121122
void arduino::WiFiClass::config(arduino::IPAddress local_ip){

0 commit comments

Comments
 (0)