|
@ -17,10 +17,9 @@ |
|
|
#include "TinyGsmCommon.h" |
|
|
#include "TinyGsmCommon.h" |
|
|
|
|
|
|
|
|
#define GSM_NL "\r\n" |
|
|
#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 const char GSM_CME_ERROR[] TINY_GSM_PROGMEM = GSM_NL "+CME ERROR:"; |
|
|
|
|
|
static unsigned TINY_GSM_TCP_KEEP_ALIVE = 120; |
|
|
|
|
|
|
|
|
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; |
|
|
|
|
|
|
|
|
// <stat> status of ESP8266 station interface |
|
|
// <stat> status of ESP8266 station interface |
|
|
// 2 : ESP8266 station connected to an AP and has obtained IP |
|
|
// 2 : ESP8266 station connected to an AP and has obtained IP |
|
@ -421,8 +420,7 @@ class TinyGsmESP8266 |
|
|
// TODO(vshymanskyy): Optimize this! |
|
|
// TODO(vshymanskyy): Optimize this! |
|
|
uint8_t waitResponse(uint32_t timeout_ms, String& data, |
|
|
uint8_t waitResponse(uint32_t timeout_ms, String& data, |
|
|
GsmConstStr r1 = GFP(GSM_OK), |
|
|
GsmConstStr r1 = GFP(GSM_OK), |
|
|
GsmConstStr r2 = GFP(GSM_ERROR), |
|
|
|
|
|
GsmConstStr r3 = GFP(GSM_CME_ERROR), |
|
|
|
|
|
|
|
|
GsmConstStr r2 = GFP(GSM_ERROR), GsmConstStr r3 = NULL, |
|
|
GsmConstStr r4 = NULL, GsmConstStr r5 = NULL) { |
|
|
GsmConstStr r4 = NULL, GsmConstStr r5 = NULL) { |
|
|
/*String r1s(r1); r1s.trim(); |
|
|
/*String r1s(r1); r1s.trim(); |
|
|
String r2s(r2); r2s.trim(); |
|
|
String r2s(r2); r2s.trim(); |
|
@ -497,16 +495,14 @@ class TinyGsmESP8266 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
uint8_t waitResponse(uint32_t timeout_ms, GsmConstStr r1 = GFP(GSM_OK), |
|
|
uint8_t waitResponse(uint32_t timeout_ms, GsmConstStr r1 = GFP(GSM_OK), |
|
|
GsmConstStr r2 = GFP(GSM_ERROR), |
|
|
|
|
|
GsmConstStr r3 = GFP(GSM_CME_ERROR), |
|
|
|
|
|
|
|
|
GsmConstStr r2 = GFP(GSM_ERROR), GsmConstStr r3 = NULL, |
|
|
GsmConstStr r4 = NULL, GsmConstStr r5 = NULL) { |
|
|
GsmConstStr r4 = NULL, GsmConstStr r5 = NULL) { |
|
|
String data; |
|
|
String data; |
|
|
return waitResponse(timeout_ms, data, r1, r2, r3, r4, r5); |
|
|
return waitResponse(timeout_ms, data, r1, r2, r3, r4, r5); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
uint8_t waitResponse(GsmConstStr r1 = GFP(GSM_OK), |
|
|
uint8_t waitResponse(GsmConstStr r1 = GFP(GSM_OK), |
|
|
GsmConstStr r2 = GFP(GSM_ERROR), |
|
|
|
|
|
GsmConstStr r3 = GFP(GSM_CME_ERROR), |
|
|
|
|
|
|
|
|
GsmConstStr r2 = GFP(GSM_ERROR), GsmConstStr r3 = NULL, |
|
|
GsmConstStr r4 = NULL, GsmConstStr r5 = NULL) { |
|
|
GsmConstStr r4 = NULL, GsmConstStr r5 = NULL) { |
|
|
return waitResponse(1000, r1, r2, r3, r4, r5); |
|
|
return waitResponse(1000, r1, r2, r3, r4, r5); |
|
|
} |
|
|
} |
|
|