diff --git a/rigs/kenwood/elecraft.c b/rigs/kenwood/elecraft.c index 50bd19d43..420849c01 100644 --- a/rigs/kenwood/elecraft.c +++ b/rigs/kenwood/elecraft.c @@ -471,3 +471,33 @@ int elecraft_get_firmware_revision_level(RIG *rig, const char *cmd, return RIG_OK; } + +// FR;FT;TQ; is faster than IF; +// Works on K4 +int elecraft_get_vfo_tq(RIG *rig, vfo_t *vfo) +{ + int retval; + int fr,ft,tx; + char cmdbuf[10]; + char splitbuf[12]; + snprintf(cmdbuf,sizeof(cmdbuf),"FR;FT;TQ;"); + memset(splitbuf,0,sizeof(splitbuf)); + retval = kenwood_safe_transaction(rig, cmdbuf, splitbuf, 9, 12); + + if (retval != RIG_OK) + { + RETURNFUNC(retval); + } + + if(sscanf(splitbuf, "FT%1d;FT%1d;TQ%1d", &fr, &ft, &tx) == 3) + { + RETURNFUNC(RIG_OK); + } + else { + rig_debug(RIG_DEBUG_ERR, "%s: unable to parse '%s'\n", __func__, splitbuf); + } + if (tx) *vfo = ft; + else *vfo = fr; + RETURNFUNC(RIG_OK); +} + diff --git a/rigs/kenwood/elecraft.h b/rigs/kenwood/elecraft.h index efed41c9e..dcd633e97 100644 --- a/rigs/kenwood/elecraft.h +++ b/rigs/kenwood/elecraft.h @@ -132,5 +132,7 @@ int elecraft_open(RIG *rig); { 103, 60 }, \ } } +// K4 is the only we know that has this as of 2021-11-09 +int elecraft_get_vfo_tq(RIG *rig, vfo_t *vfo); #endif /* _ELECRAFT_H */ diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 1af0fcad5..67d076fef 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -484,7 +484,7 @@ const struct rig_caps k4_caps = RIG_MODEL(RIG_MODEL_K4), .model_name = "K4", .mfg_name = "Elecraft", - .version = BACKEND_VER ".17", + .version = BACKEND_VER ".18", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -597,7 +597,7 @@ const struct rig_caps k4_caps = .set_mode = k3_set_mode, .get_mode = k3_get_mode, .set_vfo = k3_set_vfo, - .get_vfo = k3_get_vfo, + .get_vfo = elecraft_get_vfo_tq, .set_split_mode = k3_set_split_mode, .get_split_mode = k3_get_split_mode, .set_split_vfo = kenwood_set_split_vfo,