mirror of
https://github.com/meshcore-dev/meshcore_py.git
synced 2026-04-20 22:13:49 +00:00
fix path len issue when getting contacts
This commit is contained in:
parent
ee75ed12dd
commit
f2def83f30
1 changed files with 2 additions and 6 deletions
|
|
@ -90,12 +90,8 @@ class MessageReader:
|
|||
c["public_key"] = dbuf.read(32).hex()
|
||||
c["type"] = dbuf.read(1)[0]
|
||||
c["flags"] = dbuf.read(1)[0]
|
||||
plen = int.from_bytes(dbuf.read(1), signed=True, byteorder="little")
|
||||
c["out_path_len"] = plen
|
||||
if plen == -1:
|
||||
plen = 0
|
||||
path = dbuf.read(64)
|
||||
c["out_path"] = path[0:plen].hex()
|
||||
c["out_path_len"] = int.from_bytes(dbuf.read(1), signed=True, byteorder="little")
|
||||
c["out_path"] = dbuf.read(64).replace(b"\0", b"").hex()
|
||||
c["adv_name"] = dbuf.read(32).decode("utf-8", "ignore").replace("\0", "")
|
||||
c["last_advert"] = int.from_bytes(dbuf.read(4), byteorder="little")
|
||||
c["adv_lat"] = (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue