Pull back changes
This commit is contained in:
		@@ -11,15 +11,19 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Select your modem:
 | 
					// Select your modem:
 | 
				
			||||||
#define TINY_GSM_MODEM_SIM800
 | 
					#define TINY_GSM_MODEM_SIM800
 | 
				
			||||||
// #define TINY_GSM_MODEM_SIM808
 | 
					 | 
				
			||||||
// #define TINY_GSM_MODEM_SIM900
 | 
					// #define TINY_GSM_MODEM_SIM900
 | 
				
			||||||
 | 
					// #define TINY_GSM_MODEM_SIM808
 | 
				
			||||||
 | 
					// #define TINY_GSM_MODEM_SIM868
 | 
				
			||||||
// #define TINY_GSM_MODEM_UBLOX
 | 
					// #define TINY_GSM_MODEM_UBLOX
 | 
				
			||||||
 | 
					// #define TINY_GSM_MODEM_M95
 | 
				
			||||||
// #define TINY_GSM_MODEM_BG96
 | 
					// #define TINY_GSM_MODEM_BG96
 | 
				
			||||||
// #define TINY_GSM_MODEM_A6
 | 
					// #define TINY_GSM_MODEM_A6
 | 
				
			||||||
// #define TINY_GSM_MODEM_A7
 | 
					// #define TINY_GSM_MODEM_A7
 | 
				
			||||||
// #define TINY_GSM_MODEM_M590
 | 
					// #define TINY_GSM_MODEM_M590
 | 
				
			||||||
// #define TINY_GSM_MODEM_MC60
 | 
					// #define TINY_GSM_MODEM_MC60
 | 
				
			||||||
// #define TINY_GSM_MODEM_MC60E
 | 
					// #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)
 | 
					// Set serial for debug console (to the Serial Monitor, speed 115200)
 | 
				
			||||||
#define SerialMon Serial
 | 
					#define SerialMon Serial
 | 
				
			||||||
