aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/console.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-08-07 20:49:42 -0400
committerKevin O'Connor <kevin@koconnor.net>2017-08-08 00:27:28 -0400
commit5e6acf7dbc152ed9b0715dca7c0c3bd9b37aa8e1 (patch)
treea34875aafd6a7d38a19bf413af5ebe2ff3c7662f /klippy/console.py
parent58811b5c4488ee19e707254a7710d0c705900d1e (diff)
downloadkutter-5e6acf7dbc152ed9b0715dca7c0c3bd9b37aa8e1.tar.gz
kutter-5e6acf7dbc152ed9b0715dca7c0c3bd9b37aa8e1.tar.xz
kutter-5e6acf7dbc152ed9b0715dca7c0c3bd9b37aa8e1.zip
console: Add support for a STATS command
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/console.py')
-rwxr-xr-xklippy/console.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/klippy/console.py b/klippy/console.py
index f2e80591..35a0ca7a 100755
--- a/klippy/console.py
+++ b/klippy/console.py
@@ -15,6 +15,7 @@ help_txt = """
PINS : Load pin name aliases (eg, "PINS arduino")
DELAY : Send a command at a clock time (eg, "DELAY 9999 get_uptime")
SET : Create a local variable (eg, "SET myvar 123.4")
+ STATS : Report serial statistics
LIST : List available mcu commands, local commands, and local variables
HELP : Show this text
All commands also support evaluation by enclosing an expression in { }.
@@ -41,7 +42,7 @@ class KeyboardReader:
self.local_commands = {
"PINS": self.command_PINS, "SET": self.command_SET,
"DELAY": self.command_DELAY, "LIST": self.command_LIST,
- "HELP": self.command_HELP,
+ "STATS": self.command_STATS, "HELP": self.command_HELP,
}
self.eval_globals = {}
def connect(self, eventtime):
@@ -85,6 +86,8 @@ class KeyboardReader:
self.output("Error: %s" % (str(e),))
return
self.ser.send(msg, minclock=val)
+ def command_STATS(self, parts):
+ self.output(self.ser.stats(self.reactor.monotonic()))
def command_LIST(self, parts):
self.update_evals(self.reactor.monotonic())
mp = self.ser.msgparser