Reverted stop for XBee Wifi
This commit is contained in:
@@ -115,15 +115,19 @@ public:
|
|||||||
return sock_connected;
|
return sock_connected;
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is a hack to shut the socket by setting the timeout to zero and
|
|
||||||
// then sending an empty line to the server.
|
|
||||||
virtual void stop() {
|
virtual void stop() {
|
||||||
at->streamClear(); // Empty anything in the buffer
|
at->streamClear(); // Empty anything in the buffer
|
||||||
at->commandMode();
|
at->commandMode();
|
||||||
// Per documentation: If you change the TM (socket timeout) value while in
|
// For WiFi models, there's no direct way to close the socket. This is a
|
||||||
// Transparent Mode, the current connection is immediately closed.
|
// hack to shut the socket by setting the timeout to zero.
|
||||||
// NOTE: Above applies to all cellular models, uncertain if it applies
|
if (at->beeType == XBEE_S6B_WIFI) {
|
||||||
// to the WiFi models.
|
at->sendAT(GF("TM0")); // Set socket timeout (using Digi default of 10 seconds)
|
||||||
|
at->waitResponse(5000); // This response can be slow
|
||||||
|
at->writeChanges();
|
||||||
|
}
|
||||||
|
// 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("TM64")); // Set socket timeout (using Digi default of 10 seconds)
|
||||||
at->waitResponse(5000); // This response can be slow
|
at->waitResponse(5000); // This response can be slow
|
||||||
at->writeChanges();
|
at->writeChanges();
|
||||||
|
Reference in New Issue
Block a user