Browse Source

Add localIP()

v_master
Volodymyr Shymanskyy 7 years ago
parent
commit
5b0e72f6bc
2 changed files with 9 additions and 6 deletions
  1. +3
    -1
      TinyGsmClientM590.h
  2. +6
    -5
      TinyGsmClientSIM800.h

+ 3
- 1
TinyGsmClientM590.h View File

@ -387,6 +387,8 @@ public:
String getLocalIP() TINY_GSM_ATTR_NOT_IMPLEMENTED;
IPAddress localIP() TINY_GSM_ATTR_NOT_IMPLEMENTED;
/*
* Phone Call functions
*/
@ -448,7 +450,7 @@ public:
private:
int modemConnect(const char* host, uint16_t port, uint8_t mux) {
bool modemConnect(const char* host, uint16_t port, uint8_t mux) {
for (int i=0; i<3; i++) { // TODO: no need for loop?
String ip = dnsIpQuery(host);


+ 6
- 5
TinyGsmClientSIM800.h View File

@ -109,7 +109,7 @@ public:
virtual int available() {
TINY_GSM_YIELD();
if (sock_connected && !rx.size()) {
if (!rx.size() && sock_connected) {
// Workaround: sometimes SIM800 forgets to notify about data arrival.
// TODO: Currently we ping the module periodically,
// but maybe there's a better indicator that we need to poll
@ -446,9 +446,7 @@ public:
}
sendAT(GF("+CIFSR;E0"));
String data;
if (waitResponse(10000L, data) != 1) {
data.replace(GSM_NL, "");
if (waitResponse(10000L) != 1) {
return false;
}
@ -475,6 +473,8 @@ public:
return res;
}
IPAddress localIP() TINY_GSM_ATTR_NOT_IMPLEMENTED;
/*
* Phone Call functions
*/
@ -598,7 +598,8 @@ public:
}
private:
int modemConnect(const char* host, uint16_t port, uint8_t mux) {
bool modemConnect(const char* host, uint16_t port, uint8_t mux) {
sendAT(GF("+CIPSTART="), mux, ',', GF("\"TCP"), GF("\",\""), host, GF("\","), port);
int rsp = waitResponse(75000L,
GF("CONNECT OK" GSM_NL),


Loading…
Cancel
Save