From 62e8e9340ef352d4778bfe9bb06a319d47eb054b Mon Sep 17 00:00:00 2001 From: Volodymyr Shymanskyy Date: Tue, 6 Dec 2016 21:13:36 +0200 Subject: [PATCH] Fix build --- .travis.yml | 7 +++---- TinyGsmClient.h | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 617ad44..4800059 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,13 +32,12 @@ install: # # Libraries from PlatformIO Library Registry: # - # http://platformio.org/lib/show/415/Blynk - # http://platformio.org/lib/show/419/SimpleTimer # http://platformio.org/lib/show/89/PubSubClient - # http://platformio.org/lib/show/44/Time + # http://platformio.org/lib/show/415/Blynk + # http://platformio.org/lib/show/1202/CRC32 # http://platformio.org/lib/show/1286/StreamDebugger - - platformio lib -g install 415 419 89 44 1286 + - platformio lib -g install 89 415 1202 1286 script: - platformio ci --lib="." $PLATFORMIO_CI_ARGS diff --git a/TinyGsmClient.h b/TinyGsmClient.h index bf87b95..4c92a30 100644 --- a/TinyGsmClient.h +++ b/TinyGsmClient.h @@ -41,8 +41,8 @@ #endif #define GSM_NL "\r\n" -static constexpr char GSM_OK[] GSM_PROGMEM = "OK" GSM_NL; -static constexpr char GSM_ERROR[] GSM_PROGMEM = "ERROR" GSM_NL; +static const char GSM_OK[] GSM_PROGMEM = "OK" GSM_NL; +static const char GSM_ERROR[] GSM_PROGMEM = "ERROR" GSM_NL; class TinyGsmClient : public Client @@ -88,7 +88,7 @@ public: host += ip[2]; host += "."; host += ip[3]; - return modemConnect(host.c_str(), port); + return modemConnect(host.c_str(), port); //TODO: c_str may be missing } virtual void stop() { @@ -276,6 +276,18 @@ public: } } + bool simUnlock(const char *pin) + { + sendAT(F("+CPIN="), pin); + return waitResponse() == 1; + } + + bool simGetCCID() { + sendAT(F("+CCID")); + //TODO... + } + + private: int modemConnect(const char* host, uint16_t port) { sendAT(F("+CIPSTART="), mux, ',', F("\"TCP"), F("\",\""), host, F("\","), port);