Fix kenwood unsupported VFO error for currVFO

https://github.com/Hamlib/Hamlib/issues/849
pull/875/head
Mike Black W9MDB 2021-11-02 09:34:47 -05:00
rodzic 8fe190d622
commit de1b0f5126
2 zmienionych plików z 12 dodań i 5 usunięć

Wyświetl plik

@ -1241,7 +1241,7 @@ int kenwood_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
unsigned char vfo_function;
split_t tsplit;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
rig_debug(RIG_DEBUG_VERBOSE, "%s called %s,%d,%s\n", __func__, rig_strvfo(vfo), split, rig_strvfo(txvfo));
if (RIG_IS_TS990S)
{
@ -1257,8 +1257,8 @@ int kenwood_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
RETURNFUNC(kenwood_transaction(rig, cmdbuf, NULL, 0));
}
if (vfo != RIG_VFO_CURR)
{
if (vfo == RIG_VFO_CURR) vfo = rig->state.current_vfo;
switch (vfo)
{
case RIG_VFO_A: vfo_function = '0'; break;
@ -1297,7 +1297,6 @@ int kenwood_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
{
RETURNFUNC(retval);
}
}
/* Split off means Rx and Tx are the same */
if (split == RIG_SPLIT_OFF)
@ -1315,6 +1314,14 @@ int kenwood_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
}
}
if (txvfo == RIG_VFO_CURR && vfo == RIG_VFO_A) {
if (vfo == RIG_VFO_A) txvfo = RIG_VFO_B;
else if (vfo == RIG_VFO_B) txvfo = RIG_VFO_A;
else {
rig_debug(RIG_DEBUG_ERR, "%s: unsupported split VFO=%s\n", __func__, rig_strvfo(txvfo));
RETURNFUNC(-RIG_EINVAL);
}
}
switch (txvfo)
{
case RIG_VFO_VFO:

Wyświetl plik

@ -28,7 +28,7 @@
#include "token.h"
#include "misc.h"
#define BACKEND_VER "20211028"
#define BACKEND_VER "20211102"
#define EOM_KEN ';'
#define EOM_TH '\r'