Skip to content

Commit 60f9dc6

Browse files
committed
new implementation
1 parent f9ae021 commit 60f9dc6

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

meshtastic/mesh_interface.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -892,8 +892,10 @@ def _sendPacket(
892892
else:
893893
our_exit("Warning: No myInfo found.")
894894
# A simple hex style nodeid - we can parse this without needing the DB
895-
elif destinationId.startswith("!"):
896-
nodeNum = int(destinationId[1:], 16)
895+
elif isinstance(destinationId, str) and len(destinationId) > 8:
896+
# assuming some form of node id string such as !1234578 or 0x12345678
897+
# always grab the last 8 items of the hexadecimal id str and parse to integer
898+
nodeNum = int(destinationId[-8:], 16)
897899
else:
898900
if self.nodes:
899901
node = self.nodes.get(destinationId)

0 commit comments

Comments
 (0)