make use of TS_ANY, added 2 new vfo_op: UP/DOWN

git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1380 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.1.4
Stéphane Fillod, F8CFE 2003-02-23 22:43:01 +00:00
rodzic 340dd91c23
commit 0a6040a75a
1 zmienionych plików z 22 dodań i 3 usunięć

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib Dummy backend - main file * Hamlib Dummy backend - main file
* Copyright (c) 2001,2002 by Stephane Fillod * Copyright (c) 2001,2002 by Stephane Fillod
* *
* $Id: dummy.c,v 1.30 2002-11-12 00:16:28 fillods Exp $ * $Id: dummy.c,v 1.31 2003-02-23 22:43:01 fillods Exp $
* *
* This library is free software; you can redistribute it and/or modify * This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as * it under the terms of the GNU Library General Public License as
@ -785,6 +785,9 @@ static int dummy_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
{ {
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv; struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
channel_t *curr = priv->curr; channel_t *curr = priv->curr;
int ret;
freq_t freq;
shortfreq_t ts;
rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n",__FUNCTION__, rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n",__FUNCTION__,
strvfop(op)); strvfop(op));
@ -853,7 +856,23 @@ static int dummy_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
mem_chan->vfo = RIG_VFO_MEM; mem_chan->vfo = RIG_VFO_MEM;
} }
break; break;
default: case RIG_OP_UP:
ret = dummy_get_freq(rig, vfo, &freq);
if (!ret) break;
ret = dummy_get_ts(rig, vfo, &ts);
if (!ret) break;
ret = dummy_set_freq(rig, vfo, freq+ts); /* up */
break;
case RIG_OP_DOWN:
ret = dummy_get_freq(rig, vfo, &freq);
if (!ret) break;
ret = dummy_get_ts(rig, vfo, &ts);
if (!ret) break;
ret = dummy_set_freq(rig, vfo, freq-ts); /* down */
break;
default:
break;
} }
return RIG_OK; return RIG_OK;
@ -1041,7 +1060,7 @@ const struct rig_caps dummy_caps = {
.low_power=-1,.high_power=-1,RIG_VFO_A|RIG_VFO_B}, .low_power=-1,.high_power=-1,RIG_VFO_A|RIG_VFO_B},
RIG_FRNG_END, }, RIG_FRNG_END, },
.tx_range_list2 = { RIG_FRNG_END, }, .tx_range_list2 = { RIG_FRNG_END, },
.tuning_steps = { {DUMMY_MODES,1}, RIG_TS_END, }, .tuning_steps = { {DUMMY_MODES,1}, {DUMMY_MODES,RIG_TS_ANY}, RIG_TS_END, },
.filters = { .filters = {
{RIG_MODE_SSB|RIG_MODE_CW|RIG_MODE_RTTY, kHz(2.4)}, {RIG_MODE_SSB|RIG_MODE_CW|RIG_MODE_RTTY, kHz(2.4)},
{RIG_MODE_CW, Hz(500)}, {RIG_MODE_CW, Hz(500)},