From 9fa5694ab38a3a59fa634e0bef9cf0c0b3e58104 Mon Sep 17 00:00:00 2001 From: SRGDamia1 Date: Wed, 14 Mar 2018 16:30:56 -0400 Subject: [PATCH] Changed waitForNetwork in XBee Want to force the reset for the WifiBee, which tends to be stuck reconnecting --- src/TinyGsmClientXBee.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/TinyGsmClientXBee.h b/src/TinyGsmClientXBee.h index 7e8bfaf..99cb307 100644 --- a/src/TinyGsmClientXBee.h +++ b/src/TinyGsmClientXBee.h @@ -537,20 +537,12 @@ public: } bool waitForNetwork(unsigned long timeout = 60000L) { - commandMode(); for (unsigned long start = millis(); millis() - start < timeout; ) { - sendAT(GF("AI")); - String res = readResponse(); - char buf[3] = {0,}; // Set up buffer for response - res.toCharArray(buf, 3); - int intRes = strtol(buf, 0, 16); - if (intRes == 0) { - exitCommand(); + if (isNetworkConnected()) { return true; } delay(250); } - exitCommand(); return false; }