fixed some ARQ timing issues

This commit is contained in:
DJ2LS 2021-03-16 11:39:22 +01:00 committed by GitHub
parent 55017df9cc
commit 99c74cfd74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 14 deletions

View file

@ -275,7 +275,7 @@ def arq_transmit(data_out):
# --------------------------- START TIMER FOR WAITING FOR ACK ---> IF TIMEOUT REACHED, ACK_TIMEOUT = 1
logging.info("ARQ | RX | WAITING FOR BURST ACK")
logging.debug("ARQ | RX | WAITING FOR BURST ACK")
static.CHANNEL_STATE = 'RECEIVING_SIGNALLING'
helpers.arq_reset_timeout(False)
@ -316,7 +316,7 @@ def arq_transmit(data_out):
while static.ARQ_ACK_RECEIVED == False and static.ARQ_FRAME_ACK_RECEIVED == False and static.ARQ_RX_RPT_TIMEOUT == False:
time.sleep(0.01) # lets reduce CPU load a little bit
logging.debug(static.ARQ_STATE)
logging.info(static.ARQ_STATE)
if static.ARQ_ACK_RECEIVED == True:
@ -334,7 +334,7 @@ def arq_transmit(data_out):
# --------------------------------------------------------------------------------------------------------------
elif static.ARQ_ACK_RECEIVED == True and static.ARQ_RX_ACK_TIMEOUT == 1:
elif static.ARQ_ACK_RECEIVED == False and static.ARQ_RX_ACK_TIMEOUT == True:
logging.warning("ARQ | RX | ACK TIMEOUT!")
pass # no break here so we can continue with the next try of repeating the burst
@ -356,7 +356,9 @@ def arq_transmit(data_out):
break
else:
logging.debug("------------------------------->NO RULE MATCHED!")
logging.info("------------------------------->NO RULE MATCHED!")
print("ARQ_ACK_RECEIVED " + str(static.ARQ_ACK_RECEIVED))
print("ARQ_RX_ACK_TIMEOUT " + str(static.ARQ_RX_ACK_TIMEOUT))
break
# --------------------------------WAITING AREA FOR FRAME ACKs

View file

@ -62,14 +62,23 @@ def data_channel_keep_alive_watchdog():
if static.ARQ_STATE == 'DATA' and static.TNC_STATE == 'BUSY': # and not static.ARQ_SEND_KEEP_ALIVE:
time.sleep(0.01)
if static.ARQ_DATA_CHANNEL_LAST_RECEIVED + 10 > time.time():
if static.ARQ_DATA_CHANNEL_LAST_RECEIVED + 30 > time.time():
pass
else:
static.ARQ_DATA_CHANNEL_LAST_RECEIVED = 0
logging.info("DATA [" + str(static.MYCALLSIGN, 'utf-8') + "]<< >>[" + str(static.DXCALLSIGN, 'utf-8') + "] [BER." + str(static.BER) + "]")
logging.info("DATA [" + str(static.MYCALLSIGN, 'utf-8') + "]<<T>>[" + str(static.DXCALLSIGN, 'utf-8') + "] [BER." + str(static.BER) + "]")
arq_reset_frame_machine()
#async def set_after_timeout():
# """
# Author: DJ2LS
# """
# while True:
# time.sleep(1)
# static.ARQ_RX_ACK_TIMEOUT = True
# await asyncio.sleep(1.1)
def arq_ack_timeout():
"""

View file

@ -135,10 +135,7 @@ ARQ_N_SENT_FRAMES = 0 # counter for already sent frames
# SENDING_ACK
# ACK_RECEIVED
# CONNECTED
# DISCONNECTED
# CONNECTING
# DISCONNECTING
# DATA
ARQ_STATE = 'IDLE'
# RECEIVING_SIGNALLING
@ -156,10 +153,6 @@ ARQ_READY_FOR_DATA = False
ARQ_DATA_CHANNEL_MODE = 12
ARQ_DATA_CHANNEL_LAST_RECEIVED = 0
# SEND KEEP ALIVE ONLY IF WE WANT
ARQ_SEND_KEEP_ALIVE = True
ARQ_CONNECTION_KEEP_ALIVE_RECEIVED = 0
#ARQ_WAIT_FOR_DISCONNECT = False
# ------- TX BUFFER
TX_BUFFER_SIZE = 0