}
}
+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];
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
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]==';') {