From 77e0230c61f616554ecba8ddba9c2439effd9621 Mon Sep 17 00:00:00 2001 From: Florent Date: Fri, 27 Feb 2026 07:16:28 -0400 Subject: [PATCH] now you can send trace to a contact when using multibyte path --- src/meshcore_cli/meshcore_cli.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/meshcore_cli/meshcore_cli.py b/src/meshcore_cli/meshcore_cli.py index 3defce9..cf64460 100644 --- a/src/meshcore_cli/meshcore_cli.py +++ b/src/meshcore_cli/meshcore_cli.py @@ -1819,19 +1819,26 @@ async def get_channels (mc, anim=False) : async def print_trace_to (mc, contact): path = contact["out_path"] path_len = contact["out_path_len"] + path_hash_len = await mc.commands.get_path_hash_mode() + 1 trace = "" if path_len == -1: print ("No path to destination") return + if path_hash_len == 3: + logger.error("Can't do trace when path_hash_len is 3") + if contact["type"] == 2 or contact["type"] == 3: # repeater or room, can trace to the contact itself - trace = contact["public_key"][0:2] + trace = contact["public_key"][0:2*path_hash_len] for i in range(0, path_len): - elem = path[2*(path_len-i-1):2*(path_len-i)] - trace = elem if trace=="" else f"{elem},{trace},{elem}" + elem = path[2*path_hash_len*(path_len-i-1):2*path_hash_len*(path_len-i)] + trace = elem if trace=="" else f"{elem}{trace}{elem}" + + if path_hash_len == 2: + trace = trace + ":1" await next_cmd(mc, ["trace", trace])