From 30a8258f4ee3f5a3d639e2ac9eca06969641fd00 Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Sat, 27 Feb 2021 14:27:07 -0600 Subject: [PATCH] Another attempt to fix elecraft K3 rigs to recognize VFOB being selected https://github.com/Hamlib/Hamlib/issues/563 --- rigs/kenwood/k3.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 3b86cdd63..2228bc465 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -183,7 +183,7 @@ const struct rig_caps k3_caps = RIG_MODEL(RIG_MODEL_K3), .model_name = "K3", .mfg_name = "Elecraft", - .version = BACKEND_VER ".5", + .version = BACKEND_VER ".6", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -334,7 +334,7 @@ const struct rig_caps k3s_caps = RIG_MODEL(RIG_MODEL_K3S), .model_name = "K3S", .mfg_name = "Elecraft", - .version = BACKEND_VER ".4", + .version = BACKEND_VER ".5", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -484,7 +484,7 @@ const struct rig_caps k4_caps = RIG_MODEL(RIG_MODEL_K4), .model_name = "K4", .mfg_name = "Elecraft", - .version = BACKEND_VER ".4", + .version = BACKEND_VER ".5", .copyright = "LGPL", .status = RIG_STATUS_ALPHA, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -633,7 +633,7 @@ const struct rig_caps kx3_caps = RIG_MODEL(RIG_MODEL_KX3), .model_name = "KX3", .mfg_name = "Elecraft", - .version = BACKEND_VER ".4", + .version = BACKEND_VER ".5", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -782,7 +782,7 @@ const struct rig_caps kx2_caps = RIG_MODEL(RIG_MODEL_KX2), .model_name = "KX2", .mfg_name = "Elecraft", - .version = BACKEND_VER ".4", + .version = BACKEND_VER ".5", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1206,8 +1206,6 @@ int k3_get_vfo(RIG *rig, vfo_t *vfo) { char buf[KENWOOD_MAX_BUF_LEN]; int ret; - struct kenwood_priv_data *priv = rig->state.priv; - ret = write_block(&rig->state.rigport, "IC;", 3); if (ret != RIG_OK) @@ -1222,7 +1220,7 @@ int k3_get_vfo(RIG *rig, vfo_t *vfo) rig_debug(RIG_DEBUG_ERR, "%s: expected 8 bytes from '%s', got %d bytes\n", __func__, buf, ret); RETURNFUNC(-RIG_EPROTO); } - if (buf[6] == '0') *vfo = RIG_VFO_B; + if ((buf[6]&0x02) == 0) *vfo = RIG_VFO_B; else *vfo = RIG_VFO_A; RETURNFUNC(RIG_OK);