Merge pull request #443 from GUVWAF/master

Option to wait for ACK after --sendtext
This commit is contained in:
Ben Meadors
2023-04-11 10:05:02 -05:00
committed by GitHub

View File

@@ -383,7 +383,11 @@ def onConnected(interface):
f"Sending text message {args.sendtext} to {args.dest} on channelIndex:{channelIndex}"
)
interface.sendText(
args.sendtext, args.dest, wantAck=True, channelIndex=channelIndex
args.sendtext,
args.dest,
wantAck=True,
channelIndex=channelIndex,
onResponse=interface.getNode(args.dest, False).onAckNak,
)
else:
meshtastic.util.our_exit(
@@ -762,7 +766,7 @@ def onConnected(interface):
else:
tunnel.Tunnel(interface, subnet=args.tunnel_net)
if args.dest != BROADCAST_ADDR and waitForAckNak:
if args.ack or (args.dest != BROADCAST_ADDR and waitForAckNak):
print(
f"Waiting for an acknowledgment from remote node (this could take a while)"
)
@@ -1183,6 +1187,12 @@ def initParser():
"Only nodes that have the encryption key can be traced.",
)
parser.add_argument(
"--ack",
help="Use in combination with --sendtext to wait for an acknowledgment.",
action="store_true",
)
parser.add_argument(
"--reboot", help="Tell the destination node to reboot", action="store_true"
)