Skip to content

Commit ec3d113

Browse files
author
Veijo Pesonen
committed
Fixes busy status handling
1 parent 181e484 commit ec3d113

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
@@ -868,18 +868,20 @@ void ESP8266::_oob_busy()
868868
{
869869
char status[5];
870870
if (_parser.recv("%4[^\"]\n", status)) {
871-
if (strcmp(status, " s...\n") == 0) {
872-
; //TODO maybe do something here, or not...
873-
} else if (strcmp(status, "p...\n") == 0) {
874-
; //TODO maybe do something here, or not...
871+
if (strcmp(status, "s...") == 0) {
872+
tr_debug("busy s...");
873+
} else if (strcmp(status, "p...") == 0) {
874+
tr_debug("busy p...");
875875
} else {
876+
tr_error("unrecognized busy state \'%s\'", status);
876877
MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_DRIVER, MBED_ERROR_CODE_EBADMSG), \
877-
"ESP8266::_oob_busy: unrecognized busy state\n");
878+
"ESP8266::_oob_busy() unrecognized busy state\n");
878879
}
879880
} else {
880881
MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_DRIVER, MBED_ERROR_CODE_ENOMSG), \
881-
"ESP8266::_oob_busy: AT timeout\n");
882+
"ESP8266::_oob_busy() AT timeout\n");
882883
}
884+
_busy = true;
883885
}
884886

885887
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)