mirror of
https://github.com/meshcore-dev/meshcore-cli.git
synced 2026-04-20 22:13:48 +00:00
add baudrate param
This commit is contained in:
parent
a1d7b2eb91
commit
6a9d3bf65b
1 changed files with 5 additions and 2 deletions
7
mccli.py
7
mccli.py
|
|
@ -561,6 +561,7 @@ def usage () :
|
||||||
-t <hostname> : connects via tcp/ip
|
-t <hostname> : connects via tcp/ip
|
||||||
-p <port> : specifies tcp port (default 5000)
|
-p <port> : specifies tcp port (default 5000)
|
||||||
-s <port> : use serial port <port>
|
-s <port> : use serial port <port>
|
||||||
|
-b <baudrate> : specify baudrate
|
||||||
|
|
||||||
Available Commands (can be chained) :
|
Available Commands (can be chained) :
|
||||||
infos : print informations about the node
|
infos : print informations about the node
|
||||||
|
|
@ -600,7 +601,7 @@ async def main(argv):
|
||||||
with open(MCCLI_ADDRESS, encoding="utf-8") as f :
|
with open(MCCLI_ADDRESS, encoding="utf-8") as f :
|
||||||
address = f.readline().strip()
|
address = f.readline().strip()
|
||||||
|
|
||||||
opts, args = getopt.getopt(argv, "a:d:s:ht:p:")
|
opts, args = getopt.getopt(argv, "a:d:s:ht:p:b:")
|
||||||
for opt, arg in opts :
|
for opt, arg in opts :
|
||||||
match opt:
|
match opt:
|
||||||
case "-d" : # name specified on cmdline
|
case "-d" : # name specified on cmdline
|
||||||
|
|
@ -609,10 +610,12 @@ async def main(argv):
|
||||||
address = arg
|
address = arg
|
||||||
case "-s" : # serial port
|
case "-s" : # serial port
|
||||||
serial_port = arg
|
serial_port = arg
|
||||||
|
case "-b" :
|
||||||
|
baudrate = int(arg)
|
||||||
case "-t" :
|
case "-t" :
|
||||||
hostname = arg
|
hostname = arg
|
||||||
case "-p" :
|
case "-p" :
|
||||||
port = int(arg)
|
port = int(arg)
|
||||||
|
|
||||||
if len(args) == 0 : # no args, no action
|
if len(args) == 0 : # no args, no action
|
||||||
usage()
|
usage()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue