From afa5d1b38d4ac5748667818a5ce4251371cc1b9a Mon Sep 17 00:00:00 2001 From: Sara Damiano Date: Wed, 17 Jul 2019 10:06:03 -0400 Subject: [PATCH] Minor changes to 5360 --- README.md | 1 + library.json | 2 +- library.properties | 2 +- src/TinyGsmClientSIM5360.h | 22 +++++++++++----------- src/TinyGsmCommon.h | 2 +- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index bc9f0b8..3afadf6 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,7 @@ Primary Author/Contributor |[vshymanskyy](https://github.com/vshymanskyy)|[vsh - Quectel M95 - Quectel MC60 ***(alpha)*** - SIMCom SIM7000 ***(alpha)*** +- SIMCom SIM5360 ***(alpha)*** ### Supported boards/modules - Arduino MKR GSM 1400 diff --git a/library.json b/library.json index 4194086..e922dd0 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "TinyGSM", - "version": "0.9.0", + "version": "0.9.1", "description": "A small Arduino library for GPRS modules, that just works. Includes examples for Blynk, MQTT, File Download, and Web Client. Supports many GSM, LTE, and WiFi modules with AT command interfaces.", "keywords": "GSM, AT commands, AT, SIM800, SIM900, A6, A7, M590, ESP8266, SIM7000, SIM800A, SIM800C, SIM800L, SIM800H, SIM808, SIM868, SIM900A, SIM900D, SIM908, SIM968, M95, MC60, MC60E, BG96, ublox, Quectel, SIMCOM, AI Thinker, LTE, LTE-M", "authors": diff --git a/library.properties b/library.properties index 670a804..0230421 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=TinyGSM -version=0.9.0 +version=0.9.1 author=Volodymyr Shymanskyy maintainer=Volodymyr Shymanskyy sentence=A small Arduino library for GPRS modules, that just works. diff --git a/src/TinyGsmClientSIM5360.h b/src/TinyGsmClientSIM5360.h index c445dc4..f28c91e 100644 --- a/src/TinyGsmClientSIM5360.h +++ b/src/TinyGsmClientSIM5360.h @@ -199,11 +199,7 @@ TINY_GSM_MODEM_GET_INFO_ATI() if (!testAT()) { return false; } - sendAT(GF("+CFUN=0")); - if (waitResponse(10000L) != 1) { - return false; - } - sendAT(GF("+CFUN=1,1")); + sendAT(GF("+REBOOT")); if (waitResponse(10000L) != 1) { return false; } @@ -212,18 +208,23 @@ TINY_GSM_MODEM_GET_INFO_ATI() } bool poweroff() { - sendAT(GF("+CPOF=1")); + sendAT(GF("+CPOF")); return waitResponse() == 1; } bool radioOff() { - sendAT(GF("+CFUN=0")); + sendAT(GF("+CFUN=4")); if (waitResponse(10000L) != 1) { return false; } delay(3000); return true; } + + bool sleepEnable(bool enable = true) { + sendAT(GF("+CSCLK="), enable); + return waitResponse() == 1; + } /* * SIM card functions @@ -761,10 +762,9 @@ TINY_GSM_MODEM_STREAM_UTILITIES() } data = ""; DBG("### Got Data:", len, "on", mux); - } else if (data.endsWith(GF("CLOSED" GSM_NL))) { - int nl = data.lastIndexOf(GSM_NL, data.length()-8); - int coma = data.indexOf(',', nl+2); - int mux = data.substring(nl+2, coma).toInt(); + } else if (data.endsWith(GF("+IPCLOSE:"))) { + int mux = stream.readStringUntil(',').toInt(); + streamSkipUntil('\n'); // Skip the reason code if (mux >= 0 && mux < TINY_GSM_MUX_COUNT && sockets[mux]) { sockets[mux]->sock_connected = false; } diff --git a/src/TinyGsmCommon.h b/src/TinyGsmCommon.h index 0e53688..48ea2ff 100644 --- a/src/TinyGsmCommon.h +++ b/src/TinyGsmCommon.h @@ -10,7 +10,7 @@ #define TinyGsmCommon_h // The current library version number -#define TINYGSM_VERSION "0.9.0" +#define TINYGSM_VERSION "0.9.1" #if defined(SPARK) || defined(PARTICLE) #include "Particle.h"