Skip to content

Commit 9d9a076

Browse files
author
Cruz Monrreal
authored
Merge pull request #9885 from VeijoPesonen/esp8266_conn_timeout_err2trace
ESP8266: graceful disconnect on network state timeout
2 parents 13945c6 + 7bb887f commit 9d9a076

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

components/wifi/esp8266-driver/ESP8266/ESP8266.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,8 +1151,13 @@ void ESP8266::_oob_connection_status()
11511151
"ESP8266::_oob_connection_status: invalid AT cmd\n");
11521152
}
11531153
} else {
1154-
MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_DRIVER, MBED_ERROR_CODE_ENOMSG), \
1155-
"ESP8266::_oob_connection_status: network status timed out\n");
1154+
tr_error("_oob_connection_status(): network status timeout, disconnecting");
1155+
if (!disconnect()) {
1156+
tr_warning("_oob_connection_status(): driver initiated disconnect failed");
1157+
} else {
1158+
tr_debug("_oob_connection_status(): disconnected");
1159+
}
1160+
_conn_status = NSAPI_STATUS_ERROR_UNSUPPORTED;
11561161
}
11571162

11581163
MBED_ASSERT(_conn_stat_cb);

0 commit comments

Comments
 (0)