From 21f46e9a7fde8fc1ebd18a6bcc12e989bc717189 Mon Sep 17 00:00:00 2001 From: Mashintime Date: Sat, 13 May 2023 09:08:01 -0400 Subject: [PATCH] Fix slot based busy detection --- tnc/modem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tnc/modem.py b/tnc/modem.py index 3acf6d13..ae8db8b8 100644 --- a/tnc/modem.py +++ b/tnc/modem.py @@ -1251,11 +1251,11 @@ class RF: range_end = range[1] # define the area, we are detecting busy state #dfft = dfft[120:176] if TNC.low_bandwidth_mode else dfft[65:231] - dfft = dfft[range_start:range_end] + slotdfft = dfft[range_start:range_end] # Check for signals higher than average by checking for "100" # If we have a signal, increment our channel_busy delay counter # so we have a smoother state toggle - if np.sum(dfft[dfft > avg + 15]) >= 400 and not TNC.transmitting: + if np.sum(slotdfft[slotdfft > avg + 15]) >= 400 and not TNC.transmitting: ModemParam.channel_busy = True ModemParam.channel_busy_slot[slot] = True # Limit delay counter to a maximum of 200. The higher this value,