Browse Source

Added extra "ping" for data to read() of SIM800

v_master
Sara Damiano 6 years ago
parent
commit
0e905afa6e
2 changed files with 10 additions and 0 deletions
  1. +3
    -0
      .gitignore
  2. +7
    -0
      src/TinyGsmClientSIM800.h

+ 3
- 0
.gitignore View File

@ -27,3 +27,6 @@ extras/docs/*
.gcc-flags.json .gcc-flags.json
platformio.ini platformio.ini
lib/readme.txt lib/readme.txt
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json

+ 7
- 0
src/TinyGsmClientSIM800.h View File

@ -144,6 +144,13 @@ public:
continue; continue;
} }
// TODO: Read directly into user buffer? // 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
if (millis() - prev_check > 500) {
got_data = true;
prev_check = millis();
}
at->maintain(); at->maintain();
if (sock_available > 0) { if (sock_available > 0) {
sock_available -= at->modemRead(TinyGsmMin((uint16_t)rx.free(), sock_available), mux); sock_available -= at->modemRead(TinyGsmMin((uint16_t)rx.free(), sock_available), mux);


Loading…
Cancel
Save