hamlib-cvs-digest Mailing List for Ham Radio Control Libraries (Page 22)
Library to control radio transceivers and receivers
Brought to you by:
n0nb
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(57) |
Nov
(27) |
Dec
(25) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(41) |
Feb
(101) |
Mar
(60) |
Apr
(32) |
May
(32) |
Jun
(198) |
Jul
(95) |
Aug
(60) |
Sep
(48) |
Oct
(96) |
Nov
(27) |
Dec
(222) |
2002 |
Jan
(180) |
Feb
(46) |
Mar
(68) |
Apr
(11) |
May
(36) |
Jun
(34) |
Jul
(113) |
Aug
(42) |
Sep
(71) |
Oct
(65) |
Nov
(116) |
Dec
(40) |
2003 |
Jan
(32) |
Feb
(92) |
Mar
(29) |
Apr
(102) |
May
(21) |
Jun
(34) |
Jul
(3) |
Aug
(60) |
Sep
(30) |
Oct
(62) |
Nov
(57) |
Dec
(33) |
2004 |
Jan
(28) |
Feb
(46) |
Mar
(16) |
Apr
(14) |
May
(31) |
Jun
(21) |
Jul
(10) |
Aug
(80) |
Sep
(42) |
Oct
(11) |
Nov
(28) |
Dec
(13) |
2005 |
Jan
(35) |
Feb
(26) |
Mar
(20) |
Apr
(118) |
May
(2) |
Jun
(5) |
Jul
|
Aug
|
Sep
(5) |
Oct
(1) |
Nov
(13) |
Dec
(1) |
2006 |
Jan
(9) |
Feb
(25) |
Mar
(22) |
Apr
(6) |
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
(3) |
Oct
(46) |
Nov
(13) |
Dec
(7) |
2007 |
Jan
(9) |
Feb
(14) |
Mar
(3) |
Apr
|
May
(6) |
Jun
(1) |
Jul
|
Aug
(11) |
Sep
(7) |
Oct
(8) |
Nov
(41) |
Dec
(3) |
2008 |
Jan
(27) |
Feb
(16) |
Mar
(13) |
Apr
(23) |
May
(39) |
Jun
(4) |
Jul
(7) |
Aug
(1) |
Sep
(13) |
Oct
(52) |
Nov
(44) |
Dec
(55) |
2009 |
Jan
(72) |
Feb
(69) |
Mar
|
Apr
|
May
|
Jun
(13) |
Jul
(1) |
Aug
(6) |
Sep
(15) |
Oct
(11) |
Nov
(31) |
Dec
(20) |
2010 |
Jan
(24) |
Feb
(21) |
Mar
(22) |
Apr
(40) |
May
(38) |
Jun
(4) |
Jul
(2) |
Aug
(22) |
Sep
(19) |
Oct
(14) |
Nov
(5) |
Dec
(8) |
2011 |
Jan
(14) |
Feb
(36) |
Mar
(6) |
Apr
|
May
|
Jun
(23) |
Jul
(13) |
Aug
(8) |
Sep
(7) |
Oct
|
Nov
(3) |
Dec
(9) |
2012 |
Jan
(17) |
Feb
(13) |
Mar
(10) |
Apr
|
May
(1) |
Jun
(14) |
Jul
(4) |
Aug
(12) |
Sep
(2) |
Oct
(24) |
Nov
(14) |
Dec
(2) |
2013 |
Jan
(4) |
Feb
(3) |
Mar
(3) |
Apr
(3) |
May
(10) |
Jun
(4) |
Jul
(7) |
Aug
|
Sep
(15) |
Oct
(5) |
Nov
(1) |
Dec
(2) |
2014 |
Jan
|
Feb
(8) |
Mar
(1) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
(3) |
Oct
(7) |
Nov
(6) |
Dec
(3) |
2015 |
Jan
(4) |
Feb
(5) |
Mar
(8) |
Apr
(8) |
May
(2) |
Jun
|
Jul
(4) |
Aug
(7) |
Sep
(8) |
Oct
|
Nov
(6) |
Dec
(4) |
2016 |
Jan
(6) |
Feb
(26) |
Mar
(3) |
Apr
(10) |
May
(6) |
Jun
(5) |
Jul
(1) |
Aug
(4) |
Sep
(3) |
Oct
(4) |
Nov
(3) |
Dec
(10) |
2017 |
Jan
(11) |
Feb
(11) |
Mar
(2) |
Apr
(1) |
May
(7) |
Jun
(2) |
Jul
(11) |
Aug
(9) |
Sep
(5) |
Oct
(5) |
Nov
(1) |
Dec
(2) |
2018 |
Jan
(5) |
Feb
(2) |
Mar
(19) |
Apr
(7) |
May
(11) |
Jun
(3) |
Jul
(4) |
Aug
(10) |
Sep
(2) |
Oct
(8) |
Nov
(6) |
Dec
(9) |
2019 |
Jan
(9) |
Feb
(6) |
Mar
(2) |
Apr
(4) |
May
(6) |
Jun
(9) |
Jul
(6) |
Aug
(3) |
Sep
(5) |
Oct
(2) |
Nov
(8) |
Dec
(9) |
2020 |
Jan
(15) |
Feb
(1) |
Mar
(18) |
Apr
(33) |
May
(43) |
Jun
(87) |
Jul
(45) |
Aug
(8) |
Sep
(43) |
Oct
(3) |
Nov
(5) |
Dec
(42) |
2021 |
Jan
(116) |
Feb
(40) |
Mar
(58) |
Apr
(48) |
May
(29) |
Jun
(2) |
Jul
|
Aug
(22) |
Sep
(18) |
Oct
(1) |
Nov
|
Dec
(3) |
2022 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(2) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
(6) |
Nov
(2) |
Dec
(9) |
2023 |
Jan
(10) |
Feb
|
Mar
|
Apr
(10) |
May
(3) |
Jun
(1) |
Jul
(2) |
Aug
(4) |
Sep
(1) |
Oct
|
Nov
(2) |
Dec
(3) |
2024 |
Jan
(4) |
Feb
(1) |
Mar
(2) |
Apr
(2) |
May
(5) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(9) |
2025 |
Jan
(5) |
Feb
(5) |
Mar
|
Apr
(10) |
May
(20) |
Jun
(43) |
Jul
(24) |
Aug
(20) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael B. <mdb...@us...> - 2021-01-13 18:42:57
|
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 8024ffb93731de1b658cc156e8ce158e0341efea (commit) from b5de94da2abcf2ba4edf4ced94f1531f6b416e13 (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 8024ffb93731de1b658cc156e8ce158e0341efea Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Jan 13 12:42:03 2021 -0600 Change icom_get_usb_echo_off to return TIMEOUT when it occurs instead of RIG_OK https://github.com/Hamlib/Hamlib/issues/509 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index f50429b7..d11f7087 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -715,6 +715,8 @@ int icom_get_usb_echo_off(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s: ack_len=%d\n", __func__, ack_len); + if (retval == -RIG_ETIMEOUT) return retval; + if (retval == RIG_OK) { rig_debug(RIG_DEBUG_VERBOSE, "%s: USB echo on detected\n", diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 413d2c98..7d28b6e6 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -30,7 +30,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20210107" +#define BACKEND_VER "20210113" /* * defines used by comp_cal_str in rig.c ----------------------------------------------------------------------- Summary of changes: rigs/icom/icom.c | 2 ++ rigs/icom/icom.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-13 15:42:48
|
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 b5de94da2abcf2ba4edf4ced94f1531f6b416e13 (commit) from b4627b75ba065d22c85fa71d045486702be1e199 (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 b5de94da2abcf2ba4edf4ced94f1531f6b416e13 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Jan 13 09:40:20 2021 -0600 Try adding an 11ms delay on set commands before the ID; is sent FT2000 is seeing repeated ?; responses and timing may be important https://github.com/Hamlib/Hamlib/issues/505 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 245dcab9..d4ce36e8 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -9396,6 +9396,7 @@ int newcat_set_cmd(RIG *rig) return RIG_OK; } + hl_usleep(11*1000); // some Yaeus rigs have 10ms timeout -- does this fix the ?; reponse problem? /* send the verification command */ rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s\n", verify_cmd); ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-13 14:51:48
|
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 b4627b75ba065d22c85fa71d045486702be1e199 (commit) via 4e9791d8b9cf561ea4faa7b70864614dc15b34c9 (commit) via 00a7f2c749396160b289d6250ffe898336e89040 (commit) from a9a806f8e02d859a3778728247dc87ebaa81a133 (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 b4627b75ba065d22c85fa71d045486702be1e199 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Jan 13 08:48:48 2021 -0600 Fix newcat.c retry when read command returns ?; https://github.com/Hamlib/Hamlib/issues/505 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 2b733653..245dcab9 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -539,6 +539,29 @@ int newcat_open(RIG *rig) (void)newcat_get_rigid(rig); rig_debug(RIG_DEBUG_VERBOSE, "%s: rig_id=%d\n", __func__, priv->rig_id); +#if 0 // possible future enhancement? + // some rigs have a CAT TOT timeout that defaults to 10ms + // so we'll increase CAT timeout to 100ms + if (priv->rig_id == NC_RIGID_FT2000 + || priv->rig_id == NC_RIGID_FT2000D + || priv->rig_id == NC_RIGID_FT891 + || priv->rig_id == NC_RIGID_FT991 + || priv->rig_id == NC_RIGID_FT950) + { + int err; + char *cmd = "EX0291%c"; + if (priv->rig_id == NC_RIGID_FT950) cmd = "EX0271%c"; + else if (priv->rig_id == NC_RIGID_FT891) cmd = "EX05071c"; + else if (priv->rig_id == NC_RIGID_FT991) cmd = "EX0321c"; + snprintf(priv->cmd_str, sizeof(priv->cmd_str), cmd, cat_term); + + if (RIG_OK != (err = newcat_set_cmd(rig))) + { + return err; + } + } +#endif + rig_debug(RIG_DEBUG_VERBOSE, "%s: returning RIG_OK\n", __func__); return RIG_OK; } @@ -784,6 +807,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) && !rig->state.cache.split && !is_ft891) // 891 does not remember bandwidth so don't do this { + hl_usleep(200*1000); // seems we need some time before doing band select 200ms enough? snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BS%02d%c", newcat_band_index(freq), cat_term); @@ -883,6 +907,7 @@ int newcat_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) break; default: + rig_debug(RIG_DEBUG_ERR, "%s: unsupported vfo=%s\n", __func__, rig_strvfo(vfo)); return -RIG_EINVAL; /* sorry, unsupported VFO */ } @@ -9201,9 +9226,9 @@ int newcat_get_cmd(RIG *rig) while (rc != RIG_OK && retry_count++ <= state->rigport.retry) { + rig_flush(&state->rigport); /* discard any unsolicited data */ 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); @@ -9294,8 +9319,8 @@ int newcat_get_cmd(RIG *rig) return -RIG_ERJCTED; } - rig_debug(RIG_DEBUG_WARN, "%s: Rig busy - retrying: '%s'\n", __func__, - priv->cmd_str); + rig_debug(RIG_DEBUG_WARN, "%s: Rig busy - retrying %d of %d: '%s'\n", __func__, + retry_count, state->rigport.retry, priv->cmd_str); rc = -RIG_ERJCTED; /* retry */ break; @@ -9449,17 +9474,12 @@ int newcat_set_cmd(RIG *rig) rig_debug(RIG_DEBUG_WARN, "%s: Rig busy - retrying: '%s'\n", __func__, priv->cmd_str); - /* read the verify command reply */ + /* read/flush the verify command reply which should still be there */ if ((rc = read_string(&state->rigport, priv->ret_data, sizeof(priv->ret_data), &cat_term, sizeof(cat_term))) > 0) { rig_debug(RIG_DEBUG_TRACE, "%s: read count = %d, ret_data = %s\n", __func__, rc, priv->ret_data); - rc = RIG_OK; /* probably recovered and read verification */ - } - else - { - /* probably a timeout */ rc = -RIG_BUSBUSY; /* retry */ } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 7c8918da..452cb283 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20210112" +#define NEWCAT_VER "20210113" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 4e9791d8b9cf561ea4faa7b70864614dc15b34c9 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Jan 12 23:03:54 2021 -0600 Update flrig version diff --git a/rigs/dummy/flrig.h b/rigs/dummy/flrig.h index dd0ecc19..4c6633b3 100644 --- a/rigs/dummy/flrig.h +++ b/rigs/dummy/flrig.h @@ -28,7 +28,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20201231" +#define BACKEND_VER "20210112" #define EOM "\r" #define TRUE 1 commit 00a7f2c749396160b289d6250ffe898336e89040 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Jan 12 23:03:20 2021 -0600 Fix flrig set_micgain to use i4 format diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index dacd414c..46eea2de 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -58,7 +58,7 @@ RIG_MODE_FM | RIG_MODE_WFM | RIG_MODE_FMN | RIG_MODE_PKTFM |\ RIG_MODE_C4FM) -#define FLRIG_LEVELS (RIG_LEVEL_AF | RIG_LEVEL_RF | RIG_LEVEL_MICGAIN | RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER_METER | RIG_LEVEL_RFPOWER_METER_WATTS) +#define FLRIG_LEVELS (RIG_LEVEL_AF | RIG_LEVEL_RF | RIG_LEVEL_MICGAIN | RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER_METER | RIG_LEVEL_RFPOWER_METER_WATTS | RIG_LEVEL_RFPOWER) #define streq(s1,s2) (strcmp(s1,s2)==0) @@ -1883,6 +1883,7 @@ static int flrig_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) int retval; char cmd_arg[MAXARGLEN]; char *cmd; + char *param_type="i4"; rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s level=%d, val=%f\n", __func__, rig_strvfo(vfo), (int)level, val.f); @@ -1894,23 +1895,26 @@ static int flrig_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) return -RIG_EINVAL; } - sprintf(cmd_arg, - "<params><param><value><double>%d</double></value></param></params>", - (int)val.f); - switch (level) { - case RIG_LEVEL_RF: cmd = "rig.set_rfgain"; break; + case RIG_LEVEL_RF: cmd = "rig.set_rfgain"; val.f*= 100; break; + + case RIG_LEVEL_AF: cmd = "rig.set_volume"; val.f*= 100; break; - case RIG_LEVEL_AF: cmd = "rig.set_volume"; break; + case RIG_LEVEL_MICGAIN: cmd = "rig.set_micgain"; val.f*= 100; break; - case RIG_LEVEL_MICGAIN: cmd = "rig.set_micgain"; break; + case RIG_LEVEL_RFPOWER: cmd = "rig.set_power"; val.f*= 100; break; default: rig_debug(RIG_DEBUG_ERR, "%s: invalid level=%d\n", __func__, (int)level); return -RIG_EINVAL; } + sprintf(cmd_arg, + "<params><param><value><%s>%d</%s></value></param></params>", + param_type, (int)val.f, param_type); + + retval = flrig_transaction(rig, cmd, cmd_arg, NULL, 0); if (retval < 0) @@ -1945,6 +1949,8 @@ static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_MICGAIN: cmd = "rig.get_micgain"; break; case RIG_LEVEL_STRENGTH: cmd = "rig.get_smeter"; break; + + case RIG_LEVEL_RFPOWER: cmd = "rig.get_power"; break; case RIG_LEVEL_RFPOWER_METER_WATTS: case RIG_LEVEL_RFPOWER_METER: cmd = "rig.get_pwrmeter"; break; @@ -1972,6 +1978,11 @@ static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) rig_debug(RIG_DEBUG_TRACE, "%s: val.i='%s'(%d)\n", __func__, value, val->i); break; + case RIG_LEVEL_RFPOWER: + val->f = atof(value) / 100.0 * priv->powermeter_scale; + rig_debug(RIG_DEBUG_TRACE, "%s: val.f='%s'(%g)\n", __func__, value, val->f); + break; + case RIG_LEVEL_RFPOWER_METER: val->f = atof(value) / 100.0 * priv->powermeter_scale; rig_debug(RIG_DEBUG_TRACE, "%s: val.f='%s'(%g)\n", __func__, value, val->f); ----------------------------------------------------------------------- Summary of changes: rigs/dummy/flrig.c | 27 +++++++++++++++++++-------- rigs/dummy/flrig.h | 2 +- rigs/yaesu/newcat.c | 38 +++++++++++++++++++++++++++++--------- rigs/yaesu/newcat.h | 2 +- 4 files changed, 50 insertions(+), 19 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-12 22:27:57
|
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 a9a806f8e02d859a3778728247dc87ebaa81a133 (commit) via c46ac9b47422cac41f7c918a8b0ae1dda1b2c067 (commit) via 49128645b11bec3cda0d55bca67ca272e5db7287 (commit) via 7be0af03628373a4bfb792f330f64d189305f82b (commit) via 5e00a54ca06d40f57905ed1c212d58da3c9f4835 (commit) via 23e94a5375a1063f4599aec31a28b2f90c4fb6ef (commit) via 2c224a9ca119c0ec12ef87fe45a3b776ab0212a2 (commit) via 3af9f06fa5dacfd6ca39ac4adc4705acc1ae3a87 (commit) via cce1db9ee1300464285517d3bf51d2071f9066c9 (commit) via c1a0e15464e96fd35a4a740c1970b1dc613a43ff (commit) via dd4076355d7b864b102d270476aa77c06cd86618 (commit) from 935b520b441fc9a33b38a126ac633d623c2dbada (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 a9a806f8e02d859a3778728247dc87ebaa81a133 Merge: 2c224a9c c46ac9b4 Author: Michael Black <mdb...@ya...> Date: Tue Jan 12 16:22:21 2021 -0600 Merge pull request #507 from mikaelnousiainen/fix-yaesu-newcat-retries Re-enable Yaesu question mark handling and fix newcat_get_cmd retries in case of question mark response (2nd attempt) commit c46ac9b47422cac41f7c918a8b0ae1dda1b2c067 Author: Mikael Nousiainen <mik...@ik...> Date: Wed Jan 13 00:10:52 2021 +0200 Get MICGAIN is also rejected in RTTY modes by certain Yaesu newcat rigs diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 35375347..b3dad6ca 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -4090,14 +4090,32 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "KS%c", cat_term); break; - case RIG_LEVEL_MICGAIN: + case RIG_LEVEL_MICGAIN: { + pbwidth_t width; + rmode_t mode = 0; + if (!newcat_valid_command(rig, "MG")) { return -RIG_ENAVAIL; } + if (is_ft991 || is_ftdx5000 || is_ftdx101) + { + newcat_get_mode(rig, vfo, &mode, &width); + } + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "MG%c", cat_term); + + // Some Yaesu rigs reject this command in RTTY modes + if (is_ft991 || is_ftdx5000 || is_ftdx101) + { + if (mode & RIG_MODE_RTTY || mode & RIG_MODE_RTTYR) + { + priv->question_mark_response_means_rejected = 1; + } + } break; + } case RIG_LEVEL_METER: if (!newcat_valid_command(rig, "MS")) commit 49128645b11bec3cda0d55bca67ca272e5db7287 Author: Mikael Nousiainen <mik...@ik...> Date: Wed Jan 13 00:04:10 2021 +0200 Set comp is also rejected in AM/FM/RTTY modes by certain Yaesu newcat rigs diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index f6df3b26..35375347 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -5067,6 +5067,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) { newcat_get_mode(rig, vfo, &mode, &width); } + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "NR0%d%c", status ? 1 : 0, cat_term); @@ -5086,12 +5087,20 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) break; } - case RIG_FUNC_COMP: + case RIG_FUNC_COMP: { + pbwidth_t width; + rmode_t mode = 0; + if (!newcat_valid_command(rig, "PR")) { return -RIG_ENAVAIL; } + if (is_ft991 || is_ftdx5000 || is_ftdx101) + { + newcat_get_mode(rig, vfo, &mode, &width); + } + if (is_ft891 || is_ft991 || is_ftdx1200 || is_ftdx3000 || is_ftdx101) { // There seems to be an error in the manuals for some of these rigs stating that values should be 1 = OFF and 2 = ON, but they are 0 = OFF and 1 = ON instead @@ -5104,7 +5113,17 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) cat_term); } + // Some Yaesu rigs reject this command in AM/FM/RTTY modes + if (is_ft991 || is_ftdx5000 || is_ftdx101) + { + if (mode & RIG_MODE_AM || mode & RIG_MODE_FM || mode & RIG_MODE_AMN || mode & RIG_MODE_FMN || + mode & RIG_MODE_RTTY || mode & RIG_MODE_RTTYR) + { + priv->question_mark_response_means_rejected = 1; + } + } break; + } case RIG_FUNC_VOX: if (!newcat_valid_command(rig, "VX")) commit 7be0af03628373a4bfb792f330f64d189305f82b Author: Mikael Nousiainen <mik...@ik...> Date: Wed Jan 13 00:01:10 2021 +0200 IF shift is rejected also in AM mode diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 58604f7e..f6df3b26 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -4061,10 +4061,10 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) priv->cmd_str[2] = main_sub_vfo; } - // Some Yaesu rigs reject this command in FM mode + // Some Yaesu rigs reject this command in AM/FM modes if (is_ft991 || is_ftdx5000 || is_ftdx101) { - if (mode & RIG_MODE_FM || mode & RIG_MODE_FMN) + if (mode & RIG_MODE_AM || mode & RIG_MODE_FM || mode & RIG_MODE_AMN || mode & RIG_MODE_FMN) { priv->question_mark_response_means_rejected = 1; } commit 5e00a54ca06d40f57905ed1c212d58da3c9f4835 Author: Mikael Nousiainen <mik...@ik...> Date: Tue Jan 12 23:57:49 2021 +0200 Get mode command was conflicting with other commands diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index e7dd88fa..58604f7e 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -3261,12 +3261,20 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) break; - case RIG_LEVEL_IF: + case RIG_LEVEL_IF: { + pbwidth_t width; + rmode_t mode = 0; + if (!newcat_valid_command(rig, "IS")) { return -RIG_ENAVAIL; } + if (is_ft991 || is_ftdx5000 || is_ftdx101) + { + newcat_get_mode(rig, vfo, &mode, &width); + } + rig_debug(RIG_DEBUG_TRACE, "%s: LEVEL_IF val.i=%d\n", __func__, val.i); if (abs(val.i) > rig->caps->max_ifshift) @@ -3306,16 +3314,13 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) // Some Yaesu rigs reject this command in AM/FM modes if (is_ft991 || is_ftdx5000 || is_ftdx101) { - pbwidth_t width; - rmode_t mode; - err = newcat_get_mode(rig, vfo, &mode, &width); - if (mode & RIG_MODE_AM || mode & RIG_MODE_FM || mode & RIG_MODE_AMN || mode & RIG_MODE_FMN) { priv->question_mark_response_means_rejected = 1; } } break; + } case RIG_LEVEL_CWPITCH: { @@ -3362,12 +3367,20 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "KS%03d%c", val.i, cat_term); break; - case RIG_LEVEL_MICGAIN: + case RIG_LEVEL_MICGAIN: { + pbwidth_t width; + rmode_t mode = 0; + if (!newcat_valid_command(rig, "MG")) { return -RIG_ENAVAIL; } + if (is_ft991 || is_ftdx5000 || is_ftdx101) + { + newcat_get_mode(rig, vfo, &mode, &width); + } + if (is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991 || is_ftdx101 || is_ftdx10) { @@ -3383,16 +3396,13 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) // Some Yaesu rigs reject this command in RTTY modes if (is_ft991 || is_ftdx5000 || is_ftdx101) { - pbwidth_t width; - rmode_t mode; - err = newcat_get_mode(rig, vfo, &mode, &width); - if (mode & RIG_MODE_RTTY || mode & RIG_MODE_RTTYR) { priv->question_mark_response_means_rejected = 1; } } break; + } case RIG_LEVEL_METER: if (!newcat_valid_command(rig, "MS")) @@ -4029,12 +4039,20 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) cat_term); break; - case RIG_LEVEL_IF: + case RIG_LEVEL_IF: { + pbwidth_t width; + rmode_t mode = 0; + if (!newcat_valid_command(rig, "IS")) { return -RIG_ENAVAIL; } + if (is_ft991 || is_ftdx5000 || is_ftdx101) + { + newcat_get_mode(rig, vfo, &mode, &width); + } + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "IS%c%c", main_sub_vfo, cat_term); @@ -4046,16 +4064,13 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) // Some Yaesu rigs reject this command in FM mode if (is_ft991 || is_ftdx5000 || is_ftdx101) { - pbwidth_t width; - rmode_t mode; - err = newcat_get_mode(rig, vfo, &mode, &width); - if (mode & RIG_MODE_FM || mode & RIG_MODE_FMN) { priv->question_mark_response_means_rejected = 1; } } break; + } case RIG_LEVEL_CWPITCH: if (!newcat_valid_command(rig, "KP")) @@ -4885,12 +4900,20 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) switch (func) { - case RIG_FUNC_ANF: + case RIG_FUNC_ANF: { + pbwidth_t width; + rmode_t mode = 0; + if (!newcat_valid_command(rig, "BC")) { return -RIG_ENAVAIL; } + if (is_ft991 || is_ftdx5000 || is_ftdx101) + { + err = newcat_get_mode(rig, vfo, &mode, &width); + } + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BC0%d%c", status ? 1 : 0, cat_term); @@ -4902,23 +4925,28 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) // Some Yaesu rigs reject this command in FM mode if (is_ft991 || is_ftdx5000 || is_ftdx101) { - pbwidth_t width; - rmode_t mode; - err = newcat_get_mode(rig, vfo, &mode, &width); - if (mode & RIG_MODE_FM || mode & RIG_MODE_FMN) { priv->question_mark_response_means_rejected = 1; } } break; + } + + case RIG_FUNC_MN: { + pbwidth_t width; + rmode_t mode = 0; - case RIG_FUNC_MN: if (!newcat_valid_command(rig, "BP")) { return -RIG_ENAVAIL; } + if (is_ft991 || is_ftdx5000 || is_ftdx101) + { + newcat_get_mode(rig, vfo, &mode, &width); + } + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BP00%03d%c", status ? 1 : 0, cat_term); @@ -4930,16 +4958,13 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) // Some Yaesu rigs reject this command in FM mode if (is_ft991 || is_ftdx5000 || is_ftdx101) { - pbwidth_t width; - rmode_t mode; - err = newcat_get_mode(rig, vfo, &mode, &width); - if (mode & RIG_MODE_FM || mode & RIG_MODE_FMN) { priv->question_mark_response_means_rejected = 1; } } break; + } case RIG_FUNC_FBKIN: if (!newcat_valid_command(rig, "BI")) @@ -5029,12 +5054,19 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) break; - case RIG_FUNC_NR: + case RIG_FUNC_NR: { + pbwidth_t width; + rmode_t mode = 0; + if (!newcat_valid_command(rig, "NR")) { return -RIG_ENAVAIL; } + if (is_ft991 || is_ftdx5000 || is_ftdx101) + { + newcat_get_mode(rig, vfo, &mode, &width); + } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "NR0%d%c", status ? 1 : 0, cat_term); @@ -5046,16 +5078,13 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) // Some Yaesu rigs reject this command in FM mode if (is_ft991 || is_ftdx5000 || is_ftdx101) { - pbwidth_t width; - rmode_t mode; - err = newcat_get_mode(rig, vfo, &mode, &width); - if (mode & RIG_MODE_FM || mode & RIG_MODE_FMN) { priv->question_mark_response_means_rejected = 1; } } break; + } case RIG_FUNC_COMP: if (!newcat_valid_command(rig, "PR")) @@ -5149,12 +5178,20 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) switch (func) { - case RIG_FUNC_ANF: + case RIG_FUNC_ANF: { + pbwidth_t width; + rmode_t mode = 0; + if (!newcat_valid_command(rig, "BC")) { return -RIG_ENAVAIL; } + if (is_ft991 || is_ftdx5000 || is_ftdx101) + { + err = newcat_get_mode(rig, vfo, &mode, &width); + } + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BC0%c", cat_term); if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) @@ -5165,16 +5202,13 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) // Some Yaesu rigs reject this command in FM mode if (is_ft991 || is_ftdx5000 || is_ftdx101) { - pbwidth_t width; - rmode_t mode; - err = newcat_get_mode(rig, vfo, &mode, &width); - if (mode & RIG_MODE_FM || mode & RIG_MODE_FMN) { priv->question_mark_response_means_rejected = 1; } } break; + } case RIG_FUNC_MN: if (!newcat_valid_command(rig, "BP")) commit 23e94a5375a1063f4599aec31a28b2f90c4fb6ef Author: Mikael Nousiainen <mik...@ik...> Date: Tue Jan 12 23:42:49 2021 +0200 Make skipping of retries for certain Yaesu newcat commands rig and mode-specific diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 4f11ecce..e7dd88fa 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -3304,7 +3304,17 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } // Some Yaesu rigs reject this command in AM/FM modes - priv->question_mark_response_means_rejected = 1; + if (is_ft991 || is_ftdx5000 || is_ftdx101) + { + pbwidth_t width; + rmode_t mode; + err = newcat_get_mode(rig, vfo, &mode, &width); + + if (mode & RIG_MODE_AM || mode & RIG_MODE_FM || mode & RIG_MODE_AMN || mode & RIG_MODE_FMN) + { + priv->question_mark_response_means_rejected = 1; + } + } break; case RIG_LEVEL_CWPITCH: @@ -3371,7 +3381,17 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "MG%03d%c", fpf, cat_term); // Some Yaesu rigs reject this command in RTTY modes - priv->question_mark_response_means_rejected = 1; + if (is_ft991 || is_ftdx5000 || is_ftdx101) + { + pbwidth_t width; + rmode_t mode; + err = newcat_get_mode(rig, vfo, &mode, &width); + + if (mode & RIG_MODE_RTTY || mode & RIG_MODE_RTTYR) + { + priv->question_mark_response_means_rejected = 1; + } + } break; case RIG_LEVEL_METER: @@ -3577,9 +3597,6 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) priv->cmd_str[2] = main_sub_vfo; } } - - // Some Yaesu rigs reject this command in AM/FM modes - priv->question_mark_response_means_rejected = 1; break; case RIG_LEVEL_COMP: @@ -4026,6 +4043,18 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) priv->cmd_str[2] = main_sub_vfo; } + // Some Yaesu rigs reject this command in FM mode + if (is_ft991 || is_ftdx5000 || is_ftdx101) + { + pbwidth_t width; + rmode_t mode; + err = newcat_get_mode(rig, vfo, &mode, &width); + + if (mode & RIG_MODE_FM || mode & RIG_MODE_FMN) + { + priv->question_mark_response_means_rejected = 1; + } + } break; case RIG_LEVEL_CWPITCH: @@ -4311,6 +4340,9 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) err = newcat_get_cmd(rig); + // Clear flag after executing command + priv->question_mark_response_means_rejected = 0; + if (err != RIG_OK) { return err; @@ -4867,8 +4899,18 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) priv->cmd_str[2] = main_sub_vfo; } - // Some Yaesu rigs reject this command in AM/FM modes - priv->question_mark_response_means_rejected = 1; + // Some Yaesu rigs reject this command in FM mode + if (is_ft991 || is_ftdx5000 || is_ftdx101) + { + pbwidth_t width; + rmode_t mode; + err = newcat_get_mode(rig, vfo, &mode, &width); + + if (mode & RIG_MODE_FM || mode & RIG_MODE_FMN) + { + priv->question_mark_response_means_rejected = 1; + } + } break; case RIG_FUNC_MN: @@ -4885,8 +4927,18 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) priv->cmd_str[2] = main_sub_vfo; } - // Some Yaesu rigs reject this command in AM/FM modes - priv->question_mark_response_means_rejected = 1; + // Some Yaesu rigs reject this command in FM mode + if (is_ft991 || is_ftdx5000 || is_ftdx101) + { + pbwidth_t width; + rmode_t mode; + err = newcat_get_mode(rig, vfo, &mode, &width); + + if (mode & RIG_MODE_FM || mode & RIG_MODE_FMN) + { + priv->question_mark_response_means_rejected = 1; + } + } break; case RIG_FUNC_FBKIN: @@ -4991,8 +5043,18 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) priv->cmd_str[2] = main_sub_vfo; } - // Some Yaesu rigs reject this command in AM/FM modes - priv->question_mark_response_means_rejected = 1; + // Some Yaesu rigs reject this command in FM mode + if (is_ft991 || is_ftdx5000 || is_ftdx101) + { + pbwidth_t width; + rmode_t mode; + err = newcat_get_mode(rig, vfo, &mode, &width); + + if (mode & RIG_MODE_FM || mode & RIG_MODE_FMN) + { + priv->question_mark_response_means_rejected = 1; + } + } break; case RIG_FUNC_COMP: @@ -5100,6 +5162,18 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) priv->cmd_str[2] = main_sub_vfo; } + // Some Yaesu rigs reject this command in FM mode + if (is_ft991 || is_ftdx5000 || is_ftdx101) + { + pbwidth_t width; + rmode_t mode; + err = newcat_get_mode(rig, vfo, &mode, &width); + + if (mode & RIG_MODE_FM || mode & RIG_MODE_FMN) + { + priv->question_mark_response_means_rejected = 1; + } + } break; case RIG_FUNC_MN: @@ -5261,7 +5335,12 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) return -RIG_EINVAL; } - if (RIG_OK != (err = newcat_get_cmd(rig))) + err = newcat_get_cmd(rig); + + // Clear flag after executing command + priv->question_mark_response_means_rejected = 0; + + if (err != RIG_OK) { return err; } commit 2c224a9ca119c0ec12ef87fe45a3b776ab0212a2 Merge: 935b520b 3af9f06f Author: Michael Black <mdb...@ya...> Date: Tue Jan 12 15:05:44 2021 -0600 Merge pull request #508 from mikaelnousiainen/fix-yaesu-ctcss-off All Yaesu newcat rigs use the same format for turning CTCSS ON/OFF commit 3af9f06fa5dacfd6ca39ac4adc4705acc1ae3a87 Author: Mikael Nousiainen <mik...@ik...> Date: Tue Jan 12 23:01:54 2021 +0200 All Yaesu newcat rigs use the same format for turning CTCSS ON/OFF diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index d5863a75..ad8515c4 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2519,17 +2519,8 @@ int newcat_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone) if (tone == 0) /* turn off ctcss */ { - if (is_ft891 || is_ft991 || is_ftdx101) - { - // note ftdx101 cat manual says CTP1P2; not CTP1P2P3; so is this correct? - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT%c00%c", main_sub_vfo, - cat_term); - } - else - { - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT%c0%c", main_sub_vfo, - cat_term); - } + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT%c0%c", main_sub_vfo, + cat_term); } else { commit cce1db9ee1300464285517d3bf51d2071f9066c9 Merge: c1a0e154 935b520b Author: Mikael Nousiainen <mik...@ik...> Date: Tue Jan 12 22:18:35 2021 +0200 Fix conflicts diff --cc rigs/yaesu/newcat.c index f2c52d90,d5863a75..4f11ecce --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@@ -9146,18 -9160,9 +9146,18 @@@ int newcat_get_cmd(RIG *rig * Followup 20201213 FTDX3000 FB; command returning ?; so do NOT abort * see https://github.com/Hamlib/Hamlib/issues/464 */ - rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig#1: '%s'\n", __func__, - priv->cmd_str); - // return -RIG_ERJCTED; + if (priv->question_mark_response_means_rejected) + { - rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig: '%s'\n", __func__, ++ rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig (get): '%s'\n", __func__, + priv->cmd_str); + return -RIG_ERJCTED; + } + + rig_debug(RIG_DEBUG_WARN, "%s: Rig busy - retrying: '%s'\n", __func__, + priv->cmd_str); + + rc = -RIG_ERJCTED; /* retry */ + break; } continue; @@@ -9299,8 -9304,8 +9299,8 @@@ int newcat_set_cmd(RIG *rig */ if (priv->question_mark_response_means_rejected) { - rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig: '%s'\n", __func__, - priv->cmd_str); - rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig#2: '%s'\n", __func__, ++ rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig (set): '%s'\n", __func__, + priv->cmd_str); return -RIG_ERJCTED; } commit c1a0e15464e96fd35a4a740c1970b1dc613a43ff Author: Mikael Nousiainen <mik...@ik...> Date: Tue Jan 12 22:13:11 2021 +0200 Fix error codes to allow retries in newcat_get_cmd diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 972f2af6..f2c52d90 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -9085,19 +9085,17 @@ int newcat_get_cmd(RIG *rig) rc = RIG_OK; /* received something */ /* Check that command termination is correct - alternative is - response is longer that the buffer */ + response is longer than the buffer */ if (cat_term != priv->ret_data[strlen(priv->ret_data) - 1]) { rig_debug(RIG_DEBUG_ERR, "%s: Command is not correctly terminated '%s'\n", __func__, priv->ret_data); - // we were using BUSBUSY but microham devices need retries - //rc = -RIG_BUSBUSY; /* don't write command again */ - // rc = -RIG_EPROTO; + rc = -RIG_EPROTO; /* retry */ /* we could decrement retry_count here but there is a danger of infinite looping so we just use up a retry for safety's sake */ - continue; /* retry */ + continue; } /* check for error codes */ @@ -9158,7 +9156,7 @@ int newcat_get_cmd(RIG *rig) rig_debug(RIG_DEBUG_WARN, "%s: Rig busy - retrying: '%s'\n", __func__, priv->cmd_str); - rc = -RIG_BUSBUSY; /* retry */ + rc = -RIG_ERJCTED; /* retry */ break; } commit dd4076355d7b864b102d270476aa77c06cd86618 Author: Mikael Nousiainen <mik...@ik...> Date: Tue Jan 12 11:00:18 2021 +0200 Re-enable Yaesu question mark handling and fix newcat_get_cmd retries in case of question mark response diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 20ef392a..972f2af6 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -3304,9 +3304,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } // Some Yaesu rigs reject this command in AM/FM modes - // Disabling as it's too general - // Need to be rig/mode specific - //priv->question_mark_response_means_rejected = 1; + priv->question_mark_response_means_rejected = 1; break; case RIG_LEVEL_CWPITCH: @@ -3373,9 +3371,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "MG%03d%c", fpf, cat_term); // Some Yaesu rigs reject this command in RTTY modes - // Disabling as it's too general - // Need to be rig/mode specific - //priv->question_mark_response_means_rejected = 1; + priv->question_mark_response_means_rejected = 1; break; case RIG_LEVEL_METER: @@ -3583,9 +3579,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } // Some Yaesu rigs reject this command in AM/FM modes - // Disabling as it's too general - // Need to be rig/mode specific - //priv->question_mark_response_means_rejected = 1; + priv->question_mark_response_means_rejected = 1; break; case RIG_LEVEL_COMP: @@ -4874,9 +4868,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) } // Some Yaesu rigs reject this command in AM/FM modes - // Disabling as it's too general - // Need to be rig/mode specific - //priv->question_mark_response_means_rejected = 1; + priv->question_mark_response_means_rejected = 1; break; case RIG_FUNC_MN: @@ -4894,9 +4886,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) } // Some Yaesu rigs reject this command in AM/FM modes - // Disabling as it's too general - // Need to be rig/mode specific - //priv->question_mark_response_means_rejected = 1; + priv->question_mark_response_means_rejected = 1; break; case RIG_FUNC_FBKIN: @@ -5002,9 +4992,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) } // Some Yaesu rigs reject this command in AM/FM modes - // Disabling as it's too general - // Need to be rig/mode specific - //priv->question_mark_response_means_rejected = 1; + priv->question_mark_response_means_rejected = 1; break; case RIG_FUNC_COMP: @@ -9160,9 +9148,18 @@ int newcat_get_cmd(RIG *rig) * Followup 20201213 FTDX3000 FB; command returning ?; so do NOT abort * see https://github.com/Hamlib/Hamlib/issues/464 */ - rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig: '%s'\n", __func__, - priv->cmd_str); - // return -RIG_ERJCTED; + if (priv->question_mark_response_means_rejected) + { + rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig: '%s'\n", __func__, + priv->cmd_str); + return -RIG_ERJCTED; + } + + rig_debug(RIG_DEBUG_WARN, "%s: Rig busy - retrying: '%s'\n", __func__, + priv->cmd_str); + + rc = -RIG_BUSBUSY; /* retry */ + break; } continue; @@ -9305,12 +9302,13 @@ int newcat_set_cmd(RIG *rig) if (priv->question_mark_response_means_rejected) { rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig: '%s'\n", __func__, - priv->cmd_str); + priv->cmd_str); return -RIG_ERJCTED; } /* Rig busy wait please */ - rig_debug(RIG_DEBUG_WARN, "%s: Rig busy - retrying\n", __func__); + rig_debug(RIG_DEBUG_WARN, "%s: Rig busy - retrying: '%s'\n", __func__, + priv->cmd_str); /* read the verify command reply */ if ((rc = read_string(&state->rigport, priv->ret_data, sizeof(priv->ret_data), diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 29471517..7c8918da 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20210111" +#define NEWCAT_VER "20210112" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 245 ++++++++++++++++++++++++++++++++++++++++------------ rigs/yaesu/newcat.h | 2 +- 2 files changed, 192 insertions(+), 55 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-12 13:15:39
|
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 935b520b441fc9a33b38a126ac633d623c2dbada (commit) from 614f08b6720e3d8d44821bf47405866529f94920 (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 935b520b441fc9a33b38a126ac633d623c2dbada Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Jan 12 07:13:50 2021 -0600 Change debug message in newcat.c so we can see which one it is https://github.com/Hamlib/Hamlib/issues/505 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 20ef392a..d5863a75 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -9160,7 +9160,7 @@ int newcat_get_cmd(RIG *rig) * Followup 20201213 FTDX3000 FB; command returning ?; so do NOT abort * see https://github.com/Hamlib/Hamlib/issues/464 */ - rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig: '%s'\n", __func__, + rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig#1: '%s'\n", __func__, priv->cmd_str); // return -RIG_ERJCTED; } @@ -9304,7 +9304,7 @@ int newcat_set_cmd(RIG *rig) */ if (priv->question_mark_response_means_rejected) { - rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig: '%s'\n", __func__, + rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig#2: '%s'\n", __func__, priv->cmd_str); return -RIG_ERJCTED; } ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-11 23:47: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 614f08b6720e3d8d44821bf47405866529f94920 (commit) from 612de9762e3a7e00597ce48499746b77e96b433a (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 614f08b6720e3d8d44821bf47405866529f94920 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jan 11 17:45:53 2021 -0600 Disable several question_mark_response_means_rejected lines They are much too general and need to be narrowed to rig/mode https://github.com/Hamlib/Hamlib/issues/505 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index a0896675..20ef392a 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -3304,7 +3304,9 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } // Some Yaesu rigs reject this command in AM/FM modes - priv->question_mark_response_means_rejected = 1; + // Disabling as it's too general + // Need to be rig/mode specific + //priv->question_mark_response_means_rejected = 1; break; case RIG_LEVEL_CWPITCH: @@ -3371,7 +3373,9 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "MG%03d%c", fpf, cat_term); // Some Yaesu rigs reject this command in RTTY modes - priv->question_mark_response_means_rejected = 1; + // Disabling as it's too general + // Need to be rig/mode specific + //priv->question_mark_response_means_rejected = 1; break; case RIG_LEVEL_METER: @@ -3579,7 +3583,9 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } // Some Yaesu rigs reject this command in AM/FM modes - priv->question_mark_response_means_rejected = 1; + // Disabling as it's too general + // Need to be rig/mode specific + //priv->question_mark_response_means_rejected = 1; break; case RIG_LEVEL_COMP: @@ -4868,7 +4874,9 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) } // Some Yaesu rigs reject this command in AM/FM modes - priv->question_mark_response_means_rejected = 1; + // Disabling as it's too general + // Need to be rig/mode specific + //priv->question_mark_response_means_rejected = 1; break; case RIG_FUNC_MN: @@ -4886,7 +4894,9 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) } // Some Yaesu rigs reject this command in AM/FM modes - priv->question_mark_response_means_rejected = 1; + // Disabling as it's too general + // Need to be rig/mode specific + //priv->question_mark_response_means_rejected = 1; break; case RIG_FUNC_FBKIN: @@ -4992,7 +5002,9 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) } // Some Yaesu rigs reject this command in AM/FM modes - priv->question_mark_response_means_rejected = 1; + // Disabling as it's too general + // Need to be rig/mode specific + //priv->question_mark_response_means_rejected = 1; break; case RIG_FUNC_COMP: diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 7954f8e9..29471517 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20210108" +#define NEWCAT_VER "20210111" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 24 ++++++++++++++++++------ rigs/yaesu/newcat.h | 2 +- 2 files changed, 19 insertions(+), 7 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-11 20:54:30
|
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 612de9762e3a7e00597ce48499746b77e96b433a (commit) via 0ebdaee747a0b15477d62c4b4a4ecf55ad3710b9 (commit) from 4571dcb2a50497162e464d6928e86fc7571a1f2c (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 612de9762e3a7e00597ce48499746b77e96b433a Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jan 11 14:53:35 2021 -0600 Fix intialization of rx_range_list https://github.com/Hamlib/Hamlib/issues/504 diff --git a/src/rig.c b/src/rig.c index b740af56..06b29be1 100644 --- a/src/rig.c +++ b/src/rig.c @@ -426,15 +426,16 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model) sizeof(struct freq_range_list)*FRQRANGESIZ); // if we don't have list1 we'll try list2 - if (RIG_IS_FRNG_END(rs->rx_range_list[0])) + if (rs->rx_range_list == NULL) { + rig_debug(RIG_DEBUG_TRACE, "%s: rx_range_list1 is empty, using rx_range_list2\n", __func__); memcpy(rs->tx_range_list, caps->rx_range_list2, sizeof(struct freq_range_list)*FRQRANGESIZ); memcpy(rs->rx_range_list, caps->tx_range_list2, sizeof(struct freq_range_list)*FRQRANGESIZ); } - if (RIG_IS_FRNG_END(rs->rx_range_list[0])) + if (rs->tx_range_list == NULL) { rig_debug(RIG_DEBUG_ERR, "%s: rig does not have rx_range!!\n", __func__); return NULL; commit 0ebdaee747a0b15477d62c4b4a4ecf55ad3710b9 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jan 11 14:43:08 2021 -0600 Change rig_init logic to allow first char of '/' to mean a pathname and not a hostname https://github.com/Hamlib/Hamlib/issues/492 diff --git a/src/misc.c b/src/misc.c index 205f47ca..bfe5d2ad 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1636,6 +1636,7 @@ int HAMLIB_API parse_hoststr(char *hoststr, char host[256], char port[6]) // Handle device names 1st if (strstr(hoststr, "/dev")) { return -1; } + if (strstr(hoststr, "/")) { return -1; } // posible path -- no hostname starts with / if (strncasecmp(hoststr, "com", 3) == 0) { return -1; } ----------------------------------------------------------------------- Summary of changes: src/misc.c | 1 + src/rig.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-10 20:40:42
|
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 4571dcb2a50497162e464d6928e86fc7571a1f2c (commit) via 736959f41ac8cae181713e444df0e7d0565b2717 (commit) from 2b3439b75136e20b1f3fa7dce76daf02a894a31c (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 4571dcb2a50497162e464d6928e86fc7571a1f2c Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 10 14:39:39 2021 -0600 Fix rig_get_function_ptr return value https://github.com/Hamlib/Hamlib/issues/502 diff --git a/src/misc.c b/src/misc.c index 17a790ac..205f47ca 100644 --- a/src/misc.c +++ b/src/misc.c @@ -2073,13 +2073,13 @@ void *rig_get_function_ptr(rig_model_t rig_model, default: rig_debug(RIG_DEBUG_ERR, "Unknown function?? function=%d\n", rig_function); - return NULL; - } - return RIG_OK; + return NULL; } +// negative return indicates error +// watch out for integer values that may be negative int rig_get_caps_int(rig_model_t rig_model, enum rig_caps_int_e rig_caps) { const struct rig_caps *caps = rig_get_caps(rig_model); @@ -2102,8 +2102,6 @@ int rig_get_caps_int(rig_model_t rig_model, enum rig_caps_int_e rig_caps) rig_debug(RIG_DEBUG_ERR, "%s: Unknown rig_caps value=%d\n", __func__, rig_caps); return -RIG_EINVAL; } - - return RIG_OK; } const char *rig_get_caps_cptr(rig_model_t rig_model, commit 736959f41ac8cae181713e444df0e7d0565b2717 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 10 14:35:37 2021 -0600 Fix ft100.c RPT_SHIFT bit masking https://github.com/Hamlib/Hamlib/issues/501 diff --git a/rigs/yaesu/ft100.c b/rigs/yaesu/ft100.c index 31a5f993..da0a018c 100644 --- a/rigs/yaesu/ft100.c +++ b/rigs/yaesu/ft100.c @@ -174,7 +174,7 @@ const struct rig_caps ft100_caps = RIG_MODEL(RIG_MODEL_FT100), .model_name = "FT-100", .mfg_name = "Yaesu", - .version = "20210102.0", + .version = "20210110.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1022,8 +1022,8 @@ int ft100_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *shift) *shift = RIG_RPT_SHIFT_NONE; - if (priv->status.flag1 && 1 << 2) { *shift = RIG_RPT_SHIFT_MINUS; } - else if (priv->status.flag1 && 1 << 3) { *shift = RIG_RPT_SHIFT_PLUS; } + if (priv->status.flag1 & (1 << 2)) { *shift = RIG_RPT_SHIFT_MINUS; } + else if (priv->status.flag1 & (1 << 3)) { *shift = RIG_RPT_SHIFT_PLUS; } rig_debug(RIG_DEBUG_VERBOSE, "%s: flag1=0x%02x\n", __func__, priv->status.flag1); ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/ft100.c | 6 +++--- src/misc.c | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-10 13:57:04
|
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 2b3439b75136e20b1f3fa7dce76daf02a894a31c (commit) from 7615f850124efb5e5436fabd90d487b653a4b8d5 (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 2b3439b75136e20b1f3fa7dce76daf02a894a31c Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 10 07:56:39 2021 -0600 Update NEWS diff --git a/NEWS b/NEWS index c7a64f93..4d78c5e0 100644 --- a/NEWS +++ b/NEWS @@ -7,11 +7,14 @@ Copyright (C) 2000-2020 Michael Black W9MDB, and others Please send Hamlib bug reports to ham...@li... Version 4.1 + * Several fixes for Icom and Yaesu rigs * Nobody should need to use rig->caps or rig->state anymore If you need a variable added please contact us. Note that rig->state abstraction is not implemented yet...no need known * New rig_get_caps_int and rig_get_caps_cptr functions to replace using caps-> values * New rig_get_function to replace using caps-> function pointers + * Fix shared library problem with WSJTX, JTDX, and JS8Call + * New model Barrett 950 Version 4.0 2020-11-29 ----------------------------------------------------------------------- Summary of changes: NEWS | 3 +++ 1 file changed, 3 insertions(+) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-10 13:47:24
|
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 7615f850124efb5e5436fabd90d487b653a4b8d5 (commit) from 6fbf33e8edb4448e122df67d5379bf48be124dd1 (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 7615f850124efb5e5436fabd90d487b653a4b8d5 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 10 07:46:07 2021 -0600 Fix hamlib_port structure alignment Should fix the shared libary problem with WSJTX getting incorrect vfo_list https://github.com/Hamlib/Hamlib/issues/500 diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index a5281350..5dfc56f8 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -1996,7 +1996,8 @@ typedef struct hamlib_port { } post_write_date; /*!< hamlib internal use */ int timeout; /*!< Timeout, in mS */ - int retry; /*!< Maximum number of retries, 0 to disable */ + short retry; /*!< Maximum number of retries, 0 to disable */ + short flushx; /*!< If true flush is done with read instead of TCFLUSH - MicroHam */ char pathname[FILPATHLEN]; /*!< Port pathname */ @@ -2034,7 +2035,6 @@ typedef struct hamlib_port { int value; /*!< Toggle PTT ON or OFF */ } gpio; /*!< GPIO attributes */ } parm; /*!< Port parameter union */ - int flushx; /*!< If true flush is done with read instead of TCFLUSH - MicroHam */ } hamlib_port_t; //! @endcond ----------------------------------------------------------------------- Summary of changes: include/hamlib/rig.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-10 05:18:18
|
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 6fbf33e8edb4448e122df67d5379bf48be124dd1 (commit) from 6e8b90aeec93ae249acc77a6ca72acb5808231ea (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 6fbf33e8edb4448e122df67d5379bf48be124dd1 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Jan 9 23:17:37 2021 -0600 Undo changes on testrig.c diff --git a/tests/testrig.c b/tests/testrig.c index f6c526c1..b7b9ab97 100644 --- a/tests/testrig.c +++ b/tests/testrig.c @@ -15,7 +15,7 @@ # include "config.h" #endif -#define SERIAL_PORT "/dev/pts/3" +#define SERIAL_PORT "/dev/ttyUSB0" int main(int argc, char *argv[]) @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) printf("testrig: Hello, I am your main() !\n"); /* Turn off backend debugging output */ - rig_set_debug_level(RIG_DEBUG_ERR); + rig_set_debug_level(RIG_DEBUG_NONE); /* * allocate memory, setup & open port @@ -66,13 +66,10 @@ int main(int argc, char *argv[]) if (!my_rig) { - fprintf(stderr, "Rig Not OK!!!\n"); - //fprintf(stderr, "Unknown rig num: %d\n", myrig_model); - //fprintf(stderr, "Please check riglist.h\n"); + fprintf(stderr, "Unknown rig num: %d\n", myrig_model); + fprintf(stderr, "Please check riglist.h\n"); exit(1); /* whoops! something went wrong (mem alloc?) */ } - fprintf(stderr, "Rig OK\n"); - exit(0); strncpy(my_rig->state.rigport.pathname, SERIAL_PORT, FILPATHLEN - 1); @@ -86,7 +83,6 @@ int main(int argc, char *argv[]) printf("Port %s opened ok\n", SERIAL_PORT); - printf("Offset of vfo_list=%p\n", &my_rig->state.vfo_list); /* * Below are examples of set/get routines. * Must add checking of functionality map prior to command execution -- FS ----------------------------------------------------------------------- Summary of changes: tests/testrig.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-10 05:15:09
|
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 6e8b90aeec93ae249acc77a6ca72acb5808231ea (commit) via b79fdc0587514d27ed58d9318eb47ffd4d3ca82d (commit) via d475dc81a3b347ee907398760204d0e517f9d355 (commit) via 17a37be2c286ae226f4cb8752dc5c5cc647efa32 (commit) via a4d9e61f5afc093a52c30ab408cc7dd8261d1d95 (commit) from ca8ed30f8f39745941b1b7c1d4031e9bf246e144 (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 6e8b90aeec93ae249acc77a6ca72acb5808231ea Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Jan 9 15:19:19 2021 -0600 Fix cppcheck warnings diff --git a/rigs/barrett/950.c b/rigs/barrett/950.c index 672da1ed..f06b5b31 100644 --- a/rigs/barrett/950.c +++ b/rigs/barrett/950.c @@ -222,7 +222,7 @@ int barrett950_set_freq(RIG *rig, vfo_t vfo, freq_t freq) sprintf((char *) cmd_buf, "PC%04dR%08.0lfT%08.0lf", chan, freq, freq); retval = barrett_transaction(rig, cmd_buf, 0, &response); - if (strncmp(response, "OK", 2) != 0) + if (retval != RIG_OK || strncmp(response, "OK", 2) != 0) { rig_debug(RIG_DEBUG_ERR, "%s: Expected OK, got '%s'\n", __func__, response); return -RIG_EPROTO; diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 553a0c63..c6d657aa 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -306,8 +306,8 @@ int icom_transaction(RIG *rig, int cmd, int subcmd, int retval, retry; rig_debug(RIG_DEBUG_VERBOSE, - "%s: cmd=0x%02x, subcmd=0x%02x, payload_len=%d, data_len=%d\n", __func__, - cmd, subcmd, payload_len, *data_len); + "%s: cmd=0x%02x, subcmd=0x%02x, payload_len=%d\n", __func__, + cmd, subcmd, payload_len); retry = rig->state.rigport.retry; diff --git a/rigs/winradio/g305.c b/rigs/winradio/g305.c index 7e2a5643..b5fa2430 100644 --- a/rigs/winradio/g305.c +++ b/rigs/winradio/g305.c @@ -272,11 +272,10 @@ int g3_cleanup(RIG *rig) { struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv; - /* Clean up the dll access */ - FreeLibrary(priv->dll); - - if (rig->state.priv) + if (priv) { + /* Clean up the dll access */ + FreeLibrary(priv->dll); free(rig->state.priv); } diff --git a/rigs/winradio/g313-posix.c b/rigs/winradio/g313-posix.c index ba09ec56..f9d096bf 100644 --- a/rigs/winradio/g313-posix.c +++ b/rigs/winradio/g313-posix.c @@ -306,10 +306,7 @@ int g313_cleanup(RIG *rig) dlclose(priv->hWRAPI); } - if (rig->state.priv) - { - free(rig->state.priv); - } + free(rig->state.priv); rig->state.priv = NULL; return RIG_OK; diff --git a/rigs/winradio/g313-win.c b/rigs/winradio/g313-win.c index abc99cf3..2134d520 100644 --- a/rigs/winradio/g313-win.c +++ b/rigs/winradio/g313-win.c @@ -469,11 +469,7 @@ int g313_cleanup(RIG *rig) FreeLibrary(priv->WinMM); FreeLibrary(priv->hWRG313WO); - - if (rig->state.priv) - { - free(rig->state.priv); - } + free(rig->state.priv); rig->state.priv = NULL; diff --git a/src/rig.c b/src/rig.c index dfd9ac90..b740af56 100644 --- a/src/rig.c +++ b/src/rig.c @@ -437,6 +437,7 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model) if (RIG_IS_FRNG_END(rs->rx_range_list[0])) { rig_debug(RIG_DEBUG_ERR, "%s: rig does not have rx_range!!\n", __func__); + return NULL; } #if 0 // this is no longer applicable -- replace it with something? diff --git a/tests/testrig.c b/tests/testrig.c index a2a8e890..f6c526c1 100644 --- a/tests/testrig.c +++ b/tests/testrig.c @@ -15,7 +15,7 @@ # include "config.h" #endif -#define SERIAL_PORT "/dev/ttyUSB0" +#define SERIAL_PORT "/dev/pts/3" int main(int argc, char *argv[]) @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) printf("testrig: Hello, I am your main() !\n"); /* Turn off backend debugging output */ - rig_set_debug_level(RIG_DEBUG_NONE); + rig_set_debug_level(RIG_DEBUG_ERR); /* * allocate memory, setup & open port @@ -66,10 +66,13 @@ int main(int argc, char *argv[]) if (!my_rig) { - fprintf(stderr, "Unknown rig num: %d\n", myrig_model); - fprintf(stderr, "Please check riglist.h\n"); + fprintf(stderr, "Rig Not OK!!!\n"); + //fprintf(stderr, "Unknown rig num: %d\n", myrig_model); + //fprintf(stderr, "Please check riglist.h\n"); exit(1); /* whoops! something went wrong (mem alloc?) */ } + fprintf(stderr, "Rig OK\n"); + exit(0); strncpy(my_rig->state.rigport.pathname, SERIAL_PORT, FILPATHLEN - 1); commit b79fdc0587514d27ed58d9318eb47ffd4d3ca82d Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Jan 9 12:06:40 2021 -0600 Fix potential null reference in dttsp.c diff --git a/rigs/winradio/g303.c b/rigs/winradio/g303.c index 67dceb78..dda2c5cc 100644 --- a/rigs/winradio/g303.c +++ b/rigs/winradio/g303.c @@ -272,7 +272,7 @@ int g3_cleanup(RIG *rig) struct g3_priv_data *priv = (struct g3_priv_data *)rig->state.priv; /* Clean up the dll access */ - FreeLibrary(priv->dll); + if (priv) FreeLibrary(priv->dll); if (rig->state.priv) { commit d475dc81a3b347ee907398760204d0e517f9d355 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Jan 9 12:05:49 2021 -0600 Fix potential null reference in dttsp.c diff --git a/rigs/kit/elektor507.c b/rigs/kit/elektor507.c index 8237830a..fcca4a2f 100644 --- a/rigs/kit/elektor507.c +++ b/rigs/kit/elektor507.c @@ -345,7 +345,7 @@ int elektor507_cleanup(RIG *rig) rig->state.priv; /* Clean up the dll access */ - FreeLibrary(priv->extra_priv.dll); + if (priv) FreeLibrary(priv->extra_priv.dll); if (rig->state.priv) { commit 17a37be2c286ae226f4cb8752dc5c5cc647efa32 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Jan 9 12:05:00 2021 -0600 Fix potential null reference in dttsp.c diff --git a/rigs/kit/dwt.c b/rigs/kit/dwt.c index 110da9d8..65252db5 100644 --- a/rigs/kit/dwt.c +++ b/rigs/kit/dwt.c @@ -342,7 +342,7 @@ int dwtdll_cleanup(RIG *rig) struct dwtdll_priv_data *priv = (struct dwtdll_priv_data *)rig->state.priv; /* Clean up the dll access */ - FreeLibrary(priv->dll); + if (priv) FreeLibrary(priv->dll); if (rig->state.priv) { commit a4d9e61f5afc093a52c30ab408cc7dd8261d1d95 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Jan 9 12:03:29 2021 -0600 Fix potential null reference in dttsp.c diff --git a/rigs/flexradio/dttsp.c b/rigs/flexradio/dttsp.c index 84ac4196..b9ad58ad 100644 --- a/rigs/flexradio/dttsp.c +++ b/rigs/flexradio/dttsp.c @@ -660,7 +660,7 @@ int dttsp_cleanup(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - if (priv->tuner) + if (priv && priv->tuner) { rig_cleanup(priv->tuner); } ----------------------------------------------------------------------- Summary of changes: rigs/barrett/950.c | 2 +- rigs/flexradio/dttsp.c | 2 +- rigs/icom/frame.c | 4 ++-- rigs/kit/dwt.c | 2 +- rigs/kit/elektor507.c | 2 +- rigs/winradio/g303.c | 2 +- rigs/winradio/g305.c | 7 +++---- rigs/winradio/g313-posix.c | 5 +---- rigs/winradio/g313-win.c | 6 +----- src/rig.c | 1 + tests/testrig.c | 11 +++++++---- 11 files changed, 20 insertions(+), 24 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-09 16:14:01
|
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 ca8ed30f8f39745941b1b7c1d4031e9bf246e144 (commit) from 1d74711a00dfa416a171cec87c841db315c5d9f7 (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 ca8ed30f8f39745941b1b7c1d4031e9bf246e144 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Jan 9 10:13:17 2021 -0600 astyle files diff --git a/rigs/barrett/barrett.c b/rigs/barrett/barrett.c index 739825c9..1494c80e 100644 --- a/rigs/barrett/barrett.c +++ b/rigs/barrett/barrett.c @@ -54,14 +54,14 @@ int barrett_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt); static int barrett_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt); int barrett_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); int barrett_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, - pbwidth_t *width); + pbwidth_t *width); int barrett_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq); int barrett_set_split_vfo(RIG *rig, vfo_t rxvfo, split_t split, - vfo_t txvfo); + vfo_t txvfo); int barrett_get_split_vfo(RIG *rig, vfo_t rxvfo, split_t *split, - vfo_t *txvfo); + vfo_t *txvfo); static int barrett_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index aaba5d0b..4165884d 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -1123,7 +1123,7 @@ static int dummy_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; } - memcpy (val, &curr->levels[idx], sizeof(value_t)); + memcpy(val, &curr->levels[idx], sizeof(value_t)); rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rig_strlevel(level)); diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 2b183e62..dacd414c 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -909,7 +909,7 @@ static int flrig_open(RIG *rig) else if (streq(p, "UCW")) { modeMapAdd(&modes, RIG_MODE_CW, p); } else if (streq(p, "C4FM")) { modeMapAdd(&modes, RIG_MODE_C4FM, p); } else if (streq(p, "SPEC")) { modeMapAdd(&modes, RIG_MODE_SPEC, p); } - else if (streq(p,"DRM")) // we don't support DRM yet (or maybe ever) + else if (streq(p, "DRM")) // we don't support DRM yet (or maybe ever) { rig_debug(RIG_DEBUG_VERBOSE, "%s: no mapping for mode %s\n", __func__, p); } diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index e9359d23..4b507415 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -579,27 +579,32 @@ static int netrigctl_open(RIG *rig) else if (strcmp(setting, "targetable_vfo") == 0) { int has = strtol(value, NULL, 0); - if (!has) rig->caps->targetable_vfo = strtol(value, NULL, 0); + + if (!has) { rig->caps->targetable_vfo = strtol(value, NULL, 0); } } else if (strcmp(setting, "has_set_vfo") == 0) { int has = strtol(value, NULL, 0); - if (!has) rig->caps->set_vfo = NULL; + + if (!has) { rig->caps->set_vfo = NULL; } } else if (strcmp(setting, "has_get_vfo") == 0) { int has = strtol(value, NULL, 0); - if (!has) rig->caps->get_vfo = NULL; + + if (!has) { rig->caps->get_vfo = NULL; } } else if (strcmp(setting, "has_set_freq") == 0) { int has = strtol(value, NULL, 0); - if (!has) rig->caps->set_freq = NULL; + + if (!has) { rig->caps->set_freq = NULL; } } else if (strcmp(setting, "has_get_freq") == 0) { int has = strtol(value, NULL, 0); - if (!has) rig->caps->get_freq= NULL; + + if (!has) { rig->caps->get_freq = NULL; } } else { @@ -836,11 +841,11 @@ static int netrigctl_get_vfo(RIG *rig, vfo_t *vfo) ret = netrigctl_transaction(rig, cmd, len, buf); - if (ret == -RIG_ENAVAIL || ret == -RIG_ENIMPL) - { + if (ret == -RIG_ENAVAIL || ret == -RIG_ENIMPL) + { // for rigs without get_vfo we'll use our saved vfo *vfo = priv->vfo_curr; - return RIG_OK; + return RIG_OK; } if (ret <= 0) diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index fe1131c2..553a0c63 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -227,6 +227,7 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd, frm_len = read_icom_frame(&rs->rigport, buf, sizeof(buf)); #if 0 + // this was causing rigctld to fail on IC706 and WSJT-X // This dynamic detection is therefore disabled for now if (memcmp(buf, sendbuf, frm_len) == 0 && priv->serial_USB_echo_off) @@ -236,6 +237,7 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd, // And try again frm_len = read_icom_frame(&rs->rigport, buf, sizeof(buf)); } + #endif Unhold_Decode(rig); @@ -273,7 +275,8 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd, if (NAK == buf[frm_len - 2]) { return -RIG_ERJCTED; } *data_len = frm_len - (ACKFRMLEN - 1); - rig_debug(RIG_DEBUG_TRACE, "%s: data_len=%d, frm_len=%d\n", __func__, *data_len, frm_len); + rig_debug(RIG_DEBUG_TRACE, "%s: data_len=%d, frm_len=%d\n", __func__, *data_len, + frm_len); memcpy(data, buf + 4, *data_len); /* @@ -400,7 +403,8 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, pbwidth_t width_tmp = width; struct icom_priv_data *priv_data = (struct icom_priv_data *) rig->state.priv; - rig_debug(RIG_DEBUG_TRACE, "%s: mode=%d, width=%d\n", __func__, (int)mode, (int)width); + rig_debug(RIG_DEBUG_TRACE, "%s: mode=%d, width=%d\n", __func__, (int)mode, + (int)width); icmode_ext = -1; if (width == RIG_PASSBAND_NOCHANGE) // then we read width so we can reuse it diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 97d9ebaf..a0896675 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -7701,7 +7701,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) else { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c%c", cmd, main_sub_vfo, - cat_term); + cat_term); } err = newcat_get_cmd(rig); diff --git a/src/misc.c b/src/misc.c index a504376e..17a790ac 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1812,7 +1812,8 @@ const char *HAMLIB_API rot_strstatus(rot_status_t status) * \param RIG* and rig_function_e * \return the corresponding function pointer */ -void *rig_get_function_ptr(rig_model_t rig_model, enum rig_function_e rig_function) +void *rig_get_function_ptr(rig_model_t rig_model, + enum rig_function_e rig_function) { const struct rig_caps *caps = rig_get_caps(rig_model); @@ -2105,7 +2106,8 @@ int rig_get_caps_int(rig_model_t rig_model, enum rig_caps_int_e rig_caps) return RIG_OK; } -const char *rig_get_caps_cptr(rig_model_t rig_model, enum rig_caps_cptr_e rig_caps) +const char *rig_get_caps_cptr(rig_model_t rig_model, + enum rig_caps_cptr_e rig_caps) { const struct rig_caps *caps = rig_get_caps(rig_model); @@ -2124,7 +2126,8 @@ const char *rig_get_caps_cptr(rig_model_t rig_model, enum rig_caps_cptr_e rig_ca return rig_strstatus(caps->status); default: - rig_debug(RIG_DEBUG_ERR, "%s: Unknown requested rig_caps value=%d\n", __func__, rig_caps); + rig_debug(RIG_DEBUG_ERR, "%s: Unknown requested rig_caps value=%d\n", __func__, + rig_caps); return "Unknown caps value"; } } diff --git a/src/register.c b/src/register.c index 85ee3f3f..c4f6127d 100644 --- a/src/register.c +++ b/src/register.c @@ -388,8 +388,8 @@ int HAMLIB_API rig_list_foreach(int (*cfunc)(const struct rig_caps *, */ //! @cond Doxygen_Suppress int HAMLIB_API rig_list_foreach_model(int (*cfunc)(const rig_model_t rig_model, - rig_ptr_t), - rig_ptr_t data) + rig_ptr_t), + rig_ptr_t data) { struct rig_list *p; int i; @@ -489,7 +489,7 @@ int rig_load_all_backends() { int i; - memset(rig_hash_table, 0 , sizeof(rig_hash_table)); + memset(rig_hash_table, 0, sizeof(rig_hash_table)); for (i = 0; i < RIG_BACKEND_MAX && rig_backend_list[i].be_name; i++) { diff --git a/src/rig.c b/src/rig.c index 4c76a7d9..dfd9ac90 100644 --- a/src/rig.c +++ b/src/rig.c @@ -424,6 +424,7 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model) sizeof(struct freq_range_list)*FRQRANGESIZ); memcpy(rs->tx_range_list, caps->tx_range_list1, sizeof(struct freq_range_list)*FRQRANGESIZ); + // if we don't have list1 we'll try list2 if (RIG_IS_FRNG_END(rs->rx_range_list[0])) { @@ -432,6 +433,7 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model) memcpy(rs->rx_range_list, caps->tx_range_list2, sizeof(struct freq_range_list)*FRQRANGESIZ); } + if (RIG_IS_FRNG_END(rs->rx_range_list[0])) { rig_debug(RIG_DEBUG_ERR, "%s: rig does not have rx_range!!\n", __func__); @@ -490,16 +492,26 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model) rs->vfo_list |= caps->tx_range_list2[i].vfo; rs->mode_list |= caps->tx_range_list2[i].modes; } - if (rs->vfo_list & RIG_VFO_A) rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_A\n", __func__); - if (rs->vfo_list & RIG_VFO_B) rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_B\n", __func__); - if (rs->vfo_list & RIG_VFO_C) rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_C\n", __func__); - if (rs->vfo_list & RIG_VFO_SUB_A) rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_SUB_A\n", __func__); - if (rs->vfo_list & RIG_VFO_SUB_B) rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_SUB_B\n", __func__); - if (rs->vfo_list & RIG_VFO_MAIN_A) rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_MAIN_A\n", __func__); - if (rs->vfo_list & RIG_VFO_MAIN_B) rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_MAIN_B\n", __func__); - if (rs->vfo_list & RIG_VFO_SUB) rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_SUB\n", __func__); - if (rs->vfo_list & RIG_VFO_MAIN) rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_MAIN\n", __func__); - if (rs->vfo_list & RIG_VFO_MEM) rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_MEM\n", __func__); + + if (rs->vfo_list & RIG_VFO_A) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_A\n", __func__); } + + if (rs->vfo_list & RIG_VFO_B) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_B\n", __func__); } + + if (rs->vfo_list & RIG_VFO_C) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_C\n", __func__); } + + if (rs->vfo_list & RIG_VFO_SUB_A) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_SUB_A\n", __func__); } + + if (rs->vfo_list & RIG_VFO_SUB_B) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_SUB_B\n", __func__); } + + if (rs->vfo_list & RIG_VFO_MAIN_A) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_MAIN_A\n", __func__); } + + if (rs->vfo_list & RIG_VFO_MAIN_B) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_MAIN_B\n", __func__); } + + if (rs->vfo_list & RIG_VFO_SUB) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_SUB\n", __func__); } + + if (rs->vfo_list & RIG_VFO_MAIN) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_MAIN\n", __func__); } + + if (rs->vfo_list & RIG_VFO_MEM) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_MEM\n", __func__); } memcpy(rs->preamp, caps->preamp, sizeof(int)*MAXDBLSTSIZ); memcpy(rs->attenuator, caps->attenuator, sizeof(int)*MAXDBLSTSIZ); @@ -1526,6 +1538,7 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) } } + // update our current freq too if (vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { rig->state.current_freq = freq_new; } @@ -1753,7 +1766,8 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) const struct rig_caps *caps; int retcode; - rig_debug(RIG_DEBUG_VERBOSE, "%s called, vfo=%s, mode=%s, width=%d\n", __func__, rig_strvfo(vfo), rig_strrmode(mode), (int)width); + rig_debug(RIG_DEBUG_VERBOSE, "%s called, vfo=%s, mode=%s, width=%d\n", __func__, + rig_strvfo(vfo), rig_strrmode(mode), (int)width); if (CHECK_RIG_ARG(rig)) { diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 962ed7a4..4e00f968 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -4109,10 +4109,10 @@ declare_proto_rig(dump_state) fprintf(fout, "vfo_ops=0x%x\n", rig->caps->vfo_ops); fprintf(fout, "ptt_type=0x%x\n", rig->state.pttport.type.ptt); fprintf(fout, "targetable_vfo=0x%x\n", rig->caps->targetable_vfo); - fprintf(fout, "has_set_vfo=%d\n", rig->caps->set_vfo!=NULL); - fprintf(fout, "has_get_vfo=%d\n", rig->caps->get_vfo!=NULL); - fprintf(fout, "has_set_freq=%d\n", rig->caps->set_freq!=NULL); - fprintf(fout, "has_get_freq=%d\n", rig->caps->get_freq!=NULL); + fprintf(fout, "has_set_vfo=%d\n", rig->caps->set_vfo != NULL); + fprintf(fout, "has_get_vfo=%d\n", rig->caps->get_vfo != NULL); + fprintf(fout, "has_set_freq=%d\n", rig->caps->set_freq != NULL); + fprintf(fout, "has_get_freq=%d\n", rig->caps->get_freq != NULL); fprintf(fout, "done\n"); } ----------------------------------------------------------------------- Summary of changes: rigs/barrett/barrett.c | 6 +++--- rigs/dummy/dummy.c | 2 +- rigs/dummy/flrig.c | 2 +- rigs/dummy/netrigctl.c | 21 +++++++++++++-------- rigs/icom/frame.c | 8 ++++++-- rigs/yaesu/newcat.c | 2 +- src/misc.c | 9 ++++++--- src/register.c | 6 +++--- src/rig.c | 36 +++++++++++++++++++++++++----------- tests/rigctl_parse.c | 8 ++++---- 10 files changed, 63 insertions(+), 37 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-08 23:51:47
|
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 1d74711a00dfa416a171cec87c841db315c5d9f7 (commit) from 0089964af7fa1f43757083b7bc7db195ba382fe0 (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 1d74711a00dfa416a171cec87c841db315c5d9f7 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 8 17:49:56 2021 -0600 Fix filling of range_list which affects vfo_list See also https://github.com/Hamlib/Hamlib/issues/498 https://github.com/Hamlib/Hamlib/issues/490 diff --git a/src/rig.c b/src/rig.c index 188d813a..4c76a7d9 100644 --- a/src/rig.c +++ b/src/rig.c @@ -418,10 +418,25 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model) // Eventually we will have separate model number for different rig variations // So range_list1 will become just range_list (per model) // See ic9700.c for a 5-model example - memcpy(rs->tx_range_list, caps->tx_range_list1, - sizeof(struct freq_range_list)*FRQRANGESIZ); + // Every rig should have a rx_range + // Rig backends need updating for new range_list format memcpy(rs->rx_range_list, caps->rx_range_list1, sizeof(struct freq_range_list)*FRQRANGESIZ); + memcpy(rs->tx_range_list, caps->tx_range_list1, + sizeof(struct freq_range_list)*FRQRANGESIZ); + // if we don't have list1 we'll try list2 + if (RIG_IS_FRNG_END(rs->rx_range_list[0])) + { + memcpy(rs->tx_range_list, caps->rx_range_list2, + sizeof(struct freq_range_list)*FRQRANGESIZ); + memcpy(rs->rx_range_list, caps->tx_range_list2, + sizeof(struct freq_range_list)*FRQRANGESIZ); + } + if (RIG_IS_FRNG_END(rs->rx_range_list[0])) + { + rig_debug(RIG_DEBUG_ERR, "%s: rig does not have rx_range!!\n", __func__); + } + #if 0 // this is no longer applicable -- replace it with something? // we need to be able to figure out what model radio we have ----------------------------------------------------------------------- Summary of changes: src/rig.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-08 22:39:22
|
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 0089964af7fa1f43757083b7bc7db195ba382fe0 (commit) from 6a523705319918a84feccfed151e408fbc43ee59 (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 0089964af7fa1f43757083b7bc7db195ba382fe0 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 8 16:37:53 2021 -0600 Add some dumpcaps values to allow for set/get_freq and set/get_vfo functions https://github.com/Hamlib/Hamlib/issues/490 diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 98199165..e9359d23 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -578,7 +578,28 @@ static int netrigctl_open(RIG *rig) } else if (strcmp(setting, "targetable_vfo") == 0) { - rig->caps->targetable_vfo = strtol(value, NULL, 0); + int has = strtol(value, NULL, 0); + if (!has) rig->caps->targetable_vfo = strtol(value, NULL, 0); + } + else if (strcmp(setting, "has_set_vfo") == 0) + { + int has = strtol(value, NULL, 0); + if (!has) rig->caps->set_vfo = NULL; + } + else if (strcmp(setting, "has_get_vfo") == 0) + { + int has = strtol(value, NULL, 0); + if (!has) rig->caps->get_vfo = NULL; + } + else if (strcmp(setting, "has_set_freq") == 0) + { + int has = strtol(value, NULL, 0); + if (!has) rig->caps->set_freq = NULL; + } + else if (strcmp(setting, "has_get_freq") == 0) + { + int has = strtol(value, NULL, 0); + if (!has) rig->caps->get_freq= NULL; } else { @@ -775,12 +796,11 @@ static int netrigctl_set_vfo(RIG *rig, vfo_t vfo) char cmd[CMD_MAX]; char buf[BUF_MAX]; char vfostr[16] = ""; + struct netrigctl_priv_data *priv; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - //ret = netrigctl_vfostr(rig, vfostr, sizeof(vfostr), RIG_VFO_A); - - //if (ret != RIG_OK) { return ret; } + priv = (struct netrigctl_priv_data *)rig->state.priv; len = sprintf(cmd, "V%s %s\n", vfostr, rig_strvfo(vfo)); rig_debug(RIG_DEBUG_VERBOSE, "%s: cmd='%s'\n", __func__, cmd); @@ -790,10 +810,9 @@ static int netrigctl_set_vfo(RIG *rig, vfo_t vfo) { return -RIG_EPROTO; } - else - { - return ret; - } + + priv->vfo_curr = vfo; // remember our vfo + return ret; } @@ -817,7 +836,12 @@ static int netrigctl_get_vfo(RIG *rig, vfo_t *vfo) ret = netrigctl_transaction(rig, cmd, len, buf); - if (ret == -RIG_ENAVAIL) { return ret; } + if (ret == -RIG_ENAVAIL || ret == -RIG_ENIMPL) + { + // for rigs without get_vfo we'll use our saved vfo + *vfo = priv->vfo_curr; + return RIG_OK; + } if (ret <= 0) { @@ -2255,7 +2279,7 @@ struct rig_caps netrigctl_caps = RIG_MODEL(RIG_MODEL_NETRIGCTL), .model_name = "NET rigctl", .mfg_name = "Hamlib", - .version = "20200503.0", + .version = "20210108.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 1dbd877b..962ed7a4 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -4109,6 +4109,10 @@ declare_proto_rig(dump_state) fprintf(fout, "vfo_ops=0x%x\n", rig->caps->vfo_ops); fprintf(fout, "ptt_type=0x%x\n", rig->state.pttport.type.ptt); fprintf(fout, "targetable_vfo=0x%x\n", rig->caps->targetable_vfo); + fprintf(fout, "has_set_vfo=%d\n", rig->caps->set_vfo!=NULL); + fprintf(fout, "has_get_vfo=%d\n", rig->caps->get_vfo!=NULL); + fprintf(fout, "has_set_freq=%d\n", rig->caps->set_freq!=NULL); + fprintf(fout, "has_get_freq=%d\n", rig->caps->get_freq!=NULL); fprintf(fout, "done\n"); } ----------------------------------------------------------------------- Summary of changes: rigs/dummy/netrigctl.c | 44 ++++++++++++++++++++++++++++++++++---------- tests/rigctl_parse.c | 4 ++++ 2 files changed, 38 insertions(+), 10 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-08 22:35:52
|
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 6a523705319918a84feccfed151e408fbc43ee59 (commit) via 5805de6e1e71f7b2ada5e528b16460adf4ccff8b (commit) via cf858bfa3c8a36eda749c5078ef6f53a119fb285 (commit) via c426713a4b8ac441b8b41123a4fd26a0b0196b2a (commit) from 19e819948f9b7ce0c593dc6e934b68d4f5e8426e (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 6a523705319918a84feccfed151e408fbc43ee59 Merge: cf858bfa 5805de6e Author: Michael Black <mdb...@ya...> Date: Fri Jan 8 16:34:57 2021 -0600 Merge pull request #497 from df7cb/unaligned_access dummy/dummy.c: Fix unaligned access in dummy_get_level() commit 5805de6e1e71f7b2ada5e528b16460adf4ccff8b Author: John Paul Adrian Glaubitz <gla...@de...> Date: Sat Feb 8 10:21:08 2020 -0800 dummy/dummy.c: Fix unaligned access in dummy_get_level() This fixes an unaligned access in dummy/dummy.c in the function dummy_get_level() which resulted in crashes (Bus Error) on systems with stricter alignment requirements such as SPARC. On x86_64 (and any other architecture with less strict alignment requirements), the compiler automatically optimizes the memcpy() out if necessary such that there are no performance issues. diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index d3d7b51a..aaba5d0b 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -1123,7 +1123,7 @@ static int dummy_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; } - *val = curr->levels[idx]; + memcpy (val, &curr->levels[idx], sizeof(value_t)); rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rig_strlevel(level)); commit cf858bfa3c8a36eda749c5078ef6f53a119fb285 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 8 12:04:25 2021 -0600 Change rig.c to return RIG_ENAVAIL instead of RIG_ENTARGET when set_vfo==NULL Add IC706* to rigs that don't do dsp settings Remove dynamic detection of transceive status in icom/frame.c https://github.com/Hamlib/Hamlib/issues/490 diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 2f96d6db..fe1131c2 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -226,6 +226,9 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd, buf[0] = 0; frm_len = read_icom_frame(&rs->rigport, buf, sizeof(buf)); +#if 0 + // this was causing rigctld to fail on IC706 and WSJT-X + // This dynamic detection is therefore disabled for now if (memcmp(buf, sendbuf, frm_len) == 0 && priv->serial_USB_echo_off) { // Hmmm -- got an echo back when not expected so let's change @@ -233,6 +236,7 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd, // And try again frm_len = read_icom_frame(&rs->rigport, buf, sizeof(buf)); } +#endif Unhold_Decode(rig); @@ -269,6 +273,7 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd, if (NAK == buf[frm_len - 2]) { return -RIG_ERJCTED; } *data_len = frm_len - (ACKFRMLEN - 1); + rig_debug(RIG_DEBUG_TRACE, "%s: data_len=%d, frm_len=%d\n", __func__, *data_len, frm_len); memcpy(data, buf + 4, *data_len); /* diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index d61b10a2..f50429b7 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1886,7 +1886,7 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) retval = icom_transaction(rig, C_RD_MODE, -1, NULL, 0, modebuf, &mode_len); - if (mode_len == 3) + if (--mode_len == 3) { priv_data->filter = modebuf[2]; rig_debug(RIG_DEBUG_TRACE, @@ -1933,8 +1933,12 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) * not ask for DSP filter settings */ /* Likewise, don't ask if we happen to be an Omni VI Plus */ /* Likewise, don't ask if we happen to be an IC-R30 */ + /* Likewise, don't ask if we happen to be an IC-706* */ if ((rig->caps->rig_model == RIG_MODEL_IC910) || (rig->caps->rig_model == RIG_MODEL_OMNIVIP) || + (rig->caps->rig_model == RIG_MODEL_IC706) || + (rig->caps->rig_model == RIG_MODEL_IC706MKII) || + (rig->caps->rig_model == RIG_MODEL_IC706MKIIG) || (rig->caps->rig_model == RIG_MODEL_ICR30)) { return RIG_OK; diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 3a680edc..413d2c98 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -30,7 +30,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20210106" +#define BACKEND_VER "20210107" /* * defines used by comp_cal_str in rig.c diff --git a/src/rig.c b/src/rig.c index bcd8377d..188d813a 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1448,7 +1448,7 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } if (twiddling(rig)) @@ -1767,7 +1767,7 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -1877,7 +1877,7 @@ int HAMLIB_API rig_get_mode(RIG *rig, if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -2300,7 +2300,7 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -2519,7 +2519,7 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -2729,7 +2729,7 @@ int HAMLIB_API rig_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -2831,7 +2831,7 @@ int HAMLIB_API rig_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -2899,7 +2899,7 @@ int HAMLIB_API rig_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -2967,7 +2967,7 @@ int HAMLIB_API rig_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -3035,7 +3035,7 @@ int HAMLIB_API rig_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -3694,7 +3694,7 @@ int HAMLIB_API rig_set_split_vfo(RIG *rig, if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -3804,7 +3804,7 @@ int HAMLIB_API rig_get_split_vfo(RIG *rig, if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } #if 0 // why were we doing this? Shouldn't need to set_vfo to figure out tx_vfo @@ -3885,7 +3885,7 @@ int HAMLIB_API rig_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -3953,7 +3953,7 @@ int HAMLIB_API rig_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -4021,7 +4021,7 @@ int HAMLIB_API rig_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -4089,7 +4089,7 @@ int HAMLIB_API rig_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -4157,7 +4157,7 @@ int HAMLIB_API rig_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -4225,7 +4225,7 @@ int HAMLIB_API rig_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -4298,7 +4298,7 @@ int HAMLIB_API rig_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -4373,7 +4373,7 @@ int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -4797,7 +4797,7 @@ int HAMLIB_API rig_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -4897,7 +4897,7 @@ int HAMLIB_API rig_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -4965,7 +4965,7 @@ int HAMLIB_API rig_send_dtmf(RIG *rig, vfo_t vfo, const char *digits) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -5034,7 +5034,7 @@ int HAMLIB_API rig_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -5102,7 +5102,7 @@ int HAMLIB_API rig_send_morse(RIG *rig, vfo_t vfo, const char *msg) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -5161,7 +5161,7 @@ int HAMLIB_API rig_stop_morse(RIG *rig, vfo_t vfo) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -5252,7 +5252,7 @@ int HAMLIB_API rig_wait_morse(RIG *rig, vfo_t vfo) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -5320,7 +5320,7 @@ int HAMLIB_API rig_send_voice_mem(RIG *rig, vfo_t vfo, int ch) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; commit c426713a4b8ac441b8b41123a4fd26a0b0196b2a Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 8 07:56:17 2021 -0600 Fix debug statement data types in icom/frame.c diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 1723fa8b..2f96d6db 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -395,7 +395,7 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, pbwidth_t width_tmp = width; struct icom_priv_data *priv_data = (struct icom_priv_data *) rig->state.priv; - rig_debug(RIG_DEBUG_TRACE, "%s: mode=%ld, width=%ld\n", __func__, mode, width); + rig_debug(RIG_DEBUG_TRACE, "%s: mode=%d, width=%d\n", __func__, (int)mode, (int)width); icmode_ext = -1; if (width == RIG_PASSBAND_NOCHANGE) // then we read width so we can reuse it ----------------------------------------------------------------------- Summary of changes: rigs/dummy/dummy.c | 2 +- rigs/icom/frame.c | 7 ++++++- rigs/icom/icom.c | 6 +++++- rigs/icom/icom.h | 2 +- src/rig.c | 56 +++++++++++++++++++++++++++--------------------------- 5 files changed, 41 insertions(+), 32 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-08 13:17:38
|
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 19e819948f9b7ce0c593dc6e934b68d4f5e8426e (commit) from 62066d5b74e8ef909aeb37093446f757160454d0 (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 19e819948f9b7ce0c593dc6e934b68d4f5e8426e Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 8 07:16:45 2021 -0600 Add RIG_TARGETABLE_ANT and fix Yaesu rigs -- Yaesu are only ones needing this right now https://github.com/Hamlib/Hamlib/pull/495 diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index cc731fb7..a5281350 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -473,6 +473,7 @@ typedef unsigned int vfo_t; #define RIG_TARGETABLE_PTT (1<<7) #define RIG_TARGETABLE_MEM (1<<8) #define RIG_TARGETABLE_BANK (1<<9) +#define RIG_TARGETABLE_ANT (1<<10) #define RIG_TARGETABLE_COMMON (RIG_TARGETABLE_RITXIT | RIG_TARGETABLE_PTT | RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK) #define RIG_TARGETABLE_ALL 0x7fffffff //! @endcond diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c index 0a8e6cf8..58c0327e 100644 --- a/rigs/yaesu/ft5000.c +++ b/rigs/yaesu/ft5000.c @@ -126,7 +126,7 @@ const struct rig_caps ftdx5000_caps = .max_xit = Hz(9999), .max_ifshift = Hz(1000), .vfo_ops = FTDX5000_VFO_OPS, - .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_FUNC | RIG_TARGETABLE_LEVEL, + .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_FUNC | RIG_TARGETABLE_LEVEL | RIG_TARGETABLE_ANT, .transceive = RIG_TRN_OFF, /* May enable later as the 5000 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, diff --git a/rigs/yaesu/ft9000.c b/rigs/yaesu/ft9000.c index cd573c37..746225c7 100644 --- a/rigs/yaesu/ft9000.c +++ b/rigs/yaesu/ft9000.c @@ -89,7 +89,7 @@ const struct rig_caps ft9000_caps = .max_xit = Hz(9999), .max_ifshift = Hz(1000), .vfo_ops = FT9000_VFO_OPS, - .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, + .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_ANT, .transceive = RIG_TRN_OFF, /* May enable later as the 9000 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, diff --git a/rigs/yaesu/ftdx10.c b/rigs/yaesu/ftdx10.c index aa4e7c95..40498068 100644 --- a/rigs/yaesu/ftdx10.c +++ b/rigs/yaesu/ftdx10.c @@ -214,8 +214,8 @@ const struct rig_caps ftdx10_caps = .get_rit = newcat_get_rit, .set_xit = newcat_set_xit, .get_xit = newcat_get_xit, - .set_ant = newcat_set_ant, - .get_ant = newcat_get_ant, + .set_ant = NULL, + .get_ant = NULL, .get_func = newcat_get_func, .set_func = newcat_set_func, .get_level = newcat_get_level, diff --git a/rigs/yaesu/ftdx101.c b/rigs/yaesu/ftdx101.c index 8ecc1b77..24a77bd3 100644 --- a/rigs/yaesu/ftdx101.c +++ b/rigs/yaesu/ftdx101.c @@ -113,7 +113,7 @@ const struct rig_caps ftdx101d_caps = .max_xit = Hz(9999), .max_ifshift = Hz(1200), .vfo_ops = FTDX101_VFO_OPS, - .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_FUNC | RIG_TARGETABLE_LEVEL | RIG_TARGETABLE_COMMON, + .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_FUNC | RIG_TARGETABLE_LEVEL | RIG_TARGETABLE_COMMON | RIG_TARGETABLE_ANT, .transceive = RIG_TRN_OFF, /* May enable later as the FTDX101 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index f5a03ea1..97d9ebaf 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -3010,7 +3010,7 @@ int newcat_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) return err; } - if ((rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) && !is_ft2000) + if ((rig->caps->targetable_vfo & RIG_TARGETABLE_ANT)) { main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0'; } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 3ed57ca6..7954f8e9 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20210104" +#define NEWCAT_VER "20210108" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 diff --git a/src/rig.c b/src/rig.c index 18cceacb..bcd8377d 100644 --- a/src/rig.c +++ b/src/rig.c @@ -4289,7 +4289,7 @@ int HAMLIB_API rig_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) return -RIG_ENAVAIL; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_ANT) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { @@ -4364,7 +4364,7 @@ int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, return -RIG_ENAVAIL; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_ANT) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { ----------------------------------------------------------------------- Summary of changes: include/hamlib/rig.h | 1 + rigs/yaesu/ft5000.c | 2 +- rigs/yaesu/ft9000.c | 2 +- rigs/yaesu/ftdx10.c | 4 ++-- rigs/yaesu/ftdx101.c | 2 +- rigs/yaesu/newcat.c | 2 +- rigs/yaesu/newcat.h | 2 +- src/rig.c | 4 ++-- 8 files changed, 10 insertions(+), 9 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-08 12:39:50
|
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 62066d5b74e8ef909aeb37093446f757160454d0 (commit) via 9e8b7539bbc0f822fcd7e8bc0f7e77a12e37378f (commit) via eefea70a248f4de283037c5878f080f0b370492e (commit) from a15353ec4c4c2989bed303b51c21235762955ba6 (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 62066d5b74e8ef909aeb37093446f757160454d0 Merge: a15353ec 9e8b7539 Author: Michael Black <mdb...@ya...> Date: Fri Jan 8 06:37:25 2021 -0600 Merge pull request #495 from mikaelnousiainen/yaesu-ft2000-fix-vfob-for-sh-an Fix SH and AN commands on FT-2000 for VFOB as these commands are not targetable commit 9e8b7539bbc0f822fcd7e8bc0f7e77a12e37378f Author: Mikael Nousiainen <mik...@ik...> Date: Fri Jan 8 09:13:56 2021 +0200 Set FT-2000 retries to 3 to follow other Yaesu backends. There should be no need for 10 retries. diff --git a/rigs/yaesu/ft2000.c b/rigs/yaesu/ft2000.c index aeaa6af1..c4428cf0 100644 --- a/rigs/yaesu/ft2000.c +++ b/rigs/yaesu/ft2000.c @@ -107,7 +107,7 @@ const struct rig_caps ft2000_caps = .write_delay = FT2000_WRITE_DELAY, .post_write_delay = FT2000_POST_WRITE_DELAY, .timeout = 2000, - .retry = 10, + .retry = 3, .has_get_func = FT2000_FUNCS, .has_set_func = FT2000_FUNCS, .has_get_level = FT2000_LEVELS, commit eefea70a248f4de283037c5878f080f0b370492e Author: Mikael Nousiainen <mik...@ik...> Date: Fri Jan 8 09:12:29 2021 +0200 Fix SH and AN commands on FT-2000 for VFOB as these commands are not targetable diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 76f94cdc..f5a03ea1 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -3010,7 +3010,7 @@ int newcat_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) return err; } - if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) + if ((rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) && !is_ft2000) { main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0'; } @@ -3102,7 +3102,7 @@ int newcat_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option, return err; } - if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) + if ((rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) && !is_ft2000) { main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0'; } @@ -7465,6 +7465,10 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SH%c%d%02d;", main_sub_vfo, on, w); } + else if (is_ft2000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SH0%02d;", w); + } else { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SH%c%02d;", main_sub_vfo, w); @@ -7690,8 +7694,15 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) if (sh_command_valid) { - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c%c", cmd, main_sub_vfo, - cat_term); + if (is_ft2000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s0%c", cmd, cat_term); + } + else + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c%c", cmd, main_sub_vfo, + cat_term); + } err = newcat_get_cmd(rig); ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/ft2000.c | 2 +- rigs/yaesu/newcat.c | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-08 04:15:00
|
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 a15353ec4c4c2989bed303b51c21235762955ba6 (commit) via a14df2d536b47922213c99061cc04db9b2472295 (commit) via a3a6467ac1e4c524e700e2b5007a21e10f22b596 (commit) via 16d76eff4b33d3b56e5bcfeb8254ef220c7ec7c6 (commit) via cfb0e1359997546859676fcc44500590b765a588 (commit) from 02c085443485487e3a330494710cbb0d7d7bd1d1 (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 a15353ec4c4c2989bed303b51c21235762955ba6 Merge: a14df2d5 a3a6467a Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 7 22:14:27 2021 -0600 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit a14df2d536b47922213c99061cc04db9b2472295 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 7 22:14:04 2021 -0600 Add bootstrap note to INSTALL diff --git a/INSTALL b/INSTALL index 23034b25..9ffa4190 100644 --- a/INSTALL +++ b/INSTALL @@ -17,6 +17,8 @@ main directory and do the following: $ ./configure + If configure does not exist you can create it with ./bootstrap + If you are planning to install the package into your home directory or to a location other than `/usr/local' then add the flag `--prefix=PATH' to `configure'. For example, if your home directory commit a3a6467ac1e4c524e700e2b5007a21e10f22b596 Merge: 16d76eff cfb0e135 Author: Michael Black <mdb...@ya...> Date: Thu Jan 7 16:12:35 2021 -0600 Merge pull request #494 from N8TW/FT-980_Backend Bug fix limiting memory access to 15 slots instead of 16. commit 16d76eff4b33d3b56e5bcfeb8254ef220c7ec7c6 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Jan 7 15:50:50 2021 -0600 Add debug to icom/frame.c https://github.com/Hamlib/Hamlib/issues/490 diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 861347a0..1723fa8b 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -395,10 +395,12 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, pbwidth_t width_tmp = width; struct icom_priv_data *priv_data = (struct icom_priv_data *) rig->state.priv; + rig_debug(RIG_DEBUG_TRACE, "%s: mode=%ld, width=%ld\n", __func__, mode, width); icmode_ext = -1; if (width == RIG_PASSBAND_NOCHANGE) // then we read width so we can reuse it { + rig_debug(RIG_DEBUG_TRACE, "%s: width==RIG_PASSBAND_NOCHANGE\n", __func__); rmode_t tmode; int ret = rig_get_mode(rig, vfo, &tmode, &width); @@ -472,6 +474,7 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, if (width_tmp != RIG_PASSBAND_NOCHANGE) { + rig_debug(RIG_DEBUG_TRACE, "%s: width_tmp=%ld\n", __func__, width_tmp); pbwidth_t medium_width = rig_passband_normal(rig, mode); if (width == RIG_PASSBAND_NORMAL) commit cfb0e1359997546859676fcc44500590b765a588 Author: N8TW <i.m...@ou...> Date: Thu Jan 7 16:31:45 2021 -0500 Bug fix limiting memory access to 15 slots instead of 16. diff --git a/rigs/yaesu/ft980.c b/rigs/yaesu/ft980.c index 461d0e5d..072e58e2 100644 --- a/rigs/yaesu/ft980.c +++ b/rigs/yaesu/ft980.c @@ -995,7 +995,7 @@ int ft980_set_mem(RIG *rig, vfo_t vfo, int ch) unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x0A }; struct ft980_priv_data *priv = (struct ft980_priv_data *)rig->state.priv; - if (ch >= 16 || ch < 1) + if (ch > 16 || ch < 1) { return -RIG_EINVAL; } @@ -1021,4 +1021,3 @@ int ft980_get_mem(RIG *rig, vfo_t vfo, int *ch) return RIG_OK; } - ----------------------------------------------------------------------- Summary of changes: INSTALL | 2 ++ rigs/icom/frame.c | 3 +++ rigs/yaesu/ft980.c | 3 +-- 3 files changed, 6 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-06 23:06: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 02c085443485487e3a330494710cbb0d7d7bd1d1 (commit) via e9d6d751f26301c6b94b68d8b81ccc3a18129ee0 (commit) via b1f01708edc9d50c48155d06d6c6f88d12e62f1f (commit) from 08792f9295655521973589805e4f9ce6ba7e30a8 (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 02c085443485487e3a330494710cbb0d7d7bd1d1 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Jan 6 17:04:44 2021 -0600 In icom.c init() set priv->filter to RIG_PASSBAND_NOCHANGE to fix set_mode rigs with 2-byte cmds https://github.com/Hamlib/Hamlib/issues/490 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 5bfa1c8b..d61b10a2 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -655,6 +655,7 @@ icom_init(RIG *rig) priv->tx_vfo = RIG_VFO_NONE; priv->rx_vfo = RIG_VFO_NONE; rig->state.current_vfo = RIG_VFO_NONE; + priv->filter = RIG_PASSBAND_NOCHANGE; rig_debug(RIG_DEBUG_TRACE, "%s: done\n", __func__); diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 6b7dadec..3a680edc 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -30,7 +30,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20201219" +#define BACKEND_VER "20210106" /* * defines used by comp_cal_str in rig.c commit e9d6d751f26301c6b94b68d8b81ccc3a18129ee0 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Jan 5 09:49:20 2021 -0600 Change Barrett 950 version number https://github.com/Hamlib/Hamlib/issues/483 diff --git a/rigs/barrett/950.c b/rigs/barrett/950.c index 14a4d588..672da1ed 100644 --- a/rigs/barrett/950.c +++ b/rigs/barrett/950.c @@ -82,7 +82,7 @@ const struct rig_caps barrett950_caps = RIG_MODEL(RIG_MODEL_BARRETT_950), .model_name = "950", .mfg_name = "Barrett", - .version = BACKEND_VER "/20210105", + .version = BACKEND_VER ".0", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, commit b1f01708edc9d50c48155d06d6c6f88d12e62f1f Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Jan 5 09:28:53 2021 -0600 Fix Barret 950 set_freq Change Barrett 950 to use channels 441-450 for 10-band memory This will minimize EEPROM writes https://github.com/Hamlib/Hamlib/issues/483 diff --git a/rigs/barrett/950.c b/rigs/barrett/950.c index 2229f1b1..14a4d588 100644 --- a/rigs/barrett/950.c +++ b/rigs/barrett/950.c @@ -49,17 +49,40 @@ static int barrett950_set_freq(RIG *rig, vfo_t vfo, freq_t freq); static int barrett950_get_level(RIG *rig, vfo_t vfo, setting_t level, - value_t *val); + value_t *val); static const char *barrett950_get_info(RIG *rig); +// 10 band channel from 441 to 450 +#define CHANNEL_BASE 441 + +struct chan_map_s +{ + float lo, hi; + int chan_offset; +}; + +// Our 10 bands +struct chan_map_s chan_map[] = +{ + { 1.8, 2.0, 0}, + { 3.5, 4.0, 1}, + { 5.3, 5.4, 2}, + { 7.0, 7.3, 3}, + { 10.1, 10.15, 4}, + { 14.0, 14.35, 5}, + { 18.068, 18.168, 6}, + { 21.0, 21.45, 7}, + { 24.89, 24.99, 8}, + { 28.0, 29.7, 9} +}; const struct rig_caps barrett950_caps = { RIG_MODEL(RIG_MODEL_BARRETT_950), .model_name = "950", .mfg_name = "Barrett", - .version = BACKEND_VER ".0", + .version = BACKEND_VER "/20210105", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -130,50 +153,79 @@ int barrett950_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { char cmd_buf[MAXCMDLEN]; int retval; - struct barrett_priv_data *priv = rig->state.priv; + int i; + int chan; + freq_t freq_rx, freq_tx; + freq_t freq_MHz; + char *response = NULL; + //struct barrett_priv_data *priv = rig->state.priv; rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s freq=%.0f\n", __func__, rig_strvfo(vfo), freq); - // If we are not explicitly asking for VFO_B then we'll set the receive side also - if (vfo != RIG_VFO_B) - { - char *response = NULL; - sprintf((char *) cmd_buf, "PR%08.0f", freq); - retval = barrett_transaction(rig, cmd_buf, 0, &response); + // 950 can only set freq via memory channel + // So we make a 10-channel memory from 441-450 by band + // And we don't care about VFO -- we set TX=RX to avoid doing split freq changes + // Trying to minimize writes to EEPROM + + // What band is being requested? + freq_MHz = freq / 1e6; - if (retval < 0) + for (i = 0; i < 10; ++i) + { + if (freq_MHz >= chan_map[i].lo && freq_MHz <= chan_map[i].hi) { - return retval; + chan = CHANNEL_BASE + chan_map[i].chan_offset; } + } - //dump_hex((unsigned char *)response, strlen(response)); + rig_debug(RIG_DEBUG_VERBOSE, "%s: using chan %d for freq %.0f \n", __func__, + chan, freq); - if (strncmp(response, "OK", 2) != 0) - { - rig_debug(RIG_DEBUG_ERR, "%s: Expected OK, got '%s'\n", __func__, response); - return -RIG_EPROTO; - } + // Set the channel + sprintf((char *) cmd_buf, "XC%04d", chan); + retval = barrett_transaction(rig, cmd_buf, 0, &response); + + if (retval < 0) + { + return retval; } - if (priv->split == 0 - || vfo == RIG_VFO_B) // if we aren't in split mode we have to set the TX VFO too + // Read the current channel for the requested freq to see if it needs changing + sprintf((char *) cmd_buf, "IDC%04d", chan); + retval = barrett_transaction(rig, cmd_buf, 0, &response); + + if (retval < 0) { + return retval; + } - char *response = NULL; - sprintf((char *) cmd_buf, "PT%08.0f", freq); - retval = barrett_transaction(rig, cmd_buf, 0, &response); + if (sscanf(response, "%4d%8lf%8lf", &chan, &freq_rx, &freq_tx) != 2) + { + rig_debug(RIG_DEBUG_ERR, "%s: unable to parse chan/freq from %s\n", __func__, + response); + return -RIG_EPROTO; + } - if (retval < 0) - { - return retval; - } + rig_debug(RIG_DEBUG_VERBOSE, "%s: got chan %d, freq_rx=%.0f, freq_tx=%.0f", + __func__, chan, + freq_rx, freq_tx); - if (strncmp(response, "OK", 2) != 0) - { - rig_debug(RIG_DEBUG_ERR, "%s: Expected OK, got '%s'\n", __func__, response); - return -RIG_EPROTO; - } + if (freq_rx == freq && freq_tx == freq) + { + rig_debug(RIG_DEBUG_VERBOSE, "%s: no freq change needed\n", __func__); + return RIG_OK; + } + + // New freq so let's update the channel + // We do not support split mode -- too many writes to EEPROM to support it + sprintf((char *) cmd_buf, "PC%04dR%08.0lfT%08.0lf", chan, freq, freq); + retval = barrett_transaction(rig, cmd_buf, 0, &response); + + if (strncmp(response, "OK", 2) != 0) + { + rig_debug(RIG_DEBUG_ERR, "%s: Expected OK, got '%s'\n", __func__, response); + return -RIG_EPROTO; } return RIG_OK; ----------------------------------------------------------------------- Summary of changes: rigs/barrett/950.c | 112 +++++++++++++++++++++++++++++++++++++++-------------- rigs/icom/icom.c | 1 + rigs/icom/icom.h | 2 +- 3 files changed, 84 insertions(+), 31 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-04 23:42:50
|
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 08792f9295655521973589805e4f9ce6ba7e30a8 (commit) from d6d79de732b6bfbe020f783831ecb5fa9bd392d3 (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 08792f9295655521973589805e4f9ce6ba7e30a8 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jan 4 17:36:09 2021 -0600 Change FT897 write_delay to 5ms -- MicroHam seems to need it https://github.com/Hamlib/Hamlib/issues/384 diff --git a/rigs/yaesu/ft897.h b/rigs/yaesu/ft897.h index d28f44e0..9e8c62ed 100644 --- a/rigs/yaesu/ft897.h +++ b/rigs/yaesu/ft897.h @@ -32,7 +32,7 @@ /* * No need to wait between written characters. */ -#define FT897_WRITE_DELAY 0 +#define FT897_WRITE_DELAY 5 /* * Wait 'delay' milliseconds after writing a command sequence. ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/ft897.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-04 20:45:15
|
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 d6d79de732b6bfbe020f783831ecb5fa9bd392d3 (commit) from f34ccfa3b8e9ca5e6885b7790ac97d7c80092281 (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 d6d79de732b6bfbe020f783831ecb5fa9bd392d3 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jan 4 14:43:03 2021 -0600 Another attempt to get FT2000 RFPOWER_METER correct for both 0-1 and watts readings https://github.com/Hamlib/Hamlib/issues/488 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 482ca6e9..76f94cdc 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -4423,7 +4423,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) &rig->caps->rfpower_meter_cal) / (level == RIG_LEVEL_RFPOWER_METER_WATTS ? 1.0 : 100.0); - if (level == RIG_LEVEL_RFPOWER_METER && priv->rig_id == NC_RIGID_FT2000) + if (priv->rig_id == NC_RIGID_FT2000) { // we reuse the FT2000D table for the FT2000 so need to divide by 2 // hopefully this works well otherwise we need a separate table ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-04 18:11: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, master has been updated via f34ccfa3b8e9ca5e6885b7790ac97d7c80092281 (commit) from e8c3d37cdcbf335507b46988ca149552765cd2e6 (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 f34ccfa3b8e9ca5e6885b7790ac97d7c80092281 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jan 4 12:09:28 2021 -0600 Fix FT2000 RIG_LEVEL_RFPOWER_METER for FT2000 astyle newcat.c https://github.com/Hamlib/Hamlib/issues/488 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 9e6f7758..482ca6e9 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -351,7 +351,8 @@ static const yaesu_newcat_commands_t valid_commands[] = {"ZI", FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE }, }; -int valid_commands_count = sizeof(valid_commands) / sizeof(yaesu_newcat_commands_t); +int valid_commands_count = sizeof(valid_commands) / sizeof( + yaesu_newcat_commands_t); /* * configuration Tokens @@ -537,19 +538,6 @@ int newcat_open(RIG *rig) /* Initialize rig_id in case any subsequent commands need it */ (void)newcat_get_rigid(rig); rig_debug(RIG_DEBUG_VERBOSE, "%s: rig_id=%d\n", __func__, priv->rig_id); -#if 0 // what's the right way to do this? - if (priv->rig_id == NC_RIGID_FT2000) - { - // then we need to readjust rfpowermeter cal table in half - int i; - - for (i = 0; i < rig->caps->rfpower_meter_cal.size; ++i) - { - // we may need a table for the FT2000 instead of this - rig->caps->rfpower_meter_cal.table[i].raw /= 2; - } - } -#endif rig_debug(RIG_DEBUG_VERBOSE, "%s: returning RIG_OK\n", __func__); return RIG_OK; @@ -1705,12 +1693,14 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) if (freq >= 28000000 && freq <= 29700000) { strcpy(command, "EX010315"); - if (is_ftdx10) strcpy(command, "EX010317"); + + if (is_ftdx10) { strcpy(command, "EX010317"); } } else if (freq >= 50000000 && freq <= 54000000) { strcpy(command, "EX010316"); - if (is_ftdx10) strcpy(command, "EX010318"); + + if (is_ftdx10) { strcpy(command, "EX010318"); } } else { @@ -1911,13 +1901,17 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) if (freq >= 28000000 && freq <= 29700000) { char *cmd = "EX010315%c"; - if (is_ftdx10) cmd = "EX010317%c"; + + if (is_ftdx10) { cmd = "EX010317%c"; } + snprintf(priv->cmd_str, sizeof(priv->cmd_str), cmd, cat_term); } else if (freq >= 50000000 && freq <= 54000000) { char *cmd = "EX010316%c"; - if (is_ftdx10) cmd = "EX010318%c"; + + if (is_ftdx10) { cmd = "EX010318%c"; } + snprintf(priv->cmd_str, sizeof(priv->cmd_str), cmd, cat_term); } else @@ -3364,7 +3358,8 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) return -RIG_ENAVAIL; } - if (is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991 || is_ftdx101 || is_ftdx10) + if (is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991 || is_ftdx101 + || is_ftdx10) { fpf = newcat_scale_float(100, val.f); } @@ -3910,7 +3905,8 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) return -RIG_ENAVAIL; } - if (is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991 || is_ftdx101 || is_ftdx10) + if (is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991 || is_ftdx101 + || is_ftdx10) { fpf = newcat_scale_float(100, val.f); } @@ -4426,6 +4422,13 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->f = rig_raw2val_float(atoi(retlvl), &rig->caps->rfpower_meter_cal) / (level == RIG_LEVEL_RFPOWER_METER_WATTS ? 1.0 : 100.0); + + if (level == RIG_LEVEL_RFPOWER_METER && priv->rig_id == NC_RIGID_FT2000) + { + // we reuse the FT2000D table for the FT2000 so need to divide by 2 + // hopefully this works well otherwise we need a separate table + val->f /= 2; + } } rig_debug(RIG_DEBUG_VERBOSE, "%s: RFPOWER_METER=%s, converted to %f\n", @@ -4495,7 +4498,8 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_MICGAIN: - if (is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991 || is_ftdx101 || is_ftdx10) + if (is_ftdx1200 || is_ftdx3000 || is_ft891 || is_ft991 || is_ftdx101 + || is_ftdx10) { scale = 100.; } ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-04 17:55:42
|
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 e8c3d37cdcbf335507b46988ca149552765cd2e6 (commit) via 38faad95e870d53db42fc23c2d9f1e7e7ec3a614 (commit) from 98d0f20daaf7c3ce0e2554cf9cda9cb0793d7426 (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 e8c3d37cdcbf335507b46988ca149552765cd2e6 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jan 4 11:28:32 2021 -0600 Remove str_cal correction for FT2000 -- have to figure out a better way to do it https://github.com/Hamlib/Hamlib/issues/488 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index a2ca83f3..9e6f7758 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -537,6 +537,7 @@ int newcat_open(RIG *rig) /* Initialize rig_id in case any subsequent commands need it */ (void)newcat_get_rigid(rig); rig_debug(RIG_DEBUG_VERBOSE, "%s: rig_id=%d\n", __func__, priv->rig_id); +#if 0 // what's the right way to do this? if (priv->rig_id == NC_RIGID_FT2000) { // then we need to readjust rfpowermeter cal table in half @@ -548,6 +549,7 @@ int newcat_open(RIG *rig) rig->caps->rfpower_meter_cal.table[i].raw /= 2; } } +#endif rig_debug(RIG_DEBUG_VERBOSE, "%s: returning RIG_OK\n", __func__); return RIG_OK; diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index bf8b796a..3ed57ca6 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201222" +#define NEWCAT_VER "20210104" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 38faad95e870d53db42fc23c2d9f1e7e7ec3a614 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Jan 4 10:44:25 2021 -0600 Add some debug to newcat.c diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 705a9e35..a2ca83f3 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -536,7 +536,7 @@ int newcat_open(RIG *rig) /* Initialize rig_id in case any subsequent commands need it */ (void)newcat_get_rigid(rig); - + rig_debug(RIG_DEBUG_VERBOSE, "%s: rig_id=%d\n", __func__, priv->rig_id); if (priv->rig_id == NC_RIGID_FT2000) { // then we need to readjust rfpowermeter cal table in half @@ -549,6 +549,7 @@ int newcat_open(RIG *rig) } } + rig_debug(RIG_DEBUG_VERBOSE, "%s: returning RIG_OK\n", __func__); return RIG_OK; } ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 5 ++++- rigs/yaesu/newcat.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-01-04 04:59:19
|
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 98d0f20daaf7c3ce0e2554cf9cda9cb0793d7426 (commit) from 8d9f7378db8f8c8c71f9790f9564060d130864e7 (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 98d0f20daaf7c3ce0e2554cf9cda9cb0793d7426 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Jan 3 22:52:56 2021 -0600 Change RIG_TARGETABLE_PURE to appropriate RIG_TARGETABLE -- might actually work now No rig has/had this flag This change affects rig_set_func, rig_get_func, rig_set_ext_level, rig_get_ext_func, rig_set_level, rig_get_level https://github.com/Hamlib/Hamlib/issues/414 diff --git a/src/settings.c b/src/settings.c index 357c2e17..42e72136 100644 --- a/src/settings.c +++ b/src/settings.c @@ -632,7 +632,7 @@ int HAMLIB_API rig_set_ext_level(RIG *rig, return -RIG_ENAVAIL; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_LEVEL) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { @@ -698,7 +698,7 @@ int HAMLIB_API rig_get_ext_level(RIG *rig, return -RIG_ENAVAIL; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_LEVEL) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { @@ -763,7 +763,7 @@ int HAMLIB_API rig_set_ext_func(RIG *rig, return -RIG_ENAVAIL; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_FUNC) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { @@ -829,7 +829,7 @@ int HAMLIB_API rig_get_ext_func(RIG *rig, return -RIG_ENAVAIL; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_FUNC) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { ----------------------------------------------------------------------- Summary of changes: src/settings.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |