From a8e6afeb763011a727c0c3ae0c15be713f49cba6 Mon Sep 17 00:00:00 2001 From: Peter Saunderson Date: Mon, 23 Sep 2024 20:41:49 +0100 Subject: [PATCH] enable more Meade commands --- drivers/telescope/lx200_OpenAstroTech.cpp | 31 +++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/drivers/telescope/lx200_OpenAstroTech.cpp b/drivers/telescope/lx200_OpenAstroTech.cpp index 80ffc40d76..6143dac06e 100644 --- a/drivers/telescope/lx200_OpenAstroTech.cpp +++ b/drivers/telescope/lx200_OpenAstroTech.cpp @@ -330,7 +330,23 @@ int LX200_OpenAstroTech::executeMeadeCommand(const char *cmd, char *data) getchar = true; } } - else if(cmd[1] == 'M' && cmd[2] == 'A') // MAL, MAZ + else if(cmd[1] == 'M' && cmd[2] == 'A') // MAL, MAZ + { + wait = false; + } + else if(cmd[1] == 'M' && cmd[2] == 'X') // MXxnnnnn# + { + getchar = true; + } + else if(cmd[1] == 'M' && (cmd[2] == 'g' || cmd[2] == 'G')) // Mgnxxxx# + { + wait = false; + } + else if(cmd[1] == 'S' && cmd[2] != 'C') // SCMM/DD/YY# + { + getchar = true; + } + else if(cmd[1] == 'X' && cmd[2] == 'S') // :XSRn.n# :XSDn.n# :XS... { wait = false; } @@ -343,7 +359,18 @@ int LX200_OpenAstroTech::executeMeadeCommand(const char *cmd, char *data) if(getchar) { int val = getCommandChar(PortFD, cmd); - sprintf(data, "%c", val); + if(0 < val) + { + sprintf(data, "%c", val); + } + else if(0 == val) + { + sprintf(data, "%s", "null"); + } + else + { + err = val; + } } else {