Browse Source

Pull back changes

v_master
Sara Damiano 6 years ago
parent
commit
ea7f69cd05
12 changed files with 55 additions and 54 deletions
  1. +8
    -6
      examples/AllFunctions/AllFunctions.ino
  2. +3
    -3
      library.json
  3. +2
    -2
      library.properties
  4. +4
    -4
      src/TinyGsmClientA6.h
  5. +4
    -4
      src/TinyGsmClientBG96.h
  6. +4
    -4
      src/TinyGsmClientESP8266.h
  7. +4
    -4
      src/TinyGsmClientM590.h
  8. +5
    -5
      src/TinyGsmClientM95.h
  9. +4
    -4
      src/TinyGsmClientMC60.h
  10. +4
    -5
      src/TinyGsmClientSIM800.h
  11. +4
    -4
      src/TinyGsmClientUBLOX.h
  12. +9
    -9
      src/TinyGsmClientXBee.h

+ 8
- 6
examples/AllFunctions/AllFunctions.ino View File

@ -11,15 +11,19 @@
// Select your modem:
#define TINY_GSM_MODEM_SIM800
// #define TINY_GSM_MODEM_SIM808
// #define TINY_GSM_MODEM_SIM900
// #define TINY_GSM_MODEM_SIM808
// #define TINY_GSM_MODEM_SIM868
// #define TINY_GSM_MODEM_UBLOX
// #define TINY_GSM_MODEM_M95
// #define TINY_GSM_MODEM_BG96
// #define TINY_GSM_MODEM_A6
// #define TINY_GSM_MODEM_A7
// #define TINY_GSM_MODEM_M590
// #define TINY_GSM_MODEM_MC60
// #define TINY_GSM_MODEM_MC60E
// #define TINY_GSM_MODEM_ESP8266
// #define TINY_GSM_MODEM_XBEE
// Set serial for debug console (to the Serial Monitor, speed 115200)
#define SerialMon Serial
@ -91,7 +95,7 @@ void loop() {
// To skip it, call init() instead of restart()
DBG("Initializing modem...");
if (!modem.restart()) {
DBG("Failed to restart modem, delayin 10s and retring");
DBG("Failed to restart modem, delaying 10s and retrying");
delay(3000);
// restart autobaud in case GSM just rebooted
TinyGsmAutoBaud(SerialAT,GSM_AUTOBAUD_MIN,GSM_AUTOBAUD_MAX);
@ -103,7 +107,7 @@ void loop() {
DBG("Modem:", modemInfo);
// Unlock your SIM card with a PIN if needed
if ( GSM_PIN && modem.getSimStatus() != 3 ) {
if ( GSM_PIN && modem.getSimStatus() != 3 ) {
modem.simUnlock(GSM_PIN);
}
@ -123,7 +127,6 @@ void loop() {
delay(10000);
return;
}
#endif
bool res = modem.isGprsConnected();
DBG("GPRS status:", res ? "connected" : "not connected");
@ -139,7 +142,6 @@ void loop() {
IPAddress local = modem.localIP();
DBG("Local IP:", local);
#endif
int csq = modem.getSignalQuality();
DBG("Signal quality:", csq);
@ -219,7 +221,7 @@ void loop() {
}
#endif
#if TINY_GSM_POWERDOWN
#if TINY_GSM_POWERDOWN
// Try to power-off (modem may decide to restart automatically)
// To turn off modem completely, please use Reset/Enable pins
modem.poweroff();


+ 3
- 3
library.json View File

@ -1,8 +1,8 @@
{
"name": "TinyGSM",
"version": "0.3.50",
"description": "A small Arduino library for GPRS modules, that just works. Includes examples for Blynk, MQTT, File Download, and Web Client. Supports GSM modules with AT command interface: SIM800, SIM800A, SIM800C, SIM800L, SIM800H, SIM808, SIM868, SIM900, SIM900A, SIM900D, SIM908, SIM968, Quectel M95",
"keywords": "GSM, AT commands, AT, SIM800, SIM900, A6, A7, M590, ESP8266, SIM800A, SIM800C, SIM800L, SIM800H, SIM808, SIM868, SIM900A, SIM900D, SIM908, SIM968, M95",
"version": "0.3.6",
"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":
[
{


+ 2
- 2
library.properties View File

@ -1,9 +1,9 @@
name=TinyGSM
version=0.3.50
version=0.3.6
author=Volodymyr Shymanskyy
maintainer=Volodymyr Shymanskyy
sentence=A small Arduino library for GPRS modules, that just works.
paragraph=Includes examples for Blynk, MQTT, File Download, and Web Client. Supports GSM modules with AT command interface: SIM800, SIM900, A6, A7, M590, ESP8266, SIM800A, SIM800C, SIM800L, SIM800H, SIM808, SIM868, SIM900A, SIM900D, SIM908, SIM968, Quectel M95
paragraph=Includes examples for Blynk, MQTT, File Download, and Web Client. Supports many GSM and wifi modules with AT command interfaces.
category=Communication
url=https://github.com/vshymanskyy/TinyGSM
architectures=*

+ 4
- 4
src/TinyGsmClientA6.h View File

@ -579,7 +579,7 @@ public:
streamWrite("AT", cmd..., GSM_NL);
stream.flush();
TINY_GSM_YIELD();
DBG("### AT:", cmd...);
//DBG("### AT:", cmd...);
}
// TODO: Optimize this!
@ -587,12 +587,12 @@ public:
GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
GsmConstStr r3=NULL, GsmConstStr r4=NULL, GsmConstStr r5=NULL)
{
String r1s(r1); r1s.trim();
/*String r1s(r1); r1s.trim();
String r2s(r2); r2s.trim();
String r3s(r3); r3s.trim();
String r4s(r4); r4s.trim();
String r5s(r5); r5s.trim();
DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);
DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);*/
data.reserve(64);
int index = 0;
unsigned long startMillis = millis();
@ -652,7 +652,7 @@ finish:
}
data = "";
}
DBG('<', index, '>');
//DBG('<', index, '>');
return index;
}


+ 4
- 4
src/TinyGsmClientBG96.h View File

@ -661,7 +661,7 @@ public:
streamWrite("AT", cmd..., GSM_NL);
stream.flush();
TINY_GSM_YIELD();
DBG("### AT:", cmd...);
//DBG("### AT:", cmd...);
}
// TODO: Optimize this!
@ -669,12 +669,12 @@ public:
GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
GsmConstStr r3=NULL, GsmConstStr r4=NULL, GsmConstStr r5=NULL)
{
String r1s(r1); r1s.trim();
/*String r1s(r1); r1s.trim();
String r2s(r2); r2s.trim();
String r3s(r3); r3s.trim();
String r4s(r4); r4s.trim();
String r5s(r5); r5s.trim();
DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);
DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);*/
data.reserve(64);
int index = 0;
unsigned long startMillis = millis();
@ -730,7 +730,7 @@ finish:
}
data = "";
}
DBG('<', index, '>');
//DBG('<', index, '>');
return index;
}


