mirror of
https://github.com/meshcore-dev/meshcore-cli.git
synced 2026-04-20 22:13:48 +00:00
take transport codes into account in echoes
This commit is contained in:
parent
1b21ec890e
commit
2599b970c1
1 changed files with 13 additions and 6 deletions
|
|
@ -210,13 +210,20 @@ async def handle_log_rx(event):
|
||||||
pkt = bytes().fromhex(event.payload["payload"])
|
pkt = bytes().fromhex(event.payload["payload"])
|
||||||
|
|
||||||
if handle_log_rx.channel_echoes:
|
if handle_log_rx.channel_echoes:
|
||||||
if pkt[0] == 0x15:
|
if pkt[0] & ~1 == 0x14:
|
||||||
chan_name = ""
|
chan_name = ""
|
||||||
path_len = pkt[1]
|
if pkt[0] & 1: #no transport code
|
||||||
path = pkt[2:path_len+2].hex()
|
path_len = pkt[1]
|
||||||
chan_hash = pkt[path_len+2:path_len+3].hex()
|
path = pkt[2:path_len+2].hex()
|
||||||
cipher_mac = pkt[path_len+3:path_len+5]
|
path_end = path_len+2
|
||||||
msg = pkt[path_len+5:]
|
else:
|
||||||
|
path_len = pkt[5]
|
||||||
|
path = pkt[6:path_len+6].hex()
|
||||||
|
path_end = path_len+6
|
||||||
|
|
||||||
|
chan_hash = pkt[path_end:path_end+1].hex()
|
||||||
|
cipher_mac = pkt[path_end+1:path_end+3]
|
||||||
|
msg = pkt[path_end+3:]
|
||||||
channel = None
|
channel = None
|
||||||
for c in await get_channels(mc):
|
for c in await get_channels(mc):
|
||||||
if c["channel_hash"] == chan_hash : # validate against MAC
|
if c["channel_hash"] == chan_hash : # validate against MAC
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue