mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-07 15:07:33 -06:00
gcode: Add support for M115 command
Support querying the firmware type and version. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
2e03d84755
commit
860fc3e91d
3 changed files with 16 additions and 9 deletions
|
@ -36,11 +36,11 @@ def create_pty(ptyname):
|
|||
termios.tcsetattr(mfd, termios.TCSADRAIN, old)
|
||||
return mfd
|
||||
|
||||
def report_git_version():
|
||||
def get_git_version():
|
||||
# Obtain version info from "git" program
|
||||
if not os.path.exists('.git'):
|
||||
logging.debug("No '.git' file/directory found")
|
||||
return
|
||||
return "?"
|
||||
prog = "git describe --tags --long --dirty"
|
||||
try:
|
||||
process = subprocess.Popen(shlex.split(prog), stdout=subprocess.PIPE)
|
||||
|
@ -48,6 +48,5 @@ def report_git_version():
|
|||
retcode = process.poll()
|
||||
except OSError:
|
||||
logging.debug("Exception on run: %s" % (traceback.format_exc(),))
|
||||
return
|
||||
ver = output.strip()
|
||||
logging.info("Git version: %s" % (repr(ver),))
|
||||
return "?"
|
||||
return output.strip()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue