From 29b1932517d22aefb9ad7ac7785185e697b4702b Mon Sep 17 00:00:00 2001
From: Ramakrishnan Muthukrishnan <ram@rkrishnan.org>
Date: Tue, 11 Jan 2022 14:56:12 +0530
Subject: [PATCH] implement ZZCS command (set or get CW keyer speed)

---
 rigctl.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/rigctl.c b/rigctl.c
index 34f5079..99cd219 100644
--- a/rigctl.c
+++ b/rigctl.c
@@ -1271,7 +1271,20 @@ gboolean parse_extended_cmd(char *command, CLIENT *client) {
       }
       break;
     case 'S': // ZZCS
-      implemented = FALSE;
+        if (command[4] == ';') {
+            sprintf(reply, "ZZCS%02d;", cw_keyer_speed);
+            send_resp(client->fd, reply);
+        } else if (command[6] == ';') {
+            command[6] = '\0';
+            int speed = atoi(&command[4]);
+            if (speed >= 1 && speed <= 60) {
+                cw_keyer_speed = speed;
+#ifdef LOCALCW
+                keyer_update();
+#endif
+                vfo_update();
+            }
+        }
       break;
     case 'T': // ZZCT
       implemented = FALSE;
-- 
2.45.2