Fix IP from string in MC60

Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
This commit is contained in:
Sara Damiano
2021-04-29 12:14:33 -04:00
parent 0094193049
commit 9af0acc18b

View File

@@ -381,7 +381,8 @@ class TinyGsmMC60 : public TinyGsmModem<TinyGsmMC60>,
// If it is a domain name, "AT+QIDNSIP=1" should be executed. // If it is a domain name, "AT+QIDNSIP=1" should be executed.
// "AT+QIDNSIP=0" is for dotted decimal IP address. // "AT+QIDNSIP=0" is for dotted decimal IP address.
IPAddress addr; IPAddress addr;
sendAT(GF("+QIDNSIP="), (addr.fromString(host) ? 0 : 1)); sendAT(GF("+QIDNSIP="),
(TinyGsmIpFromString(host) == IPAddress(0, 0, 0, 0) ? 0 : 1));
if (waitResponse() != 1) { return false; } if (waitResponse() != 1) { return false; }
uint32_t timeout_ms = ((uint32_t)timeout_s) * 1000; uint32_t timeout_ms = ((uint32_t)timeout_s) * 1000;