[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. cfaa761c83ef6d785a139
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Michael B. <mdb...@us...> - 2021-02-09 18:28:33
|
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 cfaa761c83ef6d785a139b50dcf899a8a3e54eca (commit) via a23a3b48821da4edc3b0fbd133be4fe63d2b80ee (commit) from 2bb74f77d2be23c9d2f31a9cd4fe36d604155827 (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 cfaa761c83ef6d785a139b50dcf899a8a3e54eca Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Feb 9 12:25:12 2021 -0600 Fix caching of bad IF response for Kenwood rigs Update cache calls to use the enum values in kenwood.c diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 2f3609b4..6d38b120 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -260,7 +260,7 @@ int kenwood_transaction(RIG *rig, const char *cmdstr, char *data, { int cache_age_ms; - cache_age_ms = elapsed_ms(&priv->cache_start, 0); + cache_age_ms = elapsed_ms(&priv->cache_start, HAMLIB_ELAPSED_GET); if (cache_age_ms < 500) // 500ms cache time { @@ -548,7 +548,7 @@ transaction_quit: // update the cache if (retval == RIG_OK && strcmp(cmdstr, "IF") == 0) { - elapsed_ms(&priv->cache_start, 1); + elapsed_ms(&priv->cache_start, HAMLIB_ELAPSED_SET); strncpy(priv->last_if_response, buffer, caps->if_len); } @@ -613,10 +613,12 @@ int kenwood_safe_transaction(RIG *rig, const char *cmd, char *buf, if (checklen && length != expected) /* worth retrying as some rigs occasionally send short results */ { + struct kenwood_priv_data *priv = rig->state.priv; rig_debug(RIG_DEBUG_ERR, "%s: wrong answer; len for cmd %s: expected = %d, got %d\n", __func__, cmd, (int)expected, (int)length); err = -RIG_EPROTO; + elapsed_ms(&priv->cache_start, HAMLIB_ELAPSED_INVALIDATE); hl_usleep(50 * 1000); // let's do a short wait } } diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 7382156d..83553879 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -27,7 +27,7 @@ #include <string.h> #include "token.h" -#define BACKEND_VER "20201231" +#define BACKEND_VER "20210209" #define EOM_KEN ';' #define EOM_TH '\r' commit a23a3b48821da4edc3b0fbd133be4fe63d2b80ee Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Feb 8 17:36:48 2021 -0600 Add a little debug to rig.c https://github.com/Hamlib/Hamlib/issues/539 diff --git a/src/rig.c b/src/rig.c index 0dcda745..8f8aff38 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1373,6 +1373,8 @@ static int set_cache_freq(RIG *rig, vfo_t vfo, freq_t freq) if (vfo == RIG_VFO_CURR) { vfo = rig->state.current_vfo; } + rig_debug(RIG_DEBUG_TRACE, "%s: set vfo=%s to freq=%.0f\n", __func__, rig_strvfo(vfo), freq); + switch (vfo) { case RIG_VFO_CURR: @@ -1433,6 +1435,8 @@ static int get_cache_freq(RIG *rig, vfo_t vfo, freq_t *freq, int *cache_ms) if (vfo == RIG_VFO_CURR) { vfo = rig->state.current_vfo; } + rig_debug(RIG_DEBUG_TRACE, "%s: get vfo=%s\n", __func__, rig_strvfo(vfo)); + // VFO_C to be implemented switch (vfo) { ----------------------------------------------------------------------- Summary of changes: rigs/kenwood/kenwood.c | 6 ++++-- rigs/kenwood/kenwood.h | 2 +- src/rig.c | 4 ++++ 3 files changed, 9 insertions(+), 3 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |