Tacked in some maintains to hopefully reduce missed URC's
This commit is contained in:
@@ -638,6 +638,7 @@ protected:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
// TODO: Wait for ACK? AT+QISEND=id,0
|
// TODO: Wait for ACK? AT+QISEND=id,0
|
||||||
|
maintain(); // look for a very quick response from the remote
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -656,6 +657,7 @@ protected:
|
|||||||
}
|
}
|
||||||
waitResponse();
|
waitResponse();
|
||||||
DBG("### READ:", len, "from", mux);
|
DBG("### READ:", len, "from", mux);
|
||||||
|
maintain(); // Listen for a close or other URC
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -672,6 +674,7 @@ protected:
|
|||||||
if (!result) {
|
if (!result) {
|
||||||
sockets[mux]->sock_connected = modemGetConnected(mux);
|
sockets[mux]->sock_connected = modemGetConnected(mux);
|
||||||
}
|
}
|
||||||
|
maintain(); // Listen for a close or other URC
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -690,6 +693,7 @@ protected:
|
|||||||
int res = stream.readStringUntil(',').toInt(); // socket state
|
int res = stream.readStringUntil(',').toInt(); // socket state
|
||||||
|
|
||||||
waitResponse();
|
waitResponse();
|
||||||
|
maintain(); // Listen for a close or other URC
|
||||||
|
|
||||||
// 0 Initial, 1 Opening, 2 Connected, 3 Listening, 4 Closing
|
// 0 Initial, 1 Opening, 2 Connected, 3 Listening, 4 Closing
|
||||||
return 2 == res;
|
return 2 == res;
|
||||||
|
|||||||
@@ -690,10 +690,11 @@ protected:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
waitResponse(5000L);
|
waitResponse(5000L);
|
||||||
|
maintain(); // look for a very quick response from the remote
|
||||||
|
|
||||||
// streamSkipUntil(','); // Skip mux
|
// streamSkipUntil(','); // Skip mux
|
||||||
// return stream.readStringUntil('\n').toInt();
|
// return stream.readStringUntil('\n').toInt();
|
||||||
return 1;
|
return len; // TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t modemRead(size_t size, uint8_t mux) {
|
size_t modemRead(size_t size, uint8_t mux) {
|
||||||
@@ -711,6 +712,7 @@ protected:
|
|||||||
}
|
}
|
||||||
waitResponse();
|
waitResponse();
|
||||||
DBG("### READ:", len, "from", mux);
|
DBG("### READ:", len, "from", mux);
|
||||||
|
maintain(); // Listen for a close or other URC
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -727,6 +729,7 @@ protected:
|
|||||||
if (!result) {
|
if (!result) {
|
||||||
sockets[mux]->sock_connected = modemGetConnected(mux);
|
sockets[mux]->sock_connected = modemGetConnected(mux);
|
||||||
}
|
}
|
||||||
|
maintain(); // Listen for a close or other URC
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -745,6 +748,7 @@ protected:
|
|||||||
int res = stream.readStringUntil(',').toInt(); // socket state
|
int res = stream.readStringUntil(',').toInt(); // socket state
|
||||||
|
|
||||||
waitResponse();
|
waitResponse();
|
||||||
|
maintain(); // Listen for a close or other URC
|
||||||
|
|
||||||
// 0 Initial, 1 Opening, 2 Connected, 3 Listening, 4 Closing
|
// 0 Initial, 1 Opening, 2 Connected, 3 Listening, 4 Closing
|
||||||
return 2 == res;
|
return 2 == res;
|
||||||
|
|||||||
@@ -721,7 +721,9 @@ protected:
|
|||||||
|
|
||||||
// streamSkipUntil(','); // Skip mux
|
// streamSkipUntil(','); // Skip mux
|
||||||
// return stream.readStringUntil('\n').toInt();
|
// 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) {
|
size_t modemRead(size_t size, uint8_t mux) {
|
||||||
@@ -739,6 +741,7 @@ protected:
|
|||||||
}
|
}
|
||||||
waitResponse();
|
waitResponse();
|
||||||
DBG("### READ:", len, "from", mux);
|
DBG("### READ:", len, "from", mux);
|
||||||
|
maintain(); // Listen for a close or other URC
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -755,6 +758,7 @@ protected:
|
|||||||
if (!result) {
|
if (!result) {
|
||||||
sockets[mux]->sock_connected = modemGetConnected(mux);
|
sockets[mux]->sock_connected = modemGetConnected(mux);
|
||||||
}
|
}
|
||||||
|
maintain(); // Listen for a close or other URC
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -773,6 +777,7 @@ protected:
|
|||||||
int res = stream.readStringUntil(',').toInt(); // socket state
|
int res = stream.readStringUntil(',').toInt(); // socket state
|
||||||
|
|
||||||
waitResponse();
|
waitResponse();
|
||||||
|
maintain(); // Listen for a close or other URC
|
||||||
|
|
||||||
// 0 Initial, 1 Opening, 2 Connected, 3 Listening, 4 Closing
|
// 0 Initial, 1 Opening, 2 Connected, 3 Listening, 4 Closing
|
||||||
return 2 == res;
|
return 2 == res;
|
||||||
|
|||||||
@@ -942,6 +942,7 @@ protected:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
streamSkipUntil(','); // Skip mux
|
streamSkipUntil(','); // Skip mux
|
||||||
|
maintain(); // look for a very quick response from the remote
|
||||||
return stream.readStringUntil('\n').toInt();
|
return stream.readStringUntil('\n').toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -984,6 +985,7 @@ protected:
|
|||||||
}
|
}
|
||||||
waitResponse();
|
waitResponse();
|
||||||
DBG("### READ:", len_confirmed, "from", mux);
|
DBG("### READ:", len_confirmed, "from", mux);
|
||||||
|
maintain(); // Listen for a close or other URC
|
||||||
return len_confirmed;
|
return len_confirmed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -999,6 +1001,7 @@ protected:
|
|||||||
if (!result) {
|
if (!result) {
|
||||||
sockets[mux]->sock_connected = modemGetConnected(mux);
|
sockets[mux]->sock_connected = modemGetConnected(mux);
|
||||||
}
|
}
|
||||||
|
maintain(); // Listen for a close or other URC
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1006,6 +1009,7 @@ protected:
|
|||||||
sendAT(GF("+CIPSTATUS="), mux);
|
sendAT(GF("+CIPSTATUS="), mux);
|
||||||
int res = waitResponse(GF(",\"CONNECTED\""), GF(",\"CLOSED\""), GF(",\"CLOSING\""), GF(",\"INITIAL\""));
|
int res = waitResponse(GF(",\"CONNECTED\""), GF(",\"CLOSED\""), GF(",\"CLOSING\""), GF(",\"INITIAL\""));
|
||||||
waitResponse();
|
waitResponse();
|
||||||
|
maintain(); // Listen for a close or other URC
|
||||||
return 1 == res;
|
return 1 == res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -864,6 +864,7 @@ protected:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
streamSkipUntil(','); // Skip mux
|
streamSkipUntil(','); // Skip mux
|
||||||
|
maintain(); // look for a very quick response from the remote
|
||||||
return stream.readStringUntil('\n').toInt();
|
return stream.readStringUntil('\n').toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -906,6 +907,7 @@ protected:
|
|||||||
}
|
}
|
||||||
waitResponse();
|
waitResponse();
|
||||||
DBG("### READ:", len_confirmed, "from", mux);
|
DBG("### READ:", len_confirmed, "from", mux);
|
||||||
|
maintain(); // Listen for a close or other URC
|
||||||
return len_confirmed;
|
return len_confirmed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -921,6 +923,7 @@ protected:
|
|||||||
if (!result) {
|
if (!result) {
|
||||||
sockets[mux]->sock_connected = modemGetConnected(mux);
|
sockets[mux]->sock_connected = modemGetConnected(mux);
|
||||||
}
|
}
|
||||||
|
maintain(); // Listen for a close or other URC
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -928,6 +931,7 @@ protected:
|
|||||||
sendAT(GF("+CIPSTATUS="), mux);
|
sendAT(GF("+CIPSTATUS="), mux);
|
||||||
int res = waitResponse(GF(",\"CONNECTED\""), GF(",\"CLOSED\""), GF(",\"CLOSING\""), GF(",\"INITIAL\""));
|
int res = waitResponse(GF(",\"CONNECTED\""), GF(",\"CLOSED\""), GF(",\"CLOSING\""), GF(",\"INITIAL\""));
|
||||||
waitResponse();
|
waitResponse();
|
||||||
|
maintain(); // Listen for a close or other URC
|
||||||
return 1 == res;
|
return 1 == res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -808,7 +808,7 @@ protected:
|
|||||||
streamSkipUntil(','); // Skip mux
|
streamSkipUntil(','); // Skip mux
|
||||||
int sent = stream.readStringUntil('\n').toInt();
|
int sent = stream.readStringUntil('\n').toInt();
|
||||||
waitResponse();
|
waitResponse();
|
||||||
maintain(); // look for a very quick response
|
maintain(); // look for a very quick response from the remote
|
||||||
return sent;
|
return sent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -830,6 +830,7 @@ protected:
|
|||||||
streamSkipUntil('\"');
|
streamSkipUntil('\"');
|
||||||
waitResponse();
|
waitResponse();
|
||||||
DBG("### READ:", len, "from", mux);
|
DBG("### READ:", len, "from", mux);
|
||||||
|
maintain(); // Listen for a close or other URC
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -848,6 +849,7 @@ protected:
|
|||||||
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
|
||||||
sockets[mux]->sock_connected = modemGetConnected(mux);
|
sockets[mux]->sock_connected = modemGetConnected(mux);
|
||||||
}
|
}
|
||||||
|
maintain(); // Listen for a close or other URC
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -873,6 +875,7 @@ protected:
|
|||||||
// 9: the socket is in LAST_ACK status
|
// 9: the socket is in LAST_ACK status
|
||||||
// 10: the socket is in TIME_WAIT status
|
// 10: the socket is in TIME_WAIT status
|
||||||
waitResponse();
|
waitResponse();
|
||||||
|
maintain(); // Listen for a close or other URC
|
||||||
return (result != 0);
|
return (result != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user