mirror of
https://github.com/meshcore-dev/meshcore-cli.git
synced 2026-04-20 22:13:48 +00:00
acl support for repeaters in IM
This commit is contained in:
parent
6ad3147808
commit
1c9cab092a
1 changed files with 9 additions and 9 deletions
|
|
@ -459,6 +459,8 @@ def make_completion_dict(contacts, pending={}, to=None):
|
||||||
"start ota" : None,
|
"start ota" : None,
|
||||||
"password" : None,
|
"password" : None,
|
||||||
"neighbors" : None,
|
"neighbors" : None,
|
||||||
|
"req_acl":None,
|
||||||
|
"setperm":contact_list,
|
||||||
"get" : {"name" : None,
|
"get" : {"name" : None,
|
||||||
"role":None,
|
"role":None,
|
||||||
"radio" : None,
|
"radio" : None,
|
||||||
|
|
@ -480,6 +482,7 @@ def make_completion_dict(contacts, pending={}, to=None):
|
||||||
"telemetry" : None,
|
"telemetry" : None,
|
||||||
"status" : None,
|
"status" : None,
|
||||||
"timeout" : None,
|
"timeout" : None,
|
||||||
|
"acl":None,
|
||||||
},
|
},
|
||||||
"set" : {"name" : None,
|
"set" : {"name" : None,
|
||||||
"radio" : {",,,":None, "f,bw,sf,cr": None},
|
"radio" : {",,,":None, "f,bw,sf,cr": None},
|
||||||
|
|
@ -498,25 +501,22 @@ def make_completion_dict(contacts, pending={}, to=None):
|
||||||
"lat" : None,
|
"lat" : None,
|
||||||
"lon" : None,
|
"lon" : None,
|
||||||
"timeout" : None,
|
"timeout" : None,
|
||||||
|
"perm":contact_list,
|
||||||
},
|
},
|
||||||
"erase": None,
|
"erase": None,
|
||||||
"log" : {"start" : None, "stop" : None, "erase" : None}
|
"log" : {"start" : None, "stop" : None, "erase" : None}
|
||||||
})
|
})
|
||||||
|
|
||||||
if (to['type'] == 4) : #sensors
|
if (to['type'] == 4) : #specific to sensors
|
||||||
completion_list.update({
|
completion_list.update({
|
||||||
"req_mma":{"begin end":None},
|
"req_mma":{"begin end":None},
|
||||||
"req_acl":None,
|
|
||||||
"setperm":contact_list,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
completion_list["get"].update({
|
completion_list["get"].update({
|
||||||
"mma":None,
|
"mma":None,
|
||||||
"acl":None,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
completion_list["set"].update({
|
completion_list["set"].update({
|
||||||
"perm":contact_list,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
completion_list.update({
|
completion_list.update({
|
||||||
|
|
@ -725,9 +725,9 @@ Line starting with \"$\" or \".\" will issue a meshcli command.
|
||||||
print(f"timeout: {0 if not 'timeout' in contact else contact['timeout']}")
|
print(f"timeout: {0 if not 'timeout' in contact else contact['timeout']}")
|
||||||
|
|
||||||
elif contact["type"] == 4 and\
|
elif contact["type"] == 4 and\
|
||||||
(line == "get acl" or line.startswith("get mma ")) or\
|
(line.startswith("get mma ")) or\
|
||||||
contact["type"] > 1 and\
|
contact["type"] > 1 and\
|
||||||
(line.startswith("get telemetry") or line.startswith("get status")):
|
(line.startswith("get telemetry") or line.startswith("get status") or line.startswith("get acl")):
|
||||||
cmds = line.split(" ")
|
cmds = line.split(" ")
|
||||||
args = [f"req_{cmds[1]}", contact['adv_name']]
|
args = [f"req_{cmds[1]}", contact['adv_name']]
|
||||||
if len(cmds) > 2 :
|
if len(cmds) > 2 :
|
||||||
|
|
@ -737,7 +737,7 @@ Line starting with \"$\" or \".\" will issue a meshcli command.
|
||||||
await process_cmds(mc, args)
|
await process_cmds(mc, args)
|
||||||
|
|
||||||
# special treatment for setperm to support contact name as param
|
# special treatment for setperm to support contact name as param
|
||||||
elif contact["type"] == 4 and\
|
elif contact["type"] > 1 and\
|
||||||
(line.startswith("setperm ") or line.startswith("set perm ")):
|
(line.startswith("setperm ") or line.startswith("set perm ")):
|
||||||
cmds = shlex.split(line)
|
cmds = shlex.split(line)
|
||||||
off = 1 if line.startswith("set perm") else 0
|
off = 1 if line.startswith("set perm") else 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue