File tree 1 file changed +8
-5
lines changed
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -108,14 +108,17 @@ void arduino::WiFiClass::end() {
108
108
disconnect ();
109
109
}
110
110
111
- int arduino::WiFiClass::disconnect () {
111
+ int arduino::WiFiClass::disconnect () {
112
112
if (_softAP != nullptr ) {
113
- static_cast <WhdSoftAPInterface*>(_softAP)->unregister_event_handler ();
114
- return static_cast <WhdSoftAPInterface*>(_softAP)->stop ();
113
+ WhdSoftAPInterface* softAPInterface = static_cast <WhdSoftAPInterface*>(_softAP);
114
+ softAPInterface->unregister_event_handler ();
115
+ _currentNetworkStatus = (softAPInterface->stop () == NSAPI_ERROR_OK ? WL_DISCONNECTED : WL_AP_FAILED);
115
116
} else {
116
- return wifi_if->disconnect ();
117
+ wifi_if->disconnect ();
118
+ _currentNetworkStatus = WL_DISCONNECTED;
117
119
}
118
- _currentNetworkStatus = WL_IDLE_STATUS;
120
+
121
+ return _currentNetworkStatus;
119
122
}
120
123
121
124
void arduino::WiFiClass::config (arduino::IPAddress local_ip){
You can’t perform that action at this time.
0 commit comments