@@ -91,7 +95,7 @@ void loop() {
 | 
				
			|||||||
  // To skip it, call init() instead of restart()
 | 
					  // To skip it, call init() instead of restart()
 | 
				
			||||||
  DBG("Initializing modem...");
 | 
					  DBG("Initializing modem...");
 | 
				
			||||||
  if (!modem.restart()) {
 | 
					  if (!modem.restart()) {
 | 
				
			||||||
    DBG("Failed to restart modem, delayin 10s and retring");
 | 
					    DBG("Failed to restart modem, delaying 10s and retrying");
 | 
				
			||||||
    delay(3000);
 | 
					    delay(3000);
 | 
				
			||||||
    // restart autobaud in case GSM just rebooted
 | 
					    // restart autobaud in case GSM just rebooted
 | 
				
			||||||
    TinyGsmAutoBaud(SerialAT,GSM_AUTOBAUD_MIN,GSM_AUTOBAUD_MAX);
 | 
					    TinyGsmAutoBaud(SerialAT,GSM_AUTOBAUD_MIN,GSM_AUTOBAUD_MAX);
 | 
				
			||||||
@@ -123,7 +127,6 @@ void loop() {
 | 
				
			|||||||
    delay(10000);
 | 
					    delay(10000);
 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  bool res = modem.isGprsConnected();
 | 
					  bool res = modem.isGprsConnected();
 | 
				
			||||||
  DBG("GPRS status:", res ? "connected" : "not connected");
 | 
					  DBG("GPRS status:", res ? "connected" : "not connected");
 | 
				
			||||||
@@ -139,7 +142,6 @@ void loop() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  IPAddress local = modem.localIP();
 | 
					  IPAddress local = modem.localIP();
 | 
				
			||||||
  DBG("Local IP:", local);
 | 
					  DBG("Local IP:", local);
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  int csq = modem.getSignalQuality();
 | 
					  int csq = modem.getSignalQuality();
 | 
				
			||||||
  DBG("Signal quality:", csq);
 | 
					  DBG("Signal quality:", csq);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,8 +1,8 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "TinyGSM",
 | 
					  "name": "TinyGSM",
 | 
				
			||||||
  "version": "0.3.50",
 | 
					  "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 GSM modules with AT command interface: SIM800, SIM800A, SIM800C, SIM800L, SIM800H, SIM808, SIM868, SIM900, SIM900A, SIM900D, SIM908, SIM968, Quectel M95",
 | 
					  "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",
 | 
					  "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":
 | 
					  "authors":
 | 
				
			||||||
  [
 | 
					  [
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,9 +1,9 @@
 | 
				
			|||||||
name=TinyGSM
 | 
					name=TinyGSM
 | 
				
			||||||
version=0.3.50
 | 
					version=0.3.6
 | 
				
			||||||
author=Volodymyr Shymanskyy
 | 
					author=Volodymyr Shymanskyy
 | 
				
			||||||
maintainer=Volodymyr Shymanskyy
 | 
					maintainer=Volodymyr Shymanskyy
 | 
				
			||||||
sentence=A small Arduino library for GPRS modules, that just works.
 | 
					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
 | 
					category=Communication
 | 
				
			||||||
url=https://github.com/vshymanskyy/TinyGSM
 | 
					url=https://github.com/vshymanskyy/TinyGSM
 | 
				
			||||||
architectures=*
 | 
					architectures=*
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -579,7 +579,7 @@ public:
 | 
				
			|||||||
    streamWrite("AT", cmd..., GSM_NL);
 | 
					    streamWrite("AT", cmd..., GSM_NL);
 | 
				
			||||||
    stream.flush();
 | 
					    stream.flush();
 | 
				
			||||||
    TINY_GSM_YIELD();
 | 
					    TINY_GSM_YIELD();
 | 
				
			||||||
    DBG("### AT:", cmd...);
 | 
					    //DBG("### AT:", cmd...);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // TODO: Optimize this!
 | 
					  // TODO: Optimize this!
 | 
				
			||||||
@@ -587,12 +587,12 @@ public:
 | 
				
			|||||||
                       GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
 | 
					                       GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
 | 
				
			||||||
                       GsmConstStr r3=NULL, GsmConstStr r4=NULL, GsmConstStr r5=NULL)
 | 
					                       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 r2s(r2); r2s.trim();
 | 
				
			||||||
    String r3s(r3); r3s.trim();
 | 
					    String r3s(r3); r3s.trim();
 | 
				
			||||||
    String r4s(r4); r4s.trim();
 | 
					    String r4s(r4); r4s.trim();
 | 
				
			||||||
    String r5s(r5); r5s.trim();
 | 
					    String r5s(r5); r5s.trim();
 | 
				
			||||||
    DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);
 | 
					    DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);*/
 | 
				
			||||||
    data.reserve(64);
 | 
					    data.reserve(64);
 | 
				
			||||||
    int index = 0;
 | 
					    int index = 0;
 | 
				
			||||||
    unsigned long startMillis = millis();
 | 
					    unsigned long startMillis = millis();
 | 
				
			||||||
@@ -652,7 +652,7 @@ finish:
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
      data = "";
 | 
					      data = "";
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    DBG('<', index, '>');
 | 
					    //DBG('<', index, '>');
 | 
				
			||||||
    return index;
 | 
					    return index;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -661,7 +661,7 @@ public:
 | 
				
			|||||||
    streamWrite("AT", cmd..., GSM_NL);
 | 
					    streamWrite("AT", cmd..., GSM_NL);
 | 
				
			||||||
    stream.flush();
 | 
					    stream.flush();
 | 
				
			||||||
    TINY_GSM_YIELD();
 | 
					    TINY_GSM_YIELD();
 | 
				
			||||||
    DBG("### AT:", cmd...);
 | 
					    //DBG("### AT:", cmd...);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // TODO: Optimize this!
 | 
					  // TODO: Optimize this!
 | 
				
			||||||
@@ -669,12 +669,12 @@ public:
 | 
				
			|||||||
                       GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
 | 
					                       GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
 | 
				
			||||||
                       GsmConstStr r3=NULL, GsmConstStr r4=NULL, GsmConstStr r5=NULL)
 | 
					                       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 r2s(r2); r2s.trim();
 | 
				
			||||||
    String r3s(r3); r3s.trim();
 | 
					    String r3s(r3); r3s.trim();
 | 
				
			||||||
    String r4s(r4); r4s.trim();
 | 
					    String r4s(r4); r4s.trim();
 | 
				
			||||||
    String r5s(r5); r5s.trim();
 | 
					    String r5s(r5); r5s.trim();
 | 
				
			||||||
    DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);
 | 
					    DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);*/
 | 
				
			||||||
    data.reserve(64);
 | 
					    data.reserve(64);
 | 
				
			||||||
    int index = 0;
 | 
					    int index = 0;
 | 
				
			||||||
    unsigned long startMillis = millis();
 | 
					    unsigned long startMillis = millis();
 | 
				
			||||||
