mirror of
https://github.com/meshcore-dev/meshcore-cli.git
synced 2026-04-20 22:13:48 +00:00
update to path command and doc
This commit is contained in:
parent
d28cac5e25
commit
d67aaece28
2 changed files with 27 additions and 16 deletions
28
README.md
28
README.md
|
|
@ -36,16 +36,18 @@ Arguments mostly deals with ble connection
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
-h : prints this help
|
-h : prints this help
|
||||||
-j : json output
|
-v : prints version
|
||||||
-D : print debug messages
|
-j : json output (disables init file)
|
||||||
-S : BLE device selector
|
-D : debug
|
||||||
-l : lists BLE devices
|
-S : performs a ble scan and ask for device
|
||||||
-a <address> : specifies device address (can be a name)
|
-l : list available ble devices and exit
|
||||||
-d <name> : filter meshcore devices with name or address
|
-T <timeout> : timeout for the ble scan (-S and -l) default 2s
|
||||||
-t <hostname> : connects via tcp/ip
|
-a <address> : specifies device address (can be a name)
|
||||||
-p <port> : specifies tcp port (default 5000)
|
-d <name> : filter meshcore devices with name or address
|
||||||
-s <port> : use serial port <port>
|
-t <hostname> : connects via tcp/ip
|
||||||
-b <baudrate> : specify baudrate
|
-p <port> : specifies tcp port (default 5000)
|
||||||
|
-s <port> : use serial port <port>
|
||||||
|
-b <baudrate> : specify baudrate
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
### Available Commands
|
### Available Commands
|
||||||
|
|
@ -58,6 +60,7 @@ Commands are given after arguments, they can be chained and some have shortcuts.
|
||||||
chat_to <ct> : enter chat with contact to
|
chat_to <ct> : enter chat with contact to
|
||||||
script <filename> : execute commands in filename
|
script <filename> : execute commands in filename
|
||||||
infos : print informations about the node i
|
infos : print informations about the node i
|
||||||
|
self_telemetry : print own telemtry t
|
||||||
card : export this node URI e
|
card : export this node URI e
|
||||||
ver : firmware version v
|
ver : firmware version v
|
||||||
reboot : reboots node
|
reboot : reboots node
|
||||||
|
|
@ -72,6 +75,8 @@ Commands are given after arguments, they can be chained and some have shortcuts.
|
||||||
wait_msg : wait for a message and read it wm
|
wait_msg : wait for a message and read it wm
|
||||||
sync_msgs : gets all unread msgs from the node sm
|
sync_msgs : gets all unread msgs from the node sm
|
||||||
msgs_subscribe : display msgs as they arrive ms
|
msgs_subscribe : display msgs as they arrive ms
|
||||||
|
get_channel <n> : get info for channel n
|
||||||
|
set_channel n nm k : set channel info (nb, name, key)
|
||||||
Management
|
Management
|
||||||
advert : sends advert a
|
advert : sends advert a
|
||||||
floodadv : flood advert
|
floodadv : flood advert
|
||||||
|
|
@ -80,13 +85,14 @@ Commands are given after arguments, they can be chained and some have shortcuts.
|
||||||
time <epoch> : sets time to given epoch
|
time <epoch> : sets time to given epoch
|
||||||
clock : get current time
|
clock : get current time
|
||||||
clock sync : sync device clock st
|
clock sync : sync device clock st
|
||||||
cli : send a cmd to node's cli (if avail) @
|
|
||||||
Contacts
|
Contacts
|
||||||
contacts / list : gets contact list lc
|
contacts / list : gets contact list lc
|
||||||
|
contact_info <ct> : prints information for contact ct ci
|
||||||
share_contact <ct> : share a contact with others sc
|
share_contact <ct> : share a contact with others sc
|
||||||
export_contact <ct> : get a contact's URI ec
|
export_contact <ct> : get a contact's URI ec
|
||||||
import_contact <URI> : import a contactt from its URI ic
|
import_contact <URI> : import a contactt from its URI ic
|
||||||
remove_contact <ct> : removes a contact from this node
|
remove_contact <ct> : removes a contact from this node
|
||||||
|
path <ct> : diplays path for a contact
|
||||||
reset_path <ct> : resets path to a contact to flood rp
|
reset_path <ct> : resets path to a contact to flood rp
|
||||||
change_path <ct> <pth> : change the path to a contact cp
|
change_path <ct> <pth> : change the path to a contact cp
|
||||||
change_flags <ct> <f> : change contact flags (tel_l|tel_a|star)cf
|
change_flags <ct> <f> : change contact flags (tel_l|tel_a|star)cf
|
||||||
|
|
|
||||||
|
|
@ -1228,15 +1228,19 @@ async def next_cmd(mc, cmds, json_output=False):
|
||||||
else:
|
else:
|
||||||
print(f"Unknown contact {cmds[1]}")
|
print(f"Unknown contact {cmds[1]}")
|
||||||
else:
|
else:
|
||||||
res = contact["out_path"]
|
path = contact["out_path"]
|
||||||
|
path_len = contact["out_path_len"]
|
||||||
if json_output :
|
if json_output :
|
||||||
print(json.dumps({"adv_name" : contact["adv_name"],
|
print(json.dumps({"adv_name" : contact["adv_name"],
|
||||||
"out_path" : res}))
|
"out_path_len" : path_len,
|
||||||
|
"out_path" : path}))
|
||||||
else:
|
else:
|
||||||
if (res == "") :
|
if (path_len == 0) :
|
||||||
print("0 hop")
|
print("0 hop")
|
||||||
|
elif (path_len == -1) :
|
||||||
|
print("Path not set")
|
||||||
else:
|
else:
|
||||||
print(res)
|
print(path)
|
||||||
|
|
||||||
case "contact_info" | "ci":
|
case "contact_info" | "ci":
|
||||||
argnum = 1
|
argnum = 1
|
||||||
|
|
@ -1617,13 +1621,14 @@ def command_help():
|
||||||
time <epoch> : sets time to given epoch
|
time <epoch> : sets time to given epoch
|
||||||
clock : get current time
|
clock : get current time
|
||||||
clock sync : sync device clock st
|
clock sync : sync device clock st
|
||||||
cli : send a cmd to node's cli (if avail) @
|
|
||||||
Contacts
|
Contacts
|
||||||
contacts / list : gets contact list lc
|
contacts / list : gets contact list lc
|
||||||
|
contact_info <ct> : prints information for contact ct ci
|
||||||
share_contact <ct> : share a contact with others sc
|
share_contact <ct> : share a contact with others sc
|
||||||
export_contact <ct> : get a contact's URI ec
|
export_contact <ct> : get a contact's URI ec
|
||||||
import_contact <URI> : import a contactt from its URI ic
|
import_contact <URI> : import a contactt from its URI ic
|
||||||
remove_contact <ct> : removes a contact from this node
|
remove_contact <ct> : removes a contact from this node
|
||||||
|
path <ct> : diplays path for a contact
|
||||||
reset_path <ct> : resets path to a contact to flood rp
|
reset_path <ct> : resets path to a contact to flood rp
|
||||||
change_path <ct> <pth> : change the path to a contact cp
|
change_path <ct> <pth> : change the path to a contact cp
|
||||||
change_flags <ct> <f> : change contact flags (tel_l|tel_a|star)cf
|
change_flags <ct> <f> : change contact flags (tel_l|tel_a|star)cf
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue