mirror of
https://github.com/meshtastic/python.git
synced 2026-01-12 17:57:58 -05:00
Updates to work with 32 bit nodenums
This commit is contained in:
@@ -64,8 +64,10 @@ START2 = 0xc3
|
||||
HEADER_LEN = 4
|
||||
MAX_TO_FROM_RADIO_SIZE = 512
|
||||
|
||||
BROADCAST_ADDR = "all" # A special ID that means broadcast
|
||||
BROADCAST_NUM = 255
|
||||
BROADCAST_ADDR = "^all" # A special ID that means broadcast
|
||||
|
||||
# if using 8 bit nodenums this will be shortend on the target
|
||||
BROADCAST_NUM = 0xffffffff
|
||||
|
||||
MY_CONFIG_ID = 42
|
||||
|
||||
@@ -119,7 +121,7 @@ class MeshInterface:
|
||||
if isinstance(destinationId, int):
|
||||
nodeNum = destinationId
|
||||
elif destinationId == BROADCAST_ADDR:
|
||||
nodeNum = 255
|
||||
nodeNum = BROADCAST_NUM
|
||||
else:
|
||||
nodeNum = self.nodes[destinationId].num
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ def main():
|
||||
parser.add_argument("--setpref", help="Set a preferences field", nargs=2)
|
||||
|
||||
parser.add_argument(
|
||||
"--dest", help="The destination node id for the --send commands, if not set 'all' is assumed", default="all")
|
||||
"--dest", help="The destination node id for the --send commands, if not set '^all' is assumed", default="^all")
|
||||
|
||||
parser.add_argument(
|
||||
"--sendtext", help="Send a text message")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import logging
|
||||
from . import util
|
||||
from . import StreamInterface
|
||||
from . import StreamInterface, BROADCAST_NUM
|
||||
from pubsub import pub
|
||||
import time
|
||||
import sys
|
||||
@@ -55,7 +55,7 @@ def testSend(fromInterface, toInterface, isBroadcast=False):
|
||||
fromNode = fromInterface.myInfo.my_node_num
|
||||
|
||||
if isBroadcast:
|
||||
toNode = 255
|
||||
toNode = BROADCAST_NUM
|
||||
else:
|
||||
toNode = toInterface.myInfo.my_node_num
|
||||
|
||||
|
||||
Reference in New Issue
Block a user