From 32686d48a8fd71a4cf369d4ef8e7ee780eb6b77f Mon Sep 17 00:00:00 2001 From: Michal Paszta Date: Fri, 15 Feb 2019 17:33:21 +0200 Subject: [PATCH] ESP8266: connect() returns OK in non-blocking calls --- components/wifi/esp8266-driver/ESP8266Interface.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/wifi/esp8266-driver/ESP8266Interface.cpp b/components/wifi/esp8266-driver/ESP8266Interface.cpp index 02ae6a59db..9c32dda606 100644 --- a/components/wifi/esp8266-driver/ESP8266Interface.cpp +++ b/components/wifi/esp8266-driver/ESP8266Interface.cpp @@ -253,7 +253,11 @@ int ESP8266Interface::connect() _cmutex.unlock(); - return _connect_retval; + if (!_if_blocking) { + return NSAPI_ERROR_OK; + } else { + return _connect_retval; + } } int ESP8266Interface::set_credentials(const char *ssid, const char *pass, nsapi_security_t security)