Browse Source

Leave airplane mode on in disconnect

v_master
Sara Damiano 5 years ago
parent
commit
7087a31e6e
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      src/TinyGsmClientXBee.h

+ 5
- 3
src/TinyGsmClientXBee.h View File

@ -767,6 +767,8 @@ public:
XBEE_COMMAND_START_DECORATOR(5, false)
sendAT(GF("AN"), apn); // Set the APN
bool success = waitResponse() == 1;
sendAT(GF("AM0")); // Airplane mode off
waitResponse(5000);
writeChanges();
XBEE_COMMAND_END_DECORATOR
return success;
@ -777,9 +779,9 @@ public:
sendAT(GF("AM1")); // Cheating and disconnecting by turning on airplane mode
int8_t res = (1 == waitResponse(5000));
writeChanges();
sendAT(GF("AM0")); // Airplane mode off
waitResponse(5000);
writeChanges();
// sendAT(GF("AM0")); // Airplane mode off
// waitResponse(5000);
// writeChanges();
XBEE_COMMAND_END_DECORATOR
return res;
}


Loading…
Cancel
Save