Skip to content

Commit b2e9c9b

Browse files
author
Veijo Pesonen
committed
Adds placeholder for busy-msgs, no action taken if one occurs
1 parent f1e0d36 commit b2e9c9b

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

ESP8266/ESP8266.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ ESP8266::ESP8266(PinName tx, PinName rx, bool debug, PinName rts, PinName cts)
6666
// Don't see a reason to make distiction between software(Software WDT reset) and hardware(wdt reset) watchdog treatment
6767
//https://github.com/esp8266/Arduino/blob/4897e0006b5b0123a2fa31f67b14a3fff65ce561/doc/faq/a02-my-esp-crashes.md#watchdog
6868
_parser.oob("Soft WDT reset", callback(this, &ESP8266::_oob_watchdog_reset));
69+
_parser.oob("busy ", callback(this, &ESP8266::_oob_busy));
6970

7071
for(int i= 0; i < SOCKET_COUNT; i++) {
7172
_sock_i[i].open = false;
@@ -843,6 +844,24 @@ void ESP8266::_oob_watchdog_reset()
843844
_conn_stat_cb();
844845
}
845846

847+
void ESP8266::_oob_busy()
848+
{
849+
char status[5];
850+
if (_parser.recv("%4[^\"]\n", status)) {
851+
if (strcmp(status, " s...\n") == 0) {
852+
; //TODO maybe do something here, or not...
853+
} else if (strcmp(status, "p...\n") == 0) {
854+
; //TODO maybe do something here, or not...
855+
} else {
856+
MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_DRIVER, MBED_ERROR_CODE_EBADMSG), \
857+
"ESP8266::_oob_busy: unrecognized busy state\n");
858+
}
859+
} else {
860+
MBED_ERROR(MBED_MAKE_ERROR(MBED_MODULE_DRIVER, MBED_ERROR_CODE_ENOMSG), \
861+
"ESP8266::_oob_busy: AT timeout\n");
862+
}
863+
}
864+
846865
void ESP8266::_oob_connect_err()
847866
{
848867
_fail = false;

ESP8266/ESP8266.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ class ESP8266
406406
void _oob_connection_status();
407407
void _oob_socket_close_err();
408408
void _oob_watchdog_reset();
409+
void _oob_busy();
409410

410411
// OOB state variables
411412
int _connect_error;

0 commit comments

Comments
 (0)