Browse Source

Keep XBee from thinking no response means connected

v_master
Sara Damiano 5 years ago
parent
commit
19dd23882f
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      src/TinyGsmClientXBee.h

+ 2
- 1
src/TinyGsmClientXBee.h View File

@ -538,7 +538,7 @@ public:
if (beeType == XBEE_UNKNOWN) getSeries(); // Need to know the bee type to interpret response if (beeType == XBEE_UNKNOWN) getSeries(); // Need to know the bee type to interpret response
sendAT(GF("AI")); sendAT(GF("AI"));
int16_t intRes = readResponseInt();
int16_t intRes = readResponseInt(10000L);
RegStatus stat = REG_UNKNOWN; RegStatus stat = REG_UNKNOWN;
switch (beeType){ switch (beeType){
@ -1106,6 +1106,7 @@ finish:
int16_t readResponseInt(uint32_t timeout_ms = 1000) { int16_t readResponseInt(uint32_t timeout_ms = 1000) {
String res = readResponseString(timeout_ms); // it just works better reading a string first String res = readResponseString(timeout_ms); // it just works better reading a string first
if (res == "") res = "FF";
char buf[5] = {0,}; char buf[5] = {0,};
res.toCharArray(buf, 5); res.toCharArray(buf, 5);
int16_t intRes = strtol(buf, 0, 16); int16_t intRes = strtol(buf, 0, 16);


Loading…
Cancel
Save