From 325754c580a160733aa9ea269d80bcd0be5a475f Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Wed, 17 Jun 2020 10:37:57 -0500 Subject: [PATCH] Fix FLRig get_mode function https://github.com/Hamlib/Hamlib/issues/310 --- dummy/flrig.c | 13 ++++--------- dummy/flrig.h | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/dummy/flrig.c b/dummy/flrig.c index 174c83543..8d9a6b8f9 100644 --- a/dummy/flrig.c +++ b/dummy/flrig.c @@ -642,7 +642,7 @@ static rmode_t modeMapGetHamlib(const char *modeFLRig) } } - rig_debug(RIG_DEBUG_TRACE, "%s: Unknown mode requested: %s\n", __func__, + rig_debug(RIG_DEBUG_TRACE, "%s: mode requested: %s, not in modeMap\n", __func__, modeFLRig); return RIG_MODE_NONE; } @@ -1383,6 +1383,7 @@ static int flrig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) char value[MAXCMDLEN]; char *cmdp; vfo_t curr_vfo; + rmode_t my_mode; struct flrig_priv_data *priv = (struct flrig_priv_data *) rig->state.priv; rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__, @@ -1456,14 +1457,8 @@ static int flrig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) return retval; } - retval = modeMapGetHamlib(value); - - if (retval != RIG_OK) - { - return retval; - } - - *mode = retval; + my_mode = modeMapGetHamlib(value); + *mode = my_mode; rig_debug(RIG_DEBUG_TRACE, "%s: mode='%s'\n", __func__, rig_strrmode(*mode)); diff --git a/dummy/flrig.h b/dummy/flrig.h index 00e841d8a..8459eb8ed 100644 --- a/dummy/flrig.h +++ b/dummy/flrig.h @@ -28,7 +28,7 @@ #include #endif -#define BACKEND_VER "20200613" +#define BACKEND_VER "20200617" #define EOM "\r" #define TRUE 1