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>
This commit is contained in:
Fabrice Fontaine
2021-03-05 16:47:09 +01:00
parent b0e363c536
commit eb9c1f7786

View File

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