Change ptt check in newcat.c set_freq to check ptt only for affected rigs

https://github.com/Hamlib/Hamlib/issues/540
pull/544/head
Michael Black W9MDB 2021-02-08 16:29:04 -06:00
rodzic 360704908b
commit 54aca79671
2 zmienionych plików z 33 dodań i 12 usunięć

Wyświetl plik

@ -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);
}
// 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 (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; }
if (is_ftdx5000) { return RIG_ENTARGET; }
if (ptt) { return RIG_ENTARGET; }
}
if (RIG_MODEL_FT450 == caps->rig_model)

Wyświetl plik

@ -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