+ 4
- 4
src/TinyGsmClientESP8266.h View File

@ -437,7 +437,7 @@ public:
streamWrite("AT", cmd..., GSM_NL);
stream.flush();
TINY_GSM_YIELD();
DBG("### AT:", cmd...);
//DBG("### AT:", cmd...);
}
// TODO: Optimize this!
@ -445,12 +445,12 @@ public:
GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
GsmConstStr r3=NULL, GsmConstStr r4=NULL, GsmConstStr r5=NULL)
{
String r1s(r1); r1s.trim();
/*String r1s(r1); r1s.trim();
String r2s(r2); r2s.trim();
String r3s(r3); r3s.trim();
String r4s(r4); r4s.trim();
String r5s(r5); r5s.trim();
DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);
DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);*/
data.reserve(64);
int index = 0;
unsigned long startMillis = millis();
@ -512,7 +512,7 @@ finish:
}
data = "";
}
DBG('<', index, '>');
//DBG('<', index, '>');
return index;
}


+ 4
- 4
src/TinyGsmClientM590.h View File

@ -589,7 +589,7 @@ public:
streamWrite("AT", cmd..., GSM_NL);
stream.flush();
TINY_GSM_YIELD();
DBG("### AT:", cmd...);
//DBG("### AT:", cmd...);
}
// TODO: Optimize this!
@ -597,12 +597,12 @@ public:
GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
GsmConstStr r3=NULL, GsmConstStr r4=NULL, GsmConstStr r5=NULL)
{
String r1s(r1); r1s.trim();
/*String r1s(r1); r1s.trim();
String r2s(r2); r2s.trim();
String r3s(r3); r3s.trim();
String r4s(r4); r4s.trim();
String r5s(r5); r5s.trim();
DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);
DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);*/
data.reserve(64);
int index = 0;
unsigned long startMillis = millis();
@ -663,7 +663,7 @@ finish:
}
data = "";
}
DBG('<', index, '>');
//DBG('<', index, '>');
return index;
}


+ 5
- 5
src/TinyGsmClientM95.h View File

@ -1,6 +1,6 @@
/**
* @file TinyGsmClientM95.h
* @author Volodymyr Shymanskyy - Modified by Pacman Pereira
* @author Volodymyr Shymanskyy, Pacman Pereira, and Replicade Ltd.
* @license LGPL-3.0
* @copyright Copyright (c) 2016 Volodymyr Shymanskyy, (c)2017 Replicade Ltd. <http://www.replicade.com>
* @date Nov 2016
@ -741,7 +741,7 @@ public:
streamWrite("AT", cmd..., GSM_NL);
stream.flush();
TINY_GSM_YIELD();
DBG("### AT:", cmd...);
//DBG("### AT:", cmd...);
}
// TODO: Optimize this!
@ -749,12 +749,12 @@ public:
GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
GsmConstStr r3=NULL, GsmConstStr r4=NULL, GsmConstStr r5=NULL)
{
String r1s(r1); r1s.trim();
/*String r1s(r1); r1s.trim();
String r2s(r2); r2s.trim();
String r3s(r3); r3s.trim();
String r4s(r4); r4s.trim();
String r5s(r5); r5s.trim();
DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);
DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);*/
data.reserve(64);
int index = 0;
unsigned long startMillis = millis();
@ -807,7 +807,7 @@ finish:
}
data = "";
}
DBG('<', index, '>');
//DBG('<', index, '>');
return index;
}


