Skip to content

Commit 3ad8b18

Browse files
authored
Allow overriding the ESP8266 timeouts
By wrapping these in an `#ifndef` these can be overridden from user space (e.g. mbed_app.json). For a justification, see https://stackoverflow.com/questions/45328298/mbed-socket-connection-takes-a-long-time.
1 parent 7e7b260 commit 3ad8b18

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ESP8266Interface.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,18 @@
1919
#include "mbed_debug.h"
2020

2121
// Various timeouts for different ESP8266 operations
22+
#ifndef ESP8266_CONNECT_TIMEOUT
2223
#define ESP8266_CONNECT_TIMEOUT 15000
24+
#endif
25+
#ifndef ESP8266_SEND_TIMEOUT
2326
#define ESP8266_SEND_TIMEOUT 500
27+
#endif
28+
#ifndef ESP8266_RECV_TIMEOUT
2429
#define ESP8266_RECV_TIMEOUT 0
30+
#endif
31+
#ifndef ESP8266_MISC_TIMEOUT
2532
#define ESP8266_MISC_TIMEOUT 500
33+
#endif
2634

2735
// Firmware version
2836
#define ESP8266_VERSION 2

0 commit comments

Comments
 (0)