From 5a5d7ac55d47d27b3f8b62efe6a04dcf4c38b80e Mon Sep 17 00:00:00 2001 From: DJ2LS Date: Sun, 28 May 2023 12:48:57 +0200 Subject: [PATCH] and some more networkrelated tests --- tnc/sock.py | 8 ++++---- tnc/static.py | 2 +- tools/freedata_cli_tools.py | 6 +++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tnc/sock.py b/tnc/sock.py index 05180664..0fbb2340 100644 --- a/tnc/sock.py +++ b/tnc/sock.py @@ -777,8 +777,8 @@ class ThreadedTCPRequestHandler(socketserver.StreamRequestHandler): for _, route in enumerate(MeshParam.routing_table): output["routes"].append( { - "dxcall": MeshParam.routing_table[_][0].decode('utf-8'), - "router": MeshParam.routing_table[_][1].decode('utf-8'), + "dxcall": MeshParam.routing_table[_][0], + "router": MeshParam.routing_table[_][1], "hops": MeshParam.routing_table[_][2], "snr": MeshParam.routing_table[_][3], "score": MeshParam.routing_table[_][4], @@ -1152,8 +1152,8 @@ def send_tnc_state(): for _, route in enumerate(MeshParam.routing_table): output["routing_table"].append( { - "dxcall": MeshParam.routing_table[_][0].decode('utf-8'), - "router": MeshParam.routing_table[_][1].decode('utf-8'), + "dxcall": MeshParam.routing_table[_][0], + "router": MeshParam.routing_table[_][1], "hops": MeshParam.routing_table[_][2], "snr": MeshParam.routing_table[_][3], "score": MeshParam.routing_table[_][4], diff --git a/tnc/static.py b/tnc/static.py index 8312c7e9..dddfdb6b 100644 --- a/tnc/static.py +++ b/tnc/static.py @@ -128,7 +128,7 @@ class TCIParam: @dataclass class TNC: - version = "0.10.0-alpha.1-mesh-exp4" + version = "0.10.0-alpha.1-mesh-exp5" host: str = "0.0.0.0" port: int = 3000 SOCKET_TIMEOUT: int = 1 # seconds diff --git a/tools/freedata_cli_tools.py b/tools/freedata_cli_tools.py index 420593a2..4f600225 100755 --- a/tools/freedata_cli_tools.py +++ b/tools/freedata_cli_tools.py @@ -29,7 +29,7 @@ def main_menu(): while True: time.sleep(0.1) title = 'Please select a command you want to run: ' - options = ['BEACON', 'PING', 'ARQ', 'LIST AUDIO DEVICES'] + options = ['BEACON', 'PING', 'ARQ', 'LIST AUDIO DEVICES','LIST ROUTING TABLE'] option, index = pick(options, title) # BEACON AREA @@ -87,6 +87,10 @@ def main_menu(): option, index = pick(device_list, "Audio devices") + elif option == 'LIST ROUTING TABLE': + run_network_command({"type": "get", "command": "routing_table"}) + + if option == '----- BACK -----': main_menu()