Not always resetting socket timeout on XBee

This commit is contained in:
Sara Damiano
2019-08-28 16:15:09 -04:00
parent 2092163a36
commit 9ea8fd358c
2 changed files with 5 additions and 3 deletions

View File

@@ -131,7 +131,9 @@ public:
// For cellular models, per documentation: If you change the TM (socket
// timeout) value while in Transparent Mode, the current connection is
// immediately closed.
at->sendAT(GF("TM64")); // Set socket timeout (using Digi default of 10 seconds)
at->sendAT(GF("TM")); // Get socket timeout
String timeoutUsed = at->readResponseString(5000L);
at->sendAT(GF("TM"), timeoutUsed); // Re-set socket timeout
at->waitResponse(maxWaitMs); // This response can be slow
at->writeChanges();
at->exitCommand();