fix(console): multi-byte hops in change_path parser and path display

The console treated 2-/3-byte hops as 1-byte:
- change_path "<name>" d103 5e34 (space-separated) was joined into
  continuous hex with hash_size=1, producing four 1-byte hops instead
  of two 2-byte ones.
- path <name> always rendered 1-byte hops because it decoded the
  hash-size mode from upper bits of out_path_len. In meshcore 2.x the
  library already masks out_path_len to the hop count and exposes the
  mode separately in out_path_hash_mode.

Parser now splits on commas, whitespace, or arrow separators and
requires consistent hop length. Display reads out_path_hash_mode and
also shows the byte size, e.g. "D103,5E34 (2 hops, 2B)".
This commit is contained in:
MarekWo
2026-06-05 08:29:33 +02:00
parent fd2b3d0f61
commit fecf8cdccb
2 changed files with 20 additions and 13 deletions
+1 -1
View File
@@ -2753,7 +2753,7 @@ class DeviceManager:
return {'success': True, 'data': {
'out_path': contact.get('out_path', ''),
'out_path_len': contact.get('out_path_len', -1),
'out_path_hash_len': contact.get('out_path_hash_len', 0),
'out_path_hash_mode': contact.get('out_path_hash_mode', 0),
}}
def discover_path(self, name_or_key: str) -> Dict: