From 9dcf98e229bc9a3c17d573b78199c8ce38bf22ef Mon Sep 17 00:00:00 2001 From: DJ2LS Date: Fri, 19 Nov 2021 17:47:25 +0100 Subject: [PATCH] datachannel attempt fix --- gui/preload-chat.js | 2 +- gui/src/chat-module.html | 2 +- tnc/data_handler.py | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/gui/preload-chat.js b/gui/preload-chat.js index 9039a2d2..ac15931f 100644 --- a/gui/preload-chat.js +++ b/gui/preload-chat.js @@ -18,7 +18,7 @@ var chatDB = path.join(configFolder, 'chatDB.json') window.addEventListener('DOMContentLoaded', () => { // SEND MSG document.getElementById("sendMessage").addEventListener("click", () => { - dxcallsign = 'DN2LS' + dxcallsign = document.getElementById('chatModuledxCall').value let Data = { command: "sendMessage", dxcallsign : dxcallsign.toUpperCase(), diff --git a/gui/src/chat-module.html b/gui/src/chat-module.html index 8d1037ce..944b9fc9 100644 --- a/gui/src/chat-module.html +++ b/gui/src/chat-module.html @@ -19,7 +19,7 @@ - + diff --git a/tnc/data_handler.py b/tnc/data_handler.py index d3bdb3dd..73676474 100644 --- a/tnc/data_handler.py +++ b/tnc/data_handler.py @@ -678,14 +678,13 @@ async def arq_open_data_channel(mode): connection_frame[2:3] = static.MYCALLSIGN_CRC8 connection_frame[3:9] = static.MYCALLSIGN connection_frame[12:13] = bytes([DATA_CHANNEL_MODE]) - + while not DATA_CHANNEL_READY_FOR_DATA: time.sleep(0.01) for attempt in range(1,DATA_CHANNEL_MAX_RETRIES+1): static.INFO.append("DATACHANNEL;OPENING") - attempt = str(attempt) + "/" + str(DATA_CHANNEL_MAX_RETRIES) - structlog.get_logger("structlog").info("[TNC] DATA [" + str(static.MYCALLSIGN, 'utf-8') + "]>> <<[" + str(static.DXCALLSIGN, 'utf-8') + "]", attempt=attempt) + structlog.get_logger("structlog").info("[TNC] DATA [" + str(static.MYCALLSIGN, 'utf-8') + "]>> <<[" + str(static.DXCALLSIGN, 'utf-8') + "]", attempt=str(attempt) + "/" + str(DATA_CHANNEL_MAX_RETRIES)) while not modem.transmit_signalling(connection_frame, 1): time.sleep(0.01) @@ -698,7 +697,7 @@ async def arq_open_data_channel(mode): break if DATA_CHANNEL_READY_FOR_DATA: break - + if not DATA_CHANNEL_READY_FOR_DATA and attempt == DATA_CHANNEL_MAX_RETRIES: static.INFO.append("DATACHANNEL;FAILED")