Added flow control timeouts to AX.25 interface and optimised timeouts.

This commit is contained in:
Mark Qvist 2021-09-03 10:56:49 +02:00
parent cd9daaefee
commit 425f0153d0
2 changed files with 13 additions and 10 deletions

View file

@ -60,7 +60,7 @@ class KISSInterface(Interface):
self.packet_queue = []
self.flow_control = flow_control
self.interface_ready = False
self.flow_control_timeout = 10
self.flow_control_timeout = 5
self.flow_control_locked = time.time()
self.preamble = preamble if preamble != None else 350;
@ -259,12 +259,12 @@ class KISSInterface(Interface):
in_frame = False
command = KISS.CMD_UNKNOWN
escape = False
sleep(0.08)
sleep(0.05)
if self.flow_control:
if not self.interface_ready:
if time.time() > self.flow_control_locked + self.flow_control_timeout:
RNS.log("Interface "+str(self)+" is unlocking flow control due to time-out. This should not happen. Your hardware might have missed a flow-control READY command.", RNS.LOG_WARNING)
RNS.log("Interface "+str(self)+" is unlocking flow control due to time-out. This should not happen. Your hardware might have missed a flow-control READY command, or maybe it does not support flow-control.", RNS.LOG_WARNING)
self.process_queue()
if self.beacon_i != None and self.beacon_d != None: