From 2991d43e26d2179618a3b93313401cda10b65000 Mon Sep 17 00:00:00 2001 From: mdblack98 Date: Fri, 1 May 2020 10:35:16 -0500 Subject: [PATCH] If icom.c rig_get_freq is called and VFO is None then VFO gets set to the requexted VFO https://github.com/Hamlib/Hamlib/issues/231 --- rigs/icom/icom.c | 7 +++++++ rigs/icom/icom.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index b0fa32b53..61f60cee3 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1095,6 +1095,13 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) rig_debug(RIG_DEBUG_VERBOSE, "%s: using vfo=%s\n", __func__, rig_strvfo(vfo)); + if (priv->curr_vfo == RIG_VFO_NONE) { + retval = rig_set_vfo(rig, vfo); + if (retval != RIG_OK) { + rig_debug(RIG_DEBUG_ERR, "%s: set_vfo failed? retval=%s\n", __func__, strerror(retval)); + } + } + retval = icom_transaction(rig, cmd, subcmd, NULL, 0, freqbuf, &freq_len); if (retval != RIG_OK) diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 420be1eba..7ed790230 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -30,7 +30,7 @@ #include #endif -#define BACKEND_VER "20200426" +#define BACKEND_VER "20200501" /* * defines used by comp_cal_str in rig.c