From da6732b5a96d29a38bebf2a69a6f151a66e15639 Mon Sep 17 00:00:00 2001 From: Sara Damiano Date: Fri, 7 Sep 2018 12:47:19 -0400 Subject: [PATCH] Pull some updates from upstream --- src/TinyGsmClientA6.h | 7 ++++--- src/TinyGsmClientSIM800.h | 3 +-- src/TinyGsmClientSIM808.h | 2 +- src/TinyGsmClientUBLOX.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/TinyGsmClientA6.h b/src/TinyGsmClientA6.h index 7a6f6ba..3561d9b 100644 --- a/src/TinyGsmClientA6.h +++ b/src/TinyGsmClientA6.h @@ -49,7 +49,7 @@ class TinyGsmA6 //============================================================================// //============================================================================// -// The Internal A6 Client Class +// The Internal A6 Client Class //============================================================================// //============================================================================// @@ -418,8 +418,9 @@ public: bool gprsConnect(const char* apn, const char* user = NULL, const char* pwd = NULL) { gprsDisconnect(); - sendAT(GF("EE"), 2); // Set security to WPA2 - if (waitResponse() != 1) goto fail; + sendAT(GF("+CGATT=1")); + if (waitResponse(60000L) != 1) + return false; // TODO: wait AT+CGATT? diff --git a/src/TinyGsmClientSIM800.h b/src/TinyGsmClientSIM800.h index c696516..e83faa4 100644 --- a/src/TinyGsmClientSIM800.h +++ b/src/TinyGsmClientSIM800.h @@ -852,8 +852,7 @@ public: streamWrite(tail...); } - bool streamSkipUntil(char c) { - const unsigned long timeout = 1000L; + bool streamSkipUntil(const char c, const unsigned long timeout = 3000L) { unsigned long startMillis = millis(); while (millis() - startMillis < timeout) { while (millis() - startMillis < timeout && !stream.available()) { diff --git a/src/TinyGsmClientSIM808.h b/src/TinyGsmClientSIM808.h index b49ab85..fccfbcb 100644 --- a/src/TinyGsmClientSIM808.h +++ b/src/TinyGsmClientSIM808.h @@ -14,7 +14,7 @@ //============================================================================// //============================================================================// -// Declaration and Definitio of the TinyGsmSim808 Class +// Declaration and Definition of the TinyGsmSim808 Class //============================================================================// //============================================================================// diff --git a/src/TinyGsmClientUBLOX.h b/src/TinyGsmClientUBLOX.h index c91ed98..a692d27 100644 --- a/src/TinyGsmClientUBLOX.h +++ b/src/TinyGsmClientUBLOX.h @@ -726,7 +726,7 @@ public: TINY_GSM_YIELD(); while (stream.available() > 0) { int a = stream.read(); - if (a <= 0) continue; // Skip 0x00 bytes, just in case + if (a < 0) continue; data += (char)a; if (r1 && data.endsWith(r1)) { index = 1;