mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
improved helpers
This commit is contained in:
parent
91114d0db2
commit
cebaf469db
1 changed files with 36 additions and 4 deletions
40
helpers.py
40
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
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue