mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
respond to CQ and PING if not in ARQ session
This commit is contained in:
parent
363b90da07
commit
b0c0940e5d
|
@ -9,7 +9,8 @@ class CQFrameHandler(frame_handler_ping.PingFrameHandler):
|
||||||
|
|
||||||
def should_respond(self):
|
def should_respond(self):
|
||||||
self.logger.debug(f"Respond to CQ: {self.config['MODEM']['respond_to_cq']}")
|
self.logger.debug(f"Respond to CQ: {self.config['MODEM']['respond_to_cq']}")
|
||||||
return self.config['MODEM']['respond_to_cq']
|
return bool(self.config['MODEM']['respond_to_cq'] and not self.states.getARQ())
|
||||||
|
|
||||||
|
|
||||||
def send_ack(self):
|
def send_ack(self):
|
||||||
factory = data_frame_factory.DataFrameFactory(self.config)
|
factory = data_frame_factory.DataFrameFactory(self.config)
|
||||||
|
|
|
@ -15,15 +15,11 @@ class PingFrameHandler(frame_handler.FrameHandler):
|
||||||
# ft = self.details['frame']['frame_type']
|
# ft = self.details['frame']['frame_type']
|
||||||
# self.logger.info(f"[Modem] {ft} received but not for us.")
|
# self.logger.info(f"[Modem] {ft} received but not for us.")
|
||||||
# return valid
|
# return valid
|
||||||
|
|
||||||
#def should_respond(self):
|
|
||||||
# return self.is_frame_for_me()
|
|
||||||
|
|
||||||
def follow_protocol(self):
|
def follow_protocol(self):
|
||||||
|
if not bool(self.is_frame_for_me() and not self.states.getARQ()):
|
||||||
if not self.should_respond():
|
|
||||||
return
|
return
|
||||||
|
|
||||||
self.logger.debug(
|
self.logger.debug(
|
||||||
f"[Modem] Responding to request from [{self.details['frame']['origin']}]",
|
f"[Modem] Responding to request from [{self.details['frame']['origin']}]",
|
||||||
snr=self.details['snr'],
|
snr=self.details['snr'],
|
||||||
|
|
Loading…
Reference in a new issue