[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 2066bb38fd8b77a465268
Library to control radio transceivers and receivers
Brought to you by:
n0nb
|
From: Michael B. <mdb...@us...> - 2021-04-27 22:34:40
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Hamlib -- Ham radio control libraries".
The branch, master has been updated
via 2066bb38fd8b77a46526826b1be2d0f9f34ddf8e (commit)
from bfa75996874d7d34b3921cdc76cc6a3c4e9af8fd (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2066bb38fd8b77a46526826b1be2d0f9f34ddf8e
Author: Mike Black W9MDB <mdb...@ya...>
Date: Tue Apr 27 17:32:10 2021 -0500
Change rig_get_rig_info to use cached values for VFOB when not targetable
https://github.com/Hamlib/Hamlib/issues/682
diff --git a/src/rig.c b/src/rig.c
index 22746071..d8412965 100644
--- a/src/rig.c
+++ b/src/rig.c
@@ -6223,8 +6223,19 @@ int HAMLIB_API rig_get_rig_info(RIG *rig, char *response, int max_response_len)
vfoB = vfo_fixup(rig, RIG_VFO_B);
ret = rig_get_vfo_info(rig, vfoA, &freqA, &modeA, &widthA, &split, &satmode);
if (ret != RIG_OK) RETURNFUNC(ret);
- ret = rig_get_vfo_info(rig, vfoB, &freqB, &modeB, &widthB, &split, &satmode);
- if (ret != RIG_OK) RETURNFUNC(ret);
+ // we need both vfo and mode targtable to avoid vfo swapping
+ if ((rig->caps->targetable_vfo & RIG_TARGETABLE_FREQ) && (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE))
+ {
+ ret = rig_get_vfo_info(rig, vfoB, &freqB, &modeB, &widthB, &split, &satmode);
+ if (ret != RIG_OK) RETURNFUNC(ret);
+ }
+ else
+ {
+ // we'll use cached info instead of doing the vfo swapping
+ int cache_ms_freq, cache_ms_mode, cache_ms_width;
+ rig_get_cache(rig, vfoB, &freqB, &cache_ms_freq, &modeB, &cache_ms_mode, &widthB,
+ &cache_ms_width);
+ }
rxa = 1;
txa = split == 0;
rxb = !rxa;
-----------------------------------------------------------------------
Summary of changes:
src/rig.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
hooks/post-receive
--
Hamlib -- Ham radio control libraries
|