Browse Source

(Hopefully) better wait for close on SARA R410

v_master
Sara Damiano 5 years ago
parent
commit
43cd516d1f
4 changed files with 13 additions and 15 deletions
  1. +1
    -1
      src/TinyGsmClientBG96.h
  2. +1
    -1
      src/TinyGsmClientM95.h
  3. +1
    -1
      src/TinyGsmClientMC60.h
  4. +10
    -12
      src/TinyGsmClientUBLOX.h

+ 1
- 1
src/TinyGsmClientBG96.h View File

@ -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) {


+ 1
- 1
src/TinyGsmClientM95.h View File

@ -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) {


+ 1
- 1
src/TinyGsmClientMC60.h View File

@ -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) {


+ 10
- 12
src/TinyGsmClientUBLOX.h View File

@ -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();
// 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.
// After close has completed, the +UUSOCL should appear.
if (at->isCatM) {
DBG("Waiting for +UUSOCL URC on", mux);
for (unsigned long start = millis(); millis() - start < 120000L; ) {
at->maintain();
if (!sock_connected) break;
}
stop();
// 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.
// After close has completed, the +UUSOCL should appear.
if (at->isCatM && sock_connected) {
DBG("Waiting for +UUSOCL URC on", mux);
for (unsigned long start = millis(); millis() - start < 120000L; ) {
at->maintain();
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


Loading…
Cancel
Save