Browse Source

Tacked in some maintains to hopefully reduce missed URC's

v_master
Sara Damiano 5 years ago
parent
commit
f7aa4a6c6a
6 changed files with 27 additions and 3 deletions
  1. +4
    -0
      src/TinyGsmClientBG96.h
  2. +5
    -1
      src/TinyGsmClientM95.h
  3. +6
    -1
      src/TinyGsmClientMC60.h
  4. +4
    -0
      src/TinyGsmClientSIM7000.h
  5. +4
    -0
      src/TinyGsmClientSIM800.h
  6. +4
    -1
      src/TinyGsmClientUBLOX.h

+ 4
- 0
src/TinyGsmClientBG96.h View File

@ -638,6 +638,7 @@ protected:
return 0;
}
// TODO: Wait for ACK? AT+QISEND=id,0
maintain(); // look for a very quick response from the remote
return len;
}
@ -656,6 +657,7 @@ protected:
}
waitResponse();
DBG("### READ:", len, "from", mux);
maintain(); // Listen for a close or other URC
return len;
}
@ -672,6 +674,7 @@ protected:
if (!result) {
sockets[mux]->sock_connected = modemGetConnected(mux);
}
maintain(); // Listen for a close or other URC
return result;
}
@ -690,6 +693,7 @@ protected:
int res = stream.readStringUntil(',').toInt(); // socket state
waitResponse();
maintain(); // Listen for a close or other URC
// 0 Initial, 1 Opening, 2 Connected, 3 Listening, 4 Closing
return 2 == res;


+ 5
- 1
src/TinyGsmClientM95.h View File

@ -690,10 +690,11 @@ protected:
}
}
waitResponse(5000L);
maintain(); // look for a very quick response from the remote
// streamSkipUntil(','); // Skip mux
// return stream.readStringUntil('\n').toInt();
return 1;
return len; // TODO
}
size_t modemRead(size_t size, uint8_t mux) {
@ -711,6 +712,7 @@ protected:
}
waitResponse();
DBG("### READ:", len, "from", mux);
maintain(); // Listen for a close or other URC
return len;
}
@ -727,6 +729,7 @@ protected:
if (!result) {
sockets[mux]->sock_connected = modemGetConnected(mux);
}
maintain(); // Listen for a close or other URC
return result;
}
@ -745,6 +748,7 @@ protected:
int res = stream.readStringUntil(',').toInt(); // socket state
waitResponse();
maintain(); // Listen for a close or other URC
// 0 Initial, 1 Opening, 2 Connected, 3 Listening, 4 Closing
return 2 == res;


+ 6
- 1
src/TinyGsmClientMC60.h View File

@ -721,7 +721,9 @@ protected:
// streamSkipUntil(','); // Skip mux
// return stream.readStringUntil('\n').toInt();
return 1;
maintain(); // look for a very quick response from the remote
return len; // TODO
}
size_t modemRead(size_t size, uint8_t mux) {
@ -739,6 +741,7 @@ protected:
}
waitResponse();
DBG("### READ:", len, "from", mux);
maintain(); // Listen for a close or other URC
return len;
}
@ -755,6 +758,7 @@ protected:
if (!result) {
sockets[mux]->sock_connected = modemGetConnected(mux);
}
maintain(); // Listen for a close or other URC
return result;
}
@ -773,6 +777,7 @@ protected:
int res = stream.readStringUntil(',').toInt(); // socket state
waitResponse();
maintain(); // Listen for a close or other URC
// 0 Initial, 1 Opening, 2 Connected, 3 Listening, 4 Closing
return 2 == res;


+ 4
- 0
src/TinyGsmClientSIM7000.h View File

@ -942,6 +942,7 @@ protected:
return 0;
}
streamSkipUntil(','); // Skip mux
maintain(); // look for a very quick response from the remote
return stream.readStringUntil('\n').toInt();
}
@ -984,6 +985,7 @@ protected:
}
waitResponse();
DBG("### READ:", len_confirmed, "from", mux);
maintain(); // Listen for a close or other URC
return len_confirmed;
}
@ -999,6 +1001,7 @@ protected:
if (!result) {
sockets[mux]->sock_connected = modemGetConnected(mux);
}
maintain(); // Listen for a close or other URC
return result;
}
@ -1006,6 +1009,7 @@ protected:
sendAT(GF("+CIPSTATUS="), mux);
int res = waitResponse(GF(",\"CONNECTED\""), GF(",\"CLOSED\""), GF(",\"CLOSING\""), GF(",\"INITIAL\""));
waitResponse();
maintain(); // Listen for a close or other URC
return 1 == res;
}


+ 4
- 0
src/TinyGsmClientSIM800.h View File

@ -864,6 +864,7 @@ protected:
return 0;
}
streamSkipUntil(','); // Skip mux
maintain(); // look for a very quick response from the remote
return stream.readStringUntil('\n').toInt();
}
@ -906,6 +907,7 @@ protected:
}
waitResponse();
DBG("### READ:", len_confirmed, "from", mux);
maintain(); // Listen for a close or other URC
return len_confirmed;
}
@ -921,6 +923,7 @@ protected:
if (!result) {
sockets[mux]->sock_connected = modemGetConnected(mux);
}
maintain(); // Listen for a close or other URC
return result;
}
@ -928,6 +931,7 @@ protected:
sendAT(GF("+CIPSTATUS="), mux);
int res = waitResponse(GF(",\"CONNECTED\""), GF(",\"CLOSED\""), GF(",\"CLOSING\""), GF(",\"INITIAL\""));
waitResponse();
maintain(); // Listen for a close or other URC
return 1 == res;
}


+ 4
- 1
src/TinyGsmClientUBLOX.h View File

@ -808,7 +808,7 @@ protected:
streamSkipUntil(','); // Skip mux
int sent = stream.readStringUntil('\n').toInt();
waitResponse();
maintain(); // look for a very quick response
maintain(); // look for a very quick response from the remote
return sent;
}
@ -830,6 +830,7 @@ protected:
streamSkipUntil('\"');
waitResponse();
DBG("### READ:", len, "from", mux);
maintain(); // Listen for a close or other URC
return len;
}
@ -848,6 +849,7 @@ protected:
if (!result && res != 2 && res != 3) { // Don't check modemGetConnected after an error
sockets[mux]->sock_connected = modemGetConnected(mux);
}
maintain(); // Listen for a close or other URC
return result;
}
@ -873,6 +875,7 @@ protected:
// 9: the socket is in LAST_ACK status
// 10: the socket is in TIME_WAIT status
waitResponse();
maintain(); // Listen for a close or other URC
return (result != 0);
}


Loading…
Cancel
Save