From eb61fe52c25a74dd143827b240cc2c574acae195 Mon Sep 17 00:00:00 2001 From: Sara Damiano Date: Fri, 31 May 2019 18:11:06 -0400 Subject: [PATCH] Always read to end of u-blox CMEE error --- src/TinyGsmClientUBLOX.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/TinyGsmClientUBLOX.h b/src/TinyGsmClientUBLOX.h index c82448b..4f61c13 100644 --- a/src/TinyGsmClientUBLOX.h +++ b/src/TinyGsmClientUBLOX.h @@ -646,8 +646,6 @@ protected: result = stream.readStringUntil('\n').toInt(); // if (result) DBG("### DATA AVAILABLE:", result, "on", mux); waitResponse(); - } else if (res == 3) { - streamSkipUntil('\n'); // Skip the error text } if (!result) { sockets[mux]->sock_connected = modemGetConnected(mux); @@ -718,6 +716,9 @@ TINY_GSM_MODEM_STREAM_UTILITIES() goto finish; } else if (r3 && data.endsWith(r3)) { index = 3; + if (r3 == GFP(GSM_CME_ERROR)) { + streamSkipUntil('\n'); // Read out the error + } goto finish; } else if (r4 && data.endsWith(r4)) { index = 4;