mirror of
https://github.com/meshtastic/python.git
synced 2025-12-28 18:37:52 -05:00
Merge pull request #443 from GUVWAF/master
Option to wait for ACK after --sendtext
This commit is contained in:
@@ -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"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user