kopia lustrzana https://github.com/Hamlib/Hamlib
Fix Kenwood Split Operation for TS50 & TS480.
The TS50S has the old FN and SP commands rather than the newer FR/FT commands, added code to support these commands allowing split operation to be commanded on the TS50S. The TS480 had no split VFO functions enabled, added normal modern Kenwood split VFO and mode handing functions.Hamlib-3.0
rodzic
02915a5712
commit
54c297b4c4
|
@ -538,7 +538,7 @@ static int kenwood_get_if(RIG *rig)
|
|||
}
|
||||
|
||||
|
||||
/* FR FT
|
||||
/* FN FR FT
|
||||
* Sets the RX/TX VFO or M.CH mode of the transceiver, does not set split
|
||||
* VFO, but leaves it unchanged if in split VFO mode.
|
||||
*
|
||||
|
@ -579,13 +579,19 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo)
|
|||
|
||||
sprintf(cmdbuf, "FR%c", vfo_function);
|
||||
|
||||
if (rig->caps->rig_model == RIG_MODEL_TS50)
|
||||
{
|
||||
cmdbuf[1] = 'N';
|
||||
}
|
||||
|
||||
/* set RX VFO */
|
||||
retval = kenwood_simple_cmd(rig, cmdbuf);
|
||||
if (retval != RIG_OK)
|
||||
return retval;
|
||||
|
||||
/* if FN command then there's no FT or FR */
|
||||
/* If split mode on, the don't change TxVFO */
|
||||
if (priv->split != RIG_SPLIT_OFF)
|
||||
if ('N' == cmdbuf[1] || priv->split != RIG_SPLIT_OFF)
|
||||
return RIG_OK;
|
||||
|
||||
/* set TX VFO */
|
||||
|
@ -660,6 +666,33 @@ int kenwood_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
|
|||
}
|
||||
|
||||
|
||||
/* SP
|
||||
* Sets the split mode of the transceivers that have the FN command.
|
||||
*
|
||||
*/
|
||||
int kenwood_set_split(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
if (!rig)
|
||||
return -RIG_EINVAL;
|
||||
|
||||
struct kenwood_priv_data *priv = rig->state.priv;
|
||||
char cmdbuf[6];
|
||||
int retval;
|
||||
|
||||
sprintf(cmdbuf, "SP%c", RIG_SPLIT_ON == split ? '1' : '0');
|
||||
retval = kenwood_simple_cmd(rig, cmdbuf);
|
||||
if (retval != RIG_OK)
|
||||
return retval;
|
||||
|
||||
/* Remember whether split is on, for kenwood_set_vfo */
|
||||
priv->split = split;
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
||||
/* IF
|
||||
* Gets split VFO status from kenwood_get_if()
|
||||
*
|
||||
|
|
|
@ -100,6 +100,7 @@ int kenwood_open(RIG *rig);
|
|||
|
||||
int kenwood_set_vfo(RIG *rig, vfo_t vfo);
|
||||
int kenwood_get_vfo_if(RIG *rig, vfo_t *vfo);
|
||||
int kenwood_set_split(RIG *rig, vfo_t vfo , split_t split, vfo_t txvfo);
|
||||
int kenwood_set_split_vfo(RIG *rig, vfo_t vfo , split_t split, vfo_t txvfo);
|
||||
int kenwood_get_split_vfo_if(RIG *rig, vfo_t rxvfo, split_t *split, vfo_t *txvfo);
|
||||
|
||||
|
|
|
@ -379,6 +379,8 @@ const struct rig_caps ts480_caps = {
|
|||
.get_mode = kenwood_get_mode,
|
||||
.set_vfo = kenwood_set_vfo,
|
||||
.get_vfo = kenwood_get_vfo_if,
|
||||
.set_split_vfo = kenwood_set_split_vfo,
|
||||
.get_split_vfo = kenwood_get_split_vfo_if,
|
||||
.get_ptt = kenwood_get_ptt,
|
||||
.set_ptt = kenwood_set_ptt,
|
||||
.get_dcd = kenwood_get_dcd,
|
||||
|
|
|
@ -185,6 +185,8 @@ const struct rig_caps ts50s_caps = {
|
|||
.get_mode = kenwood_get_mode,
|
||||
.set_vfo = kenwood_set_vfo,
|
||||
.get_vfo = kenwood_get_vfo_if,
|
||||
.set_split_vfo = kenwood_set_split,
|
||||
.get_split_vfo = kenwood_get_split_vfo_if,
|
||||
.set_ctcss_tone = kenwood_set_ctcss_tone,
|
||||
.get_ctcss_tone = kenwood_get_ctcss_tone,
|
||||
.get_ptt = kenwood_get_ptt,
|
||||
|
|
Ładowanie…
Reference in New Issue