Add elecraft_get_vfo_tq to take advantage of K4's new TQ command

https://github.com/Hamlib/Hamlib/issues/863
pull/875/head
Mike Black W9MDB 2021-11-09 17:07:40 -06:00
rodzic eed9637675
commit 6ba1bc0811
3 zmienionych plików z 34 dodań i 2 usunięć

Wyświetl plik

@ -471,3 +471,33 @@ int elecraft_get_firmware_revision_level(RIG *rig, const char *cmd,
return RIG_OK; 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);
}

Wyświetl plik

@ -132,5 +132,7 @@ int elecraft_open(RIG *rig);
{ 103, 60 }, \ { 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 */ #endif /* _ELECRAFT_H */

Wyświetl plik

@ -484,7 +484,7 @@ const struct rig_caps k4_caps =
RIG_MODEL(RIG_MODEL_K4), RIG_MODEL(RIG_MODEL_K4),
.model_name = "K4", .model_name = "K4",
.mfg_name = "Elecraft", .mfg_name = "Elecraft",
.version = BACKEND_VER ".17", .version = BACKEND_VER ".18",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_STABLE, .status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER, .rig_type = RIG_TYPE_TRANSCEIVER,
@ -597,7 +597,7 @@ const struct rig_caps k4_caps =
.set_mode = k3_set_mode, .set_mode = k3_set_mode,
.get_mode = k3_get_mode, .get_mode = k3_get_mode,
.set_vfo = k3_set_vfo, .set_vfo = k3_set_vfo,
.get_vfo = k3_get_vfo, .get_vfo = elecraft_get_vfo_tq,
.set_split_mode = k3_set_split_mode, .set_split_mode = k3_set_split_mode,
.get_split_mode = k3_get_split_mode, .get_split_mode = k3_get_split_mode,
.set_split_vfo = kenwood_set_split_vfo, .set_split_vfo = kenwood_set_split_vfo,