diff --git a/library.json b/library.json index 03860e5..77e8412 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "TinyGSM", - "version": "0.3.9", + "version": "0.3.10", "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", "keywords": "GSM, AT commands, AT, SIM800, SIM900, A6, A7, M590, ESP8266, SIM800A, SIM800C, SIM800L, SIM800H, SIM808, SIM868, SIM900A, SIM900D, SIM908, SIM968", "authors": diff --git a/library.properties b/library.properties index 6abf3b8..293e583 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=TinyGSM -version=0.3.9 +version=0.3.10 author=Volodymyr Shymanskyy maintainer=Volodymyr Shymanskyy sentence=A small Arduino library for GPRS modules, that just works. diff --git a/src/TinyGsmClientXBee.h b/src/TinyGsmClientXBee.h index c1c8ff9..447ead2 100644 --- a/src/TinyGsmClientXBee.h +++ b/src/TinyGsmClientXBee.h @@ -635,7 +635,7 @@ fail: if (!writeChanges()) goto fail; exitCommand(); - stream.print(text); + streamWrite(text); stream.write((char)0x0D); // close off with the carriage return return true; @@ -727,6 +727,17 @@ public: /* Utilities */ + template + void streamWrite(T last) { + stream.print(last); + } + + template + void streamWrite(T head, Args... tail) { + stream.print(head); + streamWrite(tail...); + } + void streamClear(void) { TINY_GSM_YIELD(); while (stream.available()) { stream.read(); } @@ -740,7 +751,7 @@ public: // Cannot send anything for 1 "guard time" before entering command mode // Default guard time is 1s, but the init fxn decreases it to 250 ms delay(guardTime); - stream.print(GF("+++")); // enter command mode + streamWrite(GF("+++")); // enter command mode DBG("\r\n+++"); success = (1 == waitResponse(guardTime*2)); triesMade ++; @@ -773,7 +784,7 @@ public: template void sendAT(Args... cmd) { - stream.print("AT", cmd..., GSM_NL); + streamWrite("AT", cmd..., GSM_NL); stream.flush(); TINY_GSM_YIELD(); // DBG("### AT:", cmd...);