@@ -730,7 +730,7 @@ finish:
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
      data = "";
 | 
					      data = "";
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    DBG('<', index, '>');
 | 
					    //DBG('<', index, '>');
 | 
				
			||||||
    return index;
 | 
					    return index;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -437,7 +437,7 @@ public:
 | 
				
			|||||||
    streamWrite("AT", cmd..., GSM_NL);
 | 
					    streamWrite("AT", cmd..., GSM_NL);
 | 
				
			||||||
    stream.flush();
 | 
					    stream.flush();
 | 
				
			||||||
    TINY_GSM_YIELD();
 | 
					    TINY_GSM_YIELD();
 | 
				
			||||||
    DBG("### AT:", cmd...);
 | 
					    //DBG("### AT:", cmd...);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // TODO: Optimize this!
 | 
					  // TODO: Optimize this!
 | 
				
			||||||
@@ -445,12 +445,12 @@ public:
 | 
				
			|||||||
                       GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
 | 
					                       GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
 | 
				
			||||||
                       GsmConstStr r3=NULL, GsmConstStr r4=NULL, GsmConstStr r5=NULL)
 | 
					                       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 r2s(r2); r2s.trim();
 | 
				
			||||||
    String r3s(r3); r3s.trim();
 | 
					    String r3s(r3); r3s.trim();
 | 
				
			||||||
    String r4s(r4); r4s.trim();
 | 
					    String r4s(r4); r4s.trim();
 | 
				
			||||||
    String r5s(r5); r5s.trim();
 | 
					    String r5s(r5); r5s.trim();
 | 
				
			||||||
    DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);
 | 
					    DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);*/
 | 
				
			||||||
    data.reserve(64);
 | 
					    data.reserve(64);
 | 
				
			||||||
    int index = 0;
 | 
					    int index = 0;
 | 
				
			||||||
    unsigned long startMillis = millis();
 | 
					    unsigned long startMillis = millis();
 | 
				
			||||||
@@ -512,7 +512,7 @@ finish:
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
      data = "";
 | 
					      data = "";
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    DBG('<', index, '>');
 | 
					    //DBG('<', index, '>');
 | 
				
			||||||
    return index;
 | 
					    return index;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -589,7 +589,7 @@ public:
 | 
				
			|||||||
    streamWrite("AT", cmd..., GSM_NL);
 | 
					    streamWrite("AT", cmd..., GSM_NL);
 | 
				
			||||||
    stream.flush();
 | 
					    stream.flush();
 | 
				
			||||||
    TINY_GSM_YIELD();
 | 
					    TINY_GSM_YIELD();
 | 
				
			||||||
    DBG("### AT:", cmd...);
 | 
					    //DBG("### AT:", cmd...);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // TODO: Optimize this!
 | 
					  // TODO: Optimize this!
 | 
				
			||||||
@@ -597,12 +597,12 @@ public:
 | 
				
			|||||||
                       GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
 | 
					                       GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
 | 
				
			||||||
                       GsmConstStr r3=NULL, GsmConstStr r4=NULL, GsmConstStr r5=NULL)
 | 
					                       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 r2s(r2); r2s.trim();
 | 
				
			||||||
    String r3s(r3); r3s.trim();
 | 
					    String r3s(r3); r3s.trim();
 | 
				
			||||||
    String r4s(r4); r4s.trim();
 | 
					    String r4s(r4); r4s.trim();
 | 
				
			||||||
    String r5s(r5); r5s.trim();
 | 
					    String r5s(r5); r5s.trim();
 | 
				
			||||||
    DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);
 | 
					    DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);*/
 | 
				
			||||||
    data.reserve(64);
 | 
					    data.reserve(64);
 | 
				
			||||||
    int index = 0;
 | 
					    int index = 0;
 | 
				
			||||||
    unsigned long startMillis = millis();
 | 
					    unsigned long startMillis = millis();
 | 
				
			||||||
