Pull some updates from upstream

This commit is contained in:
Sara Damiano
2018-09-07 12:47:19 -04:00
parent 078bc6d0fc
commit da6732b5a9
4 changed files with 7 additions and 7 deletions

View File

@@ -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) { bool gprsConnect(const char* apn, const char* user = NULL, const char* pwd = NULL) {
gprsDisconnect(); gprsDisconnect();
sendAT(GF("EE"), 2); // Set security to WPA2 sendAT(GF("+CGATT=1"));
if (waitResponse() != 1) goto fail; if (waitResponse(60000L) != 1)
return false;
// TODO: wait AT+CGATT? // TODO: wait AT+CGATT?

View File

@@ -852,8 +852,7 @@ public:
streamWrite(tail...); streamWrite(tail...);
} }
bool streamSkipUntil(char c) { bool streamSkipUntil(const char c, const unsigned long timeout = 3000L) {
const unsigned long timeout = 1000L;
unsigned long startMillis = millis(); unsigned long startMillis = millis();
while (millis() - startMillis < timeout) { while (millis() - startMillis < timeout) {
while (millis() - startMillis < timeout && !stream.available()) { while (millis() - startMillis < timeout && !stream.available()) {

View File

@@ -14,7 +14,7 @@
//============================================================================// //============================================================================//
//============================================================================// //============================================================================//
// Declaration and Definitio of the TinyGsmSim808 Class // Declaration and Definition of the TinyGsmSim808 Class
//============================================================================// //============================================================================//
//============================================================================// //============================================================================//

View File

@@ -726,7 +726,7 @@ public:
TINY_GSM_YIELD(); TINY_GSM_YIELD();
while (stream.available() > 0) { while (stream.available() > 0) {
int a = stream.read(); int a = stream.read();
if (a <= 0) continue; // Skip 0x00 bytes, just in case if (a < 0) continue;
data += (char)a; data += (char)a;
if (r1 && data.endsWith(r1)) { if (r1 && data.endsWith(r1)) {
index = 1; index = 1;