From eb9c1f77865f3543a5b556c49f732c81dbb742af Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Fri, 5 Mar 2021 16:47:09 +0100 Subject: [PATCH] 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 --- src/TinyGsmClientSequansMonarch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TinyGsmClientSequansMonarch.h b/src/TinyGsmClientSequansMonarch.h index 855c166..dc782ee 100644 --- a/src/TinyGsmClientSequansMonarch.h +++ b/src/TinyGsmClientSequansMonarch.h @@ -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));