mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 14:58:12 +00:00
fix(ui-orig): show hop count, not raw path_len, in message origin
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user