diff --git a/ESP8266Interface.cpp b/ESP8266Interface.cpp index 1abd966..7c23ec1 100644 --- a/ESP8266Interface.cpp +++ b/ESP8266Interface.cpp @@ -640,6 +640,9 @@ void ESP8266Interface::attach(mbed::Callback stat nsapi_connection_status_t ESP8266Interface::get_connection_status() const { + if (_initialized) { + _esp.bg_process_oob(ESP8266_RECV_TIMEOUT, true); + } return _conn_stat; } diff --git a/ESP8266Interface.h b/ESP8266Interface.h index ebd6411..643480a 100644 --- a/ESP8266Interface.h +++ b/ESP8266Interface.h @@ -332,7 +332,7 @@ class ESP8266Interface : public NetworkStack, public WiFiInterface private: // AT layer - ESP8266 _esp; + mutable ESP8266 _esp; void update_conn_state_cb(); // Credentials