From 9db54a2a51a5389e70790911a9ede7793d58fd4c Mon Sep 17 00:00:00 2001 From: DJ2LS <75909252+DJ2LS@users.noreply.github.com> Date: Sun, 29 Jan 2023 12:26:54 +0100 Subject: [PATCH] introduce IS_CODEC2_SIG_TRAFFIC --- tnc/modem.py | 8 ++++++-- tnc/static.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tnc/modem.py b/tnc/modem.py index 297344bf..9e36ab00 100644 --- a/tnc/modem.py +++ b/tnc/modem.py @@ -447,6 +447,9 @@ class RF: return False static.TRANSMITTING = True + # if we're transmitting FreeDATA signals, reset channel busy state + static.CHANNEL_BUSY = False + start_of_transmission = time.time() # TODO: Moved ptt toggle some steps before audio is ready for testing # Toggle ptt early to save some time and send ptt state via socket @@ -576,6 +579,8 @@ class RF: while self.modoutqueue: threading.Event().wait(0.01) + # if we're transmitting FreeDATA signals, reset channel busy state + static.CHANNEL_BUSY = False static.PTT_STATE = self.hamlib.set_ptt(False) @@ -644,8 +649,7 @@ class RF: rx_status = codec2.api.freedv_get_rx_status(freedv) if rx_status != 0: - # if we're receiving FreeDATA signals, reset channel busy state - static.CHANNEL_BUSY = False + static.IS_CODEC2_SIG_TRAFFIC = True self.log.debug( "[MDM] [demod_audio] modem state", mode=mode_name, rx_status=rx_status, sync_flag=codec2.api.rx_sync_flags_to_text[rx_status] diff --git a/tnc/static.py b/tnc/static.py index 0f22ecea..4e4fe197 100644 --- a/tnc/static.py +++ b/tnc/static.py @@ -134,7 +134,7 @@ INFO: list = [] # ------- CODEC2 SETTINGS TUNING_RANGE_FMIN: float = -50.0 TUNING_RANGE_FMAX: float = 50.0 - +IS_CODEC2_SIG_TRAFFIC: bool = False # true if we have codec2 signalling mode traffic on channel class FRAME_TYPE(Enum): """Lookup for frame types"""