From 7c767d52dc840046dde1c372ff6efd6deb79d63b Mon Sep 17 00:00:00 2001 From: c vw Date: Thu, 28 May 2020 10:07:08 +0200 Subject: [PATCH] rigctl.c: manual merge with John's update --- rigctl.c | 73 +++++++++++++++++++++++++++++++------------------------- 1 file changed, 41 insertions(+), 32 deletions(-) diff --git a/rigctl.c b/rigctl.c index 6b90735..08f5cda 100644 --- 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]==';') { -- 2.45.2