Fix typos, tweak to timeout

This commit is contained in:
Sara Damiano
2019-05-20 13:49:12 -04:00
parent 7f7a7563cf
commit e35e4afce0
13 changed files with 49 additions and 63 deletions

View File

@@ -246,7 +246,7 @@ TINY_GSM_MODEM_GET_OPERATOR_COPS()
* Generic network functions
*/
TINY_GSP_MODEM_GET_CSQ()
TINY_GSM_MODEM_GET_CSQ()
bool isNetworkConnected() {
RegStatus s = getRegistrationStatus();
@@ -473,7 +473,7 @@ public:
Utilities
*/
TINY_GSP_MODEM_STREAM_UTILITIES()
TINY_GSM_MODEM_STREAM_UTILITIES()
// TODO: Optimize this!
uint8_t waitResponse(uint32_t timeout_ms, String& data,
@@ -520,9 +520,7 @@ TINY_GSP_MODEM_STREAM_UTILITIES()
DBG("### Got: ", len, "->", sockets[mux]->rx.free());
}
while (len--) {
uint32_t startMillis = millis();
while (!stream.available() && (millis() - startMillis < sockets[mux]->_timeout)) { TINY_GSM_YIELD(); }
sockets[mux]->rx.put(stream.read());
TINY_GSM_MODEM_STREAM_TO_MUX_FIFO_WITH_DOUBLE_TIMEOUT
}
if (len_orig > sockets[mux]->available()) { // TODO
DBG("### Fewer characters received than expected: ", sockets[mux]->available(), " vs ", len_orig);