mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
possible fix of timeout bug
This commit is contained in:
parent
df52828207
commit
b1f4dadcc6
|
@ -64,6 +64,7 @@ class DATA:
|
||||||
|
|
||||||
self.transmission_uuid = ""
|
self.transmission_uuid = ""
|
||||||
|
|
||||||
|
self.burst_last_received = 0.0 # time of last "live sign" of a burst
|
||||||
self.data_channel_last_received = 0.0 # time of last "live sign" of a frame
|
self.data_channel_last_received = 0.0 # time of last "live sign" of a frame
|
||||||
self.burst_ack_snr = 0 # SNR from received burst ack frames
|
self.burst_ack_snr = 0 # SNR from received burst ack frames
|
||||||
|
|
||||||
|
@ -630,6 +631,7 @@ class DATA:
|
||||||
|
|
||||||
# Update data_channel timestamp
|
# Update data_channel timestamp
|
||||||
self.data_channel_last_received = int(time.time())
|
self.data_channel_last_received = int(time.time())
|
||||||
|
self.burst_last_received = int(time.time())
|
||||||
|
|
||||||
# Extract some important data from the frame
|
# Extract some important data from the frame
|
||||||
# Get sequence number of burst frame
|
# Get sequence number of burst frame
|
||||||
|
@ -3018,10 +3020,13 @@ class DATA:
|
||||||
modem_error_state = modem.get_modem_error_state()
|
modem_error_state = modem.get_modem_error_state()
|
||||||
|
|
||||||
# We want to reach this state only if connected ( == return above not called )
|
# We want to reach this state only if connected ( == return above not called )
|
||||||
if (
|
timeout = self.burst_last_received + self.time_list[self.speed_level]
|
||||||
self.data_channel_last_received + self.time_list[self.speed_level]
|
if timeout <= time.time() or modem_error_state:
|
||||||
<= time.time() or modem_error_state
|
print("timeout----------------")
|
||||||
):
|
print(time.time() - timeout)
|
||||||
|
print(time.time() - (self.burst_last_received + self.time_list[self.speed_level]))
|
||||||
|
|
||||||
|
print("-----------------------")
|
||||||
if modem_error_state:
|
if modem_error_state:
|
||||||
self.log.warning(
|
self.log.warning(
|
||||||
"[TNC] Decoding Error",
|
"[TNC] Decoding Error",
|
||||||
|
@ -3031,11 +3036,15 @@ class DATA:
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self.log.warning(
|
self.log.warning(
|
||||||
"[TNC] Frame timeout",
|
"[TNC] Burst timeout",
|
||||||
attempt=self.n_retries_per_burst,
|
attempt=self.n_retries_per_burst,
|
||||||
max_attempts=self.rx_n_max_retries_per_burst,
|
max_attempts=self.rx_n_max_retries_per_burst,
|
||||||
speed_level=self.speed_level,
|
speed_level=self.speed_level,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# reset self.burst_last_received
|
||||||
|
self.burst_last_received = time.time() + self.time_list[self.speed_level]
|
||||||
|
|
||||||
# reduce speed level if nack counter increased
|
# reduce speed level if nack counter increased
|
||||||
self.frame_received_counter = 0
|
self.frame_received_counter = 0
|
||||||
self.burst_nack_counter += 1
|
self.burst_nack_counter += 1
|
||||||
|
@ -3075,9 +3084,11 @@ class DATA:
|
||||||
> time.time()
|
> time.time()
|
||||||
):
|
):
|
||||||
|
|
||||||
timeleft = (self.data_channel_last_received + self.transmission_timeout) - time.time()
|
timeleft = int((self.data_channel_last_received + self.transmission_timeout) - time.time())
|
||||||
self.log.debug("Time left until timeout", seconds=timeleft)
|
if timeleft % 10 == 0:
|
||||||
threading.Event().wait(5)
|
self.log.debug("Time left until timeout", seconds=timeleft)
|
||||||
|
|
||||||
|
# threading.Event().wait(5)
|
||||||
# print(self.data_channel_last_received + self.transmission_timeout - time.time())
|
# print(self.data_channel_last_received + self.transmission_timeout - time.time())
|
||||||
# pass
|
# pass
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue