Skip to content

Commit 1892e2d

Browse files
authored
Merge pull request #9741 from michalpasztamobica/esp8266_fix_nonblocking_connect
ESP8266: connect() returns OK in non-blocking calls
2 parents f95ec95 + 32686d4 commit 1892e2d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

components/wifi/esp8266-driver/ESP8266Interface.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,11 @@ int ESP8266Interface::connect()
253253

254254
_cmutex.unlock();
255255

256-
return _connect_retval;
256+
if (!_if_blocking) {
257+
return NSAPI_ERROR_OK;
258+
} else {
259+
return _connect_retval;
260+
}
257261
}
258262

259263
int ESP8266Interface::set_credentials(const char *ssid, const char *pass, nsapi_security_t security)

0 commit comments

Comments
 (0)