From d10f4c688be4ad3270154e461516b6d1698da4af Mon Sep 17 00:00:00 2001 From: DJ2LS <75909252+DJ2LS@users.noreply.github.com> Date: Thu, 13 May 2021 18:50:56 +0200 Subject: [PATCH] fixed wrong byte handling in cq --- data_handler.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/data_handler.py b/data_handler.py index d37724f9..6718398f 100644 --- a/data_handler.py +++ b/data_handler.py @@ -687,13 +687,16 @@ def received_ping_ack(data_in): async def transmit_cq(): logging.info("CQ CQ CQ") + static.MYGRID = b'JN48ea' cq_frame = bytearray(14) cq_frame[:1] = bytes([200]) cq_frame[1:2] = b'\x01' - cq_frame[2:3] = static.MYCALLSIGN_CRC8 - cq_frame[3:9] = static.MYCALLSIGN - + #cq_frame[2:3] = static.MYCALLSIGN_CRC8 + #cq_frame[3:9] = static.MYCALLSIGN + cq_frame[2:8] = static.MYCALLSIGN + cq_frame[8:14] = static.MYGRID + #print(cq_frame) for i in range(0, 3): @@ -710,10 +713,12 @@ async def transmit_cq(): def received_cq(data_in): static.DXCALLSIGN = b'' static.DXCALLSIGN_CRC8 = b'' - logging.info("CQ RCVD [" + str(bytes(data_in[3:9]), 'utf-8') + "] [SNR" + str(static.SNR) + "]") # here we add the received station to the heard stations buffer - dxcallsign = bytes(data_in[3:9]).rstrip(b'\x00') + dxcallsign = bytes(data_in[2:8]).rstrip(b'\x00') + dxgrid = bytes(data_in[8:14]).rstrip(b'\x00') + + logging.info("CQ RCVD [" + str(dxcallsign), 'utf-8') + "]["+str(dxgrid), 'utf-8')+"] [SNR" + str(static.SNR) + "]") helpers.add_to_heard_stations(dxcallsign, 'CQ CQ CQ')