Updates to work with 32 bit nodenums

This commit is contained in:
geeksville
2020-06-06 13:12:40 -07:00
parent a0c83a1861
commit 747328c8f7
3 changed files with 8 additions and 6 deletions

View File

@@ -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

View File

@@ -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")

View File

@@ -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