Skip to content

Commit 672d1c8

Browse files
author
Veijo Pesonen
committed
Fixes busy status handling
1 parent d3e5ab1 commit 672d1c8

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

ESP8266/ESP8266.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -863,18 +863,20 @@ void ESP8266::_oob_busy()
863863
{
864864
char status[5];
865865
if (_parser.recv("%4[^\"]\n", status)) {
866-
if (strcmp(status, " s...\n") == 0) {
867-
; //TODO maybe do something here, or not...
868-
} else if (strcmp(status, "p...\n") == 0) {
869-
; //TODO maybe do something here, or not...
866+
if (strcmp(status, "s...") == 0) {
867+
tr_debug("busy s...");
868+
} else if (strcmp(status, "p...") == 0) {
869+
tr_debug("busy p...");
870870
} else {
871+
tr_error("unrecognized busy state \'%s\'", status);
871872
MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_DRIVER, MBED_ERROR_CODE_EBADMSG), \
872-
"ESP8266::_oob_busy: unrecognized busy state\n");
873+
"ESP8266::_oob_busy() unrecognized busy state\n");
873874
}
874875
} else {
875876
MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_DRIVER, MBED_ERROR_CODE_ENOMSG), \
876-
"ESP8266::_oob_busy: AT timeout\n");
877+
"ESP8266::_oob_busy() AT timeout\n");
877878
}
879+
_busy = true;
878880
}
879881

880882
void ESP8266::_oob_connect_err()

ESP8266/ESP8266.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ class ESP8266 {
421421
bool _sock_already;
422422
bool _closed;
423423
bool _error;
424+
bool _busy;
424425

425426
// Modem's address info
426427
char _ip_buffer[16];

0 commit comments

Comments
 (0)