From 718fcdf0c11660d3712e9a9527f47bd5b6010df5 Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Mon, 8 Jun 2020 23:09:21 -0500 Subject: [PATCH] icom.c put one more satmode call in a RIG_FUNC_SATMODE clause https://github.com/Hamlib/Hamlib/issues/288 --- rigs/icom/icom.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 9ea7ebe41..2926593c5 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -756,22 +756,25 @@ icom_rig_open(RIG *rig) } } - // retval is important here so we always call for satmode - retval = rig_get_func(rig, RIG_VFO_CURR, RIG_FUNC_SATMODE, &satmode); - rig->state.cache.satmode = satmode; - rig_debug(RIG_DEBUG_VERBOSE, "%s: satmode=%d\n", __func__, satmode); + if (rig->caps->has_get_func & RIG_FUNC_SATMODE) + { + // retval is important here -- used below + retval = rig_get_func(rig, RIG_VFO_CURR, RIG_FUNC_SATMODE, &satmode); + rig->state.cache.satmode = satmode; + rig_debug(RIG_DEBUG_VERBOSE, "%s: satmode=%d\n", __func__, satmode); - // RIG_OK return means this rig has satmode capabiltiy and Main/Sub VFOs - // Should we also set/force VFOA for Main&Sub here? - if (retval == RIG_OK && satmode) - { - priv->rx_vfo = RIG_VFO_MAIN; - priv->tx_vfo = RIG_VFO_SUB; - } - else if (retval == RIG_OK && !satmode) - { - priv->rx_vfo = RIG_VFO_MAIN; - priv->tx_vfo = RIG_VFO_MAIN; + // RIG_OK return means this rig has satmode capabiltiy and Main/Sub VFOs + // Should we also set/force VFOA for Main&Sub here? + if (retval == RIG_OK && satmode) + { + priv->rx_vfo = RIG_VFO_MAIN; + priv->tx_vfo = RIG_VFO_SUB; + } + else if (retval == RIG_OK && !satmode) + { + priv->rx_vfo = RIG_VFO_MAIN; + priv->tx_vfo = RIG_VFO_MAIN; + } } #if 0 // do not do this here -- needs to be done when ranges are requested instead as this is very slow