A few debug prints, look for "+RECEIVE" from SIMCOM's
This commit is contained in:
@@ -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) {
|
||||
|
@@ -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) {
|
||||
|
@@ -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) {
|
||||
|
@@ -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);
|
||||
|
@@ -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);
|
||||
|
@@ -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]) {
|
||||
|
@@ -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"
|
||||
|
Reference in New Issue
Block a user