Add TinyGsmIpFromString(str)

This commit is contained in:
Volodymyr Shymanskyy
2017-09-27 13:01:15 +03:00
parent a457460e94
commit 8b54123d39
6 changed files with 22 additions and 83 deletions

View File

@@ -292,20 +292,7 @@ public:
}
IPAddress localIP() {
String strIP = getLocalIP();
int Parts[4] = {0,0,0,0};
int Part = 0;
for (uint8_t i=0; i<strIP.length(); i++) {
char c = strIP[i];
if (c == '.') {
Part++;
continue;
}
Parts[Part] *= 10;
Parts[Part] += c - '0';
}
IPAddress res(Parts[0], Parts[1], Parts[2], Parts[3]);
return res;
return TinyGsmIpFromString(getLocalIP());
}
private: