callsign lookup if not present in frame

This commit is contained in:
DJ2LS 2024-02-08 13:15:46 +01:00
parent e58cc7a073
commit 13e5f98b06
2 changed files with 5 additions and 4 deletions

View file

@ -91,6 +91,7 @@ class FrameHandler():
def add_to_heard_stations(self):
frame = self.details['frame']
print(frame)
if 'origin' not in frame:
return
@ -118,9 +119,6 @@ class FrameHandler():
if 'origin' in self.details['frame']:
event['dxcallsign'] = self.details['frame']['origin']
if 'origin_crc' in self.details['frame']:
event['dxcallsign'] = DatabaseManager(self.event_manager).get_callsign_by_checksum(self.details['frame']['origin_crc'])
return event
def emit_event(self):
@ -149,6 +147,10 @@ class FrameHandler():
self.details['freedv_inst'] = freedv_inst
self.details['bytes_per_frame'] = bytes_per_frame
# look in database for a full callsign if only crc is present
if 'origin' not in frame and 'origin_crc' in frame:
self.details['frame']['origin'] = DatabaseManager(self.event_manager).get_callsign_by_checksum(frame['origin_crc'])
self.log()
self.add_to_heard_stations()
self.add_to_activity_list()

View file

@ -64,7 +64,6 @@ class TestProtocols(unittest.TestCase):
self.shortcutTransmission(event_frame)
self.assertEventReceivedType('PING_ACK')
print("PING/PING ACK CHECK SUCCESSFULLY")
def testCQWithQRV(self):
self.config['MODEM']['respond_to_cq'] = True