Added some places to set default vfo when vfo has not been set yet. We're avoiding setting the default VFO on startup but allowing for clients which don't set the vfo properly.

Commented out icom_get_freq_range as can't have this on every rig_open call...too busy for rigctld
pull/224/head
Michael Black 2020-03-12 10:12:59 -05:00
rodzic 30e4f472f5
commit 42871be196
2 zmienionych plików z 22 dodań i 4 usunięć

Wyświetl plik

@ -776,7 +776,7 @@ icom_rig_open(RIG *rig)
priv->tx_vfo = RIG_VFO_MAIN;
}
icom_get_freq_range(rig); // try get to get rig range capability dyamically
// icom_get_freq_range(rig); // try get to get rig range capability dyamically
return RIG_OK;
}
@ -803,6 +803,8 @@ int icom_set_default_vfo(RIG *rig)
int retval;
struct icom_priv_data *priv = (struct icom_priv_data *) rig->state.priv;
rig_debug(RIG_DEBUG_TRACE,"%s: called, curr_vfo=%s\n", __func__, rig_strvfo(priv->curr_vfo));
if (VFO_HAS_MAIN_SUB_A_B_ONLY)
{
rig_debug(RIG_DEBUG_TRACE, "%s: setting default as MAIN/VFOA\n",
@ -1013,6 +1015,11 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
rs = &rig->state;
priv = (struct icom_priv_data *) rs->priv;
if (priv->curr_vfo == RIG_VFO_NONE)
{
icom_set_default_vfo(rig);
}
cmd = C_RD_FREQ;
subcmd = -1;
@ -3748,9 +3755,16 @@ int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
vfo_t save_vfo;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
rig_debug(RIG_DEBUG_VERBOSE, "%s called %s\n", __func__, rig_strvfo(vfo));
rs = &rig->state;
priv = (struct icom_priv_data *) rs->priv;
rig_debug(RIG_DEBUG_VERBOSE, "%s curr_vfo=%s\n", __func__, rig_strvfo(priv->curr_vfo));
if (priv->curr_vfo == RIG_VFO_NONE)
{
icom_set_default_vfo(rig);
}
save_vfo = priv->curr_vfo; // so we can restore it later
/* This method works also in memory mode(RIG_VFO_MEM) */
@ -4067,6 +4081,10 @@ int icom_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t tx_freq,
rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s\n", __func__,
rig_strvfo(vfo));
if (priv->curr_vfo == RIG_VFO_NONE)
{
icom_set_default_vfo(rig);
}
/* This method works also in memory mode(RIG_VFO_MEM) */
if (!priv->no_xchg && rig_has_vfo_op(rig, RIG_OP_XCHG))
{
@ -4481,9 +4499,9 @@ int icom_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
retval = icom_transaction(rig, C_CTL_SPLT, -1, NULL, 0,
splitbuf, &split_len);
if (retval != RIG_OK)
{
rig_debug(RIG_DEBUG_ERR, "%s: CTL_SPLT failed?\n", __func__);
return retval;
}

Wyświetl plik

@ -30,7 +30,7 @@
#include <sys/time.h>
#endif
#define BACKEND_VER "0.36"
#define BACKEND_VER "0.37"
/*
* defines used by comp_cal_str in rig.c