From 046c2f258e7788cedf0d5d04751779731082df9e Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Sun, 5 Jul 2026 22:21:31 +0200 Subject: [PATCH] fix(ui-orig): show hop count, not raw path_len, in message origin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "(N)" origin readout printed the raw wire path_len. That byte packs the path hash-size mode in its top 2 bits and the hop count in the low 6, so with path_hash_mode >= 1 (2-byte hashes) it over-reported — e.g. "(66)" for a 2-hop message. Mask & 63 (getPathHashCount) so it shows the real hop count. Affects the ui-orig variants only (ui-new/ui-tiny ignore the arg). Co-Authored-By: Claude Opus 4.8 --- examples/companion_radio/ui-orig/UITask.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/companion_radio/ui-orig/UITask.cpp b/examples/companion_radio/ui-orig/UITask.cpp index eee990f0..59db556d 100644 --- a/examples/companion_radio/ui-orig/UITask.cpp +++ b/examples/companion_radio/ui-orig/UITask.cpp @@ -134,7 +134,7 @@ void UITask::newMsg(uint8_t path_len, const char* from_name, const char* text, i if (path_len == 0xFF) { sprintf(_origin, "(F) %s", from_name); } else { - sprintf(_origin, "(%d) %s", (uint32_t) path_len, from_name); + sprintf(_origin, "(%d) %s", (uint32_t)(path_len & 63), from_name); // low 6 bits = hop count; high 2 bits are the path hash-size mode } StrHelper::strncpy(_msg, text, sizeof(_msg));