FreeDATA/modem/frame_handler_cq.py

24 lines
821 B
Python
Raw Normal View History

import frame_handler_ping
import helpers
import data_frame_factory
2023-12-01 18:54:46 +00:00
import frame_handler
2024-02-18 20:08:14 +00:00
from message_system_db_messages import DatabaseManagerMessages
2023-12-03 14:30:30 +00:00
class CQFrameHandler(frame_handler_ping.PingFrameHandler):
def should_respond(self):
self.logger.debug(f"Respond to CQ: {self.config['MODEM']['respond_to_cq']}")
return self.config['MODEM']['respond_to_cq']
def send_ack(self):
factory = data_frame_factory.DataFrameFactory(self.config)
qrv_frame = factory.build_qrv(
self.details['snr']
)
self.transmit(qrv_frame)
2024-02-18 20:08:14 +00:00
if self.config["MESSAGES"]["enable_auto_repeat"]:
2024-02-18 20:31:08 +00:00
# set message to queued if CQ received
2024-02-18 20:08:14 +00:00
DatabaseManagerMessages(self.event_manager).set_message_to_queued_for_callsign(self.details['frame']["origin"])