From d04f4b6b3b53e7b630ebecfd46fa6a7fc257e90e Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Mon, 21 Feb 2022 08:26:49 -0600 Subject: [PATCH] Add validation handling for SH and RF in newcat.c Fix FTDX10 SH command formatting https://github.com/Hamlib/Hamlib/issues/973 --- rigs/yaesu/newcat.c | 12 +++++++++++- rigs/yaesu/newcat.h | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 2ed7364e8..8c01e2e58 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -8515,7 +8515,7 @@ 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 || is_ftdx10 || is_ftdx3000) + else if (is_ft2000 || is_ftdx3000) { SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "SH0%02d;", w); } @@ -10350,6 +10350,16 @@ int newcat_set_cmd_validate(RIG *rig) { strcpy(valcmd, ""); // nothing to validate } + else if (strncmp(priv->cmd_str, "SH", 2) == 0) + { + // could validate with SH but different formats need to be handled + strcpy(valcmd, ""); // nothing to validate + } + else if (strncmp(priv->cmd_str, "RF", 2) == 0) + { + // could validate with RF but different formats need to be handled + strcpy(valcmd, ""); // nothing to validate + } else { rig_debug(RIG_DEBUG_TRACE, "%s: %s not implemented\n", __func__, priv->cmd_str); diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 809a933a7..beec27566 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20220220" +#define NEWCAT_VER "20220221" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129