mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 10:04:33 +02:00
callsign lookup if not present in frame
This commit is contained in:
parent
e58cc7a073
commit
13e5f98b06
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue