diff --git a/src/TinyGsmClientBG96.h b/src/TinyGsmClientBG96.h index 3cf0499..991450b 100644 --- a/src/TinyGsmClientBG96.h +++ b/src/TinyGsmClientBG96.h @@ -655,7 +655,7 @@ protected: sockets[mux]->rx.put(c); } waitResponse(); - DBG("### READ:", mux, ",", len); + DBG("### READ:", len, "from", mux); return len; } @@ -666,7 +666,7 @@ protected: streamSkipUntil(','); // Skip total received streamSkipUntil(','); // Skip have read result = stream.readStringUntil('\n').toInt(); - DBG("### STILL:", mux, "has", result); + DBG("### DATA AVAILABLE:", result, "on", mux); waitResponse(); } if (!result) { diff --git a/src/TinyGsmClientM95.h b/src/TinyGsmClientM95.h index 51900a7..c1a7be2 100644 --- a/src/TinyGsmClientM95.h +++ b/src/TinyGsmClientM95.h @@ -710,7 +710,7 @@ protected: sockets[mux]->rx.put(c); } waitResponse(); - DBG("### READ:", mux, ",", len); + DBG("### READ:", len, "from", mux); return len; } @@ -721,7 +721,7 @@ protected: streamSkipUntil(','); // Skip total received streamSkipUntil(','); // Skip have read result = stream.readStringUntil('\n').toInt(); - DBG("### STILL:", mux, "has", result); + DBG("### DATA AVAILABLE:", result, "on", mux); waitResponse(); } if (!result) { diff --git a/src/TinyGsmClientMC60.h b/src/TinyGsmClientMC60.h index d3edba0..8843b4a 100644 --- a/src/TinyGsmClientMC60.h +++ b/src/TinyGsmClientMC60.h @@ -738,7 +738,7 @@ protected: sockets[mux]->rx.put(c); } waitResponse(); - DBG("### READ:", mux, ",", len); + DBG("### READ:", len, "from", mux); return len; } @@ -749,7 +749,7 @@ protected: streamSkipUntil(','); // Skip total received streamSkipUntil(','); // Skip have read result = stream.readStringUntil('\n').toInt(); - DBG("### STILL:", mux, "has", result); + DBG("### DATA AVAILABLE:", result, "on", mux); waitResponse(); } if (!result) { diff --git a/src/TinyGsmClientSIM7000.h b/src/TinyGsmClientSIM7000.h index 78fa5fe..82eae4d 100644 --- a/src/TinyGsmClientSIM7000.h +++ b/src/TinyGsmClientSIM7000.h @@ -983,6 +983,7 @@ protected: sockets[mux]->rx.put(c); } waitResponse(); + DBG("### READ:", len_confirmed, "from", mux); return len_confirmed; } @@ -1065,9 +1066,19 @@ public: sockets[mux]->got_data = true; } data = ""; + DBG("### Got Data:", mux); } else { data += mode; } + } else if (data.endsWith(GF(GSM_NL "+RECEIVE:"))) { + int mux = stream.readStringUntil(',').toInt(); + int len = stream.readStringUntil('\n').toInt(); + if (mux >= 0 && mux < TINY_GSM_MUX_COUNT && sockets[mux]) { + sockets[mux]->got_data = true; + sockets[mux]->sock_available = len; + } + data = ""; + DBG("### Got Data:", len, "on", mux); } else if (data.endsWith(GF("CLOSED" GSM_NL))) { int nl = data.lastIndexOf(GSM_NL, data.length()-8); int coma = data.indexOf(',', nl+2); diff --git a/src/TinyGsmClientSIM800.h b/src/TinyGsmClientSIM800.h index f3edce4..76b9b34 100644 --- a/src/TinyGsmClientSIM800.h +++ b/src/TinyGsmClientSIM800.h @@ -905,6 +905,7 @@ protected: sockets[mux]->rx.put(c); } waitResponse(); + DBG("### READ:", len_confirmed, "from", mux); return len_confirmed; } @@ -987,9 +988,19 @@ public: sockets[mux]->got_data = true; } data = ""; + DBG("### Got Data:", mux); } else { data += mode; } + } else if (data.endsWith(GF(GSM_NL "+RECEIVE:"))) { + int mux = stream.readStringUntil(',').toInt(); + int len = stream.readStringUntil('\n').toInt(); + if (mux >= 0 && mux < TINY_GSM_MUX_COUNT && sockets[mux]) { + sockets[mux]->got_data = true; + sockets[mux]->sock_available = len; + } + data = ""; + DBG("### Got Data:", len, "on", mux); } else if (data.endsWith(GF("CLOSED" GSM_NL))) { int nl = data.lastIndexOf(GSM_NL, data.length()-8); int coma = data.indexOf(',', nl+2); diff --git a/src/TinyGsmClientUBLOX.h b/src/TinyGsmClientUBLOX.h index 4eeadcf..1b08d24 100644 --- a/src/TinyGsmClientUBLOX.h +++ b/src/TinyGsmClientUBLOX.h @@ -829,6 +829,7 @@ protected: } streamSkipUntil('\"'); waitResponse(); + DBG("### READ:", len, "from", mux); return len; } @@ -841,6 +842,7 @@ protected: if (res == 1) { streamSkipUntil(','); // Skip mux result = stream.readStringUntil('\n').toInt(); + DBG("### DATA AVAILABLE:", result, "on", mux); waitResponse(); } if (!result && res != 2 && res != 3) { // Don't check modemGetConnected after an error @@ -925,12 +927,13 @@ public: goto finish; } else if (data.endsWith(GF(GSM_NL "+UUSORD:"))) { int mux = stream.readStringUntil(',').toInt(); - streamSkipUntil('\n'); + int len = stream.readStringUntil('\n').toInt(); if (mux >= 0 && mux < TINY_GSM_MUX_COUNT && sockets[mux]) { sockets[mux]->got_data = true; + sockets[mux]->sock_available = len; } data = ""; - DBG("### Got Data:", mux); + DBG("### Got Data:", len, "on", mux); } else if (data.endsWith(GF(GSM_NL "+UUSOCL:"))) { int mux = stream.readStringUntil('\n').toInt(); if (mux >= 0 && mux < TINY_GSM_MUX_COUNT && sockets[mux]) { diff --git a/src/TinyGsmCommon.h b/src/TinyGsmCommon.h index a8c7be4..7d0db43 100644 --- a/src/TinyGsmCommon.h +++ b/src/TinyGsmCommon.h @@ -10,7 +10,7 @@ #define TinyGsmCommon_h // The current library version number -#define TINYGSM_VERSION "0.6.1" +#define TINYGSM_VERSION "0.6.2" #if defined(SPARK) || defined(PARTICLE) #include "Particle.h"