dxgrid socket command

This commit is contained in:
DJ2LS 2021-05-14 09:01:13 +02:00 committed by GitHub
parent b1b63ce26f
commit e922e3d289
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

11
sock.py
View file

@ -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),