[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. f392cc4c1804f06fe16f7
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: n0nb <n0...@us...> - 2023-01-18 12:50:31
|
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 f392cc4c1804f06fe16f7e326c879e2ba0f20e1d (commit) via 16af6ae3aa39835711c11ec5a4376ba173dc0fc6 (commit) via aeb2692b4203f5b354cd667455f862af31821a66 (commit) via c0866e0bad111a21021b9f3d30d91a1884c2df59 (commit) via 739fe24e6287dfbdf1fafebd8c04b8cd3154e9eb (commit) via d180883f3efc24c813d6c020f6c1ef3811d94002 (commit) via c02370d27981c66c89be187965922f4bfae59d71 (commit) via 3f8da23bb62f851377d474b1ab874833207aa73c (commit) via cb1c98fa857f735f7f18f964948e320eefb63b20 (commit) via 0ad5a4b7425f5a1c73ef89300920b3f4231a54a9 (commit) via c3ff7e134fd18a6fbf0005002fd81317e584758b (commit) via e681185b61f466350e194376a8fa5e19797c7233 (commit) via 77ce6b6dc39ba90cc12d1253af0de4f5ec7abb81 (commit) via 29a80fb496696fb40a93e022987371da5c1d68db (commit) via 9c48ec785c69442892a8acb3257c308fb9611310 (commit) via e4471b9ece77601d3a5af8740dbc85caa847c323 (commit) via 37b29012934ba57d527535d84b86ea1460ff409e (commit) via 51f9cbe4575ecb82e5ff34447d44ea9e6624ac6d (commit) via dc131cba7fc76ee0e9bea1dd123b2e6ac6a681d3 (commit) via 00dce998aebfd9f4b9addd3830eb4b9026e1d1ce (commit) via 5ebde1ca34e2b44b5b1c0d5e4a38ce091639b19e (commit) from aa1cf567f67febd90e6d6a804ba2950fd9f2b6cf (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 f392cc4c1804f06fe16f7e326c879e2ba0f20e1d Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 17 23:54:05 2023 -0600 Fix AGC level display in rigctld https://github.com/Hamlib/Hamlib/issues/1155 diff --git a/NEWS b/NEWS index 23de5250..a1b4ac1c 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Fix AGC level display in rigctld * Change FTDX10 to no serial handshake * Add TS2000 to has_ps exception * Add FT991 to 60M exception diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 03976838..b69e04b6 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -814,7 +814,7 @@ static int netrigctl_open(RIG *rig) int i = 0; char *p = strtok(value, " "); rig->caps->agc_levels[0] = RIG_AGC_NONE; // default value gets overwritten - rig->caps->agc_level_count = 1; + rig->caps->agc_level_count = 0; while (p) { @@ -2735,7 +2735,7 @@ struct rig_caps netrigctl_caps = RIG_MODEL(RIG_MODEL_NETRIGCTL), .model_name = "NET rigctl", .mfg_name = "Hamlib", - .version = "20230106.0", + .version = "20230117.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, diff --git a/src/sprintflst.c b/src/sprintflst.c index 07e3c347..6a6c870f 100644 --- a/src/sprintflst.c +++ b/src/sprintflst.c @@ -939,7 +939,7 @@ int rig_sprintf_agc_levels(RIG *rig, char *str, int lenstr) { if (strlen(str) > 0) { strcat(str, " "); } - sprintf(tmpbuf, "%d=%s", i, + sprintf(tmpbuf, "%d=%s", rig->caps->agc_levels[i], rig_stragclevel(rig->caps->agc_levels[i])); if (strlen(str) + strlen(tmpbuf) < lenstr - 1) commit 16af6ae3aa39835711c11ec5a4376ba173dc0fc6 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 17 22:31:17 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index 536a8033..23de5250 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Change FTDX10 to no serial handshake * Add TS2000 to has_ps exception * Add FT991 to 60M exception * Fix get_powerstat bad call in rigctl_parse.c commit aeb2692b4203f5b354cd667455f862af31821a66 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 17 22:30:02 2023 -0600 Change FTDX10 handshake to None instead of Hardware diff --git a/rigs/yaesu/ftdx10.c b/rigs/yaesu/ftdx10.c index 9daf5241..77101d8a 100644 --- a/rigs/yaesu/ftdx10.c +++ b/rigs/yaesu/ftdx10.c @@ -137,7 +137,7 @@ const struct rig_caps ftdx10_caps = RIG_MODEL(RIG_MODEL_FTDX10), .model_name = "FTDX-10", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".5", + .version = NEWCAT_VER ".6", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -149,7 +149,7 @@ const struct rig_caps ftdx10_caps = .serial_data_bits = 8, .serial_stop_bits = 2, .serial_parity = RIG_PARITY_NONE, - .serial_handshake = RIG_HANDSHAKE_HARDWARE, + .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = FTDX10_WRITE_DELAY, .post_write_delay = FTDX10_POST_WRITE_DELAY, .timeout = 2000, commit c0866e0bad111a21021b9f3d30d91a1884c2df59 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 17 16:23:45 2023 -0600 Add hamlibmodels.c example diff --git a/tests/hamlibmodels.c b/tests/hamlibmodels.c new file mode 100644 index 00000000..a7cfac7f --- /dev/null +++ b/tests/hamlibmodels.c @@ -0,0 +1,38 @@ +/* Example showing host to list all models */ +#include <stdio.h> +#include <stdlib.h> +#include <hamlib/rig.h> + +char *list[1000]; // as of 2023-01-17 we have 275 rigs so this should cover us for long time + +int nmodels = 0; + +static int hash_model_list(const struct rig_caps *caps, void *data) +{ + char s[256]; + sprintf(s, "%s %s", caps->mfg_name, caps->model_name); + list[nmodels] = strdup(s); + ++nmodels; + return 1; /* !=0, we want them all ! */ +} + +int mycmp(const void *p1, const void *p2) +{ + const char **s1 = (const char **)p1; + const char **s2 = (const char **)p2; + return strcasecmp(*s1, *s2); +} + +int main() +{ + rig_set_debug_level(RIG_DEBUG_NONE); + rig_load_all_backends(); + rig_list_foreach(hash_model_list, NULL); + qsort(list, nmodels, sizeof(list) / 1000, mycmp); + + for (int i = 0; i < nmodels; ++i) { printf("%s\n", list[i]); } + + printf("%d models\n", nmodels); + + return 0; +} commit 739fe24e6287dfbdf1fafebd8c04b8cd3154e9eb Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 17 15:45:29 2023 -0600 Add new simulator to Makefile.am diff --git a/simulators/Makefile.am b/simulators/Makefile.am index 3e2d7c04..115b0b20 100644 --- a/simulators/Makefile.am +++ b/simulators/Makefile.am @@ -8,7 +8,7 @@ DISTCLEANFILES = bin_PROGRAMS = -check_PROGRAMS = simelecraft simicom simkenwood simyaesu simicom9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 +check_PROGRAMS = simelecraft simicom simkenwood simyaesu simicom9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simelecraft_SOURCES = simelecraft.c simicom_SOURCES = simicom.c commit d180883f3efc24c813d6c020f6c1ef3811d94002 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 17 09:22:55 2023 -0600 Allow rigctl/rigctld to continue when a bad set_conf is called -- just shows a warning now diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index c1c0dc8a..0d397724 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -2040,6 +2040,7 @@ void list_models() int set_conf(RIG *my_rig, char *conf_parms) { char *p, *n; + int token; p = conf_parms; @@ -2063,12 +2064,20 @@ int set_conf(RIG *my_rig, char *conf_parms) *n++ = '\0'; } + token = rig_token_lookup(my_rig, p); + if (token != 0) + { ret = rig_set_conf(my_rig, rig_token_lookup(my_rig, p), q); if (ret != RIG_OK) { return (ret); } + } + else + { + rig_debug(RIG_DEBUG_WARN, "%s: invalid token %s for this rig\n", __func__, p); + } p = n; } commit c02370d27981c66c89be187965922f4bfae59d71 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 17 09:19:39 2023 -0600 Allow rigctld to continue when an invalid set_conf parameter is used diff --git a/src/conf.c b/src/conf.c index a2e5898d..0b9e4f47 100644 --- a/src/conf.c +++ b/src/conf.c @@ -842,6 +842,8 @@ static int frontend_get_conf2(RIG *rig, token_t token, char *val, int val_len) case TOK_HANDSHAKE: if (rs->rigport.type.rig != RIG_PORT_SERIAL) { + rig_debug(RIG_DEBUG_ERR, "%s: getting handshake is invalid for non-serial port rig type\n", + __func__); return -RIG_EINVAL; } @@ -1251,6 +1253,7 @@ token_t HAMLIB_API rig_token_lookup(RIG *rig, const char *name) */ int HAMLIB_API rig_set_conf(RIG *rig, token_t token, const char *val) { + struct rig_state *rs = &rig->state; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); if (!rig || !rig->caps) @@ -1258,6 +1261,13 @@ int HAMLIB_API rig_set_conf(RIG *rig, token_t token, const char *val) return -RIG_EINVAL; } + // Some parameters can be ignored + if (token == TOK_HANDSHAKE && (rs->rigport.type.rig != RIG_PORT_SERIAL)) + { + rig_debug(RIG_DEBUG_WARN, "%s: handshake is not valid for non-serial port rig\n", __func__); + return RIG_OK; // this allows rigctld to continue and just print a warning instead of error + } + if (rig_need_debug(RIG_DEBUG_VERBOSE)) { const struct confparams *cfp; commit 3f8da23bb62f851377d474b1ab874833207aa73c Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 17 08:50:47 2023 -0600 Improved set_conf error when serial_handshake is invalid diff --git a/src/conf.c b/src/conf.c index f0612783..a2e5898d 100644 --- a/src/conf.c +++ b/src/conf.c @@ -369,6 +369,8 @@ static int frontend_set_conf(RIG *rig, token_t token, const char *val) case TOK_HANDSHAKE: if (rs->rigport.type.rig != RIG_PORT_SERIAL) { + rig_debug(RIG_DEBUG_ERR, "%s: setting handshake is invalid for non-serial port rig type\n", + __func__); return -RIG_EINVAL; } commit cb1c98fa857f735f7f18f964948e320eefb63b20 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 16 09:24:00 2023 -0600 Fix xdgpath in settings.c diff --git a/src/settings.c b/src/settings.c index 33c24b76..f11cc940 100644 --- a/src/settings.c +++ b/src/settings.c @@ -1029,7 +1029,7 @@ HAMLIB_EXPORT(int) rig_settings_get_path(char *path, int pathlen) if (xdgpath) { - snprintf(path, pathlen - 1, "%s/%s/%s", xdgpath, cwd, HAMLIB_SETTINGS_FILE); + snprintf(path, pathlen - 1, "%s/%s", xdgpath, HAMLIB_SETTINGS_FILE); } else if (home && access(path, F_OK) != -1) { commit 0ad5a4b7425f5a1c73ef89300920b3f4231a54a9 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 15 22:22:14 2023 -0600 Attempt to allow PS; query for Yaeus rigs when powered off https://github.com/Hamlib/Hamlib/issues/1220 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 65f8b9f4..39d94072 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -3602,6 +3602,7 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) int newcat_get_powerstat(RIG *rig, powerstat_t *status) { struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct rig_state *state = &rig->state; int err; char ps; char command[] = "PS"; @@ -3615,6 +3616,11 @@ int newcat_get_powerstat(RIG *rig, powerstat_t *status) RETURNFUNC(-RIG_ENAVAIL); } + // when not powered on need a dummy byte to wake it up + // then sleep from 1 to 2 seconds so we'll do 1.5 secs + write_block(&state->rigport, (unsigned char *) "PS;", 3); + hl_usleep(1200000); + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", command, cat_term); /* Get Power status */ commit c3ff7e134fd18a6fbf0005002fd81317e584758b Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 15 12:41:01 2023 -0600 Add TS-2000 to has_ps exceptions https://github.com/Hamlib/Hamlib/issues/1213 diff --git a/NEWS b/NEWS index 9a533279..536a8033 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Add TS2000 to has_ps exception * Add FT991 to 60M exception * Fix get_powerstat bad call in rigctl_parse.c * Really fix CM108 ptt_bitnum usage diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index fe41cdbf..1abad7a1 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -771,6 +771,7 @@ int kenwood_init(RIG *rig) if (rig->caps->rig_model == RIG_MODEL_TS450S || rig->caps->rig_model == RIG_MODEL_TS50 || rig->caps->rig_model == RIG_MODEL_TS140S + || rig->caps->rig_model == RIG_MODEL_TS2000 || rig->caps->rig_model == RIG_MODEL_TS440) { priv->has_ps = 0; diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 69106804..d0c077a0 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -29,7 +29,7 @@ #include "misc.h" #include "idx_builtin.h" -#define BACKEND_VER "20230109" +#define BACKEND_VER "20230115" #define EOM_KEN ';' #define EOM_TH '\r' commit e681185b61f466350e194376a8fa5e19797c7233 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 15 10:18:44 2023 -0600 Update NEWS diff --git a/NEWS b/NEWS index e05a2746..9a533279 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Add FT991 to 60M exception * Fix get_powerstat bad call in rigctl_parse.c * Really fix CM108 ptt_bitnum usage * Fix Elecraft power2mW precision/accuracy commit 77ce6b6dc39ba90cc12d1253af0de4f5ec7abb81 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jan 15 10:17:54 2023 -0600 Add FT991 to 60M exception diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 703b7fb6..65f8b9f4 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -824,6 +824,9 @@ int newcat_60m_exception(RIG *rig, freq_t freq, mode_t mode) return -RIG_EINVAL; } + // some rigs need to skip freq/mode settings as 60M only operates in memory mode + if (is_ft991) { return 1; } + if (!is_ftdx10 && !is_ft710 && !is_ftdx101d && !is_ftdx101mp) { return 0; } rig_debug(RIG_DEBUG_VERBOSE, "%s: 60M exception ignoring freq/mode commands\n", diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 5202dcfd..db1d64c4 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20230109" +#define NEWCAT_VER "20230115" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 29a80fb496696fb40a93e022987371da5c1d68db Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jan 13 17:30:55 2023 -0600 Fix get_powerstat call when get_powerstat is not defined https://github.com/Hamlib/Hamlib/issues/1217 diff --git a/NEWS b/NEWS index 996d795c..e05a2746 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,7 @@ Version 4.6 * Fix FTDX3000 rig split Version 4.5.5 + * Fix get_powerstat bad call in rigctl_parse.c * Really fix CM108 ptt_bitnum usage * Fix Elecraft power2mW precision/accuracy * Fix power on/off/on for Icom rigs with rigctld power_on=0 diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index c1aeb838..c1c0dc8a 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -1731,7 +1731,7 @@ readline_repeat: else { - if (my_rig->caps->set_powerstat && (rig_powerstat == RIG_POWER_OFF + if (my_rig->caps->get_powerstat && (rig_powerstat == RIG_POWER_OFF || rig_powerstat == RIG_POWER_STANDBY)) { // Update power status commit 9c48ec785c69442892a8acb3257c308fb9611310 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Jan 12 11:23:11 2023 -0600 Improve serial port timeout when permission proble or does not exist https://github.com/Hamlib/Hamlib/issues/1216 diff --git a/src/serial.c b/src/serial.c index e22df68b..05d72c22 100644 --- a/src/serial.c +++ b/src/serial.c @@ -231,7 +231,7 @@ int HAMLIB_API serial_open(hamlib_port_t *rp) fd = OPEN(rp->pathname, O_RDWR | O_NOCTTY | O_NDELAY); } } - while (++i <= 4 && fd == -1); + while (++i <= 4 && fd == -1 && errno != ENOENT && errno != EPERM); if (fd == -1) { commit e4471b9ece77601d3a5af8740dbc85caa847c323 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 10 23:07:53 2023 -0600 Fix BSD build include path order https://github.com/Hamlib/Hamlib/issues/1208 diff --git a/configure.ac b/configure.ac index fcaffc79..0af90a70 100644 --- a/configure.ac +++ b/configure.ac @@ -273,7 +273,7 @@ dnl The host_os variable is set by the AC_CANONICAL_HOST macro above. AM_CONDITIONAL([VERSIONDLL], false) AS_CASE(["$host_os"], [freebsd*], [ - AM_CPPFLAGS="-I/usr/local/include ${AM_CPPFLAGS}" + AM_CPPFLAGS="${AM_CPPFLAGS} -I/usr/local/include" AM_LDFLAGS="${AM_LDFLAGS} -L/usr/local/lib" AC_SUBST([AM_LDFLAGS])], commit 37b29012934ba57d527535d84b86ea1460ff409e Merge: dc131cba 51f9cbe4 Author: Michael Black <mdb...@ya...> Date: Tue Jan 10 15:21:03 2023 -0600 Merge pull request #1215 from fillods/F8CFE/celestron_status Update status of celestron to Stable commit 51f9cbe4575ecb82e5ff34447d44ea9e6624ac6d Author: Stephane Fillod <fi...@us...> Date: Tue Jan 10 20:41:07 2023 +0100 Update status of celestron to Stable Tested-by: Eric K0JEG Tested-by: Daniel DL7NDR <04...@ma...> Tested-by: Андрей Родионов <der...@gm...> diff --git a/rotators/celestron/celestron.c b/rotators/celestron/celestron.c index 87d98685..39baebe5 100644 --- a/rotators/celestron/celestron.c +++ b/rotators/celestron/celestron.c @@ -228,7 +228,7 @@ const struct rot_caps nexstar_rot_caps = .mfg_name = "Celestron", .version = "20220109.0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZEL, .port_type = RIG_PORT_SERIAL, .serial_rate_min = 9600, commit dc131cba7fc76ee0e9bea1dd123b2e6ac6a681d3 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jan 10 08:46:10 2023 -0600 Fix set_powerstat on/off/on for Icom rigs using rigctld power_on=0 https://github.com/Hamlib/Hamlib/issues/1212 diff --git a/NEWS b/NEWS index 9c1c8353..996d795c 100644 --- a/NEWS +++ b/NEWS @@ -27,6 +27,7 @@ Version 4.6 Version 4.5.5 * Really fix CM108 ptt_bitnum usage * Fix Elecraft power2mW precision/accuracy + * Fix power on/off/on for Icom rigs with rigctld power_on=0 Version 4.5.4 * 2023-XX-XX diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index d912ad97..feaf733f 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -7977,11 +7977,6 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) memset(fe_buf, 0xfe, fe_max); // sending more than enough 0xfe's to wake up the rs232 write_block(&rs->rigport, fe_buf, fe_max); - // close and re-open the rig - // on linux the USB gets reset during power on - rig_close(rig); - sleep(1); // let serial bus idle for a while - rig_open(rig); // we'll try 0x18 0x01 now -- should work on STBY rigs too pwr_sc = S_PWR_ON; @@ -8043,6 +8038,12 @@ int icom_set_powerstat(RIG *rig, powerstat_t status) { rig_debug(RIG_DEBUG_TRACE, "%s: Wait failed for get_powerstat\n", __func__); + // close and re-open the rig + // on linux the USB gets reset during power on + rig_close(rig); + sleep(1); + rig_open(rig); + retval = -RIG_ETIMEOUT; } diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 3f4c3c18..a9ba4fe9 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -31,7 +31,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20230109" +#define BACKEND_VER "20230110" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit 00dce998aebfd9f4b9addd3830eb4b9026e1d1ce Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 9 23:26:15 2023 -0600 Fix Elecraft power2mW precision/accuracy Should fix any others too https://github.com/Hamlib/Hamlib/issues/1205 diff --git a/NEWS b/NEWS index a8dd99d0..9c1c8353 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,7 @@ Version 4.6 Version 4.5.5 * Really fix CM108 ptt_bitnum usage + * Fix Elecraft power2mW precision/accuracy Version 4.5.4 * 2023-XX-XX diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index a9b0a1f6..336b30bc 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -343,7 +343,7 @@ const struct rig_caps k3s_caps = RIG_MODEL(RIG_MODEL_K3S), .model_name = "K3S", .mfg_name = "Elecraft", - .version = BACKEND_VER ".19", + .version = BACKEND_VER ".20", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -495,7 +495,7 @@ const struct rig_caps k4_caps = RIG_MODEL(RIG_MODEL_K4), .model_name = "K4", .mfg_name = "Elecraft", - .version = BACKEND_VER ".25", + .version = BACKEND_VER ".26", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -646,7 +646,7 @@ const struct rig_caps kx3_caps = RIG_MODEL(RIG_MODEL_KX3), .model_name = "KX3", .mfg_name = "Elecraft", - .version = BACKEND_VER ".18", + .version = BACKEND_VER ".19", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -797,7 +797,7 @@ const struct rig_caps kx2_caps = RIG_MODEL(RIG_MODEL_KX2), .model_name = "KX2", .mfg_name = "Elecraft", - .version = BACKEND_VER ".17", + .version = BACKEND_VER ".18", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1839,7 +1839,9 @@ int k3_power2mW(RIG *rig, freq_t freq, rmode_t mode) { - *mwpower = power * k3_get_maxpower(rig) * 1000; + char buf[32]; + snprintf(buf, sizeof(buf), "%.0f", power * k3_get_maxpower(rig) * 1000); + *mwpower = atoi(buf); return RIG_OK; } diff --git a/simulators/simelecraft.c b/simulators/simelecraft.c index ea82a0a3..8dc58b6e 100644 --- a/simulators/simelecraft.c +++ b/simulators/simelecraft.c @@ -281,7 +281,7 @@ int main(int argc, char *argv[]) } else if (strncmp(buf, "PC;", 3) == 0) { - SNPRINTF(buf, sizeof(buf), "PC0150;"); + SNPRINTF(buf, sizeof(buf), "PC0980;"); n = write(fd, buf, strlen(buf)); } else if (strlen(buf) > 0) diff --git a/src/rig.c b/src/rig.c index 01e36480..8c14aa3e 100644 --- a/src/rig.c +++ b/src/rig.c @@ -5845,6 +5845,7 @@ int HAMLIB_API rig_power2mW(RIG *rig, rmode_t mode) { const freq_range_t *txrange; + char buf[32]; ENTERFUNC; @@ -5880,7 +5881,10 @@ int HAMLIB_API rig_power2mW(RIG *rig, RETURNFUNC(-RIG_EINVAL); } - *mwpower = (unsigned int)(power * txrange->high_power); + + snprintf(buf, sizeof(buf), "%.0f", power * txrange->high_power); + *mwpower = atoi(buf); + //*mwpower = (unsigned int)(power * txrange->high_power); RETURNFUNC(RIG_OK); } commit 5ebde1ca34e2b44b5b1c0d5e4a38ce091639b19e Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jan 9 22:53:01 2023 -0600 Really fix CM108 ptt_bitnum usage https://github.com/Hamlib/Hamlib/issues/1203 diff --git a/NEWS b/NEWS index b2909aaa..a8dd99d0 100644 --- a/NEWS +++ b/NEWS @@ -24,6 +24,9 @@ Version 4.6 * Add FLIR PTU-D48, E46, D100, D300 rotors * Fix FTDX3000 rig split +Version 4.5.5 + * Really fix CM108 ptt_bitnum usage + Version 4.5.4 * 2023-XX-XX * Fix CM108 ptt setting for non-default usage diff --git a/src/rig.c b/src/rig.c index d4cff0ae..01e36480 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1114,8 +1114,12 @@ int HAMLIB_API rig_open(RIG *rig) rs->pttport.fd = cm108_open(&rs->pttport); strncpy(rs->rigport.pathname, DEFAULT_CM108_PORT, HAMLIB_FILPATHLEN); - rs->rigport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; - rs->pttport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; + + if (rs->rigport.parm.cm108.ptt_bitnum == 0) + { + rs->rigport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; + rs->pttport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; + } if (rs->pttport.fd < 0) { @@ -6019,6 +6023,7 @@ int HAMLIB_API rig_set_powerstat(RIG *rig, powerstat_t status) HAMLIB_TRACE; retcode = rig->caps->set_powerstat(rig, status); rig_flush(&rig->state.rigport); // if anything is queued up flush it + rig->state.auto_power_on = 1; // ensure we auto power on in the future RETURNFUNC(retcode); } ----------------------------------------------------------------------- Summary of changes: NEWS | 10 ++++++++++ configure.ac | 2 +- rigs/dummy/netrigctl.c | 4 ++-- rigs/icom/icom.c | 11 ++++++----- rigs/icom/icom.h | 2 +- rigs/kenwood/k3.c | 12 +++++++----- rigs/kenwood/kenwood.c | 1 + rigs/kenwood/kenwood.h | 2 +- rigs/yaesu/ftdx10.c | 4 ++-- rigs/yaesu/newcat.c | 9 +++++++++ rigs/yaesu/newcat.h | 2 +- rotators/celestron/celestron.c | 2 +- simulators/Makefile.am | 2 +- simulators/simelecraft.c | 2 +- src/conf.c | 12 ++++++++++++ src/rig.c | 15 ++++++++++++--- src/serial.c | 2 +- src/settings.c | 2 +- src/sprintflst.c | 2 +- tests/hamlibmodels.c | 38 ++++++++++++++++++++++++++++++++++++++ tests/rigctl_parse.c | 11 ++++++++++- 21 files changed, 119 insertions(+), 28 deletions(-) create mode 100644 tests/hamlibmodels.c hooks/post-receive -- Hamlib -- Ham radio control libraries |