[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. ebeb23e49d8096c117c54
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Michael B. <mdb...@us...> - 2021-01-17 14:55:02
|
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 ebeb23e49d8096c117c54d846a2bb0709fa704fd (commit) via a8d841182b3daa2d1947b61db22b5f6b88bc5237 (commit) from 9db79eb8412b10a0b6bd49d7655f8378c59e938d (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 ebeb23e49d8096c117c54d846a2bb0709fa704fd Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 17 08:54:40 2021 -0600 Avoid newcat BS command when VFO freq is not changing diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 79e8529e..063eeb63 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -790,7 +790,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (RIG_OK != (err = newcat_set_cmd(rig))) { - ERRMSG(err,"newcat_set_cmd failed"); + ERRMSG(err, "newcat_set_cmd failed"); return err; } } @@ -816,12 +816,24 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) { + if (rig->state.cache.freqMainA == 0) + { + freq_t freqtmp; + 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 freq changing=%d\n", __func__, changing); } else { + if (rig->state.cache.freqMainB == 0) + { + freq_t freqtmp; + 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 freq changing=%d\n", __func__, changing); @@ -861,6 +873,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // Also need to do this for the other VFO on some Yaesu rigs // is redundant for rigs where band stack includes both vfos vfo_t vfotmp; + freq_t freqtmp; err = rig_get_vfo(rig, &vfotmp); if (err != RIG_OK) { return err; } @@ -874,17 +887,25 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) err = rig_set_vfo(rig, vfotmp == RIG_VFO_A ? RIG_VFO_B : RIG_VFO_A); } - if (err != RIG_OK) { return err; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BS%02d%c", - newcat_band_index(freq), cat_term); + rig_get_freq(rig, RIG_VFO_CURR, &freqtmp); - if (RIG_OK != (err = newcat_set_cmd(rig))) + if (err != RIG_OK) { return err; } + + // we'll ignore UHF/VHF frequencies -- need to see the behavior + if (newcat_band_index(freqtmp) != newcat_band_index(freq) && freq < 100e6) { - rig_debug(RIG_DEBUG_ERR, "%s: Unexpected error with BS command#2=%s\n", - __func__, - rigerror(err)); + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BS%02d%c", + newcat_band_index(freq), cat_term); + + if (RIG_OK != (err = newcat_set_cmd(rig))) + { + rig_debug(RIG_DEBUG_ERR, "%s: Unexpected error with BS command#2=%s\n", + __func__, + rigerror(err)); + } } // switch back to the starting vfo @@ -9289,6 +9310,7 @@ int newcat_get_cmd(RIG *rig) int is_read_cmd = 0; ENTERFUNC; + // try to cache rapid repeats of the IF command // this is for WSJT-X/JTDX sequence of v/f/m/t // should allow rapid repeat of any call using the IF; cmd @@ -9812,11 +9834,11 @@ rmode_t newcat_rmode(char mode) { rig_debug(RIG_DEBUG_TRACE, "%s: %s for %c\n", __func__, rig_strrmode(newcat_mode_conv[i].mode), mode); - RETURNFUNC (newcat_mode_conv[i].mode); + RETURNFUNC(newcat_mode_conv[i].mode); } } - RETURNFUNC (RIG_MODE_NONE); + RETURNFUNC(RIG_MODE_NONE); } char newcat_modechar(rmode_t rmode) @@ -9831,11 +9853,11 @@ char newcat_modechar(rmode_t rmode) { rig_debug(RIG_DEBUG_TRACE, "%s: return %c for %s\n", __func__, newcat_mode_conv[i].modechar, rig_strrmode(rmode)); - RETURNFUNC (newcat_mode_conv[i].modechar); + RETURNFUNC(newcat_mode_conv[i].modechar); } } - RETURNFUNC ('0'); + RETURNFUNC('0'); } rmode_t newcat_rmode_width(RIG *rig, vfo_t vfo, char mode, pbwidth_t *width) @@ -9866,7 +9888,7 @@ rmode_t newcat_rmode_width(RIG *rig, vfo_t vfo, char mode, pbwidth_t *width) { if (newcat_get_narrow(rig, vfo, &narrow) != RIG_OK) { - RETURNFUNC (newcat_mode_conv[i].mode); + RETURNFUNC(newcat_mode_conv[i].mode); } if (narrow == TRUE) @@ -9880,12 +9902,12 @@ rmode_t newcat_rmode_width(RIG *rig, vfo_t vfo, char mode, pbwidth_t *width) } } - RETURNFUNC (newcat_mode_conv[i].mode); + RETURNFUNC(newcat_mode_conv[i].mode); } } rig_debug(RIG_DEBUG_VERBOSE, "%s fell out the bottom %c %s\n", __func__, mode, rig_strrmode(mode)); - RETURNFUNC ('0'); + RETURNFUNC('0'); } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index dfa3bdb5..ea6a6c22 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20210116" +#define NEWCAT_VER "20210117" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit a8d841182b3daa2d1947b61db22b5f6b88bc5237 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 17 08:22:07 2021 -0600 Improve comments in misc.c diff --git a/src/misc.c b/src/misc.c index 9dfdbe46..445c8492 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1634,6 +1634,7 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) port[0] = 0; dummy[0] = 0; + // Exclude any names that aren't a host:port format // Handle device names 1st if (strstr(hoststr, "/dev")) { return -1; } @@ -1644,6 +1645,7 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) // escaped COM port like \\.\COM3 if (strstr(hoststr, "\\\\.\\")) { return -1; } + // Now let's try and parse a host:port thing // bracketed IPV6 with optional port int n = sscanf(hoststr, "[%255[^]]]:%5s", host, port); ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 52 +++++++++++++++++++++++++++++++++++++--------------- rigs/yaesu/newcat.h | 2 +- src/misc.c | 2 ++ 3 files changed, 40 insertions(+), 16 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |