[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. ad2c20f611ba1d2511d02
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Michael B. <mdb...@us...> - 2021-01-15 16:59:28
|
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 ad2c20f611ba1d2511d021edddef67d9b9ed7480 (commit) via ea9a70674366640b42a3d0949251f3606e88d15c (commit) from 517fb87b8bded5478510bc903e52347715503591 (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 ad2c20f611ba1d2511d021edddef67d9b9ed7480 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 15 10:58:47 2021 -0600 Fix newcat_set_cmd_validate read_string check https://github.com/Hamlib/Hamlib/issues/505 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 893ba768..990de8ef 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -9426,14 +9426,15 @@ int newcat_set_cmd_validate(RIG *rig) } while (rc != RIG_OK && retry++ < retries) { + int bytes; rig_flush(&state->rigport); /* discard any unsolicited data */ rc = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)); if (rc != RIG_OK) return -RIG_EIO; rc = write_block(&state->rigport, valcmd, strlen(valcmd)); if (rc != RIG_OK) return -RIG_EIO; - rc = read_string(&state->rigport, priv->ret_data, sizeof(priv->ret_data), + bytes = read_string(&state->rigport, priv->ret_data, sizeof(priv->ret_data), &cat_term, sizeof(cat_term)); - if (rc == RIG_OK) + if (bytes > 0) { // if they match we are validated if (strcmp(priv->cmd_str, priv->ret_data)==0) return RIG_OK; commit ea9a70674366640b42a3d0949251f3606e88d15c Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 15 10:56:27 2021 -0600 Add debug for newcat_set_cmd_validate https://github.com/Hamlib/Hamlib/issues/505 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index b1336f6e..893ba768 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -9439,9 +9439,9 @@ int newcat_set_cmd_validate(RIG *rig) if (strcmp(priv->cmd_str, priv->ret_data)==0) return RIG_OK; else rc = -RIG_EPROTO; } - rig_debug(RIG_DEBUG_ERR, "%s: cmd validation failed, try#%d\n", __func__, retry); + rig_debug(RIG_DEBUG_ERR, "%s: cmd validation failed, '%s'!='%s', try#%d\n", __func__, priv->cmd_str, priv->ret_data, retry); hl_usleep(sleepms*1000); - } while(--retry > 0); + } return -RIG_EPROTO; } /* diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 3ad84a0d..3033e920 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20210114" +#define NEWCAT_VER "20210115" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 9 +++++---- rigs/yaesu/newcat.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |