From 943c9a1fdd5ee6fe287b7975983eead8b3a22e2d Mon Sep 17 00:00:00 2001 From: Sara Damiano Date: Mon, 8 Oct 2018 17:56:42 -0400 Subject: [PATCH 1/3] Removed extra check for connection in available. --- src/TinyGsmClientA6.h | 4 ++-- src/TinyGsmClientBG96.h | 2 +- src/TinyGsmClientESP8266.h | 2 +- src/TinyGsmClientM95.h | 2 +- src/TinyGsmClientMC60.h | 2 +- src/TinyGsmClientSIM800.h | 6 +++--- src/TinyGsmClientUBLOX.h | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/TinyGsmClientA6.h b/src/TinyGsmClientA6.h index c254623..e10d495 100644 --- a/src/TinyGsmClientA6.h +++ b/src/TinyGsmClientA6.h @@ -112,7 +112,7 @@ public: virtual int available() { TINY_GSM_YIELD(); - if (!rx.size() && sock_connected) { + if (!rx.size()) { at->maintain(); } return rx.size(); @@ -191,7 +191,7 @@ public: if (waitResponse() != 1) { return false; } - sendAT(GF("+CMEE=0")); // Turn of verbose errors + sendAT(GF("+CMEE=0")); // Turn off verbose errors waitResponse(); sendAT(GF("+CMER=3,0,0,2")); // Set unsolicited result code output destination waitResponse(); diff --git a/src/TinyGsmClientBG96.h b/src/TinyGsmClientBG96.h index efa8d0d..f240e37 100644 --- a/src/TinyGsmClientBG96.h +++ b/src/TinyGsmClientBG96.h @@ -112,7 +112,7 @@ public: virtual int available() { TINY_GSM_YIELD(); - if (!rx.size() && sock_connected) { + if (!rx.size()) { at->maintain(); } return rx.size() + sock_available; diff --git a/src/TinyGsmClientESP8266.h b/src/TinyGsmClientESP8266.h index 6e7fda5..1fb87e6 100644 --- a/src/TinyGsmClientESP8266.h +++ b/src/TinyGsmClientESP8266.h @@ -109,7 +109,7 @@ public: virtual int available() { TINY_GSM_YIELD(); - if (!rx.size() && sock_connected) { + if (!rx.size()) { at->maintain(); } return rx.size(); diff --git a/src/TinyGsmClientM95.h b/src/TinyGsmClientM95.h index 1e132c7..93c9f0d 100644 --- a/src/TinyGsmClientM95.h +++ b/src/TinyGsmClientM95.h @@ -112,7 +112,7 @@ public: virtual int available() { TINY_GSM_YIELD(); - if (!rx.size() && sock_connected) { + if (!rx.size()) { at->maintain(); } return rx.size() + sock_available; diff --git a/src/TinyGsmClientMC60.h b/src/TinyGsmClientMC60.h index fd67780..1c2422e 100644 --- a/src/TinyGsmClientMC60.h +++ b/src/TinyGsmClientMC60.h @@ -116,7 +116,7 @@ public: virtual int available() { TINY_GSM_YIELD(); - if (!rx.size() && sock_connected) { + if (!rx.size()) { at->maintain(); } return rx.size() + sock_available; diff --git a/src/TinyGsmClientSIM800.h b/src/TinyGsmClientSIM800.h index a23ec5a..a0990cc 100644 --- a/src/TinyGsmClientSIM800.h +++ b/src/TinyGsmClientSIM800.h @@ -118,11 +118,11 @@ public: virtual int available() { TINY_GSM_YIELD(); - if (!rx.size() && sock_connected) { + if (!rx.size()) { // Workaround: sometimes SIM800 forgets to notify about data arrival. // TODO: Currently we ping the module periodically, // but maybe there's a better indicator that we need to poll - if (millis() - prev_check > 500) { + if (millis() - prev_check > 250) { got_data = true; prev_check = millis(); } @@ -147,7 +147,7 @@ public: // Workaround: sometimes SIM800 forgets to notify about data arrival. // TODO: Currently we ping the module periodically, // but maybe there's a better indicator that we need to poll - if (millis() - prev_check > 500) { + if (millis() - prev_check > 250) { got_data = true; prev_check = millis(); } diff --git a/src/TinyGsmClientUBLOX.h b/src/TinyGsmClientUBLOX.h index 2a2aa2e..ec58d25 100644 --- a/src/TinyGsmClientUBLOX.h +++ b/src/TinyGsmClientUBLOX.h @@ -110,7 +110,7 @@ public: virtual int available() { TINY_GSM_YIELD(); - if (!rx.size() && sock_connected) { + if (!rx.size()) { at->maintain(); } return rx.size() + sock_available; From 68886a2a27feb24a5c00e15e3753f88d323effa9 Mon Sep 17 00:00:00 2001 From: Sara Damiano Date: Mon, 8 Oct 2018 17:57:56 -0400 Subject: [PATCH 2/3] bump version --- library.json | 2 +- library.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library.json b/library.json index 9044c6a..008659b 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "TinyGSM", - "version": "0.4.4", + "version": "0.4.5", "description": "A small Arduino library for GPRS modules, that just works. Includes examples for Blynk, MQTT, File Download, and Web Client. Supports many GSM and wifi modules with AT command interfaces.", "keywords": "GSM, AT commands, AT, SIM800, SIM900, A6, A7, M590, ESP8266, SIM800A, SIM800C, SIM800L, SIM800H, SIM808, SIM868, SIM900A, SIM900D, SIM908, SIM968, M95, MC60, MC60E, BG96, ublox", "authors": diff --git a/library.properties b/library.properties index 7644cb5..1ee9494 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=TinyGSM -version=0.4.4 +version=0.4.5 author=Volodymyr Shymanskyy maintainer=Volodymyr Shymanskyy sentence=A small Arduino library for GPRS modules, that just works. From 9dee2ede573304175663c758d0caa1077382a78c Mon Sep 17 00:00:00 2001 From: Sara Damiano Date: Mon, 8 Oct 2018 18:00:25 -0400 Subject: [PATCH 3/3] formatting fix --- src/TinyGsmClientSIM800.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/TinyGsmClientSIM800.h b/src/TinyGsmClientSIM800.h index a0990cc..435e88d 100644 --- a/src/TinyGsmClientSIM800.h +++ b/src/TinyGsmClientSIM800.h @@ -147,7 +147,8 @@ public: // Workaround: sometimes SIM800 forgets to notify about data arrival. // TODO: Currently we ping the module periodically, // but maybe there's a better indicator that we need to poll - if (millis() - prev_check > 250) { + if (millis() - prev_check > 250) + { got_data = true; prev_check = millis(); }