ESP8266: in unknown network state driver tries to disconnect

pull/9885/head
Veijo Pesonen 2019-02-28 11:59:32 +02:00
parent e03b3b68c1
commit 7bb887fef4
1 changed files with 7 additions and 2 deletions

View File

@ -1137,8 +1137,13 @@ void ESP8266::_oob_connection_status()
"ESP8266::_oob_connection_status: invalid AT cmd\n");
}
} else {
MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_DRIVER, MBED_ERROR_CODE_ENOMSG), \
"ESP8266::_oob_connection_status: network status timed out\n");
tr_error("_oob_connection_status(): network status timeout, disconnecting");
if (!disconnect()) {
tr_warning("_oob_connection_status(): driver initiated disconnect failed");
} else {
tr_debug("_oob_connection_status(): disconnected");
}
_conn_status = NSAPI_STATUS_ERROR_UNSUPPORTED;
}
MBED_ASSERT(_conn_stat_cb);