From 4d3d0176004bcfe17f28f31aa900a02fb7377d43 Mon Sep 17 00:00:00 2001 From: Volodymyr Shymanskyy Date: Mon, 11 Sep 2017 00:35:05 +0300 Subject: [PATCH] Add getLocalIP() --- TinyGsmClientM590.h | 2 ++ TinyGsmClientSIM800.h | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/TinyGsmClientM590.h b/TinyGsmClientM590.h index eda599c..8d090bf 100644 --- a/TinyGsmClientM590.h +++ b/TinyGsmClientM590.h @@ -378,6 +378,8 @@ public: return waitResponse(60000L) == 1; } + String getLocalIP() TINY_GSM_ATTR_NOT_IMPLEMENTED; + /* * Phone Call functions */ diff --git a/TinyGsmClientSIM800.h b/TinyGsmClientSIM800.h index b7328e0..9bd762d 100644 --- a/TinyGsmClientSIM800.h +++ b/TinyGsmClientSIM800.h @@ -163,6 +163,13 @@ public: return sock_connected; } virtual operator bool() { return connected(); } + + /* + * Extended API + */ + + String remoteIP() TINY_GSM_ATTR_NOT_IMPLEMENTED; + private: TinyGsm* at; uint8_t mux; @@ -458,6 +465,16 @@ public: return waitResponse(60000L) == 1; } + String getLocalIP() { + sendAT(GF("+CIFSR;E0")); + String res; + if (waitResponse(10000L, res) != 1) { + return ""; + } + res.trim(); + return res; + } + /* * Phone Call functions */