Skip to content

Commit 7bb887f

Browse files
author
Veijo Pesonen
committed
ESP8266: in unknown network state driver tries to disconnect
1 parent e03b3b6 commit 7bb887f

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
@@ -1137,8 +1137,13 @@ void ESP8266::_oob_connection_status()
11371137
"ESP8266::_oob_connection_status: invalid AT cmd\n");
11381138
}
11391139
} else {
1140-
MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_DRIVER, MBED_ERROR_CODE_ENOMSG), \
1141-
"ESP8266::_oob_connection_status: network status timed out\n");
1140+
tr_error("_oob_connection_status(): network status timeout, disconnecting");
1141+
if (!disconnect()) {
1142+
tr_warning("_oob_connection_status(): driver initiated disconnect failed");
1143+
} else {
1144+
tr_debug("_oob_connection_status(): disconnected");
1145+
}
1146+
_conn_status = NSAPI_STATUS_ERROR_UNSUPPORTED;
11421147
}
11431148

11441149
MBED_ASSERT(_conn_stat_cb);

0 commit comments

Comments
 (0)