From 02c08a71a8e56b7717450146e240068ea0a5bef7 Mon Sep 17 00:00:00 2001 From: DJ2LS <75909252+DJ2LS@users.noreply.github.com> Date: Mon, 5 Dec 2022 15:49:10 +0100 Subject: [PATCH] better logging for modem_error_state --- tnc/data_handler.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/tnc/data_handler.py b/tnc/data_handler.py index db4171e7..02e9985c 100644 --- a/tnc/data_handler.py +++ b/tnc/data_handler.py @@ -2840,17 +2840,28 @@ class DATA: ): return + # 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 ) if ( self.data_channel_last_received + self.time_list[self.speed_level] - <= time.time() or modem.get_modem_error_state() + <= time.time() or modem_error_state ): - self.log.warning( - "[TNC] Frame timeout", - attempt=self.n_retries_per_burst, - max_attempts=self.rx_n_max_retries_per_burst, - speed_level=self.speed_level, - ) + if modem_error_state: + self.log.warning( + "[TNC] Decoding Error", + attempt=self.n_retries_per_burst, + max_attempts=self.rx_n_max_retries_per_burst, + speed_level=self.speed_level, + ) + else: + self.log.warning( + "[TNC] Frame timeout", + attempt=self.n_retries_per_burst, + max_attempts=self.rx_n_max_retries_per_burst, + speed_level=self.speed_level, + ) # reduce speed level if nack counter increased self.frame_received_counter = 0 self.burst_nack_counter += 1