@@ -663,7 +663,7 @@ finish:
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
      data = "";
 | 
					      data = "";
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    DBG('<', index, '>');
 | 
					    //DBG('<', index, '>');
 | 
				
			||||||
    return index;
 | 
					    return index;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
/**
 | 
					/**
 | 
				
			||||||
 * @file       TinyGsmClientM95.h
 | 
					 * @file       TinyGsmClientM95.h
 | 
				
			||||||
 * @author     Volodymyr Shymanskyy - Modified by Pacman Pereira
 | 
					 * @author     Volodymyr Shymanskyy, Pacman Pereira, and Replicade Ltd.
 | 
				
			||||||
 * @license    LGPL-3.0
 | 
					 * @license    LGPL-3.0
 | 
				
			||||||
 * @copyright  Copyright (c) 2016 Volodymyr Shymanskyy, (c)2017 Replicade Ltd. <http://www.replicade.com>
 | 
					 * @copyright  Copyright (c) 2016 Volodymyr Shymanskyy, (c)2017 Replicade Ltd. <http://www.replicade.com>
 | 
				
			||||||
 * @date       Nov 2016
 | 
					 * @date       Nov 2016
 | 
				
			||||||
@@ -741,7 +741,7 @@ public:
 | 
				
			|||||||
    streamWrite("AT", cmd..., GSM_NL);
 | 
					    streamWrite("AT", cmd..., GSM_NL);
 | 
				
			||||||
    stream.flush();
 | 
					    stream.flush();
 | 
				
			||||||
    TINY_GSM_YIELD();
 | 
					    TINY_GSM_YIELD();
 | 
				
			||||||
    DBG("### AT:", cmd...);
 | 
					    //DBG("### AT:", cmd...);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // TODO: Optimize this!
 | 
					  // TODO: Optimize this!
 | 
				
			||||||
@@ -749,12 +749,12 @@ public:
 | 
				
			|||||||
                       GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
 | 
					                       GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
 | 
				
			||||||
                       GsmConstStr r3=NULL, GsmConstStr r4=NULL, GsmConstStr r5=NULL)
 | 
					                       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 r2s(r2); r2s.trim();
 | 
				
			||||||
    String r3s(r3); r3s.trim();
 | 
					    String r3s(r3); r3s.trim();
 | 
				
			||||||
    String r4s(r4); r4s.trim();
 | 
					    String r4s(r4); r4s.trim();
 | 
				
			||||||
    String r5s(r5); r5s.trim();
 | 
					    String r5s(r5); r5s.trim();
 | 
				
			||||||
    DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);
 | 
					    DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);*/
 | 
				
			||||||
    data.reserve(64);
 | 
					    data.reserve(64);
 | 
				
			||||||
    int index = 0;
 | 
					    int index = 0;
 | 
				
			||||||
    unsigned long startMillis = millis();
 | 
					    unsigned long startMillis = millis();
 | 
				
			||||||
@@ -807,7 +807,7 @@ finish:
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
      data = "";
 | 
					      data = "";
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    DBG('<', index, '>');
 | 
					    //DBG('<', index, '>');
 | 
				
			||||||
    return index;
 | 
					    return index;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -776,7 +776,7 @@ public:
 | 
				
			|||||||
    streamWrite("AT", cmd..., GSM_NL);
 | 
					    streamWrite("AT", cmd..., GSM_NL);
 | 
				
			||||||
    stream.flush();
 | 
					    stream.flush();
 | 
				
			||||||
    TINY_GSM_YIELD();
 | 
					    TINY_GSM_YIELD();
 | 
				
			||||||
    DBG("### AT:", cmd...);
 | 
					    //DBG("### AT:", cmd...);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // TODO: Optimize this!
 | 
					  // TODO: Optimize this!
 | 
				
			||||||
