]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
rigctl.c: manual merge with John's update
authorc vw <dl1ycf@darc.de>
Thu, 28 May 2020 08:07:08 +0000 (10:07 +0200)
committerc vw <dl1ycf@darc.de>
Thu, 28 May 2020 08:07:08 +0000 (10:07 +0200)
rigctl.c

index 6b90735d6580ecd7eed743fcf360dbafe32820b5..08f5cda317d6d1e71388524dc569b5f1446f1d88 100644 (file)
--- a/rigctl.c
+++ b/rigctl.c
@@ -722,6 +722,41 @@ int rit_on () {
   }
 }
 
+static int ts2000_mode(int m) {
+  int mode=1;
+  switch(m) {
+    case modeLSB:
+      mode=1;
+      break;
+    case modeUSB:
+      mode=2;
+      break;
+    case modeCWL:
+      mode=7;
+      break;
+    case modeCWU:
+      mode=3;
+      break;
+    case modeFMN:
+      mode=4;
+      break;
+    case modeAM:
+    case modeSAM:
+      mode=5;
+      break;
+    case modeDIGL:
+      mode=6;
+      break;
+    case modeDIGU:
+      mode=9;
+      break;
+    default:
+      break;
+  }
+  return mode;
+}
+
+
 gboolean parse_extended_cmd (char *command,CLIENT *client) {
   gboolean implemented=TRUE;
   char reply[256];
@@ -2874,11 +2909,14 @@ int parse_cmd(void *data) {
           send_resp(client->fd,reply);
           break;
         case 'F': //IF
-          sprintf(reply,"IF%011lld%04lld%+06lld%d%d000%d%d%d0%d%d%02d0;",
+          {
+          int mode=ts2000_mode(vfo[VFO_A].mode);
+          sprintf(reply,"IF%011lld%04lld%+06lld%d%d%d%02d%d%d%d%d%d%d%02d%d;",
                   vfo[VFO_A].ctun?vfo[VFO_A].ctun_frequency:vfo[VFO_A].frequency,
                   step,vfo[VFO_A].rit,vfo[VFO_A].rit_enabled,transmitter==NULL?0:transmitter->xit_enabled,
-                  mox,split,0,split?1:0,transmitter->ctcss_enabled,transmitter->ctcss);
+                  0,0,isTransmitting(),mode,0,0,split,transmitter->ctcss_enabled?2:0,transmitter->ctcss,0);
           send_resp(client->fd,reply);
+          }
           break;
         case 'S': //IS
           // set/read IF shift
@@ -2974,36 +3012,7 @@ int parse_cmd(void *data) {
         case 'D': //MD
           // set/read operating mode
           if(command[2]==';') {
-            int mode=1;
-            switch(vfo[VFO_A].mode) {
-              case modeLSB:
-                mode=1;
-                break;
-              case modeUSB:
-                mode=2;
-                break;
-              case modeCWL:
-                mode=7;
-                break;
-              case modeCWU:
-                mode=3;
-                break;
-              case modeFMN:
-                mode=4;
-                break;
-              case modeAM:
-              case modeSAM:
-                mode=5;
-                break;
-              case modeDIGL:
-                mode=6;
-                break;
-              case modeDIGU:
-                mode=9;
-                break;
-              default:
-                break;
-            }
+            int mode=ts2000_mode(vfo[VFO_A].mode);
             sprintf(reply,"MD%d;",mode);
             send_resp(client->fd,reply);
           } else if(command[3]==';') {