Skip to content

Commit ed545cd

Browse files
authored
Merge pull request #580 from todd-herbert/wait-to-disconnect
Add "wait to disconnect" argument
2 parents 8d538e8 + c3d044e commit ed545cd

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

meshtastic/__main__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,10 @@ def setSimpleConfig(modem_preset):
861861
)
862862
interface.getNode(args.dest, False).iface.waitForAckNak()
863863

864+
if args.wait_to_disconnect:
865+
print(f"Waiting {args.wait_to_disconnect} seconds before disconnecting" )
866+
time.sleep(int(args.wait_to_disconnect))
867+
864868
# if the user didn't ask for serial debugging output, we might want to exit after we've done our operation
865869
if (not args.seriallog) and closeNow:
866870
interface.close() # after running command then exit
@@ -1473,6 +1477,14 @@ def initParser():
14731477
action="store_true",
14741478
)
14751479

1480+
group.add_argument(
1481+
"--wait-to-disconnect",
1482+
help="How many seconds to wait before disconnecting from the device.",
1483+
const="5",
1484+
nargs="?",
1485+
action="store",
1486+
)
1487+
14761488
group.add_argument(
14771489
"--noproto",
14781490
help="Don't start the API, just function as a dumb serial terminal.",

0 commit comments

Comments
 (0)