From e922e3d289548c09f4766789019ce6eefc58fde7 Mon Sep 17 00:00:00 2001 From: DJ2LS <75909252+DJ2LS@users.noreply.github.com> Date: Fri, 14 May 2021 09:01:13 +0200 Subject: [PATCH] dxgrid socket command --- sock.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sock.py b/sock.py index f9dc3bf8..71d8926e 100644 --- a/sock.py +++ b/sock.py @@ -140,7 +140,16 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler): static.MYCALLSIGN_CRC8 = helpers.get_crc_8(static.MYCALLSIGN) logging.info("CMD | MYCALLSIGN: " + str(static.MYCALLSIGN)) - + if received_json["command"] == 'SET:MYGRID': + mygrid = received_json["parameter"] + + if bytes(mygrid, encoding) == b'': + self.request.sendall(b'INVALID GRID') + else: + static.MYGRID = bytes(mygrid, encoding) + logging.info("CMD | MYGRID: " + str(static.MYGRID)) + + if received_json["command"] == 'GET:STATION_INFO': output = { "MY_CALLSIGN": str(static.MYCALLSIGN, encoding),