From bcc15287c968e557fc3b28289dee598b44d5596c Mon Sep 17 00:00:00 2001 From: Paul Kronenwetter Date: Mon, 2 May 2022 00:39:27 +0000 Subject: [PATCH] Corrects issue #173 fix I didn't look carefully enough at `helpers.check_callsign` to see that it returns a list. The first element of the list is `True`/`False`. --- tnc/data_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tnc/data_handler.py b/tnc/data_handler.py index b3628a71..c3878fc2 100644 --- a/tnc/data_handler.py +++ b/tnc/data_handler.py @@ -1140,7 +1140,7 @@ class DATA(): Returns: """ # Close the session if the DXCALLSIGN_CRC matches the station in static. - if helpers.check_callsign(static.DXCALLSIGN, bytes(data_in[4:7])): + if helpers.check_callsign(static.DXCALLSIGN, bytes(data_in[4:7]))[0]: static.ARQ_SESSION_STATE = 'disconnected' helpers.add_to_heard_stations(static.DXCALLSIGN,static.DXGRID, 'DATA-CHANNEL', static.SNR, static.FREQ_OFFSET, static.HAMLIB_FREQUENCY) structlog.get_logger("structlog").info("SESSION [" + str(self.mycallsign, 'utf-8') + "]<>[" + str(static.DXCALLSIGN, 'utf-8') + "]", state=static.ARQ_SESSION_STATE) @@ -1187,7 +1187,7 @@ class DATA(): """ # Accept session data if the DXCALLSIGN_CRC matches the station in static. - if helpers.check_callsign(static.DXCALLSIGN, bytes(data_in[4:7])): + if helpers.check_callsign(static.DXCALLSIGN, bytes(data_in[4:7]))[0]: structlog.get_logger("structlog").debug("received session heartbeat") helpers.add_to_heard_stations(static.DXCALLSIGN, static.DXGRID, 'SESSION-HB', static.SNR, static.FREQ_OFFSET, static.HAMLIB_FREQUENCY)