Fix ping receive handling

This commit is contained in:
Pedro 2023-11-29 19:09:01 +01:00
parent 06e79e627e
commit bf4855aa63
2 changed files with 19 additions and 15 deletions

View file

@ -40,29 +40,29 @@ class PING(DATA):
snr=snr,
)
self.dxgrid = b'------'
self.dxgrid = ""
helpers.add_to_heard_stations(
origin,
self.dxgrid,
"PING",
snr,
self.modem_frequency_offset,
-999, # TODO we don't have the offset available here yet...
self.states.radio_frequency,
self.states.heard_stations
)
self.send_data_to_socket_queue(
freedata="modem-message",
ping="received",
uuid=str(uuid.uuid4()),
timestamp=int(time.time()),
dxgrid=self.dxgrid,
dxcallsign=origin,
mycallsign=mycallsign,
snr=str(snr),
)
if self.respond_to_call:
self.transmit_ping_ack(snr)
self.event_queue.put({
"freedata": "modem-message",
"ping": "received",
"uuid": str(uuid.uuid4()),
"timestamp": int(time.time()),
"dxgrid": self.dxgrid,
"dxcallsign": origin,
"mycallsign": mycallsign,
"snr": str(snr),
})
self.transmit_ping_ack(snr)
def transmit_ping_ack(self, snr):
"""
@ -70,6 +70,10 @@ class PING(DATA):
transmit a ping ack frame
called by def received_ping
"""
self.log.warning('DATA_HANDLER_PING: REVISE PING ACK!')
return
ping_frame = bytearray(self.length_sig0_frame)
ping_frame[:1] = bytes([FR_TYPE.PING_ACK.value])
ping_frame[1:4] = self.dxcallsign_crc

View file

@ -322,7 +322,7 @@ def check_callsign(callsign: str, crc_to_check: bytes, ssid_list):
if callsign_crc == crc_to_check:
log.debug("[HLP] check_callsign matched:", call_with_ssid=call_with_ssid)
return [True, call_with_ssid]
return [True, call_with_ssid.decode()]
return [False, b'']