From 38ce7c5478c611d3454308ec5cdb3abf6f31fc06 Mon Sep 17 00:00:00 2001 From: Sara Damiano Date: Tue, 7 May 2019 16:33:06 -0400 Subject: [PATCH] Check for connection before ublox disconnect - don't want to wait 2 mins --- src/TinyGsmClientUBLOX.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/TinyGsmClientUBLOX.h b/src/TinyGsmClientUBLOX.h index 98d6937..9d938f0 100644 --- a/src/TinyGsmClientUBLOX.h +++ b/src/TinyGsmClientUBLOX.h @@ -782,6 +782,7 @@ protected: bool modemDisconnect(uint8_t mux) { TINY_GSM_YIELD(); + if (!modemGetConnected(mux)) return true; if (isCatM) { // These modems allow a faster "asynchronous" close sendAT(GF("+USOCL="), mux, GF(",1")); int rsp = waitResponse(120000L);