@@ -784,13 +784,13 @@ public:
 | 
				
			|||||||
                       GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
 | 
					                       GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
 | 
				
			||||||
                       GsmConstStr r3=NULL, GsmConstStr r4=NULL, GsmConstStr r5=NULL, GsmConstStr r6=NULL)
 | 
					                       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 r2s(r2); r2s.trim();
 | 
				
			||||||
    String r3s(r3); r3s.trim();
 | 
					    String r3s(r3); r3s.trim();
 | 
				
			||||||
    String r4s(r4); r4s.trim();
 | 
					    String r4s(r4); r4s.trim();
 | 
				
			||||||
    String r5s(r5); r5s.trim();
 | 
					    String r5s(r5); r5s.trim();
 | 
				
			||||||
    String r6s(r6); r6s.trim();
 | 
					    String r6s(r6); r6s.trim();
 | 
				
			||||||
    DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s, ",", r6s);
 | 
					    DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s, ",", r6s);*/
 | 
				
			||||||
    data.reserve(64);
 | 
					    data.reserve(64);
 | 
				
			||||||
    int index = 0;
 | 
					    int index = 0;
 | 
				
			||||||
    unsigned long startMillis = millis();
 | 
					    unsigned long startMillis = millis();
 | 
				
			||||||
@@ -846,7 +846,7 @@ finish:
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
      data = "";
 | 
					      data = "";
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    DBG('<', index, '>');
 | 
					    //DBG('<', index, '>');
 | 
				
			||||||
    return index;
 | 
					    return index;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -695,7 +695,6 @@ public:
 | 
				
			|||||||
  /*
 | 
					  /*
 | 
				
			||||||
   * Battery functions
 | 
					   * Battery functions
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
 | 
					 | 
				
			||||||
  // Use: float vBatt = modem.getBattVoltage() / 1000.0;
 | 
					  // Use: float vBatt = modem.getBattVoltage() / 1000.0;
 | 
				
			||||||
  uint16_t getBattVoltage() {
 | 
					  uint16_t getBattVoltage() {
 | 
				
			||||||
    sendAT(GF("+CBC"));
 | 
					    sendAT(GF("+CBC"));
 | 
				
			||||||
@@ -828,7 +827,7 @@ public:
 | 
				
			|||||||
    streamWrite("AT", cmd..., GSM_NL);
 | 
					    streamWrite("AT", cmd..., GSM_NL);
 | 
				
			||||||
    stream.flush();
 | 
					    stream.flush();
 | 
				
			||||||
    TINY_GSM_YIELD();
 | 
					    TINY_GSM_YIELD();
 | 
				
			||||||
    DBG("### AT:", cmd...);
 | 
					    //DBG("### AT:", cmd...);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // TODO: Optimize this!
 | 
					  // TODO: Optimize this!
 | 
				
			||||||
@@ -836,12 +835,12 @@ public:
 | 
				
			|||||||
                       GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
 | 
					                       GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
 | 
				
			||||||
                       GsmConstStr r3=NULL, GsmConstStr r4=NULL, GsmConstStr r5=NULL)
 | 
					                       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 r2s(r2); r2s.trim();
 | 
				
			||||||
    String r3s(r3); r3s.trim();
 | 
					    String r3s(r3); r3s.trim();
 | 
				
			||||||
    String r4s(r4); r4s.trim();
 | 
					    String r4s(r4); r4s.trim();
 | 
				
			||||||
    String r5s(r5); r5s.trim();
 | 
					    String r5s(r5); r5s.trim();
 | 
				
			||||||
    DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);
 | 
					    DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);*/
 | 
				
			||||||
    data.reserve(64);
 | 
					    data.reserve(64);
 | 
				
			||||||
    int index = 0;
 | 
					    int index = 0;
 | 
				
			||||||
    unsigned long startMillis = millis();
 | 
					    unsigned long startMillis = millis();
 | 
				
			||||||
