From 137ac7befe72fa82557fa7a33e7045e6c94a67b7 Mon Sep 17 00:00:00 2001 From: Volodymyr Shymanskyy Date: Sun, 3 Sep 2017 21:57:19 +0300 Subject: [PATCH] Add TINY_GSM_TCP_KEEP_ALIVE --- TinyGsmClientESP8266.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TinyGsmClientESP8266.h b/TinyGsmClientESP8266.h index 75155b2..283b8ff 100644 --- a/TinyGsmClientESP8266.h +++ b/TinyGsmClientESP8266.h @@ -22,6 +22,7 @@ #define GSM_NL "\r\n" static const char GSM_OK[] TINY_GSM_PROGMEM = "OK" GSM_NL; static const char GSM_ERROR[] TINY_GSM_PROGMEM = "ERROR" GSM_NL; +static unsigned TINY_GSM_TCP_KEEP_ALIVE = 120; class TinyGsm { @@ -237,7 +238,7 @@ public: private: int modemConnect(const char* host, uint16_t port, uint8_t mux) { - sendAT(GF("+CIPSTART="), mux, ',', GF("\"TCP"), GF("\",\""), host, GF("\","), port, GF(",120")); + sendAT(GF("+CIPSTART="), mux, ',', GF("\"TCP"), GF("\",\""), host, GF("\","), port, GF(","), TINY_GSM_TCP_KEEP_ALIVE); int rsp = waitResponse(75000L, GFP(GSM_OK), GFP(GSM_ERROR),