From 1d5d50a868da06570be9668500269c8d5bf23fce Mon Sep 17 00:00:00 2001 From: DJ2LS <75909252+DJ2LS@users.noreply.github.com> Date: Wed, 10 Mar 2021 09:12:49 +0100 Subject: [PATCH] reset frame machine correctly --- data_handler.py | 2 ++ helpers.py | 14 +++++++++++++- sock.py | 6 +++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/data_handler.py b/data_handler.py index ab3b0a2a..f1028ab7 100644 --- a/data_handler.py +++ b/data_handler.py @@ -204,9 +204,11 @@ def arq_data_received(data_in): static.ARQ_FRAME_BOF_RECEIVED = False static.ARQ_FRAME_EOF_RECEIVED = False static.ARQ_N_ARQ_FRAMES_PER_DATA_FRAME = 0 + static.ARQ_RX_N_CURRENT_ARQ_FRAME = 0 static.TNC_STATE = 'IDLE' static.ARQ_SEND_KEEP_ALIVE = True static.ARQ_READY_FOR_DATA = False + logging.info("DATA ["+ str(static.MYCALLSIGN, 'utf-8') + "]<< >>["+ str(static.DXCALLSIGN, 'utf-8') + "] [BER."+str(static.BER)+"]") else: diff --git a/helpers.py b/helpers.py index bfb749d0..82447251 100644 --- a/helpers.py +++ b/helpers.py @@ -81,7 +81,19 @@ def arq_reset_frame_machine(): static.TX_N_RETRIES = 0 static.ARQ_N_SENT_FRAMES = 0 static.ARQ_TX_N_FRAMES_PER_BURST = 0 - static.TNC_STATE = b'IDLE' + static.ARQ_TX_N_CURRENT_ARQ_FRAME = 0 + static.ARQ_TX_N_TOTAL_ARQ_FRAMES = 0 + static.ARQ_TX_N_CURRENT_ARQ_FRAME = 0 + + static.ARQ_RX_N_CURRENT_ARQ_FRAME = 0 + static.ARQ_N_ARQ_FRAMES_PER_DATA_FRAME = 0 + static.ARQ_FRAME_BOF_RECEIVED = False + static.ARQ_FRAME_EOF_RECEIVED = False + + + + + static.TNC_STATE = 'IDLE' static.ARQ_SEND_KEEP_ALIVE = True static.CHANNEL_STATE = 'RECEIVING_SIGNALLING' static.ARQ_READY_FOR_DATA = False diff --git a/sock.py b/sock.py index be095537..7b57aad4 100644 --- a/sock.py +++ b/sock.py @@ -124,7 +124,7 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler): asyncio.run(data_handler.arq_transmit(data_out)) ###asyncio.run(asyncbg.call(data_handler.arq_transmit, data_out)) - print("die funktion läuft weiter...") + #print("die funktion läuft weiter...") #data_handler.arq_transmit(data_out) #TRANSMIT_ARQ = threading.Thread(target=data_handler.transmit, args=[data_out], name="TRANSMIT_ARQ") #TRANSMIT_ARQ.start() @@ -166,8 +166,8 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler): "TX_N_MAX_RETRIES": str(static.TX_N_MAX_RETRIES), "ARQ_TX_N_FRAMES_PER_BURST": str(static.ARQ_TX_N_FRAMES_PER_BURST), "ARQ_TX_N_BURSTS": str(static.ARQ_TX_N_BURSTS), - "ARQ_TX_N_CURRENT_ARQ_FRAME": str(static.ARQ_TX_N_CURRENT_ARQ_FRAME), - "ARQ_TX_N_TOTAL_ARQ_FRAMES": str(static.ARQ_TX_N_TOTAL_ARQ_FRAMES), + "ARQ_TX_N_CURRENT_ARQ_FRAME": str(int.from_bytes(bytes(static.ARQ_TX_N_CURRENT_ARQ_FRAME), "big")), + "ARQ_TX_N_TOTAL_ARQ_FRAMES": str(int.from_bytes(bytes(static.ARQ_TX_N_TOTAL_ARQ_FRAMES), "big")), "ARQ_RX_FRAME_N_BURSTS": str(static.ARQ_RX_FRAME_N_BURSTS), "ARQ_RX_N_CURRENT_ARQ_FRAME": str(static.ARQ_RX_N_CURRENT_ARQ_FRAME), "ARQ_N_ARQ_FRAMES_PER_DATA_FRAME": str(static.ARQ_N_ARQ_FRAMES_PER_DATA_FRAME )