mirror of
https://github.com/meshcore-dev/meshcore-cli.git
synced 2026-04-20 22:13:48 +00:00
get status
This commit is contained in:
parent
9bffc8e0d9
commit
25844a6d38
1 changed files with 50 additions and 0 deletions
|
|
@ -670,6 +670,11 @@ def make_completion_dict(contacts, pending={}, to=None, channels=None):
|
||||||
"max_flood_attempts":None,
|
"max_flood_attempts":None,
|
||||||
"flood_after":None,
|
"flood_after":None,
|
||||||
"custom":None,
|
"custom":None,
|
||||||
|
"stats":None,
|
||||||
|
"status":None,
|
||||||
|
"stats_core":None,
|
||||||
|
"stats_radio":None,
|
||||||
|
"stats_packets":None,
|
||||||
},
|
},
|
||||||
"?get":None,
|
"?get":None,
|
||||||
"?set":None,
|
"?set":None,
|
||||||
|
|
@ -2436,6 +2441,47 @@ async def next_cmd(mc, cmds, json_output=False):
|
||||||
logger.error("Couldn't get custom variables")
|
logger.error("Couldn't get custom variables")
|
||||||
else :
|
else :
|
||||||
print(json.dumps(res.payload, indent=4))
|
print(json.dumps(res.payload, indent=4))
|
||||||
|
case "stats_core":
|
||||||
|
res = await mc.commands.get_stats_core()
|
||||||
|
logger.debug(res)
|
||||||
|
if res.type == EventType.ERROR:
|
||||||
|
logger.error("Couldn't get stats")
|
||||||
|
else:
|
||||||
|
print(json.dumps(res.payload, indent=4))
|
||||||
|
case "stats_radio":
|
||||||
|
res = await mc.commands.get_stats_radio()
|
||||||
|
logger.debug(res)
|
||||||
|
if res.type == EventType.ERROR:
|
||||||
|
logger.error("Couldn't get stats")
|
||||||
|
else:
|
||||||
|
print(json.dumps(res.payload, indent=4))
|
||||||
|
case "stats_packets":
|
||||||
|
res = await mc.commands.get_stats_packets()
|
||||||
|
logger.debug(res)
|
||||||
|
if res.type == EventType.ERROR:
|
||||||
|
logger.error("Couldn't get stats")
|
||||||
|
else:
|
||||||
|
print(json.dumps(res.payload, indent=4))
|
||||||
|
case "stats"|"status":
|
||||||
|
stats = {}
|
||||||
|
res = await mc.commands.get_stats_core()
|
||||||
|
stats.update(res.payload)
|
||||||
|
if res.type == EventType.ERROR:
|
||||||
|
logger.error("Couldn't get core stats")
|
||||||
|
else:
|
||||||
|
stats.update(res.payload)
|
||||||
|
res = await mc.commands.get_stats_radio()
|
||||||
|
if res.type == EventType.ERROR:
|
||||||
|
logger.error("Couldn't get radio stats")
|
||||||
|
else:
|
||||||
|
stats.update(res.payload)
|
||||||
|
res = await mc.commands.get_stats_packets()
|
||||||
|
if res.type == EventType.ERROR:
|
||||||
|
logger.error("Couldn't get packets stats")
|
||||||
|
else:
|
||||||
|
stats.update(res.payload)
|
||||||
|
print(json.dumps(stats, indent=4))
|
||||||
|
|
||||||
case _ :
|
case _ :
|
||||||
res = await mc.commands.get_custom_vars()
|
res = await mc.commands.get_custom_vars()
|
||||||
logger.debug(res)
|
logger.debug(res)
|
||||||
|
|
@ -3638,6 +3684,10 @@ def get_help_for (cmdname, context="line") :
|
||||||
print_path_updates : display path updates as they come
|
print_path_updates : display path updates as they come
|
||||||
custom : all custom variables in json format
|
custom : all custom variables in json format
|
||||||
each custom var can also be get/set directly
|
each custom var can also be get/set directly
|
||||||
|
stats/status : print status of the node
|
||||||
|
stats_core : core stats (bat/error/uptime/queue)
|
||||||
|
stats_radio : radio stats (noise/rssi/snr/tx_air/rx_air)
|
||||||
|
stats_packets : packets stats (recv/sent/flood/direct)
|
||||||
""")
|
""")
|
||||||
|
|
||||||
elif cmdname == "set" :
|
elif cmdname == "set" :
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue