Add TinyGsmCommon

This commit is contained in:
Volodymyr Shymanskyy
2017-01-05 10:38:34 +02:00
parent c1e53e1148
commit 195233fbaf
5 changed files with 65 additions and 79 deletions

View File

@@ -10,12 +10,13 @@
#define TinyWiFiClientESP8266_h
//#define GSM_DEBUG Serial
//#define GSM_USE_HEX
#if !defined(TINY_GSM_RX_BUFFER)
#define TINY_GSM_RX_BUFFER 256
#endif
#include <TinyGsmCommon.h>
#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;
@@ -23,22 +24,6 @@ static const char GSM_ERROR[] TINY_GSM_PROGMEM = "ERROR" GSM_NL;
class TinyGsm
{
#ifdef GSM_DEBUG
template<typename T>
static void DBG(T last) {
GSM_DEBUG.println(last);
}
template<typename T, typename... Args>
static void DBG(T head, Args... tail) {
GSM_DEBUG.print(head);
GSM_DEBUG.print(' ');
DBG(tail...);
}
#else
#define DBG(...)
#endif
public:
TinyGsm(Stream& stream)
: stream(stream)