Skip to content

Commit 1c3fe4e

Browse files
author
Veijo Pesonen
committed
Refreshes connection state when retrieving connection status
Requires C++11
1 parent 93b9cc3 commit 1c3fe4e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

ESP8266Interface.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,9 @@ void ESP8266Interface::attach(mbed::Callback<void(nsapi_event_t, intptr_t)> stat
640640

641641
nsapi_connection_status_t ESP8266Interface::get_connection_status() const
642642
{
643+
if (_initialized) {
644+
_esp.bg_process_oob(ESP8266_RECV_TIMEOUT, true);
645+
}
643646
return _conn_stat;
644647
}
645648

ESP8266Interface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ class ESP8266Interface : public NetworkStack, public WiFiInterface
332332

333333
private:
334334
// AT layer
335-
ESP8266 _esp;
335+
mutable ESP8266 _esp;
336336
void update_conn_state_cb();
337337

338338
// Credentials

0 commit comments

Comments
 (0)