mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
Fix beacon rx handling
This commit is contained in:
parent
6020b69527
commit
06e79e627e
1 changed files with 6 additions and 10 deletions
|
@ -158,7 +158,7 @@ class BROADCAST(DATA):
|
||||||
)
|
)
|
||||||
|
|
||||||
# ----------- BROADCASTS
|
# ----------- BROADCASTS
|
||||||
def received_beacon(self, data_in: bytes, snr) -> None:
|
def received_beacon(self, frame_data, snr) -> None:
|
||||||
"""
|
"""
|
||||||
Called if we received a beacon
|
Called if we received a beacon
|
||||||
Args:
|
Args:
|
||||||
|
@ -166,25 +166,21 @@ class BROADCAST(DATA):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
# here we add the received station to the heard stations buffer
|
# here we add the received station to the heard stations buffer
|
||||||
beacon_callsign = helpers.bytes_to_callsign(bytes(data_in[1:7]))
|
beacon_callsign = frame_data['origin']
|
||||||
self.dxgrid = bytes(helpers.decode_grid(data_in[7:11]), "UTF-8")
|
self.dxgrid = frame_data['gridsquare']
|
||||||
|
|
||||||
self.event_manager.send_custom_event(
|
self.event_manager.send_custom_event(
|
||||||
freedata="modem-message",
|
freedata="modem-message",
|
||||||
beacon="received",
|
beacon="received",
|
||||||
uuid=str(uuid.uuid4()),
|
uuid=str(uuid.uuid4()),
|
||||||
timestamp=int(time.time()),
|
timestamp=int(time.time()),
|
||||||
dxcallsign=str(beacon_callsign, "UTF-8"),
|
dxcallsign=beacon_callsign,
|
||||||
dxgrid=str(self.dxgrid, "UTF-8"),
|
dxgrid=self.dxgrid,
|
||||||
snr=str(snr),
|
snr=str(snr),
|
||||||
)
|
)
|
||||||
|
|
||||||
self.log.info(
|
self.log.info(
|
||||||
"[Modem] BEACON RCVD ["
|
f"[Modem] BEACON RCVD [{beacon_callsign}][{self.dxgrid}]",
|
||||||
+ str(beacon_callsign, "UTF-8")
|
|
||||||
+ "]["
|
|
||||||
+ str(self.dxgrid, "UTF-8")
|
|
||||||
+ "] ",
|
|
||||||
snr=snr,
|
snr=snr,
|
||||||
)
|
)
|
||||||
helpers.add_to_heard_stations(
|
helpers.add_to_heard_stations(
|
||||||
|
|
Loading…
Reference in a new issue