mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
fixed wrong byte handling in cq
This commit is contained in:
parent
c65ab76ece
commit
d10f4c688b
1 changed files with 10 additions and 5 deletions
|
@ -687,13 +687,16 @@ def received_ping_ack(data_in):
|
||||||
|
|
||||||
async def transmit_cq():
|
async def transmit_cq():
|
||||||
logging.info("CQ CQ CQ")
|
logging.info("CQ CQ CQ")
|
||||||
|
static.MYGRID = b'JN48ea'
|
||||||
|
|
||||||
cq_frame = bytearray(14)
|
cq_frame = bytearray(14)
|
||||||
cq_frame[:1] = bytes([200])
|
cq_frame[:1] = bytes([200])
|
||||||
cq_frame[1:2] = b'\x01'
|
cq_frame[1:2] = b'\x01'
|
||||||
cq_frame[2:3] = static.MYCALLSIGN_CRC8
|
#cq_frame[2:3] = static.MYCALLSIGN_CRC8
|
||||||
cq_frame[3:9] = static.MYCALLSIGN
|
#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):
|
for i in range(0, 3):
|
||||||
|
@ -710,10 +713,12 @@ async def transmit_cq():
|
||||||
def received_cq(data_in):
|
def received_cq(data_in):
|
||||||
static.DXCALLSIGN = b''
|
static.DXCALLSIGN = b''
|
||||||
static.DXCALLSIGN_CRC8 = 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
|
# 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')
|
helpers.add_to_heard_stations(dxcallsign, 'CQ CQ CQ')
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue