Skip to content

Commit

Permalink
Fixed modemGetAvailable() and modemGetConnected() when socket[0] is n…
Browse files Browse the repository at this point in the history
…o connected
  • Loading branch information
Bascy committed Sep 4, 2024
1 parent 851860e commit 422b49a
Show file tree
Hide file tree
Showing 2 changed files with 690 additions and 617 deletions.
9 changes: 7 additions & 2 deletions src/TinyGsmClientSIM7000.h
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,13 @@ class TinyGsmSim7000 : public TinyGsmSim70xx<TinyGsmSim7000>,
}

size_t modemGetAvailable(uint8_t mux) {
if (!sockets[mux]) {
return 0;

// Reset sock_available on all sockets
for (int muxNo = 0; muxNo < TINY_GSM_MUX_COUNT; muxNo++) {
GsmClientSim7000* isock = sockets[muxNo];
if (isock) {
isock->sock_available = 0;
}
}

sendAT(GF("+CIPRXGET=4,"), mux);
Expand Down
Loading

0 comments on commit 422b49a

Please sign in to comment.