[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 35d945e002f475edb7242
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Michael B. <mdb...@us...> - 2021-04-02 21:41:13
|
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 35d945e002f475edb72421aef6c85afb100fbb7e (commit) via 02c985ce3d2eb7839501669a47f4db83d89c8d1d (commit) via ca9667a47e39cd6687c215563231a7a23982b43b (commit) via a3fe52ea6c8f96e42b0819ee58aff18f76380b41 (commit) via 04b4b83f15564f020106a0e02e07a4e9a27f0fd0 (commit) via c5b0b97383bf86463285ee4ace85929d5c0dd5a3 (commit) via 0794e6e1e65dfb4c8dc2c50bb974d48f57d8c50b (commit) via 33f299d16d83e27c9c19221caa65946b13d486a1 (commit) from 8e1fae4ea44fd47f585262f34abd82f9eba48c9e (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 35d945e002f475edb72421aef6c85afb100fbb7e Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Apr 2 16:36:46 2021 -0500 Add 100ms sleep to kenwood.c after set_ptt OFF In kenwood.c when ? reply is receive write the transaction again instead of just reading https://github.com/Hamlib/Hamlib/issues/644 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 22e20fe4..b98b6e48 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -450,7 +450,7 @@ transaction_read: { rig_debug(RIG_DEBUG_ERR, "%s: Retrying shortly\n", __func__); hl_usleep(rig->caps->timeout * 1000); - goto transaction_read; + goto transaction_write; } retval = -RIG_ERJCTED; @@ -3757,6 +3757,8 @@ int kenwood_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) int retval = kenwood_transaction(rig, ptt_cmd, NULL, 0); + if (ptt == RIG_PTT_OFF) hl_usleep(100*1000); // a little time for PTT to turn off + RETURNFUNC(retval); } diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index c1639e5b..9c30d27b 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "misc.h" -#define BACKEND_VER "20210328" +#define BACKEND_VER "20210402" #define EOM_KEN ';' #define EOM_TH '\r' commit 02c985ce3d2eb7839501669a47f4db83d89c8d1d Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Apr 2 12:07:34 2021 -0500 Add FLRig set_vfoA_fast detection and use it by default Need to add option to use the regular set_vfoA diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 3e25443e..5fec5f0b 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -112,6 +112,7 @@ struct flrig_priv_data pbwidth_t curr_widthB; int has_get_modeA; /* True if this function is available */ int has_get_bwA; /* True if this function is available */ + int has_set_vfoA_fast; float powermeter_scale; /* So we can scale power meter to 0-1 */ }; @@ -120,7 +121,7 @@ const struct rig_caps flrig_caps = RIG_MODEL(RIG_MODEL_FLRIG), .model_name = "FLRig", .mfg_name = "FLRig", - .version = BACKEND_VER ".0", + .version = "20210402", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -580,7 +581,7 @@ static int flrig_init(RIG *rig) struct flrig_priv_data *priv; ENTERFUNC; - rig_debug(RIG_DEBUG_TRACE, "%s version %s\n", __func__, BACKEND_VER); + rig_debug(RIG_DEBUG_TRACE, "%s version %s\n", __func__, rig->caps->version); rig->state.priv = (struct flrig_priv_data *)malloc(sizeof( struct flrig_priv_data)); @@ -746,7 +747,7 @@ static int flrig_open(RIG *rig) struct flrig_priv_data *priv = (struct flrig_priv_data *) rig->state.priv; ENTERFUNC; - rig_debug(RIG_DEBUG_VERBOSE, "%s version %s\n", __func__, BACKEND_VER); + rig_debug(RIG_DEBUG_VERBOSE, "%s version %s\n", __func__, rig->caps->version); retval = flrig_transaction(rig, "main.get_version", NULL, value, sizeof(value)); @@ -799,6 +800,22 @@ static int flrig_open(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s: getmodeA is not available\n", __func__); } + /* see if set_vfoA_fast is available */ + retval = flrig_transaction(rig, "rig.set_vfoA_fast", NULL, value, sizeof(value)); + + if (retval != RIG_OK) { RETURNFUNC(retval); } + + if (strlen(value) > 0) /* must have it since we got an answer */ + { + priv->has_set_vfoA_fast = 1; + rig_debug(RIG_DEBUG_VERBOSE, "%s: set_vfoA_fast is available=%s\n", __func__, + value); + } + else + { + rig_debug(RIG_DEBUG_VERBOSE, "%s: set_vfoA_fast is not available\n", __func__); + } + /* see if get_bwA is available */ retval = flrig_transaction(rig, "rig.get_bwA", NULL, value, sizeof(value)); @@ -1120,13 +1137,15 @@ static int flrig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (vfo == RIG_VFO_A) { cmd = "rig.set_vfoA"; - rig_debug(RIG_DEBUG_TRACE, "rig.set_vfoA %.0f\n", freq); + if (priv->has_set_vfoA_fast) cmd = "rig.set_vfoA_fast"; + rig_debug(RIG_DEBUG_TRACE, "%s %.0f\n", cmd, freq); priv->curr_freqA = freq; } else { cmd = "rig.set_vfoB"; - rig_debug(RIG_DEBUG_TRACE, "rig.set_vfoB %.0f\n", freq); + if (priv->has_set_vfoA_fast) cmd = "rig.set_vfoB_fast"; + rig_debug(RIG_DEBUG_TRACE, "%s %.0f\n", cmd, freq); priv->curr_freqB = freq; } diff --git a/rigs/dummy/flrig.h b/rigs/dummy/flrig.h index 06b76781..faec3511 100644 --- a/rigs/dummy/flrig.h +++ b/rigs/dummy/flrig.h @@ -28,8 +28,6 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20210402" - #define EOM "\r" #define TRUE 1 #define FALSE 0 commit ca9667a47e39cd6687c215563231a7a23982b43b Merge: a3fe52ea 04b4b83f Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Apr 2 10:28:47 2021 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit a3fe52ea6c8f96e42b0819ee58aff18f76380b41 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Apr 2 10:28:14 2021 -0500 In FlRig make rig.get_xcvr null answer non-fatal diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 4ef18e6d..3e25443e 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -763,27 +763,8 @@ static int flrig_open(RIG *rig) if (retval != RIG_OK) { - rig_debug(RIG_DEBUG_ERR, "%s: get_xcvr failed: %s\n", __func__, + rig_debug(RIG_DEBUG_ERR, "%s: get_xcvr failed,,,not fatal: %s\n", __func__, rigerror(retval)); - RETURNFUNC(retval); - } - - retval = flrig_transaction(rig, "rig.get_xcvr", NULL, value, sizeof(value)); - - if (retval != RIG_OK) - { - rig_debug(RIG_DEBUG_ERR, "%s: get_xcvr failed: %s\n", __func__, - rigerror(retval)); - RETURNFUNC(retval); - } - - retval = flrig_transaction(rig, "rig.get_xcvr", NULL, value, sizeof(value)); - - if (retval != RIG_OK) - { - rig_debug(RIG_DEBUG_ERR, "%s: get_xcvr failed: %s\n", __func__, - rigerror(retval)); - RETURNFUNC(retval); } strncpy(priv->info, value, sizeof(priv->info)); diff --git a/rigs/dummy/flrig.h b/rigs/dummy/flrig.h index 59f9a975..06b76781 100644 --- a/rigs/dummy/flrig.h +++ b/rigs/dummy/flrig.h @@ -28,7 +28,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20210331" +#define BACKEND_VER "20210402" #define EOM "\r" #define TRUE 1 commit 04b4b83f15564f020106a0e02e07a4e9a27f0fd0 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Apr 2 08:19:15 2021 -0500 Add a ptt check to ensure ptt is off for FTDX3000 and FTDX5000 Will wait up to 300ms for PTT off to occur Should help prevent trying to set freq while ptt is on https://github.com/Hamlib/Hamlib/issues/639 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 9dad47bc..8c601c8a 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -806,13 +806,26 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (is_ftdx3000 || is_ftdx5000) { // we have a few rigs that can't set freq while PTT_ON + // so we'll try a few times to see if we just need to wait a bit + // 3 retries should be about 400ms -- hopefully more than enough ptt_t ptt; + int retry = 3; - if (RIG_OK != (err = newcat_get_ptt(rig, vfo, &ptt))) + do { - ERRMSG(err, "newcat_set_cmd failed"); - RETURNFUNC(err); + if (RIG_OK != (err = newcat_get_ptt(rig, vfo, &ptt))) + { + ERRMSG(err, "newcat_set_cmd failed"); + RETURNFUNC(err); + } + + if (ptt == RIG_PTT_ON) + { + rig_debug(RIG_DEBUG_WARN, "%s: ptt still on...retry#%d\n", __func__, retry); + hl_usleep(100 * 1000); // 100ms pause if ptt still on + } } + while (err == RIG_OK && ptt == RIG_PTT_ON && retry-- > 0); if (ptt) { return RIG_ENTARGET; } } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index f13ca362..3c7b5e38 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20210327" +#define NEWCAT_VER "20210330" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit c5b0b97383bf86463285ee4ace85929d5c0dd5a3 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Apr 2 08:07:26 2021 -0500 Add comment to RIG_TARGETABLE_VFO https://github.com/Hamlib/Hamlib/issues/643 diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index fbb76171..57421e3a 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -491,7 +491,7 @@ typedef unsigned int vfo_t; //! @cond Doxygen_Suppress #define RIG_TARGETABLE_NONE 0 #define RIG_TARGETABLE_FREQ (1<<0) -#define RIG_TARGETABLE_MODE (1<<1) +#define RIG_TARGETABLE_MODE (1<<1) // mode by vfo or same mode on both vfos #define RIG_TARGETABLE_PURE (1<<2) // deprecated -- not used -- reuse it #define RIG_TARGETABLE_TONE (1<<3) #define RIG_TARGETABLE_FUNC (1<<4) commit 0794e6e1e65dfb4c8dc2c50bb974d48f57d8c50b Merge: 33f299d1 8e1fae4e Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Apr 2 08:04:37 2021 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 33f299d16d83e27c9c19221caa65946b13d486a1 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Apr 2 08:03:13 2021 -0500 Change get_vfo_info return VFOA cached mode/width when TARGETABLE_VFO is false https://github.com/Hamlib/Hamlib/issues/643 diff --git a/src/rig.c b/src/rig.c index c4813acb..3340019f 100644 --- a/src/rig.c +++ b/src/rig.c @@ -5999,9 +5999,17 @@ int HAMLIB_API rig_get_vfo_info(RIG *rig, vfo_t vfo, freq_t *freq, if (retval != RIG_OK) { RETURNFUNC(retval); } - retval = rig_get_mode(rig, vfo, mode, width); + if ((vfo == RIG_VFO_B || vfo == RIG_VFO_SUB) && (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE)) + { + retval = rig_get_mode(rig, vfo, mode, width); - if (retval != RIG_OK) { RETURNFUNC(retval); } + if (retval != RIG_OK) { RETURNFUNC(retval); } + } + else // we'll just us VFOA so we don't swap vfos -- freq is what's important + { + *mode = rig->state.cache.modeMainA; + *width = rig->state.cache.widthMainA; + } // we should only need to ask for VFO_CURR to minimize display swapping retval = rig_get_split(rig, RIG_VFO_CURR, split); ----------------------------------------------------------------------- Summary of changes: include/hamlib/rig.h | 2 +- rigs/dummy/flrig.c | 50 +++++++++++++++++++++++++------------------------- rigs/dummy/flrig.h | 2 -- rigs/kenwood/kenwood.c | 4 +++- rigs/kenwood/kenwood.h | 2 +- rigs/yaesu/newcat.c | 19 ++++++++++++++++--- rigs/yaesu/newcat.h | 2 +- src/rig.c | 12 ++++++++++-- 8 files changed, 57 insertions(+), 36 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |