diff --git a/TinyGsmClient.h b/TinyGsmClient.h index 80287b2..ed3b88c 100644 --- a/TinyGsmClient.h +++ b/TinyGsmClient.h @@ -22,6 +22,10 @@ #include #include +#ifndef TINY_GSM_YIELD + #define TINY_GSM_YIELD() { delay(0); } +#endif + #if defined(__AVR__) #define TINY_GSM_PROGMEM PROGMEM typedef const __FlashStringHelper* GsmConstStr; @@ -34,7 +38,7 @@ #define GF(x) x #endif -#if defined(TINY_GSM_MODEM_SIM800) || defined(TINY_GSM_MODEM_SIM900) +#if defined(TINY_GSM_MODEM_SIM800) || defined(TINY_GSM_MODEM_SIM900) #include #elif defined(TINY_GSM_MODEM_M590) #include diff --git a/TinyGsmClientM590.h b/TinyGsmClientM590.h index f1b835d..e857d78 100644 --- a/TinyGsmClientM590.h +++ b/TinyGsmClientM590.h @@ -1,52 +1,25 @@ /** - * @file TinyGsmClient.h + * @file TinyGsmClientM590.h * @author Volodymyr Shymanskyy * @license LGPL-3.0 * @copyright Copyright (c) 2016 Volodymyr Shymanskyy * @date Nov 2016 */ -#ifndef TinyGsmClient_h -#define TinyGsmClient_h - -#if defined(SPARK) || defined(PARTICLE) - #include "Particle.h" -#elif defined(ARDUINO) - #if ARDUINO >= 100 - #include "Arduino.h" - #else - #include "WProgram.h" - #endif -#endif - -#include -#include - -#if defined(__AVR__) - #define TINY_GSM_PROGMEM PROGMEM - typedef const __FlashStringHelper* GsmConstStr; - #define GFP(x) (reinterpret_cast(x)) - #define GF(x) F(x) -#else - #define TINY_GSM_PROGMEM - typedef const char* GsmConstStr; - #define GFP(x) x - #define GF(x) x -#endif +#ifndef TinyGsmClientM590_h +#define TinyGsmClientM590_h //#define GSM_DEBUG Serial //#define GSM_USE_HEX -#if !defined(GSM_RX_BUFFER) - #define GSM_RX_BUFFER 256 +#if !defined(TINY_GSM_RX_BUFFER) + #define TINY_GSM_RX_BUFFER 256 #endif #define GSM_NL "\r\n" static const char GSM_OK[] TINY_GSM_PROGMEM = "OK" GSM_NL; static const char GSM_ERROR[] TINY_GSM_PROGMEM = "ERROR" GSM_NL; -#define TINY_GSM_YIELD() delay(0) - enum SimStatus { SIM_ERROR = 0, SIM_READY = 1, @@ -92,7 +65,7 @@ public: class GsmClient : public Client { friend class TinyGsm; - typedef TinyGsmFifo RxFifo; + typedef TinyGsmFifo RxFifo; public: diff --git a/TinyGsmClientSIM800.h b/TinyGsmClientSIM800.h index e8322f0..848ed1a 100644 --- a/TinyGsmClientSIM800.h +++ b/TinyGsmClientSIM800.h @@ -1,38 +1,13 @@ /** - * @file TinyGsmClient.h + * @file TinyGsmClientSIM800.h * @author Volodymyr Shymanskyy * @license LGPL-3.0 * @copyright Copyright (c) 2016 Volodymyr Shymanskyy * @date Nov 2016 */ -#ifndef TinyGsmClient_h -#define TinyGsmClient_h - -#if defined(SPARK) || defined(PARTICLE) - #include "Particle.h" -#elif defined(ARDUINO) - #if ARDUINO >= 100 - #include "Arduino.h" - #else - #include "WProgram.h" - #endif -#endif - -#include -#include - -#if defined(__AVR__) - #define TINY_GSM_PROGMEM PROGMEM - typedef const __FlashStringHelper* GsmConstStr; - #define GFP(x) (reinterpret_cast(x)) - #define GF(x) F(x) -#else - #define TINY_GSM_PROGMEM - typedef const char* GsmConstStr; - #define GFP(x) x - #define GF(x) x -#endif +#ifndef TinyGsmClientSIM800_h +#define TinyGsmClientSIM800_h //#define GSM_DEBUG Serial //#define GSM_USE_HEX @@ -45,8 +20,6 @@ static const char GSM_OK[] TINY_GSM_PROGMEM = "OK" GSM_NL; static const char GSM_ERROR[] TINY_GSM_PROGMEM = "ERROR" GSM_NL; -#define TINY_GSM_YIELD() delay(0) - enum SimStatus { SIM_ERROR = 0, SIM_READY = 1, diff --git a/TinyWiFiClientESP8266.h b/TinyWiFiClientESP8266.h index ad8d8d2..7430cce 100644 --- a/TinyWiFiClientESP8266.h +++ b/TinyWiFiClientESP8266.h @@ -1,38 +1,13 @@ /** - * @file TinyGsmClient.h + * @file TinyWiFiClientESP8266.h * @author Volodymyr Shymanskyy * @license LGPL-3.0 * @copyright Copyright (c) 2016 Volodymyr Shymanskyy * @date Nov 2016 */ -#ifndef TinyGsmClient_h -#define TinyGsmClient_h - -#if defined(SPARK) || defined(PARTICLE) - #include "Particle.h" -#elif defined(ARDUINO) - #if ARDUINO >= 100 - #include "Arduino.h" - #else - #include "WProgram.h" - #endif -#endif - -#include -#include - -#if defined(__AVR__) - #define TINY_GSM_PROGMEM PROGMEM - typedef const __FlashStringHelper* GsmConstStr; - #define GFP(x) (reinterpret_cast(x)) - #define GF(x) F(x) -#else - #define TINY_GSM_PROGMEM - typedef const char* GsmConstStr; - #define GFP(x) x - #define GF(x) x -#endif +#ifndef TinyWiFiClientESP8266_h +#define TinyWiFiClientESP8266_h //#define GSM_DEBUG Serial //#define GSM_USE_HEX @@ -45,8 +20,6 @@ static const char GSM_OK[] TINY_GSM_PROGMEM = "OK" GSM_NL; static const char GSM_ERROR[] TINY_GSM_PROGMEM = "ERROR" GSM_NL; -#define TINY_GSM_YIELD() delay(0) - class TinyGsm {