diff --git a/QnetGateway.cpp b/QnetGateway.cpp index 877366f..c7d6ec4 100644 --- a/QnetGateway.cpp +++ b/QnetGateway.cpp @@ -1138,8 +1138,13 @@ void CQnetGateway::ProcessG2(const ssize_t g2buflen, const SDSVT &g2buf, const b } } - lastctrl = (0x3FU & g2buf.ctrl); - Gate2Modem[i].Write(g2buf.title, 27); + if ((lastctrl + 1U) % 21U == (0x3FU & g2buf.ctrl)) { + lastctrl = (0x3FU & g2buf.ctrl); + Gate2Modem[i].Write(g2buf.title, 27); + } else { + if (LOG_DEBUG) + fprintf(stderr, "Warning: Ignoring packet because its ctrl=0x%02uU and lastctrl=0x%02uU\n", g2buf.ctrl, lastctrl); + } /* timeit */ time(&toRptr[i].last_time);