From 2992c0b973bef20930611d6ed890e3a7103ec064 Mon Sep 17 00:00:00 2001 From: Sara Damiano Date: Tue, 10 Sep 2019 11:19:33 -0400 Subject: [PATCH] Check for XBee IP in connection status --- src/TinyGsmClientXBee.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/TinyGsmClientXBee.h b/src/TinyGsmClientXBee.h index 320e5e2..9cb31e6 100644 --- a/src/TinyGsmClientXBee.h +++ b/src/TinyGsmClientXBee.h @@ -663,7 +663,16 @@ public: bool isNetworkConnected() { RegStatus s = getRegistrationStatus(); - return (s == REG_OK); + if (s == REG_OK) { + IPAddress ip = localIP(); + if (ip != IPAddress(0, 0, 0, 0)) { + return true; + } else { + return false; + } + } else { + return false; + } } bool waitForNetwork(unsigned long timeout_ms = 60000L) {