From 7087a31e6e1852d5e5059f5a524646a7a500bf12 Mon Sep 17 00:00:00 2001 From: Sara Damiano Date: Fri, 6 Sep 2019 15:37:35 -0400 Subject: [PATCH] Leave airplane mode on in disconnect --- src/TinyGsmClientXBee.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/TinyGsmClientXBee.h b/src/TinyGsmClientXBee.h index 15abb59..5052762 100644 --- a/src/TinyGsmClientXBee.h +++ b/src/TinyGsmClientXBee.h @@ -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; }