mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-04-20 22:13:49 +00:00
handle path_hash_size in change_path
This commit is contained in:
parent
26730d1efa
commit
32907bb5c1
1 changed files with 8 additions and 1 deletions
|
|
@ -110,8 +110,15 @@ class ContactCommands(CommandHandlerBase):
|
|||
out_path_hex = contact["out_path"]
|
||||
out_path_len = contact["out_path_len"]
|
||||
else:
|
||||
path_hash_size = 1
|
||||
res = await self.send_device_query()
|
||||
if not res is None and res.type != EventType.ERROR:
|
||||
if "path_hash_mode" in res.payload:
|
||||
path_hash_size = res.payload["path_hash_mode"] + 1
|
||||
|
||||
out_path_hex = path
|
||||
out_path_len = int(len(path) / 2)
|
||||
out_path_len = int(len(path) / (2 * path_hash_size))
|
||||
|
||||
# reflect the change
|
||||
contact["out_path"] = out_path_hex
|
||||
contact["out_path_len"] = out_path_len
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue