From de4c82c441e6a289c1fa115052bba3670b26cf1d Mon Sep 17 00:00:00 2001 From: DJ2LS Date: Sun, 14 May 2023 09:20:39 +0200 Subject: [PATCH] moved waiting until no codec2 data decoded to socket --- tnc/modem.py | 6 ------ tnc/sock.py | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tnc/modem.py b/tnc/modem.py index 562a571e..5c783228 100644 --- a/tnc/modem.py +++ b/tnc/modem.py @@ -1009,12 +1009,6 @@ class RF: self.log.debug("[MDM] self.modem_transmit_queue", qsize=queuesize) data = self.modem_transmit_queue.get() - # TODO: carefully test this - # avoid sending data while we are receiving codec2 signalling data - interrupt_time = time.time() + 5 - while ModemParam.is_codec2_traffic and time.time() < interrupt_time: - threading.Event().wait(0.01) - # self.log.debug("[MDM] worker_transmit", mode=data[0]) self.transmit( mode=data[0], repeats=data[1], repeat_delay=data[2], frames=data[3] diff --git a/tnc/sock.py b/tnc/sock.py index 39e6dd15..b150df89 100644 --- a/tnc/sock.py +++ b/tnc/sock.py @@ -666,6 +666,12 @@ class ThreadedTCPRequestHandler(socketserver.StreamRequestHandler): # wait some random time helpers.wait(randrange(5, 25, 5) / 10.0) + # TODO: carefully test this + # avoid sending data while we are receiving codec2 signalling data + interrupt_time = time.time() + 5 + while ModemParam.is_codec2_traffic and time.time() < interrupt_time: + threading.Event().wait(0.01) + # we need to warn if already in arq state if ARQ.arq_state: command_response("send_raw", False)