Skip to content

Commit

Permalink
Change ptt check in newcat.c set_freq to check ptt only for affected …
Browse files Browse the repository at this point in the history
…rigs

Hamlib#540
  • Loading branch information
mdblack98 committed Feb 8, 2021
1 parent 3607049 commit 54aca79
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
21 changes: 9 additions & 12 deletions rigs/yaesu/newcat.c
Original file line number Diff line number Diff line change
Expand Up @@ -787,20 +787,17 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
if (vfo != rig->state.tx_vfo) return -RIG_ENTARGET;
}

ptt_t ptt;
if (RIG_OK != (err = newcat_get_ptt(rig, vfo, &ptt)))
if (is_ftdx3000 || is_ftdx5000)
{
ERRMSG(err, "newcat_set_cmd failed");
RETURNFUNC(err);
}

if (ptt == RIG_PTT_ON) // we have a few rigs that can't set TX VFO while PTT_ON
{
// should be true whether we're on VFOA or VFOB but only restricting VFOB right now
// we return RIG_OK as we dont' want
if (is_ftdx3000) { return RIG_ENTARGET; }
// we have a few rigs that can't set freq while PTT_ON
ptt_t ptt;
if (RIG_OK != (err = newcat_get_ptt(rig, vfo, &ptt)))
{
ERRMSG(err, "newcat_set_cmd failed");
RETURNFUNC(err);
}

if (is_ftdx5000) { return RIG_ENTARGET; }
if (ptt) { return RIG_ENTARGET; }
}

if (RIG_MODEL_FT450 == caps->rig_model)
Expand Down
24 changes: 24 additions & 0 deletions src/rig.c
Original file line number Diff line number Diff line change
Expand Up @@ -1839,6 +1839,30 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
RETURNFUNC(retcode);
}

/**
* \brief get the frequency of VFOA and VFOB
* \param rig The rig handle
* \param freqA The location where to store the VFOA/Main frequency
* \param freqB The location where to store the VFOB/Sub frequency
*
* Retrieves the frequency of VFOA/Main and VFOB/Sub
* The value stored at \a freq location equals RIG_FREQ_NONE when the current
* frequency of the VFO is not defined (e.g. blank memory).
*
* \RETURNFUNC(RIG_OK) if the operation has been successful, otherwise
* a negative value if an error occurred (in which case, cause is
* set appropriately).
*
* \sa rig_set_freq()
*/
int HAMLIB_API rig_get_freqs(RIG *rig, freq_t *freqA, freq_t freqB)
{
// we will attempt to avoid vfo swapping in this routine

return -RIG_ENIMPL;

}


/**
* \brief set the mode of the target VFO
Expand Down

0 comments on commit 54aca79

Please sign in to comment.