SARA R410 also "forget" to notify about incoming data

This commit is contained in:
Sara Damiano
2019-01-28 15:18:29 -05:00
parent 4225ed7c5e
commit 831171c15c
5 changed files with 50 additions and 10 deletions

View File

@@ -100,6 +100,7 @@ public:
// closes until all data is read from the buffer.
// Doing it this way allows the external mcu to find and get all of the data
// that it wants from the socket even if it was closed externally.
rx.clear();
at->maintain();
while (sock_available > 0) {
sock_available -= at->modemRead(TinyGsmMin((uint16_t)rx.free(), sock_available), mux);
@@ -153,7 +154,6 @@ public:
cnt += chunk;
continue;
}
// TODO: Read directly into user buffer?
// Workaround: sometimes SIM800 forgets to notify about data arrival.
// TODO: Currently we ping the module periodically,
// but maybe there's a better indicator that we need to poll
@@ -162,6 +162,7 @@ public:
prev_check = millis();
}
at->maintain();
// TODO: Read directly into user buffer?
if (sock_available > 0) {
sock_available -= at->modemRead(TinyGsmMin((uint16_t)rx.free(), sock_available), mux);
} else {