Add TINY_GSM_TCP_KEEP_ALIVE

This commit is contained in:
Volodymyr Shymanskyy
2017-09-03 21:57:19 +03:00
parent 1dba3dbafc
commit 137ac7befe

View File

@@ -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),