From cf4b3bf9cd9ec2b16ec4252aaffd3c8515033d85 Mon Sep 17 00:00:00 2001 From: DJ2LS <75909252+DJ2LS@users.noreply.github.com> Date: Sun, 4 Dec 2022 13:01:09 +0100 Subject: [PATCH] first version overriding own callsign ssid --- tnc/sock.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tnc/sock.py b/tnc/sock.py index f4e965a2..bdb5cdd7 100644 --- a/tnc/sock.py +++ b/tnc/sock.py @@ -351,6 +351,15 @@ def process_tnc_commands(data): dxcallsign = received_json["dxcallsign"] + # check if specific callsign is set with different SSID than the TNC is initialized + try: + mycallsign = received_json["parameter"][0]["mycallsign"] + mycallsign = helpers.callsign_to_bytes(mycallsign) + mycallsign = helpers.bytes_to_callsign(mycallsign) + + except Exception: + mycallsign = static.MYCALLSIGN + # additional step for being sure our callsign is correctly # in case we are not getting a station ssid # then we are forcing a station ssid = 0 @@ -370,10 +379,8 @@ def process_tnc_commands(data): # try connecting try: - static.DXCALLSIGN = dxcallsign - static.DXCALLSIGN_CRC = helpers.get_crc_24(static.DXCALLSIGN) - DATA_QUEUE_TRANSMIT.put(["CONNECT", dxcallsign, attempts]) + DATA_QUEUE_TRANSMIT.put(["CONNECT", mycallsign, dxcallsign, attempts]) command_response("connect", True) except Exception as err: command_response("connect", False) @@ -385,7 +392,6 @@ def process_tnc_commands(data): # allow beacon transmission again static.BEACON_PAUSE = False - # allow beacon transmission again static.BEACON_PAUSE = False