[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 2365297cacd077e5ae294
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Michael B. <mdb...@us...> - 2021-01-18 22:41:09
|
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 2365297cacd077e5ae2943d054d49c43103d9480 (commit) via c43211e3a5b03ffecf26f677122210afa257d37a (commit) from 2654503779c286da567ab64e95f551f163120b79 (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 2365297cacd077e5ae2943d054d49c43103d9480 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jan 18 16:39:57 2021 -0600 In yaesu band select disable setting other VFO. Hopefully this works OK diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 5efb972e..ab2c5d88 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -886,6 +886,8 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) __func__, rigerror(err)); } + +#if 0 // disable for testing else { // Also need to do this for the other VFO on some Yaesu rigs @@ -964,6 +966,26 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) } } +#endif + // after band select re-read things -- may not have to change anything + // reading both VFOs is really only needed for rigs with just one VFO stack + // but we read them all to ensure we cover both types + freq_t tmp_freqA, tmp_freqB; + rmode_t tmp_mode; + pbwidth_t tmp_width; + rig_get_freq(rig, RIG_VFO_MAIN, &tmp_freqA); + rig_get_freq(rig, RIG_VFO_SUB, &tmp_freqB); + rig_get_mode(rig, RIG_VFO_MAIN, &tmp_mode, &tmp_width); + rig_get_mode(rig, RIG_VFO_SUB, &tmp_mode, &tmp_width); + + if ((target_vfo == 0 && tmp_freqA == freq) + || (target_vfo == 1 && tmp_freqB == freq)) + { + rig_debug(RIG_DEBUG_VERBOSE, + "%s: freq after band select already set to %"PRIfreq"\n", __func__, freq); + RETURNFUNC(RIG_OK); // we're done then!! + } + // just drop through } commit c43211e3a5b03ffecf26f677122210afa257d37a Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jan 18 10:05:37 2021 -0600 Reduce timeout for newcat_rig_open to allow powered off rig to be detected faster Now takes a bit over 1 second instead of over 10 seconds Powered on rigs should still work the same diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 74c4d121..5efb972e 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -526,6 +526,9 @@ int newcat_open(RIG *rig) /* get current AI state so it can be restored */ priv->trn_state = -1; + // for this sequence we will shorten the timeout so we can detect rig is powered off faster + int timeout = rig->state.rigport.timeout; + rig->state.rigport.timeout = 100; newcat_get_trn(rig, &priv->trn_state); /* ignore errors */ /* Currently we cannot cope with AI mode so turn it off in case @@ -538,6 +541,7 @@ int newcat_open(RIG *rig) /* Initialize rig_id in case any subsequent commands need it */ (void)newcat_get_rigid(rig); rig_debug(RIG_DEBUG_VERBOSE, "%s: rig_id=%d\n", __func__, priv->rig_id); + rig->state.rigport.timeout = timeout; #if 0 // possible future enhancement? @@ -814,29 +818,40 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // And only when not in split mode (note this check has been removed for testing) int changing; - rig_debug(RIG_DEBUG_TRACE, "%s(%d)%s: rig->state.current_vfo=%s\n", __FILE__, __LINE__, __func__, rig_strvfo(rig->state.current_vfo)); - if (rig->state.current_vfo == RIG_VFO_A || rig->state.current_vfo == RIG_VFO_MAIN) + rig_debug(RIG_DEBUG_TRACE, "%s(%d)%s: rig->state.current_vfo=%s\n", __FILE__, + __LINE__, __func__, rig_strvfo(rig->state.current_vfo)); + + if (rig->state.current_vfo == RIG_VFO_A + || rig->state.current_vfo == RIG_VFO_MAIN) { - rig_debug(RIG_DEBUG_TRACE, "%s(%d)%s: checking VFOA for band change \n", __FILE__, __LINE__, __func__); + rig_debug(RIG_DEBUG_TRACE, "%s(%d)%s: checking VFOA for band change \n", + __FILE__, __LINE__, __func__); + if (rig->state.cache.freqMainA == 0) { freq_t freqtmp; - err = rig_get_freq(rig,RIG_VFO_CURR,&freqtmp); - if (err != RIG_OK) RETURNFUNC(err); + err = rig_get_freq(rig, RIG_VFO_CURR, &freqtmp); + + if (err != RIG_OK) { RETURNFUNC(err); } } + changing = newcat_band_index(freq) != newcat_band_index( rig->state.cache.freqMainA); rig_debug(RIG_DEBUG_TRACE, "%s: VFO_A band changing=%d\n", __func__, changing); } else { - rig_debug(RIG_DEBUG_TRACE, "%s(%d)%s: checking VFOB for band change \n", __FILE__, __LINE__, __func__); + rig_debug(RIG_DEBUG_TRACE, "%s(%d)%s: checking VFOB for band change \n", + __FILE__, __LINE__, __func__); + if (rig->state.cache.freqMainB == 0) { freq_t freqtmp; - err = rig_get_freq(rig,RIG_VFO_CURR,&freqtmp); - if (err != RIG_OK) RETURNFUNC(err); + err = rig_get_freq(rig, RIG_VFO_CURR, &freqtmp); + + if (err != RIG_OK) { RETURNFUNC(err); } } + changing = newcat_band_index(freq) != newcat_band_index( rig->state.cache.freqMainB); rig_debug(RIG_DEBUG_TRACE, "%s: VFO_B band changing=%d\n", __func__, changing); @@ -6599,7 +6614,7 @@ ncboolean newcat_is_rig(RIG *rig, rig_model_t model) //rig_debug(RIG_DEBUG_TRACE, "%s(%d):%s called\n", __FILE__, __LINE__, __func__); is_rig = (model == rig->caps->rig_model) ? TRUE : FALSE; - return(is_rig); + return (is_rig); } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index ea6a6c22..722c43d2 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20210117" +#define NEWCAT_VER "20210118" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 55 ++++++++++++++++++++++++++++++++++++++++++++--------- rigs/yaesu/newcat.h | 2 +- 2 files changed, 47 insertions(+), 10 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |