From 3ad8b18ef9813e9b8ddefdbe751be6c975cc5885 Mon Sep 17 00:00:00 2001 From: Jan Jongboom Date: Wed, 26 Jul 2017 16:49:44 +0200 Subject: [PATCH] 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. --- ESP8266Interface.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ESP8266Interface.cpp b/ESP8266Interface.cpp index 433e3bf..dcf4bea 100644 --- a/ESP8266Interface.cpp +++ b/ESP8266Interface.cpp @@ -19,10 +19,18 @@ #include "mbed_debug.h" // Various timeouts for different ESP8266 operations +#ifndef ESP8266_CONNECT_TIMEOUT #define ESP8266_CONNECT_TIMEOUT 15000 +#endif +#ifndef ESP8266_SEND_TIMEOUT #define ESP8266_SEND_TIMEOUT 500 +#endif +#ifndef ESP8266_RECV_TIMEOUT #define ESP8266_RECV_TIMEOUT 0 +#endif +#ifndef ESP8266_MISC_TIMEOUT #define ESP8266_MISC_TIMEOUT 500 +#endif // Firmware version #define ESP8266_VERSION 2