[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. a9a806f8e02d859a37787
Library to control radio transceivers and receivers
Brought to you by:
n0nb
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 |