From 891ca6ed75345079dc5d6e4c98865f867400ea10 Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Fri, 15 Oct 2021 12:02:41 -0500 Subject: [PATCH] Fix TS450 and TS690 split check -- should be using IF status now Should work with any rigs that don't have split status too in case there are any. https://github.com/Hamlib/Hamlib/issues/826 --- rigs/kenwood/kenwood.c | 10 +++++++--- rigs/kenwood/kenwood.h | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 5e48aa754..e64e361c2 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -1228,6 +1228,7 @@ int kenwood_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo) char cmdbuf[12]; int retval; unsigned char vfo_function; + split_t tsplit; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -1324,10 +1325,13 @@ int kenwood_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo) they impact output power when transmitting and all other rigs don't need to set it if it's already set correctly */ - if (RIG_OK == (retval = kenwood_safe_transaction(rig, "FT", cmdbuf, - sizeof(cmdbuf), 3))) + tsplit = RIG_SPLIT_OFF; // default in case rig does not set split status + retval = rig_get_split(rig, vfo, &tsplit); + // and it should be OK to do a SPLIT_OFF at any time so we won's skip that + if (retval == RIG_OK && split == RIG_SPLIT_ON && tsplit == RIG_SPLIT_ON) { - if (cmdbuf[2] == vfo_function) { RETURNFUNC(RIG_OK); } + rig_debug(RIG_DEBUG_VERBOSE, "%s: already set split=%d\n", __func__, tsplit); + RETURNFUNC(RIG_OK); } /* set TX VFO */ diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index e3c36b77b..18dcaa29b 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "misc.h" -#define BACKEND_VER "20211008" +#define BACKEND_VER "20211015" #define EOM_KEN ';' #define EOM_TH '\r'