+ 4
- 4
src/TinyGsmClientMC60.h View File

@ -776,7 +776,7 @@ public:
streamWrite("AT", cmd..., GSM_NL);
stream.flush();
TINY_GSM_YIELD();
DBG("### AT:", cmd...);
//DBG("### AT:", cmd...);
}
// TODO: Optimize this!
@ -784,13 +784,13 @@ public:
GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
GsmConstStr r3=NULL, GsmConstStr r4=NULL, GsmConstStr r5=NULL, GsmConstStr r6=NULL)
{
String r1s(r1); r1s.trim();
/*String r1s(r1); r1s.trim();
String r2s(r2); r2s.trim();
String r3s(r3); r3s.trim();
String r4s(r4); r4s.trim();
String r5s(r5); r5s.trim();
String r6s(r6); r6s.trim();
DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s, ",", r6s);
DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s, ",", r6s);*/
data.reserve(64);
int index = 0;
unsigned long startMillis = millis();
@ -846,7 +846,7 @@ finish:
}
data = "";
}
DBG('<', index, '>');
//DBG('<', index, '>');
return index;
}


+ 4
- 5
src/TinyGsmClientSIM800.h View File

@ -695,7 +695,6 @@ public:
/*
* Battery functions
*/
// Use: float vBatt = modem.getBattVoltage() / 1000.0;
uint16_t getBattVoltage() {
sendAT(GF("+CBC"));
@ -828,7 +827,7 @@ public:
streamWrite("AT", cmd..., GSM_NL);
stream.flush();
TINY_GSM_YIELD();
DBG("### AT:", cmd...);
//DBG("### AT:", cmd...);
}
// TODO: Optimize this!
@ -836,12 +835,12 @@ public:
GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
GsmConstStr r3=NULL, GsmConstStr r4=NULL, GsmConstStr r5=NULL)
{
String r1s(r1); r1s.trim();
/*String r1s(r1); r1s.trim();
String r2s(r2); r2s.trim();
String r3s(r3); r3s.trim();
String r4s(r4); r4s.trim();
String r5s(r5); r5s.trim();
DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);
DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);*/
data.reserve(64);
int index = 0;
unsigned long startMillis = millis();
@ -897,7 +896,7 @@ finish:
}
data = "";
}
DBG('<', index, '>');
//DBG('<', index, '>');
return index;
}


+ 4
- 4
src/TinyGsmClientUBLOX.h View File

@ -653,7 +653,7 @@ public:
streamWrite("AT", cmd..., GSM_NL);
stream.flush();
TINY_GSM_YIELD();
DBG("### AT:", cmd...);
//DBG("### AT:", cmd...);
}
// TODO: Optimize this!
@ -661,12 +661,12 @@ public:
GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
GsmConstStr r3=GFP(GSM_CME_ERROR), GsmConstStr r4=NULL, GsmConstStr r5=NULL)
{
String r1s(r1); r1s.trim();
/*String r1s(r1); r1s.trim();
String r2s(r2); r2s.trim();
String r3s(r3); r3s.trim();
String r4s(r4); r4s.trim();
String r5s(r5); r5s.trim();
DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);
DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);*/
data.reserve(64);
int index = 0;
unsigned long startMillis = millis();
@ -717,7 +717,7 @@ finish:
}
data = "";
}
DBG('<', index, '>');
//DBG('<', index, '>');
return index;
}


+ 9
- 9
src/TinyGsmClientXBee.h View File

@ -724,17 +724,17 @@ public:
Utilities
*/
void streamClear(void) {
TINY_GSM_YIELD();
while (stream.available()) { stream.read(); }
}
void streamClear(void) {
TINY_GSM_YIELD();
while (stream.available()) { stream.read(); }
}
template<typename... Args>
void sendAT(Args... cmd) {
streamWrite("AT", cmd..., GSM_NL);
stream.flush();
TINY_GSM_YIELD();
DBG("### AT:", cmd...);
//DBG("### AT:", cmd...);
}
// TODO: Optimize this!
@ -742,12 +742,12 @@ public:
GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
GsmConstStr r3=NULL, GsmConstStr r4=NULL, GsmConstStr r5=NULL)
{
String r1s(r1); r1s.trim();
/*String r1s(r1); r1s.trim();
String r2s(r2); r2s.trim();
String r3s(r3); r3s.trim();
String r4s(r4); r4s.trim();
String r5s(r5); r5s.trim();
DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);
DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);*/
data.reserve(16); // Should never be getting much here for the XBee
int index = 0;
unsigned long startMillis = millis();
@ -790,10 +790,10 @@ finish:
data.replace(GSM_NL GSM_NL, GSM_NL);
data.replace(GSM_NL, "\r\n ");
if (data.length()) {
DBG("<<< ", data);
// DBG("<<< ", data);
}
}
DBG('<', index, '>');
//DBG('<', index, '>');
return index;
}


Loading…
Cancel
Save