Just some debugger changes
This commit is contained in:
@@ -441,6 +441,9 @@ public:
|
|||||||
String r5s(r5); r5s.trim();
|
String r5s(r5); r5s.trim();
|
||||||
DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);*/
|
DBG("### ..:", r1s, ",", r2s, ",", r3s, ",", r4s, ",", r5s);*/
|
||||||
data.reserve(64);
|
data.reserve(64);
|
||||||
|
bool gotData = false;
|
||||||
|
int mux = -1;
|
||||||
|
int len = 0;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
unsigned long startMillis = millis();
|
unsigned long startMillis = millis();
|
||||||
do {
|
do {
|
||||||
@@ -465,22 +468,24 @@ public:
|
|||||||
index = 5;
|
index = 5;
|
||||||
goto finish;
|
goto finish;
|
||||||
} else if (data.endsWith(GF("+CIPRCV:"))) {
|
} else if (data.endsWith(GF("+CIPRCV:"))) {
|
||||||
int mux = streamReadUntil(',').toInt();
|
mux = stream.readStringUntil(',').toInt();
|
||||||
int len = streamReadUntil(',').toInt();
|
data += mux;
|
||||||
if (len > sockets[mux]->rx.free()) {
|
data += (',');
|
||||||
DBG("### Buffer overflow: ", len, "->", sockets[mux]->rx.free());
|
len = stream.readStringUntil(',').toInt();
|
||||||
} else {
|
data += len;
|
||||||
DBG("### Got: ", len, "->", sockets[mux]->rx.free());
|
data += (',');
|
||||||
}
|
gotData = true;
|
||||||
while (len--) {
|
index = 6;
|
||||||
while (!stream.available()) {}
|
goto finish;
|
||||||
sockets[mux]->rx.put(stream.read());
|
|
||||||
}
|
|
||||||
return index;
|
|
||||||
} else if (data.endsWith(GF("+TCPCLOSED:"))) {
|
} else if (data.endsWith(GF("+TCPCLOSED:"))) {
|
||||||
int mux = streamReadUntil(',').toInt();
|
mux = stream.readStringUntil(',').toInt();
|
||||||
streamReadUntil('\n');
|
data += mux;
|
||||||
|
data += (',');
|
||||||
|
String concl = stream.readStringUntil('\n');
|
||||||
|
data += concl;
|
||||||
sockets[mux]->sock_connected = false;
|
sockets[mux]->sock_connected = false;
|
||||||
|
index = 7;
|
||||||
|
goto finish;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (millis() - startMillis < timeout);
|
} while (millis() - startMillis < timeout);
|
||||||
@@ -499,6 +504,23 @@ public:
|
|||||||
DBG(GSM_NL, "<<< ", data);
|
DBG(GSM_NL, "<<< ", data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (gotData) {
|
||||||
|
int len_orig = len;
|
||||||
|
if (len > sockets[mux]->rx.free()) {
|
||||||
|
DBG(GSM_NL, "### Buffer overflow: ", len, "->", sockets[mux]->rx.free());
|
||||||
|
} else {
|
||||||
|
DBG(GSM_NL, "### Got: ", len, "->", sockets[mux]->rx.free());
|
||||||
|
}
|
||||||
|
while (len--) {
|
||||||
|
char c[2] = {0};
|
||||||
|
stream.readBytes(c, 1); // readBytes includes a timeout
|
||||||
|
if(c[0]) sockets[mux]->rx.put(c[0]);
|
||||||
|
// DBG(GSM_NL, c[0], " ", len, " ", stream.available(), " ", sockets[mux]->available());
|
||||||
|
}
|
||||||
|
if (len_orig > sockets[mux]->available()) {
|
||||||
|
DBG(GSM_NL, "### Fewer characters received than expected: ", len_orig, "->", sockets[mux]->available());
|
||||||
|
}
|
||||||
|
}
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -398,8 +398,8 @@ public:
|
|||||||
/*
|
/*
|
||||||
* Messaging functions
|
* Messaging functions
|
||||||
*/
|
*/
|
||||||
bool gprsConnect(const char* apn, const char* user, const char* pwd) {
|
|
||||||
return false;
|
void sendUSSD() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void sendSMS() {
|
void sendSMS() {
|
||||||
|
|||||||
Reference in New Issue
Block a user