Fix some issues with commands not supported by TS-2000 CAT emulations

Various SDR  consoles are  supported by the  TS-2000 back  end, ensure
that commands  unsupported are  not sent  to them.  Added a  flag that
shows back end is talking to an emulation like SmartSDR or PowerSDR.
pull/1/head
Bill Somerville 2017-08-02 23:31:24 +01:00 zatwierdzone przez Nate Bargmann
rodzic ffb9f21d3a
commit 3fade92c0d
2 zmienionych plików z 77 dodań i 58 usunięć

Wyświetl plik

@ -603,6 +603,7 @@ int kenwood_open(RIG *rig)
|| !strcmp ("ID907", id) /* PowerSDR Flex-6300 */
)
{
priv->is_emulation = 1; /* Emulations don't have SAT mode */
strcpy (id, "ID019"); /* fake it */
}
@ -736,7 +737,7 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo)
}
//if rig=ts2000 then check Satellite mode status
if(rig->caps->rig_model == RIG_MODEL_TS2000) {
if(rig->caps->rig_model == RIG_MODEL_TS2000 && !priv->is_emulation) {
char retbuf[20];
rig_debug(RIG_DEBUG_VERBOSE, "Checking Satellite mode status\n");
snprintf(cmdbuf, sizeof (cmdbuf), "SA");
@ -1380,6 +1381,7 @@ int kenwood_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
if (!rig)
return -RIG_EINVAL;
struct kenwood_priv_data *priv = rig->state.priv;
struct kenwood_priv_caps *caps = kenwood_caps(rig);
char buf[6];
char kmode;
@ -1411,6 +1413,14 @@ int kenwood_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
}
}
if (priv->is_emulation)
{
/* emulations like PowerSDR and SmartSDR normally hijack the
RTTY modes for SSB-DATA AFSK modes */
if (RIG_MODE_PKTLSB == mode) mode = RIG_MODE_RTTY;
if (RIG_MODE_PKTUSB == mode) mode = RIG_MODE_RTTYR;
}
kmode = rmode2kenwood(mode, caps->mode_table);
if (kmode < 0 ) {
rig_debug(RIG_DEBUG_WARN, "%s: unsupported mode '%s'\n",
@ -1545,6 +1555,7 @@ int kenwood_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
if (!rig || !mode || !width)
return -RIG_EINVAL;
struct kenwood_priv_data *priv = rig->state.priv;
struct kenwood_priv_caps *caps = kenwood_caps(rig);
char cmd[4];
char modebuf[10];
@ -1593,6 +1604,13 @@ int kenwood_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
kmode = modebuf[offs] - 'A' + 10;
}
*mode = kenwood2rmode(kmode, caps->mode_table);
if (priv->is_emulation)
{
/* emulations like PowerSDR and SmartSDR normally hijack the
RTTY modes for SSB-DATA AFSK modes */
if (RIG_MODE_RTTY == *mode) *mode = RIG_MODE_PKTLSB;
if (RIG_MODE_RTTYR == *mode) *mode = RIG_MODE_PKTUSB;
}
if (RIG_MODEL_TS590S == rig->caps->rig_model
|| RIG_MODEL_TS590SG == rig->caps->rig_model)

Wyświetl plik

@ -78,6 +78,7 @@ struct kenwood_priv_data {
int trn_state; /* AI state discovered at startup */
unsigned fw_rev_uint; /* firmware revison as a number 1.07 -> 107 */
char verify_cmd[4]; /* command used to verify set commands */
int is_emulation; /* flag for TS-2000 emulations */
void * data; /* model specific data */
};