mirror of
https://github.com/meshcore-dev/meshcore-cli.git
synced 2026-04-20 22:13:48 +00:00
let user not specify filter
This commit is contained in:
parent
91a6e31fa9
commit
1cb7e011ed
1 changed files with 22 additions and 17 deletions
|
|
@ -2420,24 +2420,29 @@ async def next_cmd(mc, cmds, json_output=False):
|
||||||
case "node_discover"|"nd" :
|
case "node_discover"|"nd" :
|
||||||
argnum = 1
|
argnum = 1
|
||||||
prefix_only = True
|
prefix_only = True
|
||||||
try: # try to decode type as int
|
|
||||||
types = int(cmds[1])
|
|
||||||
except ValueError:
|
|
||||||
if "all" in cmds[1]:
|
|
||||||
types = 0xFF
|
|
||||||
else :
|
|
||||||
types = 0
|
|
||||||
if "rep" in cmds[1]:
|
|
||||||
types = types | 4
|
|
||||||
if "cli" in cmds[1] or "comp" in cmds[1]:
|
|
||||||
types = types | 2
|
|
||||||
if "room" in cmds[1]:
|
|
||||||
types = types | 8
|
|
||||||
if "sens" in cmds[1]:
|
|
||||||
types = types | 16
|
|
||||||
|
|
||||||
if "full" in cmds[1]:
|
if len(cmds) == 1:
|
||||||
prefix_only = False
|
argnum = 0
|
||||||
|
types = 0xFF
|
||||||
|
else:
|
||||||
|
try: # try to decode type as int
|
||||||
|
types = int(cmds[1])
|
||||||
|
except ValueError:
|
||||||
|
if "all" in cmds[1]:
|
||||||
|
types = 0xFF
|
||||||
|
else :
|
||||||
|
types = 0
|
||||||
|
if "rep" in cmds[1]:
|
||||||
|
types = types | 4
|
||||||
|
if "cli" in cmds[1] or "comp" in cmds[1]:
|
||||||
|
types = types | 2
|
||||||
|
if "room" in cmds[1]:
|
||||||
|
types = types | 8
|
||||||
|
if "sens" in cmds[1]:
|
||||||
|
types = types | 16
|
||||||
|
|
||||||
|
if "full" in cmds[1]:
|
||||||
|
prefix_only = False
|
||||||
|
|
||||||
res = await mc.commands.send_node_discover_req(types, prefix_only=prefix_only)
|
res = await mc.commands.send_node_discover_req(types, prefix_only=prefix_only)
|
||||||
if res is None or res.type == EventType.ERROR:
|
if res is None or res.type == EventType.ERROR:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue