(Hopefully) better wait for close on SARA R410
This commit is contained in:
@@ -668,7 +668,7 @@ protected:
|
|||||||
streamSkipUntil(','); // Skip total received
|
streamSkipUntil(','); // Skip total received
|
||||||
streamSkipUntil(','); // Skip have read
|
streamSkipUntil(','); // Skip have read
|
||||||
result = stream.readStringUntil('\n').toInt();
|
result = stream.readStringUntil('\n').toInt();
|
||||||
DBG("### DATA AVAILABLE:", result, "on", mux);
|
if (result) DBG("### DATA AVAILABLE:", result, "on", mux);
|
||||||
waitResponse();
|
waitResponse();
|
||||||
}
|
}
|
||||||
if (!result) {
|
if (!result) {
|
||||||
|
@@ -723,7 +723,7 @@ protected:
|
|||||||
streamSkipUntil(','); // Skip total received
|
streamSkipUntil(','); // Skip total received
|
||||||
streamSkipUntil(','); // Skip have read
|
streamSkipUntil(','); // Skip have read
|
||||||
result = stream.readStringUntil('\n').toInt();
|
result = stream.readStringUntil('\n').toInt();
|
||||||
DBG("### DATA AVAILABLE:", result, "on", mux);
|
if (result) DBG("### DATA AVAILABLE:", result, "on", mux);
|
||||||
waitResponse();
|
waitResponse();
|
||||||
}
|
}
|
||||||
if (!result) {
|
if (!result) {
|
||||||
|
@@ -752,7 +752,7 @@ protected:
|
|||||||
streamSkipUntil(','); // Skip total received
|
streamSkipUntil(','); // Skip total received
|
||||||
streamSkipUntil(','); // Skip have read
|
streamSkipUntil(','); // Skip have read
|
||||||
result = stream.readStringUntil('\n').toInt();
|
result = stream.readStringUntil('\n').toInt();
|
||||||
DBG("### DATA AVAILABLE:", result, "on", mux);
|
if (result) DBG("### DATA AVAILABLE:", result, "on", mux);
|
||||||
waitResponse();
|
waitResponse();
|
||||||
}
|
}
|
||||||
if (!result) {
|
if (!result) {
|
||||||
|
@@ -71,17 +71,15 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
virtual int connect(const char *host, uint16_t port) {
|
virtual int connect(const char *host, uint16_t port) {
|
||||||
if (sock_connected) {
|
stop();
|
||||||
stop();
|
// If we're creating a new connection on the same client, we need to wait
|
||||||
// If we're creating a new connection on the same client, we need to wait
|
// until the async close has finished on Cat-M modems.
|
||||||
// until the async close has finished on Cat-M modems.
|
// After close has completed, the +UUSOCL should appear.
|
||||||
// After close has completed, the +UUSOCL should appear.
|
if (at->isCatM && sock_connected) {
|
||||||
if (at->isCatM) {
|
DBG("Waiting for +UUSOCL URC on", mux);
|
||||||
DBG("Waiting for +UUSOCL URC on", mux);
|
for (unsigned long start = millis(); millis() - start < 120000L; ) {
|
||||||
for (unsigned long start = millis(); millis() - start < 120000L; ) {
|
at->maintain();
|
||||||
at->maintain();
|
if (!sock_connected) break;
|
||||||
if (!sock_connected) break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TINY_GSM_YIELD();
|
TINY_GSM_YIELD();
|
||||||
@@ -844,7 +842,7 @@ protected:
|
|||||||
if (res == 1) {
|
if (res == 1) {
|
||||||
streamSkipUntil(','); // Skip mux
|
streamSkipUntil(','); // Skip mux
|
||||||
result = stream.readStringUntil('\n').toInt();
|
result = stream.readStringUntil('\n').toInt();
|
||||||
DBG("### DATA AVAILABLE:", result, "on", mux);
|
if (result) DBG("### DATA AVAILABLE:", result, "on", mux);
|
||||||
waitResponse();
|
waitResponse();
|
||||||
}
|
}
|
||||||
if (!result && res != 2 && res != 3) { // Don't check modemGetConnected after an error
|
if (!result && res != 2 && res != 3) { // Don't check modemGetConnected after an error
|
||||||
|
Reference in New Issue
Block a user