Skip to content

Commit

Permalink
Add MAIN/SUB vfos to dummy for testing purposes
Browse files Browse the repository at this point in the history
Hamlib#404

(cherry picked from commit 53c0936)
  • Loading branch information
mdblack98 authored and N0NB committed Oct 29, 2020
1 parent 671afff commit 1b001df
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions rigs/dummy/dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,8 @@ static int dummy_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s %s\n", __func__,
rig_strvfo(vfo), fstr);

if (vfo == RIG_VFO_A) { priv->curr->freq = freq; }
else if (vfo == RIG_VFO_B) { priv->curr->tx_freq = freq; }
if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) { priv->curr->freq = freq; }
else if (vfo == RIG_VFO_B || vfo == RIG_VFO_SUB) { priv->curr->tx_freq = freq; }

if (!priv->split)
{
Expand All @@ -447,13 +447,21 @@ static int dummy_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)

if (vfo == RIG_VFO_CURR && rig->caps->rig_model != RIG_MODEL_DUMMY_NOVFO) { vfo = priv->curr_vfo; }

if ((vfo == RIG_VFO_SUB && rig->state.uplink == 1)
|| (vfo == RIG_VFO_MAIN && rig->state.uplink == 2))
{
rig_debug(RIG_DEBUG_TRACE, "%s: uplink=%d, ignoring get_freq\n", __func__, rig->state.uplink);
return RIG_OK;
}
usleep(CMDSLEEP);
rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rig_strvfo(vfo));

switch (vfo)
{
case RIG_VFO_MAIN:
case RIG_VFO_A: *freq = priv->curr->freq; break;

case RIG_VFO_SUB:
case RIG_VFO_B: *freq = priv->curr->tx_freq; break;

default: return -RIG_EINVAL;
Expand Down Expand Up @@ -2025,7 +2033,7 @@ static int dummy_mW2power(RIG *rig, float *power, unsigned int mwpower,
#define DUMMY_VFO_OP 0x7ffffffUL /* All possible VFO OPs */
#define DUMMY_SCAN 0x7ffffffUL /* All possible scan OPs */

#define DUMMY_VFOS (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM)
#define DUMMY_VFOS (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM|RIG_VFO_MAIN|RIG_VFO_SUB)

#define DUMMY_MODES (RIG_MODE_AM | RIG_MODE_CW | RIG_MODE_RTTY | \
RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_WFM | \
Expand Down

0 comments on commit 1b001df

Please sign in to comment.