File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -110,12 +110,15 @@ void arduino::WiFiClass::end() {
110110
111111int arduino::WiFiClass::disconnect () {
112112 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);
115116 } else {
116- return wifi_if->disconnect ();
117+ wifi_if->disconnect ();
118+ _currentNetworkStatus = WL_DISCONNECTED;
117119 }
118- _currentNetworkStatus = WL_IDLE_STATUS;
120+
121+ return _currentNetworkStatus;
119122}
120123
121124void arduino::WiFiClass::config (arduino::IPAddress local_ip){
You can’t perform that action at this time.
0 commit comments