[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 9fa31392b059e4eaadad9
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Michael B. <mdb...@us...> - 2020-12-10 23:38:29
|
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 9fa31392b059e4eaadad9e9d62aaa70c32869f28 (commit) via b6d6c5d9663d9625efe6de4663751437740448ff (commit) via 7a93ce3fb23b5a2ecdb69cc32f5de3b2e4395446 (commit) via 504a01913fcb07f7b3ad67c63d9717339286d349 (commit) via 132991179968553b88bff31944fb5499fc295e85 (commit) via 679c84f3eef8c387a013bd98b68af8d430373b74 (commit) via 79e2263dfb4ca12e9b63bde380e549718b1a0556 (commit) via ac1cb518b0dba4d676168448010c93813bee8c40 (commit) via f4c12adb850c8717812aeeb749d26762677923e6 (commit) from 15958c8aab8dfcadecb2cc27c13d948b2a6d8764 (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 9fa31392b059e4eaadad9e9d62aaa70c32869f28 Merge: b6d6c5d9 7a93ce3f Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 22:20:14 2020 -0600 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit b6d6c5d9663d9625efe6de4663751437740448ff Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 18:13:58 2020 -0600 Fix retry_save for Kenwood rigs diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 57e0d739..13adb590 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -3885,7 +3885,11 @@ int kenwood_set_powerstat(RIG *rig, powerstat_t status) sleep(1); retval = rig_get_freq(rig, RIG_VFO_A, &freq); - if (retval == RIG_OK) { return retval; } + if (retval == RIG_OK) + { + rig->state.rigport.retry = retry_save; + return retval; + } rig_debug(RIG_DEBUG_TRACE, "%s: Wait #%d for power up\n", __func__, i + 1); } commit 7a93ce3fb23b5a2ecdb69cc32f5de3b2e4395446 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 18:09:49 2020 -0600 Fix retry_save during Yaesu poweron diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index dba7042c..4e00d6ea 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2885,7 +2885,10 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) hl_usleep(1000000); retval = rig_get_freq(rig, RIG_VFO_A, &freq); - if (retval == RIG_OK) { return retval; } + if (retval == RIG_OK) { + rig->state.rigport.retry = retry_save; + return retval; + } rig_debug(RIG_DEBUG_TRACE, "%s: Wait #%d for power up\n", __func__, i + 1); } commit 504a01913fcb07f7b3ad67c63d9717339286d349 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 17:48:09 2020 -0600 Fix newcat SH parsing diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 09cd2b4c..dba7042c 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -7622,11 +7622,14 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) return err; } - if (sscanf(priv->ret_data, "SH%3d;", &w) != 1 && - sscanf(priv->ret_data, "SH0%3d;", &w) != 1) + if (sscanf(priv->ret_data, "SH0%3d;", &w) != 1) { - err = -RIG_EPROTO; + if (sscanf(priv->ret_data, "SH%3d;", &w) != 1) + { + err = -RIG_EPROTO; + } } + rig_debug(RIG_DEBUG_TRACE, "%s: w=%d\n", __func__, w); if (err != RIG_OK) { @@ -7634,8 +7637,6 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) priv->ret_data); return -RIG_EPROTO; } - - rig_debug(RIG_DEBUG_TRACE, "%s: w=%d\n", __func__, w); } else { @@ -8929,6 +8930,7 @@ int newcat_get_cmd(RIG *rig) { if (rc != -RIG_BUSBUSY) { + rig_flush(&state->rigport); /* discard any unsolicited data */ /* send the command */ rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s\n", priv->cmd_str); commit 132991179968553b88bff31944fb5499fc295e85 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 16:58:16 2020 -0600 Change newcat.c set_powerstat=1 to loop logic same as kenwood https://github.com/Hamlib/Hamlib/issues/459 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index fb2ed951..09cd2b4c 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2839,7 +2839,9 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) { struct rig_state *state = &rig->state; struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; - int err; + int retval; + int i; + int retry_save; char ps; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -2870,11 +2872,36 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PS%c%c", ps, cat_term); - err = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)); + retval = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)); - if (ps) hl_usleep(1000000); // give it a second to turn on + retry_save = rig->state.rigport.retry; + rig->state.rigport.retry = 0; - return err; + if (status == RIG_POWER_ON) // wait for wakeup only + { + for (i = 0; i < 8; ++i) // up to ~10 seconds including the timeouts + { + freq_t freq; + hl_usleep(1000000); + retval = rig_get_freq(rig, RIG_VFO_A, &freq); + + if (retval == RIG_OK) { return retval; } + + rig_debug(RIG_DEBUG_TRACE, "%s: Wait #%d for power up\n", __func__, i + 1); + } + } + + rig->state.rigport.retry = retry_save; + + if (i == 9) + { + rig_debug(RIG_DEBUG_TRACE, "%s: timeout waiting for powerup, try %d\n", + __func__, + i + 1); + retval = -RIG_ETIMEOUT; + } + + return retval; } commit 679c84f3eef8c387a013bd98b68af8d430373b74 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 16:17:03 2020 -0600 Only sleep on power on for Yaesu rigs diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 5e6a7de0..fb2ed951 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2872,7 +2872,7 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) err = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)); - hl_usleep(1000000); // give it a second to turn on + if (ps) hl_usleep(1000000); // give it a second to turn on return err; } commit 79e2263dfb4ca12e9b63bde380e549718b1a0556 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 16:15:13 2020 -0600 Add 1 second sleep after power on for Yaesu rigs https://github.com/Hamlib/Hamlib/issues/459 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 3ebcd754..5e6a7de0 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2871,6 +2871,8 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PS%c%c", ps, cat_term); err = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)); + + hl_usleep(1000000); // give it a second to turn on return err; } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 39cf2b88..9ce0859e 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201207" +#define NEWCAT_VER "20201209" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit ac1cb518b0dba4d676168448010c93813bee8c40 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 16:12:31 2020 -0600 Fix a few cppcheck warnings diff --git a/rotators/indi/indi_wrapper.cpp b/rotators/indi/indi_wrapper.cpp index df616999..50baae42 100644 --- a/rotators/indi/indi_wrapper.cpp +++ b/rotators/indi/indi_wrapper.cpp @@ -58,7 +58,7 @@ int RotINDIClient::setSpeed(int speedPercent) int speed = DIV_ROUND_UP(speedPercent, 10); - for (int i = 1; i <= 10; i++) + for (unsigned int i = 1; i <= 10; i++) { char switchName[4]; snprintf(switchName, sizeof(switchName), "%ux", i); @@ -519,10 +519,9 @@ void RotINDIClient::serverDisconnected(int exit_code) const char *RotINDIClient::getInfo(void) { - static char info[128]; - if (mTelescope && mTelescope->isConnected()) { + static char info[128]; snprintf(info, sizeof(info), "using INDI device %s", mTelescope->getDeviceName()); return info; commit f4c12adb850c8717812aeeb749d26762677923e6 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 10:31:28 2020 -0600 Remove get_vfo permanently from ft891.c https://github.com/Hamlib/Hamlib/issues/455 diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index 74120e4a..1c4b3c7d 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -192,7 +192,6 @@ const struct rig_caps ft891_caps = .get_freq = newcat_get_freq, .set_mode = ft891_set_mode, .get_mode = newcat_get_mode, -// .get_vfo = newcat_get_vfo, .set_ptt = newcat_set_ptt, .get_ptt = newcat_get_ptt, .set_split_vfo = ft891_set_split_vfo, ----------------------------------------------------------------------- Summary of changes: rigs/kenwood/kenwood.c | 6 ++++- rigs/yaesu/ft891.c | 1 - rigs/yaesu/newcat.c | 50 +++++++++++++++++++++++++++++++++++------- rigs/yaesu/newcat.h | 2 +- rotators/indi/indi_wrapper.cpp | 5 ++--- 5 files changed, 50 insertions(+), 14 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |