From b62aa05dbe465dd01702e505f433c4235f70a69f Mon Sep 17 00:00:00 2001 From: dj2ls Date: Fri, 20 May 2022 14:38:43 +0200 Subject: [PATCH] removed nested state check --- tnc/data_handler.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tnc/data_handler.py b/tnc/data_handler.py index 2e322786..fb8b33c2 100644 --- a/tnc/data_handler.py +++ b/tnc/data_handler.py @@ -1915,10 +1915,9 @@ class DATA: """ # IRS SIDE # TODO: We need to redesign this part for cleaner state handling - if not static.ARQ_STATE or static.ARQ_SESSION_STATE != 'connected' or static.TNC_STATE != 'BUSY' or not self.is_IRS: - # return only if not ARQ STATE and not ARQ SESSION STATE as they are different use cases - if not static.ARQ_STATE and static.ARQ_SESSION_STATE == 'disconnected' or not self.is_IRS: - return + # return only if not ARQ STATE and not ARQ SESSION STATE as they are different use cases + if not static.ARQ_STATE and static.ARQ_SESSION_STATE != 'connected' or not self.is_IRS: + return # 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(): # print((self.data_channel_last_received + self.time_list[self.speed_level])-time.time())