From cebaf469db51c3feb1f9d3c55a6c5cfcdb638ae3 Mon Sep 17 00:00:00 2001 From: DJ2LS <75909252+DJ2LS@users.noreply.github.com> Date: Wed, 10 Feb 2021 15:04:18 +0100 Subject: [PATCH] improved helpers --- helpers.py | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/helpers.py b/helpers.py index ba1bc704..d2b2d1e3 100644 --- a/helpers.py +++ b/helpers.py @@ -30,10 +30,42 @@ def get_crc_16(data): def arq_ack_timeout(): - static.ARQ_RX_ACK_TIMEOUT = True - #print("ARQ_RX_ACK_TIMEOUT") + if static.ARQ_STATE == 'RECEIVING_SIGNALLING': + static.ARQ_RX_ACK_TIMEOUT = True + print("ARQ_RX_ACK_TIMEOUT") + + def arq_rpt_timeout(): - static.ARQ_RX_RPT_TIMEOUT = True - #print("ARQ_RX_RPT_TIMEOUT") + if static.ARQ_STATE == 'RECEIVING_SIGNALLING': + static.ARQ_RX_RPT_TIMEOUT = True + print("ARQ_RX_RPT_TIMEOUT") + +def arq_frame_timeout(): + if static.ARQ_STATE == 'RECEIVING_SIGNALLING': + static.ARQ_RX_FRAME_TIMEOUT = True + print("ARQ_RX_FRAME_TIMEOUT") + + +def arq_reset_timeout(state): + print(state) + static.ARQ_RX_ACK_TIMEOUT = state + static.ARQ_RX_FRAME_TIMEOUT = state + static.ARQ_RX_RPT_TIMEOUT = state + +def arq_reset_ack(state): + print(state) + static.ARQ_ACK_RECEIVED = state + static.ARQ_RPT_RECEIVED = state + static.ARQ_FRAME_ACK_RECEIVED = state + +def arq_reset_frame_machine(): + arq_reset_timeout(False) + arq_reset_ack(False) + static.TX_N_RETRIES = 0 + static.ARQ_N_SENT_FRAMES = 0 + static.ARQ_TX_N_FRAMES_PER_BURST = 0 + + +