Add getLocalIP()

This commit is contained in:
Volodymyr Shymanskyy
2017-09-11 00:35:05 +03:00
parent 4a86db0745
commit 4d3d017600
2 changed files with 19 additions and 0 deletions

View File

@@ -378,6 +378,8 @@ public:
return waitResponse(60000L) == 1;
}
String getLocalIP() TINY_GSM_ATTR_NOT_IMPLEMENTED;
/*
* Phone Call functions
*/

View File

@@ -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
*/