Browse Source

Update structure

v_master
Volodymyr Shymanskyy 8 years ago
parent
commit
d8ae72856f
4 changed files with 17 additions and 94 deletions
  1. +5
    -1
      TinyGsmClient.h
  2. +6
    -33
      TinyGsmClientM590.h
  3. +3
    -30
      TinyGsmClientSIM800.h
  4. +3
    -30
      TinyWiFiClientESP8266.h

+ 5
- 1
TinyGsmClient.h View File

@ -22,6 +22,10 @@
#include <Client.h>
#include <TinyGsmFifo.h>
#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 <TinyGsmClientSIM800.h>
#elif defined(TINY_GSM_MODEM_M590)
#include <TinyGsmClientM590.h>


+ 6
- 33
TinyGsmClientM590.h View File

@ -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 <Client.h>
#include <TinyGsmFifo.h>
#if defined(__AVR__)
#define TINY_GSM_PROGMEM PROGMEM
typedef const __FlashStringHelper* GsmConstStr;
#define GFP(x) (reinterpret_cast<GsmConstStr>(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<uint8_t, GSM_RX_BUFFER> RxFifo;
typedef TinyGsmFifo<uint8_t, TINY_GSM_RX_BUFFER> RxFifo;
public:


+ 3
- 30
TinyGsmClientSIM800.h View File

@ -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 <Client.h>
#include <TinyGsmFifo.h>
#if defined(__AVR__)
#define TINY_GSM_PROGMEM PROGMEM
typedef const __FlashStringHelper* GsmConstStr;
#define GFP(x) (reinterpret_cast<GsmConstStr>(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,


+ 3
- 30
TinyWiFiClientESP8266.h View File

@ -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 <Client.h>
#include <TinyGsmFifo.h>
#if defined(__AVR__)
#define TINY_GSM_PROGMEM PROGMEM
typedef const __FlashStringHelper* GsmConstStr;
#define GFP(x) (reinterpret_cast<GsmConstStr>(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
{


Loading…
Cancel
Save