@@ -897,7 +896,7 @@ finish:
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
      data = "";
 | 
					      data = "";
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    DBG('<', index, '>');
 | 
					    //DBG('<', index, '>');
 | 
				
			||||||
    return index;
 | 
					    return index;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -653,7 +653,7 @@ public:
 | 
				
			|||||||
    streamWrite("AT", cmd..., GSM_NL);
 | 
					    streamWrite("AT", cmd..., GSM_NL);
 | 
				
			||||||
    stream.flush();
 | 
					    stream.flush();
 | 
				
			||||||
    TINY_GSM_YIELD();
 | 
					    TINY_GSM_YIELD();
 | 
				
			||||||
    DBG("### AT:", cmd...);
 | 
					    //DBG("### AT:", cmd...);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // TODO: Optimize this!
 | 
					  // TODO: Optimize this!
 | 
				
			||||||
@@ -661,12 +661,12 @@ public:
 | 
				
			|||||||
                       GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
 | 
					                       GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
 | 
				
			||||||
                       GsmConstStr r3=GFP(GSM_CME_ERROR), GsmConstStr r4=NULL, GsmConstStr r5=NULL)
 | 
					                       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 r2s(r2); r2s.trim();
 | 
				
			||||||
    String r3s(r3); r3s.trim();
 | 
					    String r3s(r3); r3s.trim();
 | 
				
			||||||
    String r4s(r4); r4s.trim();
 | 
					    String r4s(r4); r4s.trim();
 | 
				
			||||||
    String r5s(r5); r5s.trim();
 | 
					    String r5s(r5); r5s.trim();
 | 
				
			||||||
    DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);
 | 
					    DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);*/
 | 
				
			||||||
    data.reserve(64);
 | 
					    data.reserve(64);
 | 
				
			||||||
    int index = 0;
 | 
					    int index = 0;
 | 
				
			||||||
    unsigned long startMillis = millis();
 | 
					    unsigned long startMillis = millis();
 | 
				
			||||||
@@ -717,7 +717,7 @@ finish:
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
      data = "";
 | 
					      data = "";
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    DBG('<', index, '>');
 | 
					    //DBG('<', index, '>');
 | 
				
			||||||
    return index;
 | 
					    return index;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -734,7 +734,7 @@ public:
 | 
				
			|||||||
    streamWrite("AT", cmd..., GSM_NL);
 | 
					    streamWrite("AT", cmd..., GSM_NL);
 | 
				
			||||||
    stream.flush();
 | 
					    stream.flush();
 | 
				
			||||||
    TINY_GSM_YIELD();
 | 
					    TINY_GSM_YIELD();
 | 
				
			||||||
    DBG("### AT:", cmd...);
 | 
					    //DBG("### AT:", cmd...);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // TODO: Optimize this!
 | 
					  // TODO: Optimize this!
 | 
				
			||||||
@@ -742,12 +742,12 @@ public:
 | 
				
			|||||||
                       GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
 | 
					                       GsmConstStr r1=GFP(GSM_OK), GsmConstStr r2=GFP(GSM_ERROR),
 | 
				
			||||||
                       GsmConstStr r3=NULL, GsmConstStr r4=NULL, GsmConstStr r5=NULL)
 | 
					                       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 r2s(r2); r2s.trim();
 | 
				
			||||||
    String r3s(r3); r3s.trim();
 | 
					    String r3s(r3); r3s.trim();
 | 
				
			||||||
    String r4s(r4); r4s.trim();
 | 
					    String r4s(r4); r4s.trim();
 | 
				
			||||||
    String r5s(r5); r5s.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
 | 
					    data.reserve(16);  // Should never be getting much here for the XBee
 | 
				
			||||||
    int index = 0;
 | 
					    int index = 0;
 | 
				
			||||||
    unsigned long startMillis = millis();
 | 
					    unsigned long startMillis = millis();
 | 
				
			||||||
@@ -790,10 +790,10 @@ finish:
 | 
				
			|||||||
      data.replace(GSM_NL GSM_NL, GSM_NL);
 | 
					      data.replace(GSM_NL GSM_NL, GSM_NL);
 | 
				
			||||||
      data.replace(GSM_NL, "\r\n    ");
 | 
					      data.replace(GSM_NL, "\r\n    ");
 | 
				
			||||||
      if (data.length()) {
 | 
					      if (data.length()) {
 | 
				
			||||||
        DBG("<<< ", data);
 | 
					        // DBG("<<< ", data);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    DBG('<', index, '>');
 | 
					    //DBG('<', index, '>');
 | 
				
			||||||
    return index;
 | 
					    return index;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user