2001-02-14 00:59:02 +00:00
|
|
|
/*
|
2001-07-13 19:08:15 +00:00
|
|
|
* Hamlib Dummy backend - main file
|
2004-05-17 21:09:45 +00:00
|
|
|
* Copyright (c) 2001-2004 by Stephane Fillod
|
2001-02-14 00:59:02 +00:00
|
|
|
*
|
2006-07-02 17:05:26 +00:00
|
|
|
* $Id: dummy.c,v 1.40 2006-07-02 17:05:26 csete Exp $
|
2001-02-14 00:59:02 +00:00
|
|
|
*
|
2001-07-13 19:08:15 +00:00
|
|
|
* This library is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Library General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of
|
|
|
|
* the License, or (at your option) any later version.
|
2001-02-14 00:59:02 +00:00
|
|
|
*
|
2001-07-13 19:08:15 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Library General Public License for more details.
|
2001-02-14 00:59:02 +00:00
|
|
|
*
|
2001-07-13 19:08:15 +00:00
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
2001-02-14 00:59:02 +00:00
|
|
|
*
|
2001-07-13 19:08:15 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
2001-02-14 00:59:02 +00:00
|
|
|
|
2003-10-01 19:32:04 +00:00
|
|
|
#include <stdio.h>
|
2001-02-14 00:59:02 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h> /* String function definitions */
|
|
|
|
#include <unistd.h> /* UNIX standard function definitions */
|
|
|
|
#include <math.h>
|
|
|
|
|
2003-04-07 22:42:11 +00:00
|
|
|
#include "hamlib/rig.h"
|
|
|
|
#include "serial.h"
|
|
|
|
#include "misc.h"
|
|
|
|
#include "tones.h"
|
|
|
|
#include "idx_builtin.h"
|
2003-04-16 22:30:43 +00:00
|
|
|
#include "register.h"
|
2001-06-15 07:08:37 +00:00
|
|
|
|
2001-02-14 00:59:02 +00:00
|
|
|
#include "dummy.h"
|
|
|
|
|
2002-02-15 00:12:44 +00:00
|
|
|
#define NB_CHAN 22 /* see caps->chan_list */
|
|
|
|
|
2001-11-18 14:16:57 +00:00
|
|
|
struct dummy_priv_data {
|
2002-01-22 00:43:05 +00:00
|
|
|
/* current vfo already in rig_state ? */
|
2001-12-16 11:24:56 +00:00
|
|
|
vfo_t curr_vfo;
|
2002-02-15 00:12:44 +00:00
|
|
|
vfo_t last_vfo; /* VFO A or VFO B, when in MEM mode */
|
2002-01-22 00:43:05 +00:00
|
|
|
|
|
|
|
ptt_t ptt;
|
|
|
|
powerstat_t powerstat;
|
|
|
|
int bank;
|
|
|
|
value_t parms[RIG_SETTING_MAX];
|
|
|
|
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr; /* points to vfo_a, vfo_b or mem[] */
|
|
|
|
|
|
|
|
channel_t vfo_a;
|
|
|
|
channel_t vfo_b;
|
|
|
|
channel_t mem[NB_CHAN];
|
2001-11-18 14:16:57 +00:00
|
|
|
};
|
2001-02-14 00:59:02 +00:00
|
|
|
|
2001-02-14 23:57:30 +00:00
|
|
|
|
|
|
|
/********************************************************************/
|
|
|
|
|
2002-02-15 00:12:44 +00:00
|
|
|
static void init_chan(RIG *rig, vfo_t vfo, channel_t *chan)
|
2002-01-22 00:43:05 +00:00
|
|
|
{
|
|
|
|
chan->channel_num = 0;
|
2002-02-15 00:12:44 +00:00
|
|
|
chan->vfo = vfo;
|
2004-05-17 21:09:45 +00:00
|
|
|
strcpy(chan->channel_desc, rig_strvfo(vfo));
|
2002-01-22 00:43:05 +00:00
|
|
|
|
|
|
|
chan->freq = MHz(145);
|
|
|
|
chan->mode = RIG_MODE_FM;
|
|
|
|
chan->width = rig_passband_normal(rig, RIG_MODE_FM);
|
|
|
|
chan->tx_freq = chan->freq;
|
|
|
|
chan->tx_mode = chan->mode;
|
|
|
|
chan->tx_width = chan->width;
|
|
|
|
chan->split = RIG_SPLIT_OFF;
|
|
|
|
|
|
|
|
chan->rptr_shift = RIG_RPT_SHIFT_NONE;
|
|
|
|
chan->rptr_offs = 0;
|
|
|
|
chan->ctcss_tone = 0;
|
|
|
|
chan->dcs_code = 0;
|
|
|
|
chan->ctcss_sql = 0;
|
|
|
|
chan->dcs_sql = 0;
|
|
|
|
chan->rit = 0;
|
|
|
|
chan->xit = 0;
|
|
|
|
chan->tuning_step = 0;
|
|
|
|
chan->ant = 0;
|
|
|
|
|
|
|
|
chan->funcs = (setting_t)0;
|
|
|
|
memset(chan->levels, 0, RIG_SETTING_MAX*sizeof(value_t));
|
|
|
|
}
|
|
|
|
|
|
|
|
static int dummy_init(RIG *rig)
|
|
|
|
{
|
2001-11-18 14:16:57 +00:00
|
|
|
struct dummy_priv_data *priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
int i;
|
2001-11-18 14:16:57 +00:00
|
|
|
|
|
|
|
priv = (struct dummy_priv_data*)malloc(sizeof(struct dummy_priv_data));
|
|
|
|
if (!priv)
|
|
|
|
return -RIG_ENOMEM;
|
|
|
|
rig->state.priv = (void*)priv;
|
|
|
|
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
|
2001-06-04 17:01:21 +00:00
|
|
|
rig->state.rigport.type.rig = RIG_PORT_NONE;
|
2001-02-14 00:59:02 +00:00
|
|
|
|
2002-01-22 00:43:05 +00:00
|
|
|
priv->ptt = RIG_PTT_OFF;
|
|
|
|
priv->powerstat = RIG_POWER_ON;
|
|
|
|
priv->bank = 0;
|
|
|
|
memset(priv->parms, 0, RIG_SETTING_MAX*sizeof(value_t));
|
|
|
|
|
2002-02-15 00:12:44 +00:00
|
|
|
memset(priv->mem, 0, sizeof(priv->mem));
|
|
|
|
for (i=0; i<NB_CHAN; i++) {
|
|
|
|
priv->mem[i].channel_num = i;
|
|
|
|
priv->mem[i].vfo = RIG_VFO_MEM;
|
|
|
|
}
|
|
|
|
init_chan(rig, RIG_VFO_A, &priv->vfo_a);
|
|
|
|
init_chan(rig, RIG_VFO_B, &priv->vfo_b);
|
|
|
|
priv->curr = &priv->vfo_a;
|
|
|
|
priv->curr_vfo = priv->last_vfo = RIG_VFO_A;
|
2001-11-18 14:16:57 +00:00
|
|
|
|
2001-02-14 00:59:02 +00:00
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
2002-01-22 00:43:05 +00:00
|
|
|
static int dummy_cleanup(RIG *rig)
|
|
|
|
{
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
|
2001-02-14 00:59:02 +00:00
|
|
|
|
2001-11-18 14:16:57 +00:00
|
|
|
if (rig->state.priv)
|
|
|
|
free(rig->state.priv);
|
|
|
|
|
|
|
|
rig->state.priv = NULL;
|
|
|
|
|
2001-02-14 00:59:02 +00:00
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int dummy_open(RIG *rig)
|
|
|
|
{
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int dummy_close(RIG *rig)
|
|
|
|
{
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called\n", __FUNCTION__);
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int dummy_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|
|
|
{
|
2001-11-18 14:16:57 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2001-12-16 11:24:56 +00:00
|
|
|
char fstr[20];
|
2001-11-18 14:16:57 +00:00
|
|
|
|
2002-01-27 23:49:12 +00:00
|
|
|
sprintf_freq(fstr, freq);
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s %s\n", __FUNCTION__,
|
2004-05-17 21:09:45 +00:00
|
|
|
rig_strvfo(vfo), fstr);
|
2002-01-22 00:43:05 +00:00
|
|
|
curr->freq = freq;
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int dummy_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|
|
|
{
|
2001-11-18 14:16:57 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2001-11-18 14:16:57 +00:00
|
|
|
|
2004-05-17 21:09:45 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, rig_strvfo(vfo));
|
2001-02-14 00:59:02 +00:00
|
|
|
|
2002-01-22 00:43:05 +00:00
|
|
|
*freq = curr->freq;
|
2001-11-18 14:16:57 +00:00
|
|
|
|
2001-02-14 00:59:02 +00:00
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int dummy_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|
|
|
{
|
2001-11-18 14:16:57 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2001-12-16 11:24:56 +00:00
|
|
|
char buf[16];
|
2001-11-18 14:16:57 +00:00
|
|
|
|
2002-01-27 23:49:12 +00:00
|
|
|
sprintf_freq(buf, width);
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s %s %s\n", __FUNCTION__,
|
2004-05-17 21:09:45 +00:00
|
|
|
rig_strvfo(vfo), rig_strrmode(mode), buf);
|
2001-02-14 00:59:02 +00:00
|
|
|
|
2002-01-22 00:43:05 +00:00
|
|
|
curr->mode = mode;
|
|
|
|
curr->width = width;
|
2001-11-18 14:16:57 +00:00
|
|
|
|
2001-02-14 00:59:02 +00:00
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int dummy_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|
|
|
{
|
2001-11-18 14:16:57 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2001-11-18 14:16:57 +00:00
|
|
|
|
2004-05-17 21:09:45 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, rig_strvfo(vfo));
|
2001-02-14 00:59:02 +00:00
|
|
|
|
2002-01-22 00:43:05 +00:00
|
|
|
*mode = curr->mode;
|
|
|
|
*width = curr->width;
|
2001-11-18 14:16:57 +00:00
|
|
|
|
2001-02-14 00:59:02 +00:00
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int dummy_set_vfo(RIG *rig, vfo_t vfo)
|
|
|
|
{
|
2001-12-16 11:24:56 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2001-12-16 11:24:56 +00:00
|
|
|
|
2004-05-17 21:09:45 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, rig_strvfo(vfo));
|
2002-02-15 00:12:44 +00:00
|
|
|
|
|
|
|
priv->last_vfo = priv->curr_vfo;
|
2001-12-16 11:24:56 +00:00
|
|
|
priv->curr_vfo = vfo;
|
2002-02-15 00:12:44 +00:00
|
|
|
switch (vfo) {
|
|
|
|
case RIG_VFO_VFO: /* FIXME */
|
|
|
|
|
|
|
|
case RIG_VFO_A: priv->curr = &priv->vfo_a; break;
|
|
|
|
case RIG_VFO_B: priv->curr = &priv->vfo_b; break;
|
|
|
|
case RIG_VFO_MEM:
|
|
|
|
if (curr->channel_num >= 0 && curr->channel_num < NB_CHAN) {
|
|
|
|
priv->curr = &priv->mem[curr->channel_num];
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
2004-05-17 21:09:45 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s unknown vfo: %s\n", __FUNCTION__, rig_strvfo(vfo));
|
2002-02-15 00:12:44 +00:00
|
|
|
}
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int dummy_get_vfo(RIG *rig, vfo_t *vfo)
|
|
|
|
{
|
2001-12-16 11:24:56 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
|
|
|
|
|
|
|
*vfo = priv->curr_vfo;
|
2004-05-17 21:09:45 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, rig_strvfo(*vfo));
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int dummy_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
|
|
|
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2002-01-22 00:43:05 +00:00
|
|
|
priv->ptt = ptt;
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int dummy_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
|
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
|
|
|
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2002-01-22 00:43:05 +00:00
|
|
|
*ptt = priv->ptt;
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-02-14 23:57:30 +00:00
|
|
|
static int dummy_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
|
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
static int twiddle = 0;
|
|
|
|
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2002-01-22 00:43:05 +00:00
|
|
|
*dcd = twiddle++ & 1 ? RIG_DCD_ON : RIG_DCD_OFF;
|
2001-02-14 23:57:30 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-02-14 00:59:02 +00:00
|
|
|
static int dummy_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift)
|
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2002-01-22 00:43:05 +00:00
|
|
|
curr->rptr_shift = rptr_shift;
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int dummy_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift)
|
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
|
|
|
*rptr_shift = curr->rptr_shift;
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int dummy_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs)
|
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2002-01-22 00:43:05 +00:00
|
|
|
curr->rptr_offs = rptr_offs;
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int dummy_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs)
|
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
|
|
|
*rptr_offs = curr->rptr_offs;
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-07-01 11:46:17 +00:00
|
|
|
static int dummy_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2002-01-22 00:43:05 +00:00
|
|
|
curr->ctcss_tone = tone;
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-07-01 11:46:17 +00:00
|
|
|
static int dummy_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
|
|
|
*tone = curr->ctcss_tone;
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-07-01 11:46:17 +00:00
|
|
|
static int dummy_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2002-01-22 00:43:05 +00:00
|
|
|
curr->dcs_code = code;
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-07-01 11:46:17 +00:00
|
|
|
static int dummy_get_dcs_code(RIG *rig, vfo_t vfo, tone_t *code)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
|
|
|
*code = curr->dcs_code;
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-07-01 11:46:17 +00:00
|
|
|
static int dummy_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2002-01-22 00:43:05 +00:00
|
|
|
curr->ctcss_sql = tone;
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-07-01 11:46:17 +00:00
|
|
|
static int dummy_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
|
|
|
*tone = curr->ctcss_sql;
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int dummy_set_dcs_sql(RIG *rig, vfo_t vfo, unsigned int code)
|
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2002-01-22 00:43:05 +00:00
|
|
|
curr->dcs_sql = code;
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int dummy_get_dcs_sql(RIG *rig, vfo_t vfo, unsigned int *code)
|
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
|
|
|
*code = curr->dcs_sql;
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-06-27 17:32:47 +00:00
|
|
|
static int dummy_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
char fstr[20];
|
|
|
|
|
2002-01-27 23:49:12 +00:00
|
|
|
sprintf_freq(fstr, tx_freq);
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s %s\n", __FUNCTION__,
|
2004-05-17 21:09:45 +00:00
|
|
|
rig_strvfo(vfo), fstr);
|
2002-01-22 00:43:05 +00:00
|
|
|
curr->tx_freq = tx_freq;
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-06-27 17:32:47 +00:00
|
|
|
static int dummy_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
2004-05-17 21:09:45 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__,rig_strvfo(vfo));
|
2002-01-22 00:43:05 +00:00
|
|
|
|
|
|
|
*tx_freq = curr->tx_freq;
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
2001-06-27 17:32:47 +00:00
|
|
|
static int dummy_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width)
|
2001-05-08 09:08:59 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
char buf[16];
|
|
|
|
|
2002-01-27 23:49:12 +00:00
|
|
|
sprintf_freq(buf, tx_width);
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s %s %s\n", __FUNCTION__,
|
2004-05-17 21:09:45 +00:00
|
|
|
rig_strvfo(vfo), rig_strrmode(tx_mode), buf);
|
2002-01-22 00:43:05 +00:00
|
|
|
|
|
|
|
curr->tx_mode = tx_mode;
|
|
|
|
curr->tx_width = tx_width;
|
2001-05-08 09:08:59 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
2001-06-27 17:32:47 +00:00
|
|
|
static int dummy_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, pbwidth_t *tx_width)
|
2001-05-08 09:08:59 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
2004-05-17 21:09:45 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, rig_strvfo(vfo));
|
2002-01-22 00:43:05 +00:00
|
|
|
|
|
|
|
*tx_mode = curr->tx_mode;
|
|
|
|
*tx_width = curr->tx_width;
|
2001-05-08 09:08:59 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
2001-02-14 00:59:02 +00:00
|
|
|
|
2003-04-06 18:40:36 +00:00
|
|
|
static int dummy_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2002-01-22 00:43:05 +00:00
|
|
|
curr->split = split;
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-04-06 18:40:36 +00:00
|
|
|
static int dummy_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
|
|
|
*split = curr->split;
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int dummy_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
|
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2002-01-22 00:43:05 +00:00
|
|
|
curr->rit = rit;
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int dummy_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
|
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
|
|
|
*rit = curr->rit;
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-05-08 09:08:59 +00:00
|
|
|
static int dummy_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit)
|
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2002-01-22 00:43:05 +00:00
|
|
|
curr->xit = xit;
|
2001-05-08 09:08:59 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int dummy_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit)
|
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
|
|
|
*xit = curr->xit;
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2001-05-08 09:08:59 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-02-14 00:59:02 +00:00
|
|
|
static int dummy_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts)
|
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2002-01-22 00:43:05 +00:00
|
|
|
curr->tuning_step = ts;
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int dummy_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts)
|
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
|
|
|
*ts = curr->tuning_step;
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-01-22 00:43:05 +00:00
|
|
|
static int dummy_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s %d\n",__FUNCTION__,
|
2004-05-17 21:09:45 +00:00
|
|
|
rig_strfunc(func), status);
|
2002-01-22 00:43:05 +00:00
|
|
|
if (func < RIG_SETTING_MAX) {
|
|
|
|
if (status)
|
|
|
|
curr->funcs |= func;
|
|
|
|
else
|
|
|
|
curr->funcs &= ~func;
|
|
|
|
}
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-01-22 00:43:05 +00:00
|
|
|
static int dummy_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
|
|
|
if (func < RIG_SETTING_MAX)
|
|
|
|
*status = curr->funcs & func ? 1 : 0;
|
|
|
|
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n",__FUNCTION__,
|
2004-05-17 21:09:45 +00:00
|
|
|
rig_strfunc(func));
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-01-22 00:43:05 +00:00
|
|
|
static int dummy_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
|
|
|
int idx;
|
2002-01-22 00:43:05 +00:00
|
|
|
char lstr[32];
|
|
|
|
|
2002-02-15 00:12:44 +00:00
|
|
|
idx = rig_setting2idx(level);
|
|
|
|
if (idx < RIG_SETTING_MAX)
|
|
|
|
curr->levels[idx] = val;
|
|
|
|
|
2002-01-22 00:43:05 +00:00
|
|
|
if (RIG_LEVEL_IS_FLOAT(level))
|
|
|
|
sprintf(lstr, "%f", val.f);
|
|
|
|
else
|
|
|
|
sprintf(lstr, "%d", val.i);
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s %s\n",__FUNCTION__,
|
2004-05-17 21:09:45 +00:00
|
|
|
rig_strlevel(level), lstr);
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-01-22 00:43:05 +00:00
|
|
|
static int dummy_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
|
|
|
int idx;
|
|
|
|
|
|
|
|
idx = rig_setting2idx(level);
|
2002-01-22 00:43:05 +00:00
|
|
|
|
2002-02-15 00:12:44 +00:00
|
|
|
if (idx < RIG_SETTING_MAX)
|
|
|
|
*val = curr->levels[idx];
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n",__FUNCTION__,
|
2004-05-17 21:09:45 +00:00
|
|
|
rig_strlevel(level));
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-01-22 00:43:05 +00:00
|
|
|
static int dummy_set_powerstat(RIG *rig, powerstat_t status)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
|
|
|
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2002-01-22 00:43:05 +00:00
|
|
|
priv->powerstat = status;
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-01-22 00:43:05 +00:00
|
|
|
static int dummy_get_powerstat(RIG *rig, powerstat_t *status)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
|
|
|
|
|
|
|
*status = priv->powerstat;
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-01-22 00:43:05 +00:00
|
|
|
static int dummy_set_parm(RIG *rig, setting_t parm, value_t val)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
int idx;
|
2002-01-22 00:43:05 +00:00
|
|
|
char pstr[32];
|
|
|
|
|
2002-02-15 00:12:44 +00:00
|
|
|
idx = rig_setting2idx(parm);
|
|
|
|
|
2002-01-22 00:43:05 +00:00
|
|
|
if (RIG_PARM_IS_FLOAT(parm))
|
|
|
|
sprintf(pstr, "%f", val.f);
|
|
|
|
else
|
|
|
|
sprintf(pstr, "%d", val.i);
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s %s\n", __FUNCTION__,
|
2004-05-17 21:09:45 +00:00
|
|
|
rig_strparm(parm), pstr);
|
2002-02-15 00:12:44 +00:00
|
|
|
if (idx < RIG_SETTING_MAX)
|
|
|
|
priv->parms[idx] = val;
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-01-22 00:43:05 +00:00
|
|
|
static int dummy_get_parm(RIG *rig, setting_t parm, value_t *val)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
int idx;
|
|
|
|
|
|
|
|
idx = rig_setting2idx(parm);
|
2002-01-22 00:43:05 +00:00
|
|
|
|
2002-02-15 00:12:44 +00:00
|
|
|
if (idx < RIG_SETTING_MAX)
|
|
|
|
*val = priv->parms[idx];
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called %s\n",__FUNCTION__,
|
2004-05-17 21:09:45 +00:00
|
|
|
rig_strparm(parm));
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-01-22 00:43:05 +00:00
|
|
|
static int dummy_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
|
|
|
curr->ant = ant;
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2002-01-22 00:43:05 +00:00
|
|
|
static int dummy_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2002-01-22 00:43:05 +00:00
|
|
|
*ant = curr->ant;
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int dummy_set_bank(RIG *rig, vfo_t vfo, int bank)
|
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
|
|
|
|
|
|
|
priv->bank = bank;
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int dummy_set_mem(RIG *rig, vfo_t vfo, int ch)
|
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
|
|
|
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2002-02-15 00:12:44 +00:00
|
|
|
|
|
|
|
if (priv->curr_vfo == RIG_VFO_MEM)
|
|
|
|
priv->curr = &priv->mem[ch];
|
|
|
|
else
|
|
|
|
priv->curr->channel_num = ch;
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int dummy_get_mem(RIG *rig, vfo_t vfo, int *ch)
|
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
2002-02-15 00:12:44 +00:00
|
|
|
channel_t *curr = priv->curr;
|
2002-01-22 00:43:05 +00:00
|
|
|
|
|
|
|
*ch = curr->channel_num;
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
2002-01-22 00:43:05 +00:00
|
|
|
static int dummy_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
|
|
|
|
{
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s %d\n",__FUNCTION__,
|
2004-05-17 21:09:45 +00:00
|
|
|
rig_strscan(scan), ch);
|
2002-01-22 00:43:05 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
2001-02-14 00:59:02 +00:00
|
|
|
|
2002-02-15 00:12:44 +00:00
|
|
|
static void chan_vfo(channel_t *chan, vfo_t vfo)
|
|
|
|
{
|
|
|
|
chan->vfo = vfo;
|
2004-05-17 21:09:45 +00:00
|
|
|
strcpy(chan->channel_desc, rig_strvfo(vfo));
|
2002-02-15 00:12:44 +00:00
|
|
|
}
|
|
|
|
|
2001-06-03 19:54:05 +00:00
|
|
|
static int dummy_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
|
|
|
|
{
|
2002-02-15 00:12:44 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
|
|
|
channel_t *curr = priv->curr;
|
2003-02-23 22:43:01 +00:00
|
|
|
int ret;
|
|
|
|
freq_t freq;
|
|
|
|
shortfreq_t ts;
|
2002-02-15 00:12:44 +00:00
|
|
|
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n",__FUNCTION__,
|
2004-05-17 21:09:45 +00:00
|
|
|
rig_strvfop(op));
|
2001-02-14 00:59:02 +00:00
|
|
|
|
2002-02-15 00:12:44 +00:00
|
|
|
switch (op) {
|
|
|
|
case RIG_OP_FROM_VFO: /* VFO->MEM */
|
|
|
|
if (priv->curr_vfo == RIG_VFO_MEM) {
|
|
|
|
int ch = curr->channel_num;
|
|
|
|
memcpy(curr, priv->last_vfo == RIG_VFO_A ?
|
|
|
|
&priv->vfo_a : &priv->vfo_b, sizeof(channel_t));
|
|
|
|
curr->channel_num = ch;
|
|
|
|
curr->channel_desc[0] = '\0';
|
|
|
|
curr->vfo = RIG_VFO_MEM;
|
|
|
|
} else {
|
|
|
|
channel_t *mem_chan = &priv->mem[curr->channel_num];
|
|
|
|
memcpy(mem_chan, curr, sizeof(channel_t));
|
|
|
|
mem_chan->channel_num = curr->channel_num;
|
|
|
|
mem_chan->channel_desc[0] = '\0';
|
|
|
|
mem_chan->vfo = RIG_VFO_MEM;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case RIG_OP_TO_VFO: /* MEM->VFO */
|
|
|
|
if (priv->curr_vfo == RIG_VFO_MEM) {
|
|
|
|
channel_t *vfo_chan = (priv->last_vfo == RIG_VFO_A) ?
|
|
|
|
&priv->vfo_a : &priv->vfo_b;
|
|
|
|
memcpy(vfo_chan, curr, sizeof(channel_t));
|
|
|
|
chan_vfo(vfo_chan, priv->last_vfo);
|
|
|
|
} else {
|
|
|
|
memcpy(&priv->mem[curr->channel_num],
|
|
|
|
curr, sizeof(channel_t));
|
|
|
|
chan_vfo(curr, priv->curr_vfo);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case RIG_OP_CPY: /* VFO A = VFO B or VFO B = VFO A */
|
|
|
|
if (priv->curr_vfo == RIG_VFO_A) {
|
|
|
|
memcpy(&priv->vfo_b, &priv->vfo_a, sizeof(channel_t));
|
|
|
|
chan_vfo(&priv->vfo_b, RIG_VFO_B);
|
|
|
|
break;
|
|
|
|
} else if (priv->curr_vfo == RIG_VFO_B) {
|
|
|
|
memcpy(&priv->vfo_a, &priv->vfo_b, sizeof(channel_t));
|
|
|
|
chan_vfo(&priv->vfo_a, RIG_VFO_A);
|
|
|
|
break;
|
|
|
|
}
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s beep!\n", __FUNCTION__ );
|
2002-02-15 00:12:44 +00:00
|
|
|
break;
|
|
|
|
case RIG_OP_XCHG: /* Exchange VFO A/B */
|
|
|
|
{
|
|
|
|
channel_t chan;
|
|
|
|
memcpy(&chan, &priv->vfo_b, sizeof(channel_t));
|
|
|
|
memcpy(&priv->vfo_b, &priv->vfo_a, sizeof(channel_t));
|
|
|
|
memcpy(&priv->vfo_a, &chan, sizeof(channel_t));
|
|
|
|
chan_vfo(&priv->vfo_a, RIG_VFO_A);
|
|
|
|
chan_vfo(&priv->vfo_b, RIG_VFO_B);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case RIG_OP_MCL: /* Memory clear */
|
|
|
|
if (priv->curr_vfo == RIG_VFO_MEM) {
|
|
|
|
int ch = curr->channel_num;
|
|
|
|
memset(curr, 0, sizeof(channel_t));
|
|
|
|
curr->channel_num = ch;
|
|
|
|
curr->vfo = RIG_VFO_MEM;
|
|
|
|
} else {
|
|
|
|
channel_t *mem_chan = &priv->mem[curr->channel_num];
|
|
|
|
memset(mem_chan, 0, sizeof(channel_t));
|
|
|
|
mem_chan->channel_num = curr->channel_num;
|
|
|
|
mem_chan->vfo = RIG_VFO_MEM;
|
|
|
|
}
|
|
|
|
break;
|
2003-02-23 22:43:01 +00:00
|
|
|
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;
|
2002-02-15 00:12:44 +00:00
|
|
|
}
|
|
|
|
|
2001-06-03 19:54:05 +00:00
|
|
|
return RIG_OK;
|
|
|
|
}
|
2001-02-14 00:59:02 +00:00
|
|
|
|
2002-08-16 17:43:02 +00:00
|
|
|
static int dummy_set_channel(RIG *rig, const channel_t *chan)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
|
|
|
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2002-10-03 20:13:35 +00:00
|
|
|
|
|
|
|
/* TODO: check chan->channel_num is in a valid range */
|
|
|
|
switch (chan->vfo) {
|
|
|
|
case RIG_VFO_MEM:
|
|
|
|
memcpy(&priv->mem[chan->channel_num], chan, sizeof(channel_t));
|
|
|
|
break;
|
|
|
|
case RIG_VFO_A:
|
|
|
|
memcpy(&priv->vfo_a, chan, sizeof(channel_t));
|
|
|
|
break;
|
|
|
|
case RIG_VFO_B:
|
|
|
|
memcpy(&priv->vfo_b, chan, sizeof(channel_t));
|
|
|
|
break;
|
|
|
|
case RIG_VFO_CURR:
|
|
|
|
memcpy(priv->curr, chan, sizeof(channel_t));
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return -RIG_EINVAL;
|
|
|
|
}
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static int dummy_get_channel(RIG *rig, channel_t *chan)
|
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
|
|
|
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2001-02-14 00:59:02 +00:00
|
|
|
|
2002-10-03 20:13:35 +00:00
|
|
|
/* TODO: check chan->channel_num is in a valid range */
|
|
|
|
switch (chan->vfo) {
|
|
|
|
case RIG_VFO_MEM:
|
|
|
|
memcpy(chan, &priv->mem[chan->channel_num], sizeof(channel_t));
|
|
|
|
break;
|
|
|
|
case RIG_VFO_A:
|
|
|
|
memcpy(chan, &priv->vfo_a, sizeof(channel_t));
|
|
|
|
break;
|
|
|
|
case RIG_VFO_B:
|
|
|
|
memcpy(chan, &priv->vfo_b, sizeof(channel_t));
|
|
|
|
break;
|
|
|
|
case RIG_VFO_CURR:
|
|
|
|
memcpy(chan, priv->curr, sizeof(channel_t));
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return -RIG_EINVAL;
|
|
|
|
}
|
|
|
|
|
2001-02-14 00:59:02 +00:00
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-12-20 07:46:13 +00:00
|
|
|
static int dummy_set_trn(RIG *rig, int trn)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-12-20 07:46:13 +00:00
|
|
|
static int dummy_get_trn(RIG *rig, int *trn)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-01-22 00:43:05 +00:00
|
|
|
*trn = RIG_TRN_OFF;
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
2001-06-02 18:11:21 +00:00
|
|
|
static const char *dummy_get_info(RIG *rig)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2001-02-14 00:59:02 +00:00
|
|
|
|
2002-01-22 00:43:05 +00:00
|
|
|
return "Nothing much (dummy)";
|
2001-02-14 00:59:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-05-08 09:08:59 +00:00
|
|
|
static int dummy_send_dtmf(RIG *rig, vfo_t vfo, const char *digits)
|
|
|
|
{
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, digits);
|
2001-05-08 09:08:59 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int dummy_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length)
|
|
|
|
{
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __FUNCTION__);
|
2002-01-22 00:43:05 +00:00
|
|
|
strcpy(digits, "0123456789ABCDEF");
|
|
|
|
*length = 16;
|
2001-05-08 09:08:59 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int dummy_send_morse(RIG *rig, vfo_t vfo, const char *msg)
|
|
|
|
{
|
2002-07-08 22:53:27 +00:00
|
|
|
rig_debug(RIG_DEBUG_VERBOSE,"%s called: %s\n", __FUNCTION__, msg);
|
2001-05-08 09:08:59 +00:00
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|
|
|
|
|
2001-02-14 00:59:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Dummy rig capabilities.
|
|
|
|
*/
|
|
|
|
|
2004-01-15 22:43:59 +00:00
|
|
|
#if 0
|
2002-01-22 00:43:05 +00:00
|
|
|
#define DUMMY_FUNC 0x7fffffffffffffLL /* has it all */
|
|
|
|
#define DUMMY_LEVEL 0x7ffffffffffffffLL
|
|
|
|
#define DUMMY_PARM 0x7ffffffffffffffLL
|
2004-01-15 22:43:59 +00:00
|
|
|
#else
|
|
|
|
#define DUMMY_FUNC ((setting_t)-1) /* has it all */
|
|
|
|
#define DUMMY_LEVEL ((setting_t)-1)
|
|
|
|
#define DUMMY_PARM ((setting_t)-1)
|
|
|
|
#endif
|
|
|
|
|
2002-01-22 00:43:05 +00:00
|
|
|
#define DUMMY_VFO_OP 0x7ffffffL
|
|
|
|
#define DUMMY_SCAN 0x7ffffffL
|
2001-02-14 00:59:02 +00:00
|
|
|
|
2001-12-26 23:37:46 +00:00
|
|
|
#define DUMMY_MODES (RIG_MODE_AM | RIG_MODE_CW | RIG_MODE_RTTY | \
|
|
|
|
RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_WFM)
|
2001-02-14 00:59:02 +00:00
|
|
|
|
2002-11-04 22:36:57 +00:00
|
|
|
#define DUMMY_MEM_CAP { \
|
|
|
|
.bank_num = 1, \
|
|
|
|
.vfo = 1, \
|
|
|
|
.ant = 1, \
|
|
|
|
.freq = 1, \
|
|
|
|
.mode = 1, \
|
|
|
|
.width = 1, \
|
|
|
|
.tx_freq = 1, \
|
|
|
|
.tx_mode = 1, \
|
|
|
|
.tx_width = 1, \
|
|
|
|
.split = 1, \
|
|
|
|
.rptr_shift = 1, \
|
|
|
|
.rptr_offs = 1, \
|
|
|
|
.tuning_step = 1, \
|
|
|
|
.rit = 1, \
|
|
|
|
.xit = 1, \
|
|
|
|
.funcs = 1, \
|
|
|
|
.levels = 1, \
|
|
|
|
.ctcss_tone = 1, \
|
|
|
|
.ctcss_sql = 1, \
|
|
|
|
.dcs_code = 1, \
|
|
|
|
.dcs_sql = 1, \
|
|
|
|
.scan_group = 1, \
|
|
|
|
.flags = 1, \
|
|
|
|
.channel_desc = 1, \
|
|
|
|
.ext_levels = 1, \
|
|
|
|
}
|
|
|
|
|
2001-02-14 00:59:02 +00:00
|
|
|
const struct rig_caps dummy_caps = {
|
2002-08-16 17:43:02 +00:00
|
|
|
.rig_model = RIG_MODEL_DUMMY,
|
|
|
|
.model_name = "Dummy",
|
|
|
|
.mfg_name = "Hamlib",
|
2002-11-04 22:36:57 +00:00
|
|
|
.version = "0.2",
|
2002-08-16 17:43:02 +00:00
|
|
|
.copyright = "LGPL",
|
|
|
|
.status = RIG_STATUS_BETA,
|
|
|
|
.rig_type = RIG_TYPE_OTHER,
|
|
|
|
.targetable_vfo = 0,
|
|
|
|
.ptt_type = RIG_PTT_RIG,
|
|
|
|
.dcd_type = RIG_DCD_RIG,
|
|
|
|
.port_type = RIG_PORT_NONE,
|
|
|
|
.has_get_func = DUMMY_FUNC,
|
|
|
|
.has_set_func = DUMMY_FUNC,
|
|
|
|
.has_get_level = DUMMY_LEVEL,
|
|
|
|
.has_set_level = RIG_LEVEL_SET(DUMMY_LEVEL),
|
|
|
|
.has_get_parm = DUMMY_PARM,
|
|
|
|
.has_set_parm = RIG_PARM_SET(DUMMY_PARM),
|
2003-12-08 08:46:11 +00:00
|
|
|
.level_gran = { [LVL_CWPITCH] = { .step = { .i = 10 } } },
|
2002-08-16 17:43:02 +00:00
|
|
|
.ctcss_list = common_ctcss_list,
|
|
|
|
.dcs_list = full_dcs_list,
|
|
|
|
.chan_list = {
|
2002-11-04 22:36:57 +00:00
|
|
|
{ 0, 18, RIG_MTYPE_MEM, DUMMY_MEM_CAP },
|
|
|
|
{ 19, 19, RIG_MTYPE_CALL },
|
|
|
|
{ 20, 21, RIG_MTYPE_EDGE },
|
2002-08-16 17:43:02 +00:00
|
|
|
RIG_CHAN_END,
|
|
|
|
},
|
|
|
|
.scan_ops = DUMMY_SCAN,
|
|
|
|
.vfo_ops = DUMMY_VFO_OP,
|
|
|
|
.transceive = RIG_TRN_OFF,
|
|
|
|
.attenuator = { 10, 20, 30, RIG_DBLST_END, },
|
|
|
|
.preamp = { 10, RIG_DBLST_END, },
|
|
|
|
.rx_range_list2 = { {.start=kHz(150),.end=MHz(1500),.modes=DUMMY_MODES,
|
|
|
|
.low_power=-1,.high_power=-1,RIG_VFO_A|RIG_VFO_B},
|
2001-02-14 00:59:02 +00:00
|
|
|
RIG_FRNG_END, },
|
2002-08-16 17:43:02 +00:00
|
|
|
.tx_range_list2 = { RIG_FRNG_END, },
|
2003-02-23 22:43:01 +00:00
|
|
|
.tuning_steps = { {DUMMY_MODES,1}, {DUMMY_MODES,RIG_TS_ANY}, RIG_TS_END, },
|
2002-11-04 22:36:57 +00:00
|
|
|
.filters = {
|
|
|
|
{RIG_MODE_SSB|RIG_MODE_CW|RIG_MODE_RTTY, kHz(2.4)},
|
|
|
|
{RIG_MODE_CW, Hz(500)},
|
|
|
|
{RIG_MODE_AM, kHz(8)},
|
|
|
|
{RIG_MODE_AM, kHz(2.4)},
|
|
|
|
{RIG_MODE_FM, kHz(15)},
|
|
|
|
{RIG_MODE_FM, kHz(8)},
|
|
|
|
{RIG_MODE_WFM, kHz(230)},
|
|
|
|
RIG_FLT_END,
|
|
|
|
},
|
2006-07-02 17:05:26 +00:00
|
|
|
.max_rit = 9990,
|
|
|
|
.max_xit = 9990,
|
|
|
|
.max_ifshift = 10000,
|
2002-08-16 17:43:02 +00:00
|
|
|
.priv = NULL, /* priv */
|
|
|
|
|
|
|
|
.rig_init = dummy_init,
|
|
|
|
.rig_cleanup = dummy_cleanup,
|
|
|
|
.rig_open = dummy_open,
|
|
|
|
.rig_close = dummy_close,
|
|
|
|
|
|
|
|
.set_freq = dummy_set_freq,
|
|
|
|
.get_freq = dummy_get_freq,
|
|
|
|
.set_mode = dummy_set_mode,
|
|
|
|
.get_mode = dummy_get_mode,
|
|
|
|
.set_vfo = dummy_set_vfo,
|
|
|
|
.get_vfo = dummy_get_vfo,
|
2001-02-14 00:59:02 +00:00
|
|
|
|
2002-08-16 17:43:02 +00:00
|
|
|
.set_powerstat = dummy_set_powerstat,
|
|
|
|
.get_powerstat = dummy_get_powerstat,
|
|
|
|
.set_level = dummy_set_level,
|
|
|
|
.get_level = dummy_get_level,
|
|
|
|
.set_func = dummy_set_func,
|
|
|
|
.get_func = dummy_get_func,
|
|
|
|
.set_parm = dummy_set_parm,
|
|
|
|
.get_parm = dummy_get_parm,
|
|
|
|
|
|
|
|
.get_info = dummy_get_info,
|
|
|
|
|
|
|
|
|
|
|
|
.set_ptt = dummy_set_ptt,
|
|
|
|
.get_ptt = dummy_get_ptt,
|
|
|
|
.get_dcd = dummy_get_dcd,
|
|
|
|
.set_rptr_shift = dummy_set_rptr_shift,
|
|
|
|
.get_rptr_shift = dummy_get_rptr_shift,
|
|
|
|
.set_rptr_offs = dummy_set_rptr_offs,
|
|
|
|
.get_rptr_offs = dummy_get_rptr_offs,
|
|
|
|
.set_ctcss_tone = dummy_set_ctcss_tone,
|
|
|
|
.get_ctcss_tone = dummy_get_ctcss_tone,
|
|
|
|
.set_dcs_code = dummy_set_dcs_code,
|
|
|
|
.get_dcs_code = dummy_get_dcs_code,
|
|
|
|
.set_ctcss_sql = dummy_set_ctcss_sql,
|
|
|
|
.get_ctcss_sql = dummy_get_ctcss_sql,
|
|
|
|
.set_dcs_sql = dummy_set_dcs_sql,
|
|
|
|
.get_dcs_sql = dummy_get_dcs_sql,
|
|
|
|
.set_split_freq = dummy_set_split_freq,
|
|
|
|
.get_split_freq = dummy_get_split_freq,
|
|
|
|
.set_split_mode = dummy_set_split_mode,
|
|
|
|
.get_split_mode = dummy_get_split_mode,
|
2003-04-06 18:40:36 +00:00
|
|
|
.set_split_vfo = dummy_set_split_vfo,
|
|
|
|
.get_split_vfo = dummy_get_split_vfo,
|
2002-08-16 17:43:02 +00:00
|
|
|
.set_rit = dummy_set_rit,
|
|
|
|
.get_rit = dummy_get_rit,
|
|
|
|
.set_xit = dummy_set_xit,
|
|
|
|
.get_xit = dummy_get_xit,
|
|
|
|
.set_ts = dummy_set_ts,
|
|
|
|
.get_ts = dummy_get_ts,
|
|
|
|
.set_ant = dummy_set_ant,
|
|
|
|
.get_ant = dummy_get_ant,
|
|
|
|
.set_bank = dummy_set_bank,
|
|
|
|
.set_mem = dummy_set_mem,
|
|
|
|
.get_mem = dummy_get_mem,
|
|
|
|
.vfo_op = dummy_vfo_op,
|
|
|
|
.scan = dummy_scan,
|
|
|
|
.send_dtmf = dummy_send_dtmf,
|
|
|
|
.recv_dtmf = dummy_recv_dtmf,
|
|
|
|
.send_morse = dummy_send_morse,
|
|
|
|
.set_channel = dummy_set_channel,
|
|
|
|
.get_channel = dummy_get_channel,
|
|
|
|
.set_trn = dummy_set_trn,
|
|
|
|
.get_trn = dummy_get_trn,
|
2001-02-14 00:59:02 +00:00
|
|
|
};
|
|
|
|
|
2003-04-16 22:30:43 +00:00
|
|
|
DECLARE_INITRIG_BACKEND(dummy)
|
2001-02-14 00:59:02 +00:00
|
|
|
{
|
|
|
|
rig_debug(RIG_DEBUG_VERBOSE, "dummy: _init called\n");
|
|
|
|
|
|
|
|
rig_register(&dummy_caps);
|
|
|
|
|
|
|
|
return RIG_OK;
|
|
|
|
}
|