Browse Source

src/TinyGsmClientSequansMonarch.h: fix connection handling

There is an issue in the handling of +SQNSS answer: the
sock->sock_connected state will always be set to the state of the last
socket. This will prevent any communication.

Fix this issue by checking that muxNo is equal to mux before updating.

Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
dependabot/github_actions/actions/checkout-4
Fabrice Fontaine 4 years ago
parent
commit
eb9c1f7786
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/TinyGsmClientSequansMonarch.h

+ 1
- 1
src/TinyGsmClientSequansMonarch.h View File

@ -597,7 +597,7 @@ class TinyGsmSequansMonarch
// SOCK_INCOMING = 5,
// SOCK_OPENING = 6,
GsmClientSequansMonarch* sock = sockets[mux % TINY_GSM_MUX_COUNT];
if (sock) {
if (sock && muxNo == mux) {
sock->sock_connected = ((status != SOCK_CLOSED) &&
(status != SOCK_INCOMING) &&
(status != SOCK_OPENING));


Loading…
Cancel
Save