Skip to content

Commit fdb44a4

Browse files
c1728p9Bartek Szatkowski
authored andcommitted
Fix dropped receive data caused by timeout
Set receive timeout to 500ms to prevent dropped data. Update the call in ESP8266::recv to call parser.process_oob rather than parser.recv since this code is only used to trigger the processing of out-of-band data.
1 parent 44fb447 commit fdb44a4

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

ESP8266/ATParser.lib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
https://github.com/ARMmbed/ATParser/#77734ee44a63b149cd20a6647394ab781b67c0aa
1+
https://github.com/ARMmbed/ATParser/#a2cb09990f11a17504608272966f1185b211ce23

ESP8266/ESP8266.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ int32_t ESP8266::recv(int id, void *data, uint32_t amount)
269269
}
270270
}
271271

272-
// Wait for inbound packet
273-
if (!_parser.recv("OK")) {
272+
// Check for inbound packets
273+
if (!_parser.process_oob()) {
274274
return -1;
275275
}
276276
}

ESP8266Interface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#define ESP8266_SEND_TIMEOUT 500
2727
#endif
2828
#ifndef ESP8266_RECV_TIMEOUT
29-
#define ESP8266_RECV_TIMEOUT 0
29+
#define ESP8266_RECV_TIMEOUT 500
3030
#endif
3131
#ifndef ESP8266_MISC_TIMEOUT
3232
#define ESP8266_MISC_TIMEOUT 500

0 commit comments

Comments
 (0)