diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 77af7489a..0c52cc2f5 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2223,17 +2223,18 @@ int kenwood_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) datamode = 1; } } - rig_debug(RIG_DEBUG_VERBOSE, "%s: curr_mode=%s, new_mode=%s\n", __func__, rig_strrmode(priv->curr_mode), rig_strrmode(mode)); + rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s, curr_mode=%s, new_mode=%s\n", __func__, rig_strvfo(vfo), rig_strrmode(priv->curr_mode), rig_strrmode(mode)); // only change mode if needed if (priv->curr_mode != mode) { snprintf(buf, sizeof(buf), "MD%c", c); err = kenwood_transaction(rig, buf, NULL, 0); } + // determine if we need to set datamode on A or B needdata = 0; - if ((vfo == RIG_VFO_A) && ((priv->datamodeA == 0 && datamode) || (priv->datamodeA == 1 && !datamode))) + if ((vfo & (RIG_VFO_A|RIG_VFO_MAIN)) && ((priv->datamodeA == 0 && datamode) || (priv->datamodeA == 1 && !datamode))) needdata = 1; - if ((vfo == RIG_VFO_B) && ((priv->datamodeB == 0 && datamode) || (priv->datamodeB == 1 && !datamode))) + if ((vfo == (RIG_VFO_B|RIG_VFO_SUB)) && ((priv->datamodeB == 0 && datamode) || (priv->datamodeB == 1 && !datamode))) needdata = 1; if (needdata) @@ -2244,6 +2245,10 @@ int kenwood_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (err != RIG_OK) { RETURNFUNC(err); } } + else if (datamode) + { + rig_debug(RIG_DEBUG_VERBOSE, "%s: datamode set on %s not needed\n", __func__, rig_strvfo(vfo)); + } if (RIG_PASSBAND_NOCHANGE == width) { RETURNFUNC(RIG_OK); } diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index caf0cab94..21473e4e3 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "misc.h" -#define BACKEND_VER "20211122" +#define BACKEND_VER "20211122.1" #define EOM_KEN ';' #define EOM_TH '\r' diff --git a/simulators/simkenwood.c b/simulators/simkenwood.c index 0f9b20d0d..9ade0c249 100644 --- a/simulators/simkenwood.c +++ b/simulators/simkenwood.c @@ -11,6 +11,7 @@ float freqA = 14074000; float freqB = 14074500; +int filternum = 7; // ID 0310 == 310, Must drop leading zero typedef enum nc_rigid_e @@ -223,6 +224,16 @@ int main(int argc, char *argv[]) { sscanf(buf, "MD%d", &modeA); // not worried about modeB yet for simulator } + else if (strncmp(buf,"FL;",3) == 0) + { + sprintf(buf, "FL%03d;", filternum); + write(fd, buf, strlen(buf)); + } + else if (strncmp(buf,"FL",2) == 0) + { + sscanf(buf, "FL%d", &filternum); + } + else if (strlen(buf) > 0)