From 9e3e67473a594887e0fa8c8062281d34a785f4dd Mon Sep 17 00:00:00 2001 From: Sara Damiano Date: Fri, 24 May 2019 16:49:05 -0400 Subject: [PATCH] Need to read negative bytes --- src/TinyGsmClientSIM800.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/TinyGsmClientSIM800.h b/src/TinyGsmClientSIM800.h index c62f282..c0252bb 100644 --- a/src/TinyGsmClientSIM800.h +++ b/src/TinyGsmClientSIM800.h @@ -768,8 +768,6 @@ protected: // ^^ Confirmed number of data bytes to be read, which may be less than requested. // 0 indicates that no data can be read. // This is actually be the number of bytes that will be remaining after the read - size_t len_read = 0; - // Attempt to read the full amount we requested, even if that quantity was not confirmed for (size_t i=0; i_timeout)) { TINY_GSM_YIELD(); } char c = stream.read(); #endif - if (c > 0) { - sockets[mux]->rx.put(c); - len_read++; - } + sockets[mux]->rx.put(c); } - DBG("### READ:", len_read, "from", mux); + DBG("### READ:", len_requested, "from", mux); // sockets[mux]->sock_available = modemGetAvailable(mux); sockets[mux]->sock_available = len_confirmed; waitResponse(); - return len_read; + return len_requested; } size_t modemGetAvailable(uint8_t mux) {