[Hamlib-commits] Hamlib -- Ham radio control libraries branch Hamlib-4.0 updated. d2fa649026d461830
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Nate B. <n0...@us...> - 2020-12-11 02:47:17
|
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, Hamlib-4.0 has been updated via d2fa649026d461830447fccbd3c3566aac2c9ed9 (commit) via 2d2475f56c5e59226b21375b5a16c0a2572fbea4 (commit) via dc5d3058eaf3ecc8820328600dca320cb9b006ee (commit) via d3a632f6b4265516783ddcc7ad47c138f0e9cc46 (commit) via e7c0239791fc88c2c9b05177d27041373a48dbc4 (commit) via 6f397021d462dfd50e0e79ef530a6a58b7ebb19e (commit) via 2b88342f8f11577b2f678174f154d667b3f948aa (commit) from 058cf38b87e1130eb7d6768fb25434047d0dcc36 (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 d2fa649026d461830447fccbd3c3566aac2c9ed9 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 18:09:49 2020 -0600 Fix retry_save during Yaesu poweron (cherry picked from commit 7a93ce3fb23b5a2ecdb69cc32f5de3b2e4395446) 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 2d2475f56c5e59226b21375b5a16c0a2572fbea4 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 17:48:09 2020 -0600 Fix newcat SH parsing (cherry picked from commit 504a01913fcb07f7b3ad67c63d9717339286d349) 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 dc5d3058eaf3ecc8820328600dca320cb9b006ee 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 (cherry picked from commit 132991179968553b88bff31944fb5499fc295e85) 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 d3a632f6b4265516783ddcc7ad47c138f0e9cc46 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 16:17:03 2020 -0600 Only sleep on power on for Yaesu rigs (cherry picked from commit 679c84f3eef8c387a013bd98b68af8d430373b74) 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 e7c0239791fc88c2c9b05177d27041373a48dbc4 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 (cherry picked from commit 79e2263dfb4ca12e9b63bde380e549718b1a0556) 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 6f397021d462dfd50e0e79ef530a6a58b7ebb19e Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 16:12:31 2020 -0600 Fix a few cppcheck warnings (cherry picked from commit ac1cb518b0dba4d676168448010c93813bee8c40) 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 2b88342f8f11577b2f678174f154d667b3f948aa 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 (cherry picked from commit f4c12adb850c8717812aeeb749d26762677923e6) 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/yaesu/ft891.c | 1 - rigs/yaesu/newcat.c | 50 +++++++++++++++++++++++++++++++++++------- rigs/yaesu/newcat.h | 2 +- rotators/indi/indi_wrapper.cpp | 5 ++--- 4 files changed, 45 insertions(+), 13 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |