From 19dd23882f0e74ab4e075a7fd260dbc2cff84453 Mon Sep 17 00:00:00 2001 From: Sara Damiano Date: Mon, 20 May 2019 14:49:52 -0400 Subject: [PATCH] Keep XBee from thinking no response means connected --- src/TinyGsmClientXBee.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/TinyGsmClientXBee.h b/src/TinyGsmClientXBee.h index c29364f..3a71f8a 100644 --- a/src/TinyGsmClientXBee.h +++ b/src/TinyGsmClientXBee.h @@ -538,7 +538,7 @@ public: if (beeType == XBEE_UNKNOWN) getSeries(); // Need to know the bee type to interpret response sendAT(GF("AI")); - int16_t intRes = readResponseInt(); + int16_t intRes = readResponseInt(10000L); RegStatus stat = REG_UNKNOWN; switch (beeType){ @@ -1106,6 +1106,7 @@ finish: int16_t readResponseInt(uint32_t timeout_ms = 1000) { String res = readResponseString(timeout_ms); // it just works better reading a string first + if (res == "") res = "FF"; char buf[5] = {0,}; res.toCharArray(buf, 5); int16_t intRes = strtol(buf, 0, 16);