From c3ac828cdb5c98e13a64a1d9c8a0af38badb1a8a Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Fri, 15 Jan 2021 12:01:06 -0600 Subject: [PATCH] Combine writes in newcat_set_cmd_validate to speed up timing https://github.com/Hamlib/Hamlib/issues/505 --- rigs/yaesu/newcat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index d1f956956..7ae231fcd 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -9427,10 +9427,10 @@ int newcat_set_cmd_validate(RIG *rig) while (rc != RIG_OK && retry++ < retries) { int bytes; + char cmd[256]; // big enough 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)); + snprintf(cmd,sizeof(cmd),"%s%s",priv->cmd_str,priv->valcmd); + rc = write_block(&state->rigport, cmd, strlen(cmd)); if (rc != RIG_OK) return -RIG_EIO; bytes = read_string(&state->rigport, priv->ret_data, sizeof(priv->ret_data), &cat_term, sizeof(cat_term));