From 2e66d3d836d147e33d3e1680e56fc520fed5875e Mon Sep 17 00:00:00 2001 From: dj2ls Date: Thu, 24 Feb 2022 22:04:38 +0100 Subject: [PATCH] hotfix for callsigns without missing ssid --- gui/package.json | 2 +- tnc/helpers.py | 28 ---------------------------- tnc/main.py | 7 ++++++- 3 files changed, 7 insertions(+), 30 deletions(-) diff --git a/gui/package.json b/gui/package.json index 2fd6eb98..117fdcea 100644 --- a/gui/package.json +++ b/gui/package.json @@ -1,6 +1,6 @@ { "name": "FreeDATA", - "version": "0.0.1-alpha.12", + "version": "v0.0.1-alpha.14", "description": "FreeDATA ", "main": "main.js", "scripts": { diff --git a/tnc/helpers.py b/tnc/helpers.py index 8bea3e28..614ec4a9 100644 --- a/tnc/helpers.py +++ b/tnc/helpers.py @@ -160,31 +160,3 @@ def bytes_to_callsign(bytestring): return bytes(callsign) -''' -def setup_logging(): - """ - Author: DJ2LS - - Set the custom logging format so we can use colors - - # https://stackoverflow.com/questions/384076/how-can-i-color-python-logging-output - # 'DEBUG' : 37, # white - # 'INFO' : 36, # cyan - # 'WARNING' : 33, # yellow - # 'ERROR' : 31, # red - # 'CRITICAL': 41, # white on red bg - - """ - - logging.basicConfig(level=logging.INFO,encoding='utf-8',format='%(asctime)s.%(msecs)03d %(levelname)s:\t%(message)s',datefmt='%H:%M:%S',handlers=[logging.FileHandler("FreeDATA-TNC.log"), logging.StreamHandler()]) - - logging.addLevelName(logging.DEBUG, "\033[1;36m%s\033[1;0m" % logging.getLevelName(logging.DEBUG)) - logging.addLevelName(logging.INFO, "\033[1;37m%s\033[1;0m" % logging.getLevelName(logging.INFO)) - logging.addLevelName(logging.WARNING, "\033[1;33m%s\033[1;0m" % logging.getLevelName(logging.WARNING)) - logging.addLevelName(logging.ERROR, "\033[1;31m%s\033[1;0m" % "FAILED") - #logging.addLevelName( logging.ERROR, "\033[1;31m%s\033[1;0m" % logging.getLevelName(logging.ERROR)) - logging.addLevelName(logging.CRITICAL, "\033[1;41m%s\033[1;0m" % logging.getLevelName(logging.CRITICAL)) - - logging.addLevelName(25, "\033[1;32m%s\033[1;0m" % "SUCCESS") - logging.addLevelName(24, "\033[1;34m%s\033[1;0m" % "DATA") -''' diff --git a/tnc/main.py b/tnc/main.py index 09315284..0210cf4b 100644 --- a/tnc/main.py +++ b/tnc/main.py @@ -60,7 +60,12 @@ if __name__ == '__main__': ARGS = PARSER.parse_args() - static.MYCALLSIGN = bytes(ARGS.mycall, 'utf-8') + # additional step for beeing sure our callsign is correctly + # in case we are not getting a station ssid + # then we are forcing a station ssid = 0 + mycallsign = bytes(ARGS.mycall.upper(), 'utf-8') + mycallsign = helpers.callsign_to_bytes(mycallsign) + static.MYCALLSIGN = helpers.bytes_to_callsign(mycallsign) static.MYCALLSIGN_CRC = helpers.get_crc_16(static.MYCALLSIGN) static.MYGRID = bytes(ARGS.mygrid, 'utf-8')