From 5ef9bde4989a9d3b24d51218a1ae25e69064a493 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Mon, 29 Dec 2014 18:48:23 +0000 Subject: [PATCH] Allow for failed test command on the K2 The K2 initialization was checking if RTTY mode was available by sending an MD6; command and they querying the mode to check if it worked. The latest kenwood routines now fail if an invalid command is sent to the K2 initialization need only try the MD6; command to see if RTTY is available on the rig. --- kenwood/k2.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/kenwood/k2.c b/kenwood/k2.c index 3764ad266..b7523f1f1 100644 --- a/kenwood/k2.c +++ b/kenwood/k2.c @@ -503,18 +503,13 @@ int k2_probe_mdfw(RIG *rig, struct kenwood_priv_data *priv) /* First try to put the K2 into RTTY mode and check if it's available. */ err = kenwood_simple_cmd(rig, "MD6"); - if (err != RIG_OK) + if (err != RIG_OK && err != -RIG_ERJCTED) return err; - /* Check for mode and test to see if K2 reports RTTY. */ - err = kenwood_safe_transaction(rig, "MD", buf, KENWOOD_MAX_BUF_LEN, 4); - if (err != RIG_OK) - return err; - - if (strcmp("MD6", buf) == 0) - priv->k2_md_rtty = 1; /* set flag for RTTY mode installed */ + if (-RIG_ERJCTED == err) + priv->k2_md_rtty = 0; /* set flag for RTTY mode installed */ else - priv->k2_md_rtty = 0; /* RTTY module not installed */ + priv->k2_md_rtty = 1; /* RTTY module not installed */ rig_debug(RIG_DEBUG_VERBOSE, "%s: RTTY flag is: %d\n", __func__, priv->k2_md_rtty); i = (priv->k2_md_rtty == 1) ? 2 : 1;