* all the API functions are now targetted to a particular VFO.

This is a major change in the library interface, and the implementation
  is not complete yet (especially in the backends), but the API should
  be fine. Anyway, at this stage of developement, interface design
  experimenting matters more than completeness.
* added new shortfreq_t type for frequencies on 31bits (up to 2GHz)
  for use by offset/shifts/etc.


git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@285 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.1.0
Stéphane Fillod, F8CFE 2000-12-05 22:01:03 +00:00
rodzic ceea07953d
commit b864758580
6 zmienionych plików z 264 dodań i 222 usunięć

Wyświetl plik

@ -6,7 +6,7 @@
* via serial interface to an AOR scanner.
*
*
* $Id: aor.c,v 1.2 2000-12-04 23:39:17 f4cfe Exp $
* $Id: aor.c,v 1.3 2000-12-05 22:01:00 f4cfe Exp $
*
*
*
@ -115,7 +115,7 @@ int aor_close(RIG *rig)
* aor_set_freq
* Assumes rig!=NULL
*/
int aor_set_freq(RIG *rig, freq_t freq)
int aor_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
{
unsigned char freqbuf[16], ackbuf[16];
int freq_len,ack_len;
@ -141,7 +141,7 @@ int aor_set_freq(RIG *rig, freq_t freq)
* aor_get_freq
* Assumes rig!=NULL, freq!=NULL
*/
int aor_get_freq(RIG *rig, freq_t *freq)
int aor_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
{
unsigned char freqbuf[16];
char *rfp;
@ -159,7 +159,7 @@ int aor_get_freq(RIG *rig, freq_t *freq)
* aor_set_mode
* Assumes rig!=NULL
*/
int aor_set_mode(RIG *rig, rmode_t mode, pbwidth_t width)
int aor_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
unsigned char mdbuf[16],ackbuf[16];
int mdbuf_len,ack_len,aormode;
@ -215,7 +215,7 @@ int aor_set_mode(RIG *rig, rmode_t mode, pbwidth_t width)
* aor_get_mode
* Assumes rig!=NULL, mode!=NULL
*/
int aor_get_mode(RIG *rig, rmode_t *mode, pbwidth_t *width)
int aor_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
{
unsigned char ackbuf[16];
int ack_len;
@ -264,7 +264,7 @@ int aor_get_mode(RIG *rig, rmode_t *mode, pbwidth_t *width)
* aor_set_ts
* Assumes rig!=NULL
*/
int aor_set_ts(RIG *rig, unsigned long ts)
int aor_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts)
{
unsigned char tsbuf[16],ackbuf[16];
int ts_len, ack_len;
@ -316,4 +316,3 @@ int init_aor(void *be_handle)
}

Wyświetl plik

@ -6,7 +6,7 @@
* via serial interface to an AOR scanner.
*
*
* $Id: aor.h,v 1.2 2000-12-04 23:39:17 f4cfe Exp $
* $Id: aor.h,v 1.3 2000-12-05 22:01:00 f4cfe Exp $
*
*
* This program is free software; you can redistribute it and/or
@ -31,12 +31,12 @@
int aor_close(RIG *rig);
int aor_set_freq(RIG *rig, freq_t freq);
int aor_get_freq(RIG *rig, freq_t *freq);
int aor_set_mode(RIG *rig, rmode_t mode, pbwidth_t width);
int aor_get_mode(RIG *rig, rmode_t *mode, pbwidth_t *width);
int aor_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
int aor_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
int aor_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
int aor_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
int aor_set_ts(RIG *rig, unsigned long ts);
int aor_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts);
int aor_set_poweroff(RIG *rig);
extern const struct rig_caps ar8200_caps;

Wyświetl plik

@ -6,7 +6,7 @@
* via serial interface to an ICOM using the "CI-V" interface.
*
*
* $Id: icom.c,v 1.10 2000-12-04 23:39:17 f4cfe Exp $
* $Id: icom.c,v 1.11 2000-12-05 22:01:02 f4cfe Exp $
*
*
*
@ -278,7 +278,7 @@ int icom_cleanup(RIG *rig)
* icom_set_freq
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int icom_set_freq(RIG *rig, freq_t freq)
int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
{
struct icom_priv_data *priv;
struct rig_state *rig_s;
@ -310,7 +310,7 @@ int icom_set_freq(RIG *rig, freq_t freq)
* icom_get_freq
* Assumes rig!=NULL, rig->state.priv!=NULL, freq!=NULL
*/
int icom_get_freq(RIG *rig, freq_t *freq)
int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
{
struct icom_priv_data *priv;
struct rig_state *rig_s;
@ -354,7 +354,7 @@ int icom_get_freq(RIG *rig, freq_t *freq)
* icom_set_mode
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int icom_set_mode(RIG *rig, rmode_t mode, pbwidth_t width)
int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
struct icom_priv_data *priv;
struct rig_state *rig_s;
@ -381,7 +381,7 @@ int icom_set_mode(RIG *rig, rmode_t mode, pbwidth_t width)
* icom_get_mode
* Assumes rig!=NULL, rig->state.priv!=NULL, mode!=NULL, width!=NULL
*/
int icom_get_mode(RIG *rig, rmode_t *mode, pbwidth_t *width)
int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
{
struct icom_priv_data *priv;
struct rig_state *rig_s;
@ -445,7 +445,7 @@ int icom_set_vfo(RIG *rig, vfo_t vfo)
* icom_get_strength
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int icom_set_level(RIG *rig, setting_t level, value_t val)
int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
return -RIG_ENIMPL;
}
@ -454,7 +454,7 @@ int icom_set_level(RIG *rig, setting_t level, value_t val)
* icom_get_strength
* Assumes rig!=NULL, rig->state.priv!=NULL, val!=NULL
*/
int icom_get_level(RIG *rig, setting_t level, value_t *val)
int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
struct icom_priv_data *priv;
struct rig_state *rig_s;
@ -606,7 +606,7 @@ int icom_get_level(RIG *rig, setting_t level, value_t *val)
* icom_set_ptt
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int icom_set_ptt(RIG *rig, ptt_t ptt)
int icom_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
{
struct icom_priv_data *priv;
struct rig_state *rig_s;
@ -633,7 +633,7 @@ int icom_set_ptt(RIG *rig, ptt_t ptt)
* icom_get_ptt
* Assumes rig!=NULL, rig->state.priv!=NULL, ptt!=NULL
*/
int icom_get_ptt(RIG *rig, ptt_t *ptt)
int icom_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
{
struct icom_priv_data *priv;
struct rig_state *rig_s;
@ -664,7 +664,7 @@ int icom_get_ptt(RIG *rig, ptt_t *ptt)
* icom_set_rptr_shift
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int icom_set_rptr_shift(RIG *rig, rptr_shift_t rptr_shift)
int icom_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift)
{
struct icom_priv_data *priv;
struct rig_state *rig_s;
@ -706,7 +706,7 @@ int icom_set_rptr_shift(RIG *rig, rptr_shift_t rptr_shift)
* icom_get_rptr_shift
* Assumes rig!=NULL, rig->state.priv!=NULL, rptr_shift!=NULL
*/
int icom_get_rptr_shift(RIG *rig, rptr_shift_t *rptr_shift)
int icom_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift)
{
struct icom_priv_data *priv;
struct rig_state *rig_s;
@ -750,7 +750,7 @@ int icom_get_rptr_shift(RIG *rig, rptr_shift_t *rptr_shift)
* icom_set_rptr_offs
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int icom_set_rptr_offs(RIG *rig, unsigned long rptr_offs)
int icom_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs)
{
struct icom_priv_data *priv;
struct rig_state *rig_s;
@ -781,7 +781,7 @@ int icom_set_rptr_offs(RIG *rig, unsigned long rptr_offs)
* icom_get_rptr_offs
* Assumes rig!=NULL, rig->state.priv!=NULL, rptr_offs!=NULL
*/
int icom_get_rptr_offs(RIG *rig, unsigned long *rptr_offs)
int icom_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs)
{
struct icom_priv_data *priv;
struct rig_state *rig_s;
@ -818,14 +818,14 @@ int icom_get_rptr_offs(RIG *rig, unsigned long *rptr_offs)
* icom_set_vfo,icom_set_freq works for this rig
* FIXME: status
*/
int icom_set_split_freq(RIG *rig, freq_t rx_freq, freq_t tx_freq)
int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t rx_freq, freq_t tx_freq)
{
int status;
status = icom_set_vfo(rig, RIG_VFO_B);
status |= icom_set_freq(rig, tx_freq);
status |= icom_set_freq(rig, RIG_VFO_CURR, tx_freq);
status |= icom_set_vfo(rig, RIG_VFO_A);
status |= icom_set_freq(rig, rx_freq);
status |= icom_set_freq(rig, RIG_VFO_CURR, rx_freq);
return status;
}
@ -836,14 +836,14 @@ int icom_set_split_freq(RIG *rig, freq_t rx_freq, freq_t tx_freq)
* icom_set_vfo,icom_get_freq works for this rig
* FIXME: status
*/
int icom_get_split_freq(RIG *rig, freq_t *rx_freq, freq_t *tx_freq)
int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *rx_freq, freq_t *tx_freq)
{
int status;
status = icom_set_vfo(rig, RIG_VFO_B);
status |= icom_get_freq(rig, tx_freq);
status |= icom_get_freq(rig, RIG_VFO_CURR, tx_freq);
status |= icom_set_vfo(rig, RIG_VFO_A);
status |= icom_get_freq(rig, rx_freq);
status |= icom_get_freq(rig, RIG_VFO_CURR, rx_freq);
return status;
}
@ -852,7 +852,7 @@ int icom_get_split_freq(RIG *rig, freq_t *rx_freq, freq_t *tx_freq)
* icom_set_split
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int icom_set_split(RIG *rig, split_t split)
int icom_set_split(RIG *rig, vfo_t vfo, split_t split)
{
struct icom_priv_data *priv;
struct rig_state *rig_s;
@ -891,7 +891,7 @@ int icom_set_split(RIG *rig, split_t split)
* icom_get_split
* Assumes rig!=NULL, rig->state.priv!=NULL, split!=NULL
*/
int icom_get_split(RIG *rig, split_t *split)
int icom_get_split(RIG *rig, vfo_t vfo, split_t *split)
{
struct icom_priv_data *priv;
struct rig_state *rig_s;
@ -932,7 +932,7 @@ int icom_get_split(RIG *rig, split_t *split)
* icom_set_ts
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int icom_set_ts(RIG *rig, unsigned long ts)
int icom_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts)
{
struct icom_priv_data *priv;
struct rig_state *rig_s;
@ -968,7 +968,7 @@ int icom_set_ts(RIG *rig, unsigned long ts)
* icom_get_ts
* Assumes rig!=NULL, rig->state.priv!=NULL, ts!=NULL
*/
int icom_get_ts(RIG *rig, unsigned long *ts)
int icom_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts)
{
struct icom_priv_data *priv;
struct rig_state *rig_s;
@ -1147,7 +1147,7 @@ int icom_set_poweroff(RIG *rig)
* icom_set_mem
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int icom_set_mem(RIG *rig, int ch)
int icom_set_mem(RIG *rig, vfo_t vfo, int ch)
{
struct icom_priv_data *priv;
struct rig_state *rig_s;
@ -1174,7 +1174,7 @@ int icom_set_mem(RIG *rig, int ch)
* icom_set_bank
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int icom_set_bank(RIG *rig, int bank)
int icom_set_bank(RIG *rig, vfo_t vfo, int bank)
{
struct icom_priv_data *priv;
struct rig_state *rig_s;
@ -1201,7 +1201,7 @@ int icom_set_bank(RIG *rig, int bank)
* icom_mv_ctl, Mem/VFO operation
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int icom_mv_ctl(RIG *rig, mv_op_t op)
int icom_mv_ctl(RIG *rig, vfo_t vfo, mv_op_t op)
{
struct icom_priv_data *priv;
struct rig_state *rig_s;
@ -1302,14 +1302,14 @@ int icom_decode_event(RIG *rig)
/* TODO: check the read freq len is 4 or 5 bytes */
if (rig->callbacks.freq_event) {
freq = from_bcd(buf+5, (priv->civ_731_mode ? 4:5)*2);
return rig->callbacks.freq_event(rig,freq);
return rig->callbacks.freq_event(rig,RIG_VFO_CURR,freq);
} else
return -RIG_ENAVAIL;
break;
case C_SND_MODE:
if (rig->callbacks.mode_event) {
icom2hamlib_mode(buf[5]| buf[6]<<8, &mode, &width);
return rig->callbacks.mode_event(rig,mode,width);
return rig->callbacks.mode_event(rig,RIG_VFO_CURR,mode,width);
} else
return -RIG_ENAVAIL;
break;

Wyświetl plik

@ -6,7 +6,7 @@
* via serial interface to an ICOM using the "CI-V" interface.
*
*
* $Id: icom.h,v 1.9 2000-12-04 23:39:17 f4cfe Exp $
* $Id: icom.h,v 1.10 2000-12-05 22:01:02 f4cfe Exp $
*
*
* This program is free software; you can redistribute it and/or
@ -28,9 +28,11 @@
#ifndef _ICOM_H
#define _ICOM_H 1
#include <hamlib/rig.h>
struct ts_sc_list {
unsigned long ts; /* tuning step */
shortfreq_t ts; /* tuning step */
unsigned char sc; /* sub command */
};
@ -42,28 +44,28 @@ struct icom_priv_data {
int icom_init(RIG *rig);
int icom_cleanup(RIG *rig);
int icom_set_freq(RIG *rig, freq_t freq);
int icom_get_freq(RIG *rig, freq_t *freq);
int icom_set_mode(RIG *rig, rmode_t mode, pbwidth_t width);
int icom_get_mode(RIG *rig, rmode_t *mode, pbwidth_t *width);
int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
int icom_set_vfo(RIG *rig, vfo_t vfo);
int icom_set_rptr_shift(RIG *rig, rptr_shift_t rptr_shift);
int icom_get_rptr_shift(RIG *rig, rptr_shift_t *rptr_shift);
int icom_set_rptr_offs(RIG *rig, unsigned long rptr_offs);
int icom_get_rptr_offs(RIG *rig, unsigned long *rptr_offs);
int icom_set_split_freq(RIG *rig, freq_t rx_freq, freq_t tx_freq);
int icom_get_split_freq(RIG *rig, freq_t *rx_freq, freq_t *tx_freq);
int icom_set_split(RIG *rig, split_t split);
int icom_get_split(RIG *rig, split_t *split);
int icom_set_ts(RIG *rig, unsigned long ts);
int icom_get_ts(RIG *rig, unsigned long *ts);
int icom_set_ptt(RIG *rig, ptt_t ptt);
int icom_get_ptt(RIG *rig, ptt_t *ptt);
int icom_set_bank(RIG *rig, int bank);
int icom_set_mem(RIG *rig, int ch);
int icom_mv_ctl(RIG *rig, mv_op_t op);
int icom_set_level(RIG *rig, setting_t level, value_t val);
int icom_get_level(RIG *rig, setting_t level, value_t *val);
int icom_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift);
int icom_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift);
int icom_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs);
int icom_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs);
int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t rx_freq, freq_t tx_freq);
int icom_get_split_freq(RIG *rig, vfo_t vfo, freq_t *rx_freq, freq_t *tx_freq);
int icom_set_split(RIG *rig, vfo_t vfo, split_t split);
int icom_get_split(RIG *rig, vfo_t vfo, split_t *split);
int icom_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts);
int icom_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts);
int icom_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
int icom_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
int icom_set_bank(RIG *rig, vfo_t vfo, int bank);
int icom_set_mem(RIG *rig, vfo_t vfo, int ch);
int icom_mv_ctl(RIG *rig, vfo_t vfo, mv_op_t op);
int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int icom_set_channel(RIG *rig, const channel_t *chan);
int icom_get_channel(RIG *rig, channel_t *chan);
int icom_set_poweron(RIG *rig);

Wyświetl plik

@ -5,7 +5,7 @@
* will be used for obtaining rig capabilities.
*
*
* $Id: rig.h,v 1.10 2000-12-04 23:39:17 f4cfe Exp $ *
* $Id: rig.h,v 1.11 2000-12-05 22:01:03 f4cfe Exp $ *
*
*
* This program is free software; you can redistribute it and/or
@ -142,7 +142,9 @@ enum vfo_e {
RIG_VFO_SAT,
RIG_VFO_A = RIG_VFO_MAIN,
RIG_VFO_B = RIG_VFO_SUB,
RIG_VFO_C = RIG_VFO_SAT
RIG_VFO_C = RIG_VFO_SAT,
RIG_VFO_CURR, /* current VFO */
RIG_VFO_ALL /* apply to all VFO (when used as target) */
};
typedef enum vfo_e vfo_t;
@ -266,9 +268,11 @@ typedef unsigned long setting_t; /* 32 bits might not be enough.. */
/*
* frequency type in Hz, must be >32bits for SHF!
* freq_t: frequency type in Hz, must be >32bits for SHF!
* shortfreq_t: frequency on 31bits, suitable for offsets, shifts, etc..
*/
typedef long long freq_t;
typedef signed long shortfreq_t;
#define Hz(f) ((freq_t)(f))
#define KHz(f) ((freq_t)((f)*1000))
@ -281,6 +285,7 @@ typedef long long freq_t;
#define mW(p) ((int)(p))
#define Watts(p) ((int)((p)*1000))
#define KW(p) ((int)((p)*1000000L))
#define MW(p) ((int)((p)*1000000000L)) /* geeez! :) */
typedef unsigned int rmode_t; /* radio mode */
@ -325,7 +330,7 @@ typedef struct freq_range_list freq_range_t;
*/
struct tuning_step_list {
rmode_t modes; /* bitwise OR'ed RIG_MODE_* */
unsigned long ts; /* tuning step in Hz */
shortfreq_t ts; /* tuning step in Hz */
};
@ -340,12 +345,13 @@ struct channel {
int channel_num;
freq_t freq;
rmode_t mode;
pbwidth_t width;
vfo_t vfo;
int power; /* in mW */
int att; /* in db */
int preamp; /* in db */
int ant; /* antenna number */
unsigned long tuning_step; /* */
shortfreq_t tuning_step; /* */
unsigned char channel_desc[MAXCHANDESC];
};
@ -405,7 +411,7 @@ struct rig_caps {
int (*rig_init)(RIG *rig); /* setup *priv */
int (*rig_cleanup)(RIG *rig);
int (*rig_open)(RIG *rig); /* called when port just opened */
int (*rig_close)(RIG *rig); /* called before port is to close */
int (*rig_close)(RIG *rig); /* called before port is to be closed */
int (*rig_probe)(RIG *rig); /* Experimental: may work.. */
/*
@ -413,44 +419,44 @@ struct rig_caps {
* List Set/Get functions pairs
*/
int (*set_freq)(RIG *rig, freq_t freq); /* select freq */
int (*get_freq)(RIG *rig, freq_t *freq); /* get freq */
int (*set_freq)(RIG *rig, vfo_t vfo, freq_t freq); /* select freq */
int (*get_freq)(RIG *rig, vfo_t vfo, freq_t *freq); /* get freq */
int (*set_mode)(RIG *rig, rmode_t mode, pbwidth_t width); /* select mode */
int (*get_mode)(RIG *rig, rmode_t *mode, pbwidth_t *width); /* get mode */
int (*set_mode)(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); /* select mode */
int (*get_mode)(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); /* get mode */
int (*set_vfo)(RIG *rig, vfo_t vfo); /* select vfo (A,B, etc.) */
int (*get_vfo)(RIG *rig, vfo_t *vfo); /* get vfo */
int (*set_ptt)(RIG *rig, ptt_t ptt); /* ptt on/off */
int (*get_ptt)(RIG *rig, ptt_t *ptt); /* get ptt status */
int (*set_ptt)(RIG *rig, vfo_t vfo, ptt_t ptt); /* ptt on/off */
int (*get_ptt)(RIG *rig, vfo_t vfo, ptt_t *ptt); /* get ptt status */
int (*set_rptr_shift)(RIG *rig, rptr_shift_t rptr_shift); /* set repeater shift */
int (*get_rptr_shift)(RIG *rig, rptr_shift_t *rptr_shift); /* get repeater shift */
int (*set_rptr_shift)(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift); /* set repeater shift */
int (*get_rptr_shift)(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift); /* get repeater shift */
int (*set_rptr_offs)(RIG *rig, unsigned long offs);/*set duplex offset freq*/
int (*get_rptr_offs)(RIG *rig, unsigned long *offs);/*get duplex offset freq*/
int (*set_rptr_offs)(RIG *rig, vfo_t vfo, shortfreq_t offs);/*set duplex offset freq*/
int (*get_rptr_offs)(RIG *rig, vfo_t vfo, shortfreq_t *offs);/*get duplex offset freq*/
int (*set_split_freq)(RIG *rig, freq_t rx_freq, freq_t tx_freq);
int (*get_split_freq)(RIG *rig, freq_t *rx_freq, freq_t *tx_freq);
int (*set_split)(RIG *rig, split_t split);
int (*get_split)(RIG *rig, split_t *split);
int (*set_split_freq)(RIG *rig, vfo_t vfo, freq_t rx_freq, freq_t tx_freq);
int (*get_split_freq)(RIG *rig, vfo_t vfo, freq_t *rx_freq, freq_t *tx_freq);
int (*set_split)(RIG *rig, vfo_t vfo, split_t split);
int (*get_split)(RIG *rig, vfo_t vfo, split_t *split);
int (*set_rit)(RIG *rig, signed long rit);
int (*get_rit)(RIG *rig, signed long *rit);
int (*set_rit)(RIG *rig, vfo_t vfo, shortfreq_t rit);
int (*get_rit)(RIG *rig, vfo_t vfo, shortfreq_t *rit);
int (*set_ts)(RIG *rig, unsigned long ts); /* set tuning step */
int (*get_ts)(RIG *rig, unsigned long *ts); /* get tuning step */
int (*set_ts)(RIG *rig, vfo_t vfo, shortfreq_t ts); /* set tuning step */
int (*get_ts)(RIG *rig, vfo_t vfo, shortfreq_t *ts); /* get tuning step */
int (*set_dcs)(RIG *rig, unsigned int code);
int (*get_dcs)(RIG *rig, unsigned int *code);
int (*set_ctcss)(RIG *rig, unsigned int tone);
int (*get_ctcss)(RIG *rig, unsigned int *tone);
int (*set_dcs)(RIG *rig, vfo_t vfo, unsigned int code);
int (*get_dcs)(RIG *rig, vfo_t vfo, unsigned int *code);
int (*set_ctcss)(RIG *rig, vfo_t vfo, unsigned int tone);
int (*get_ctcss)(RIG *rig, vfo_t vfo, unsigned int *tone);
int (*set_dcs_sql)(RIG *rig, unsigned int code);
int (*get_dcs_sql)(RIG *rig, unsigned int *code);
int (*set_ctcss_sql)(RIG *rig, unsigned int tone);
int (*get_ctcss_sql)(RIG *rig, unsigned int *tone);
int (*set_dcs_sql)(RIG *rig, vfo_t vfo, unsigned int code);
int (*get_dcs_sql)(RIG *rig, vfo_t vfo, unsigned int *code);
int (*set_ctcss_sql)(RIG *rig, vfo_t vfo, unsigned int tone);
int (*get_ctcss_sql)(RIG *rig, vfo_t vfo, unsigned int *tone);
/*
* It'd be nice to have a power2mW and mW2power functions
@ -464,19 +470,19 @@ struct rig_caps {
int (*set_poweron)(RIG *rig);
int (*set_poweroff)(RIG *rig);
int (*set_level)(RIG *rig, setting_t level, value_t val);/* set level setting */
int (*get_level)(RIG *rig, setting_t level, value_t *val);/* set level setting*/
int (*set_level)(RIG *rig, vfo_t vfo, setting_t level, value_t val);/* set level setting */
int (*get_level)(RIG *rig, vfo_t vfo, setting_t level, value_t *val);/* set level setting*/
int (*set_func)(RIG *rig, setting_t func, int status); /* activate the function(s) */
int (*get_func)(RIG *rig, setting_t *func); /* get the setting from rig */
int (*set_func)(RIG *rig, vfo_t vfo, setting_t func, int status); /* activate the function(s) */
int (*get_func)(RIG *rig, vfo_t vfo, setting_t *func); /* get the setting from rig */
int (*set_bank)(RIG *rig, int bank); /* set memory bank number */
int (*set_mem)(RIG *rig, int ch); /* set memory channel number */
int (*get_mem)(RIG *rig, int *ch); /* get memory channel number */
int (*mv_ctl)(RIG *rig, mv_op_t op); /* Mem/VFO operation */
int (*set_bank)(RIG *rig, vfo_t vfo, int bank); /* set memory bank number */
int (*set_mem)(RIG *rig, vfo_t vfo, int ch); /* set memory channel number */
int (*get_mem)(RIG *rig, vfo_t vfo, int *ch); /* get memory channel number */
int (*mv_ctl)(RIG *rig, vfo_t vfo, mv_op_t op); /* Mem/VFO operation */
int (*set_trn)(RIG *rig, int trn); /* activate transceive mode on radio */
int (*get_trn)(RIG *rig, int *trn); /* PCR-1000 can do that, ICR75 too */
int (*set_trn)(RIG *rig, vfo_t vfo, int trn); /* activate transceive mode on radio */
int (*get_trn)(RIG *rig, vfo_t vfo, int *trn); /* PCR-1000 can do that, ICR75 too */
int (*decode_event)(RIG *rig); /* When transceive on, find out which callback to call, and call it */
@ -545,10 +551,10 @@ struct rig_state {
* So far, Icoms are able to do that in Transceive mode, and PCR-1000 too.
*/
struct rig_callbacks {
int (*freq_event)(RIG *rig, freq_t freq);
int (*mode_event)(RIG *rig, rmode_t mode, pbwidth_t width);
int (*freq_event)(RIG *rig, vfo_t vfo, freq_t freq);
int (*mode_event)(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
int (*vfo_event)(RIG *rig, vfo_t vfo);
int (*ptt_event)(RIG *rig, ptt_t mode);
int (*ptt_event)(RIG *rig, vfo_t vfo, ptt_t mode);
/* etc.. */
};
@ -574,51 +580,51 @@ extern int rig_open(RIG *rig);
* List Set/Get functions pairs
*/
extern int rig_set_freq(RIG *rig, freq_t freq); /* select freq */
extern int rig_get_freq(RIG *rig, freq_t *freq); /* get freq */
extern int rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq); /* select freq */
extern int rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); /* get freq */
extern int rig_set_mode(RIG *rig, rmode_t mode, pbwidth_t width); /* select mode */
extern int rig_get_mode(RIG *rig, rmode_t *mode, pbwidth_t *width); /* get mode */
extern int rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); /* select mode */
extern int rig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); /* get mode */
extern int rig_set_vfo(RIG *rig, vfo_t vfo); /* select vfo */
extern int rig_get_vfo(RIG *rig, vfo_t *vfo); /* get vfo */
extern int rig_set_ptt(RIG *rig, ptt_t ptt); /* ptt on/off */
extern int rig_get_ptt(RIG *rig, ptt_t *ptt); /* get ptt status */
extern int rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt); /* ptt on/off */
extern int rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt); /* get ptt status */
extern int rig_set_rptr_shift(RIG *rig, rptr_shift_t rptr_shift); /* set repeater shift */
extern int rig_get_rptr_shift(RIG *rig, rptr_shift_t *rptr_shift); /* get repeater shift */
extern int rig_set_rptr_offs(RIG *rig, unsigned long rptr_offs); /* set repeater offset */
extern int rig_get_rptr_offs(RIG *rig, unsigned long *rptr_offs); /* get repeater offset */
extern int rig_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift); /* set repeater shift */
extern int rig_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift); /* get repeater shift */
extern int rig_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs); /* set repeater offset */
extern int rig_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs); /* get repeater offset */
extern int rig_set_ctcss(RIG *rig, unsigned int tone);
extern int rig_get_ctcss(RIG *rig, unsigned int *tone);
extern int rig_set_dcs(RIG *rig, unsigned int code);
extern int rig_get_dcs(RIG *rig, unsigned int *code);
extern int rig_set_ctcss(RIG *rig, vfo_t vfo, unsigned int tone);
extern int rig_get_ctcss(RIG *rig, vfo_t vfo, unsigned int *tone);
extern int rig_set_dcs(RIG *rig, vfo_t vfo, unsigned int code);
extern int rig_get_dcs(RIG *rig, vfo_t vfo, unsigned int *code);
extern int rig_set_ctcss_sql(RIG *rig, unsigned int tone);
extern int rig_get_ctcss_sql(RIG *rig, unsigned int *tone);
extern int rig_set_dcs_sql(RIG *rig, unsigned int code);
extern int rig_get_dcs_sql(RIG *rig, unsigned int *code);
extern int rig_set_ctcss_sql(RIG *rig, vfo_t vfo, unsigned int tone);
extern int rig_get_ctcss_sql(RIG *rig, vfo_t vfo, unsigned int *tone);
extern int rig_set_dcs_sql(RIG *rig, vfo_t vfo, unsigned int code);
extern int rig_get_dcs_sql(RIG *rig, vfo_t vfo, unsigned int *code);
extern int rig_set_split_freq(RIG *rig, freq_t rx_freq, freq_t tx_freq);
extern int rig_get_split_freq(RIG *rig, freq_t *rx_freq, freq_t *tx_freq);
extern int rig_set_split(RIG *rig, split_t split);
extern int rig_get_split(RIG *rig, split_t *split);
extern int rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t rx_freq, freq_t tx_freq);
extern int rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *rx_freq, freq_t *tx_freq);
extern int rig_set_split(RIG *rig, vfo_t vfo, split_t split);
extern int rig_get_split(RIG *rig, vfo_t vfo, split_t *split);
extern int rig_set_rit(RIG *rig, signed long rit);
extern int rig_get_rit(RIG *rig, signed long *rit);
extern int rig_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
extern int rig_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit);
extern int rig_set_ts(RIG *rig, unsigned long ts); /* set tuning step */
extern int rig_get_ts(RIG *rig, unsigned long *ts); /* get tuning step */
extern int rig_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts); /* set tuning step */
extern int rig_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts); /* get tuning step */
extern int rig_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq, rmode_t mode);
extern int rig_mW2power(RIG *rig, float *power, unsigned int mwpower, freq_t freq, rmode_t mode);
extern int rig_set_level(RIG *rig, setting_t level, value_t val);
extern int rig_get_level(RIG *rig, setting_t level, value_t *val);
extern int rig_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
extern int rig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
#define rig_get_strength(r,s) rig_get_level((r), RIG_LEVEL_STRENGTH, (value_t*)(s))
#define rig_get_strength(r,v,s) rig_get_level((r),(v),RIG_LEVEL_STRENGTH, (value_t*)(s))
extern int rig_set_poweron(RIG *rig);
extern int rig_set_poweroff(RIG *rig);
@ -634,19 +640,19 @@ extern setting_t rig_has_level(RIG *rig, setting_t level);
extern setting_t rig_has_set_level(RIG *rig, setting_t level);
extern setting_t rig_has_func(RIG *rig, setting_t func); /* is part of capabilities? */
extern int rig_set_func(RIG *rig, setting_t func, int status); /* activate the function(s) */
extern int rig_get_func(RIG *rig, setting_t *func); /* get the setting from rig */
extern int rig_set_func(RIG *rig, vfo_t vfo, setting_t func, int status); /* activate the function(s) */
extern int rig_get_func(RIG *rig, vfo_t vfo, setting_t *func); /* get the setting from rig */
extern int rig_set_bank(RIG *rig, int bank); /* set memory bank number */
extern int rig_set_mem(RIG *rig, int ch); /* set memory channel number */
extern int rig_get_mem(RIG *rig, int *ch); /* get memory channel number */
extern int rig_mv_ctl(RIG *rig, mv_op_t op); /* Mem/VFO operation */
extern int rig_set_bank(RIG *rig, vfo_t vfo, int bank); /* set memory bank number */
extern int rig_set_mem(RIG *rig, vfo_t vfo, int ch); /* set memory channel number */
extern int rig_get_mem(RIG *rig, vfo_t vfo, int *ch); /* get memory channel number */
extern int rig_mv_ctl(RIG *rig, vfo_t vfo, mv_op_t op); /* Mem/VFO operation */
extern int rig_set_channel(RIG *rig, const channel_t *chan);
extern int rig_get_channel(RIG *rig, channel_t *chan);
extern int rig_set_trn(RIG *rig, int trn); /* activate the transceive mode */
extern int rig_get_trn(RIG *rig, int *trn);
extern int rig_set_trn(RIG *rig, vfo_t vfo, int trn); /* activate the transceive mode */
extern int rig_get_trn(RIG *rig, vfo_t vfo, int *trn);
extern unsigned char *rig_get_info(RIG *rig);
@ -671,4 +677,3 @@ int rig_load_backend(const char *be_name);
#endif /* _RIG_H */

186
src/rig.c
Wyświetl plik

@ -2,7 +2,7 @@
Copyright (C) 2000 Stephane Fillod and Frank Singleton
This file is part of the hamlib package.
$Id: rig.c,v 1.10 2000-12-04 23:39:18 f4cfe Exp $
$Id: rig.c,v 1.11 2000-12-05 22:01:02 f4cfe Exp $
Hamlib is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
@ -337,6 +337,7 @@ int rig_cleanup(RIG *rig)
/**
* rig_set_freq - set the frequency of the current VFO
* @rig: The rig handle
* @vfo: The target VFO
* @freq: The frequency to set to
*
* The rig_set_freq() function sets the frequency of the current VFO.
@ -348,7 +349,7 @@ int rig_cleanup(RIG *rig)
* SEE ALSO: rig_get_freq()
*/
int rig_set_freq(RIG *rig, freq_t freq)
int rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
{
if (!rig || !rig->caps)
return -RIG_EINVAL;
@ -359,12 +360,13 @@ int rig_set_freq(RIG *rig, freq_t freq)
if (rig->caps->set_freq == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->set_freq(rig, freq);
return rig->caps->set_freq(rig, vfo, freq);
}
/**
* rig_get_freq - get the frequency of the current VFO
* @rig: The rig handle
* @vfo: The target VFO
* @freq: The location where to store the current frequency
*
* The rig_get_freq() function retrieves the frequency of the current VFO.
@ -376,7 +378,7 @@ int rig_set_freq(RIG *rig, freq_t freq)
* SEE ALSO: rig_set_freq()
*/
int rig_get_freq(RIG *rig, freq_t *freq)
int rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
{
int status;
@ -386,7 +388,7 @@ int rig_get_freq(RIG *rig, freq_t *freq)
if (rig->caps->get_freq == NULL)
return -RIG_ENAVAIL;
else {
status = rig->caps->get_freq(rig, freq);
status = rig->caps->get_freq(rig, vfo, freq);
if (rig->state.vfo_comp != 0.0)
*freq += (freq_t)(rig->state.vfo_comp * (*freq));
return status;
@ -397,6 +399,7 @@ int rig_get_freq(RIG *rig, freq_t *freq)
/**
* rig_set_mode - set the mode of the current VFO
* @rig: The rig handle
* @vfo: The target VFO
* @mode: The mode to set to
* @width: The passband width to set to
*
@ -411,7 +414,7 @@ int rig_get_freq(RIG *rig, freq_t *freq)
* SEE ALSO: rig_get_mode()
*/
int rig_set_mode(RIG *rig, rmode_t mode, pbwidth_t width)
int rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
{
if (!rig || !rig->caps)
return -RIG_EINVAL;
@ -419,12 +422,13 @@ int rig_set_mode(RIG *rig, rmode_t mode, pbwidth_t width)
if (rig->caps->set_mode == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->set_mode(rig, mode, width);
return rig->caps->set_mode(rig, vfo, mode, width);
}
/**
* rig_get_mode - get the mode of the current VFO
* @rig: The rig handle
* @vfo: The target VFO
* @mode: The location where to store the current mode
* @width: The location where to store the current passband width
*
@ -439,7 +443,7 @@ int rig_set_mode(RIG *rig, rmode_t mode, pbwidth_t width)
* SEE ALSO: rig_set_mode()
*/
int rig_get_mode(RIG *rig, rmode_t *mode, pbwidth_t *width)
int rig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
{
if (!rig || !rig->caps || !mode || !width)
return -RIG_EINVAL;
@ -447,7 +451,7 @@ int rig_get_mode(RIG *rig, rmode_t *mode, pbwidth_t *width)
if (rig->caps->get_mode == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->get_mode(rig, mode, width);
return rig->caps->get_mode(rig, vfo, mode, width);
}
/**
@ -503,6 +507,7 @@ int rig_get_vfo(RIG *rig, vfo_t *vfo)
/**
* rig_set_ptt - set PTT on/off
* @rig: The rig handle
* @vfo: The target VFO
* @ptt: The PTT status to set to
*
* The rig_set_ptt() function sets "Push-To-Talk" on/off.
@ -513,7 +518,7 @@ int rig_get_vfo(RIG *rig, vfo_t *vfo)
*
* SEE ALSO: rig_get_ptt()
*/
int rig_set_ptt(RIG *rig, ptt_t ptt)
int rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
{
if (!rig || !rig->caps)
return -RIG_EINVAL;
@ -523,7 +528,7 @@ int rig_set_ptt(RIG *rig, ptt_t ptt)
if (rig->caps->set_ptt == NULL)
return -RIG_ENIMPL;
else
return rig->caps->set_ptt(rig, ptt);
return rig->caps->set_ptt(rig, vfo, ptt);
break;
case RIG_PTT_SERIAL:
@ -539,6 +544,7 @@ int rig_set_ptt(RIG *rig, ptt_t ptt)
/**
* rig_get_ptt - get the status of the PTT
* @rig: The rig handle
* @vfo: The target VFO
* @ptt: The location where to store the status of the PTT
*
* The rig_get_ptt() function retrieves the status of PTT (are we
@ -550,7 +556,7 @@ int rig_set_ptt(RIG *rig, ptt_t ptt)
*
* SEE ALSO: rig_set_ptt()
*/
int rig_get_ptt(RIG *rig, ptt_t *ptt)
int rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
{
if (!rig || !rig->caps || !ptt)
return -RIG_EINVAL;
@ -560,7 +566,7 @@ int rig_get_ptt(RIG *rig, ptt_t *ptt)
if (rig->caps->get_ptt == NULL)
return -RIG_ENIMPL;
else
return rig->caps->get_ptt(rig, ptt);
return rig->caps->get_ptt(rig, vfo, ptt);
break;
case RIG_PTT_SERIAL:
@ -577,6 +583,7 @@ int rig_get_ptt(RIG *rig, ptt_t *ptt)
/**
* rig_set_rptr_shift - set the repeater shift
* @rig: The rig handle
* @vfo: The target VFO
* @rptr_shift: The repeater shift to set to
*
* The rig_set_rptr_shift() function sets the current repeater shift.
@ -587,7 +594,7 @@ int rig_get_ptt(RIG *rig, ptt_t *ptt)
*
* SEE ALSO: rig_get_rptr_shift()
*/
int rig_set_rptr_shift(RIG *rig, rptr_shift_t rptr_shift)
int rig_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift)
{
if (!rig || !rig->caps)
return -RIG_EINVAL;
@ -595,12 +602,13 @@ int rig_set_rptr_shift(RIG *rig, rptr_shift_t rptr_shift)
if (rig->caps->set_rptr_shift == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->set_rptr_shift(rig, rptr_shift);
return rig->caps->set_rptr_shift(rig, vfo, rptr_shift);
}
/**
* rig_get_rptr_shift - get the current repeater shift
* @rig: The rig handle
* @vfo: The target VFO
* @rptr_shift: The location where to store the current repeater shift
*
* The rig_get_rptr_shift() function retrieves the current repeater shift.
@ -611,7 +619,7 @@ int rig_set_rptr_shift(RIG *rig, rptr_shift_t rptr_shift)
*
* SEE ALSO: rig_set_rptr_shift()
*/
int rig_get_rptr_shift(RIG *rig, rptr_shift_t *rptr_shift)
int rig_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift)
{
if (!rig || !rig->caps || !rptr_shift)
return -RIG_EINVAL;
@ -619,12 +627,13 @@ int rig_get_rptr_shift(RIG *rig, rptr_shift_t *rptr_shift)
if (rig->caps->get_rptr_shift == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->get_rptr_shift(rig, rptr_shift);
return rig->caps->get_rptr_shift(rig, vfo, rptr_shift);
}
/**
* rig_set_rptr_offs - set the repeater offset
* @rig: The rig handle
* @vfo: The target VFO
* @rptr_offs: The VFO to set to
*
* The rig_set_rptr_offs() function sets the current repeater offset.
@ -636,7 +645,7 @@ int rig_get_rptr_shift(RIG *rig, rptr_shift_t *rptr_shift)
* SEE ALSO: rig_get_rptr_offs()
*/
int rig_set_rptr_offs(RIG *rig, unsigned long rptr_offs)
int rig_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs)
{
if (!rig || !rig->caps)
return -RIG_EINVAL;
@ -644,12 +653,13 @@ int rig_set_rptr_offs(RIG *rig, unsigned long rptr_offs)
if (rig->caps->set_rptr_offs == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->set_rptr_offs(rig, rptr_offs);
return rig->caps->set_rptr_offs(rig, vfo, rptr_offs);
}
/**
* rig_get_rptr_offs - get the current repeater offset
* @rig: The rig handle
* @vfo: The target VFO
* @rptr_offs: The location where to store the current repeater offset
*
* The rig_get_rptr_offs() function retrieves the current repeater offset.
@ -661,7 +671,7 @@ int rig_set_rptr_offs(RIG *rig, unsigned long rptr_offs)
* SEE ALSO: rig_set_rptr_offs()
*/
int rig_get_rptr_offs(RIG *rig, unsigned long *rptr_offs)
int rig_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs)
{
if (!rig || !rig->caps || !rptr_offs)
return -RIG_EINVAL;
@ -669,13 +679,14 @@ int rig_get_rptr_offs(RIG *rig, unsigned long *rptr_offs)
if (rig->caps->get_rptr_offs == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->get_rptr_offs(rig, rptr_offs);
return rig->caps->get_rptr_offs(rig, vfo, rptr_offs);
}
/**
* rig_set_split_freq - set the split frequencies
* @rig: The rig handle
* @vfo: The target VFO
* @rx_freq: The receive split frequency to set to
* @tx_freq: The transmit split frequency to set to
*
@ -688,7 +699,7 @@ int rig_get_rptr_offs(RIG *rig, unsigned long *rptr_offs)
* SEE ALSO: rig_get_split_freq()
*/
int rig_set_split_freq(RIG *rig, freq_t rx_freq, freq_t tx_freq)
int rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t rx_freq, freq_t tx_freq)
{
if (!rig || !rig->caps)
return -RIG_EINVAL;
@ -696,12 +707,13 @@ int rig_set_split_freq(RIG *rig, freq_t rx_freq, freq_t tx_freq)
if (rig->caps->set_split_freq == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->set_split_freq(rig, rx_freq, tx_freq);
return rig->caps->set_split_freq(rig, vfo, rx_freq, tx_freq);
}
/**
* rig_get_split_freq - get the current split frequencies
* @rig: The rig handle
* @vfo: The target VFO
* @rx_freq: The location where to store the current receive split frequency
* @tx_freq: The location where to store the current receive split frequency
*
@ -714,7 +726,7 @@ int rig_set_split_freq(RIG *rig, freq_t rx_freq, freq_t tx_freq)
*
* SEE ALSO: rig_set_split_freq()
*/
int rig_get_split_freq(RIG *rig, freq_t *rx_freq, freq_t *tx_freq)
int rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *rx_freq, freq_t *tx_freq)
{
if (!rig || !rig->caps || !rx_freq || !tx_freq)
return -RIG_EINVAL;
@ -722,14 +734,14 @@ int rig_get_split_freq(RIG *rig, freq_t *rx_freq, freq_t *tx_freq)
if (rig->caps->get_split_freq == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->get_split_freq(rig, rx_freq, tx_freq);
return rig->caps->get_split_freq(rig, vfo, rx_freq, tx_freq);
}
/**
* rig_set_split - set the split mode
* @rig: The rig handle
* @vfo: The target VFO
* @split: The split mode to set to
*
* The rig_set_split() function sets the current split mode.
@ -740,7 +752,7 @@ int rig_get_split_freq(RIG *rig, freq_t *rx_freq, freq_t *tx_freq)
*
* SEE ALSO: rig_get_split()
*/
int rig_set_split(RIG *rig, split_t split)
int rig_set_split(RIG *rig, vfo_t vfo, split_t split)
{
if (!rig || !rig->caps)
return -RIG_EINVAL;
@ -748,12 +760,13 @@ int rig_set_split(RIG *rig, split_t split)
if (rig->caps->set_split == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->set_split(rig, split);
return rig->caps->set_split(rig, vfo, split);
}
/**
* rig_get_split - get the current split mode
* @rig: The rig handle
* @vfo: The target VFO
* @split: The location where to store the current split mode
*
* The rig_get_split() function retrieves the current split mode.
@ -764,7 +777,7 @@ int rig_set_split(RIG *rig, split_t split)
*
* SEE ALSO: rig_set_split()
*/
int rig_get_split(RIG *rig, split_t *split)
int rig_get_split(RIG *rig, vfo_t vfo, split_t *split)
{
if (!rig || !rig->caps || !split)
return -RIG_EINVAL;
@ -772,12 +785,13 @@ int rig_get_split(RIG *rig, split_t *split)
if (rig->caps->get_split == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->get_split(rig, split);
return rig->caps->get_split(rig, vfo, split);
}
/**
* rig_set_rit - set the RIT
* @rig: The rig handle
* @vfo: The target VFO
* @rit: The RIT offset to adjust to
*
* The rig_set_rit() function sets the current RIT offset.
@ -790,7 +804,7 @@ int rig_get_split(RIG *rig, split_t *split)
* SEE ALSO: rig_get_rit()
*/
int rig_set_rit(RIG *rig, signed long rit)
int rig_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
{
if (!rig || !rig->caps)
return -RIG_EINVAL;
@ -798,12 +812,13 @@ int rig_set_rit(RIG *rig, signed long rit)
if (rig->caps->set_rit == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->set_rit(rig, rit);
return rig->caps->set_rit(rig, vfo, rit);
}
/**
* rig_get_rit - get the current RIT offset
* @rig: The rig handle
* @vfo: The target VFO
* @rit: The location where to store the current RIT offset
*
* The rig_get_rit() function retrieves the current RIT offset.
@ -815,7 +830,7 @@ int rig_set_rit(RIG *rig, signed long rit)
* SEE ALSO: rig_set_rit()
*/
int rig_get_rit(RIG *rig, signed long *rit)
int rig_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
{
if (!rig || !rig->caps || !rit)
return -RIG_EINVAL;
@ -823,7 +838,7 @@ int rig_get_rit(RIG *rig, signed long *rit)
if (rig->caps->get_rit == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->get_rit(rig, rit);
return rig->caps->get_rit(rig, vfo, rit);
}
@ -831,6 +846,7 @@ int rig_get_rit(RIG *rig, signed long *rit)
/**
* rig_set_ts - set the Tuning Step
* @rig: The rig handle
* @vfo: The target VFO
* @ts: The tuning step to set to
*
* The rig_set_rs() function sets the Tuning Step.
@ -842,7 +858,7 @@ int rig_get_rit(RIG *rig, signed long *rit)
* SEE ALSO: rig_get_ts()
*/
int rig_set_ts(RIG *rig, unsigned long ts)
int rig_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts)
{
if (!rig || !rig->caps)
return -RIG_EINVAL;
@ -850,12 +866,13 @@ int rig_set_ts(RIG *rig, unsigned long ts)
if (rig->caps->set_ts == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->set_ts(rig, ts);
return rig->caps->set_ts(rig, vfo, ts);
}
/**
* rig_get_ts - get the current Tuning Step
* @rig: The rig handle
* @vfo: The target VFO
* @ts: The location where to store the current tuning step
*
* The rig_get_ts() function retrieves the current tuning step.
@ -867,7 +884,7 @@ int rig_set_ts(RIG *rig, unsigned long ts)
* SEE ALSO: rig_set_ts()
*/
int rig_get_ts(RIG *rig, unsigned long *ts)
int rig_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts)
{
if (!rig || !rig->caps || !ts)
return -RIG_EINVAL;
@ -875,7 +892,7 @@ int rig_get_ts(RIG *rig, unsigned long *ts)
if (rig->caps->get_ts == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->get_ts(rig, ts);
return rig->caps->get_ts(rig, vfo, ts);
}
/**
@ -967,6 +984,7 @@ int rig_mW2power(RIG *rig, float *power, unsigned int mwpower, freq_t freq, rmod
/**
* rig_set_ctcss - set CTCSS
* @rig: The rig handle
* @vfo: The target VFO
* @tone: The tone to set to
*
* The rig_set_ctcss() function sets the current Continuous Tone
@ -983,7 +1001,7 @@ int rig_mW2power(RIG *rig, float *power, unsigned int mwpower, freq_t freq, rmod
* SEE ALSO: rig_get_ctcss(), rig_set_dcs(), rig_get_dcs()
*/
int rig_set_ctcss(RIG *rig, unsigned int tone)
int rig_set_ctcss(RIG *rig, vfo_t vfo, unsigned int tone)
{
if (!rig || !rig->caps)
return -RIG_EINVAL;
@ -991,7 +1009,7 @@ int rig_set_ctcss(RIG *rig, unsigned int tone)
if (rig->caps->set_ctcss == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->set_ctcss(rig, tone);
return rig->caps->set_ctcss(rig, vfo, tone);
}
/*
@ -1002,6 +1020,7 @@ int rig_set_ctcss(RIG *rig, unsigned int tone)
/**
* rig_get_ctcss - get the current CTCSS
* @rig: The rig handle
* @vfo: The target VFO
* @tone: The location where to store the current tone
*
* The rig_get_ctcss() function retrieves the current Continuous Tone
@ -1017,7 +1036,7 @@ int rig_set_ctcss(RIG *rig, unsigned int tone)
*
* SEE ALSO: rig_set_ctcss(), rig_set_dcs(), rig_get_dcs()
*/
int rig_get_ctcss(RIG *rig, unsigned int *tone)
int rig_get_ctcss(RIG *rig, vfo_t vfo, unsigned int *tone)
{
if (!rig || !rig->caps || !tone)
return -RIG_EINVAL;
@ -1025,12 +1044,13 @@ int rig_get_ctcss(RIG *rig, unsigned int *tone)
if (rig->caps->get_ctcss == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->get_ctcss(rig, tone);
return rig->caps->get_ctcss(rig, vfo, tone);
}
/**
* rig_set_dcs - set the current DCS
* @rig: The rig handle
* @vfo: The target VFO
* @code: The tone to set to
*
* The rig_set_dcs() function sets the current Digitally-Coded Squelch
@ -1043,7 +1063,7 @@ int rig_get_ctcss(RIG *rig, unsigned int *tone)
* SEE ALSO: rig_get_dcs(), rig_set_ctcss(), rig_get_ctcss()
*/
int rig_set_dcs(RIG *rig, unsigned int code)
int rig_set_dcs(RIG *rig, vfo_t vfo, unsigned int code)
{
if (!rig || !rig->caps)
return -RIG_EINVAL;
@ -1051,12 +1071,13 @@ int rig_set_dcs(RIG *rig, unsigned int code)
if (rig->caps->set_dcs == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->set_dcs(rig, code);
return rig->caps->set_dcs(rig, vfo, code);
}
/**
* rig_get_dcs - get the current DCS
* @rig: The rig handle
* @vfo: The target VFO
* @code: The location where to store the current tone
*
* The rig_get_dcs() function retrieves the current
@ -1068,7 +1089,7 @@ int rig_set_dcs(RIG *rig, unsigned int code)
*
* SEE ALSO: rig_get_dcs(), rig_set_ctcss(), rig_get_ctcss()
*/
int rig_get_dcs(RIG *rig, unsigned int *code)
int rig_get_dcs(RIG *rig, vfo_t vfo, unsigned int *code)
{
if (!rig || !rig->caps || !code)
return -RIG_EINVAL;
@ -1076,12 +1097,13 @@ int rig_get_dcs(RIG *rig, unsigned int *code)
if (rig->caps->get_dcs == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->get_dcs(rig, code);
return rig->caps->get_dcs(rig, vfo, code);
}
/**
* rig_set_ctcss_sql - set CTCSS squelch
* @rig: The rig handle
* @vfo: The target VFO
* @tone: The PL tone to set the squelch to
*
* The rig_set_ctcss_sql() function sets the current Continuous Tone
@ -1098,7 +1120,7 @@ int rig_get_dcs(RIG *rig, unsigned int *code)
* SEE ALSO: rig_get_ctcss_sql(), rig_set_ctcss()
*/
int rig_set_ctcss_sql(RIG *rig, unsigned int tone)
int rig_set_ctcss_sql(RIG *rig, vfo_t vfo, unsigned int tone)
{
if (!rig || !rig->caps)
return -RIG_EINVAL;
@ -1106,12 +1128,13 @@ int rig_set_ctcss_sql(RIG *rig, unsigned int tone)
if (rig->caps->set_ctcss_sql == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->set_ctcss_sql(rig, tone);
return rig->caps->set_ctcss_sql(rig, vfo, tone);
}
/**
* rig_get_ctcss_sql - get the current CTCSS squelch
* @rig: The rig handle
* @vfo: The target VFO
* @tone: The location where to store the current tone
*
* The rig_get_ctcss_sql() function retrieves the current Continuous Tone
@ -1127,7 +1150,7 @@ int rig_set_ctcss_sql(RIG *rig, unsigned int tone)
*
* SEE ALSO: rig_set_ctcss_sql(), rig_get_ctcss()
*/
int rig_get_ctcss_sql(RIG *rig, unsigned int *tone)
int rig_get_ctcss_sql(RIG *rig, vfo_t vfo, unsigned int *tone)
{
if (!rig || !rig->caps || !tone)
return -RIG_EINVAL;
@ -1135,12 +1158,13 @@ int rig_get_ctcss_sql(RIG *rig, unsigned int *tone)
if (rig->caps->get_ctcss_sql == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->get_ctcss_sql(rig, tone);
return rig->caps->get_ctcss_sql(rig, vfo, tone);
}
/**
* rig_set_dcs_sql - set the current DCS
* @rig: The rig handle
* @vfo: The target VFO
* @code: The tone to set to
*
* The rig_set_dcs_sql() function sets the current Digitally-Coded Squelch
@ -1153,7 +1177,7 @@ int rig_get_ctcss_sql(RIG *rig, unsigned int *tone)
* SEE ALSO: rig_get_dcs_sql(), rig_set_dcs()
*/
int rig_set_dcs_sql(RIG *rig, unsigned int code)
int rig_set_dcs_sql(RIG *rig, vfo_t vfo, unsigned int code)
{
if (!rig || !rig->caps)
return -RIG_EINVAL;
@ -1161,12 +1185,13 @@ int rig_set_dcs_sql(RIG *rig, unsigned int code)
if (rig->caps->set_dcs_sql == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->set_dcs_sql(rig, code);
return rig->caps->set_dcs_sql(rig, vfo, code);
}
/**
* rig_get_dcs_sql - get the current DCS
* @rig: The rig handle
* @vfo: The target VFO
* @code: The location where to store the current tone
*
* The rig_get_dcs_sql() function retrieves the current
@ -1178,7 +1203,7 @@ int rig_set_dcs_sql(RIG *rig, unsigned int code)
*
* SEE ALSO: rig_get_dcs_sql(), rig_get_dcs()
*/
int rig_get_dcs_sql(RIG *rig, unsigned int *code)
int rig_get_dcs_sql(RIG *rig, vfo_t vfo, unsigned int *code)
{
if (!rig || !rig->caps || !code)
return -RIG_EINVAL;
@ -1186,7 +1211,7 @@ int rig_get_dcs_sql(RIG *rig, unsigned int *code)
if (rig->caps->get_dcs_sql == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->get_dcs_sql(rig, code);
return rig->caps->get_dcs_sql(rig, vfo, code);
}
@ -1274,6 +1299,7 @@ RIG *rig_probe(const char *port_path)
/**
* rig_set_level - set a radio level setting
* @rig: The rig handle
* @vfo: The target VFO
* @level: The level setting
* @val: The value to set the level setting to
*
@ -1287,7 +1313,7 @@ RIG *rig_probe(const char *port_path)
*
* SEE ALSO: rig_has_set_level(), rig_get_level()
*/
int rig_set_level(RIG *rig, setting_t level, value_t val)
int rig_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
if (!rig || !rig->caps)
return -RIG_EINVAL;
@ -1295,12 +1321,13 @@ int rig_set_level(RIG *rig, setting_t level, value_t val)
if (rig->caps->set_level == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->set_level(rig, level, val);
return rig->caps->set_level(rig, vfo, level, val);
}
/**
* rig_get_level - get the level of a level
* @rig: The rig handle
* @vfo: The target VFO
* @level: The level setting
* @val: The location where to store the value of @level
*
@ -1314,7 +1341,7 @@ int rig_set_level(RIG *rig, setting_t level, value_t val)
*
* SEE ALSO: rig_has_level(), rig_set_level()
*/
int rig_get_level(RIG *rig, setting_t level, value_t *val)
int rig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
{
if (!rig || !rig->caps || !val)
return -RIG_EINVAL;
@ -1322,7 +1349,7 @@ int rig_get_level(RIG *rig, setting_t level, value_t *val)
if (rig->caps->get_level == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->get_level(rig, level, val);
return rig->caps->get_level(rig, vfo, level, val);
}
/**
@ -1404,6 +1431,7 @@ setting_t rig_has_func(RIG *rig, setting_t func)
/**
* rig_set_func - activate/desactivate functions of radio
* @rig: The rig handle
* @vfo: The target VFO
* @func: The functions to activate
* @status: The status (on or off) to set to
*
@ -1416,7 +1444,7 @@ setting_t rig_has_func(RIG *rig, setting_t func)
* SEE ALSO: rig_get_func()
*/
int rig_set_func(RIG *rig, setting_t func, int status)
int rig_set_func(RIG *rig, vfo_t vfo, setting_t func, int status)
{
if (!rig || !rig->caps)
return -RIG_EINVAL;
@ -1424,12 +1452,13 @@ int rig_set_func(RIG *rig, setting_t func, int status)
if (rig->caps->set_func == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->set_func(rig, func, status);
return rig->caps->set_func(rig, vfo, func, status);
}
/**
* rig_get_func - get the status of functions of the radio
* @rig: The rig handle
* @vfo: The target VFO
* @func: The location where to store the function status
*
* The rig_get_func() function retrieves the status of functions
@ -1443,7 +1472,7 @@ int rig_set_func(RIG *rig, setting_t func, int status)
*
* SEE ALSO: rig_set_func()
*/
int rig_get_func(RIG *rig, setting_t *func)
int rig_get_func(RIG *rig, vfo_t vfo, setting_t *func)
{
if (!rig || !rig->caps || !func)
return -RIG_EINVAL;
@ -1451,12 +1480,13 @@ int rig_get_func(RIG *rig, setting_t *func)
if (rig->caps->get_func == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->get_func(rig, func);
return rig->caps->get_func(rig, vfo, func);
}
/**
* rig_set_mem - set the current memory channel number
* @rig: The rig handle
* @vfo: The target VFO
* @ch: The memory channel number
*
* The rig_set_mem() function sets the current memory channel number.
@ -1470,7 +1500,7 @@ int rig_get_func(RIG *rig, setting_t *func)
* SEE ALSO: rig_get_mem()
*/
int rig_set_mem(RIG *rig, int ch)
int rig_set_mem(RIG *rig, vfo_t vfo, int ch)
{
if (!rig || !rig->caps)
return -RIG_EINVAL;
@ -1478,12 +1508,13 @@ int rig_set_mem(RIG *rig, int ch)
if (rig->caps->set_mem == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->set_mem(rig, ch);
return rig->caps->set_mem(rig, vfo, ch);
}
/**
* rig_get_mem - get the current memory channel number
* @rig: The rig handle
* @vfo: The target VFO
* @ch: The location where to store the current memory channel number
*
* The rig_get_mem() function retrieves the current memory channel number.
@ -1496,7 +1527,7 @@ int rig_set_mem(RIG *rig, int ch)
*
* SEE ALSO: rig_set_mem()
*/
int rig_get_mem(RIG *rig, int *ch)
int rig_get_mem(RIG *rig, vfo_t vfo, int *ch)
{
if (!rig || !rig->caps || !ch)
return -RIG_EINVAL;
@ -1504,12 +1535,13 @@ int rig_get_mem(RIG *rig, int *ch)
if (rig->caps->get_mem == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->get_mem(rig, ch);
return rig->caps->get_mem(rig, vfo, ch);
}
/**
* rig_mv_ctl - perform Memory/VFO operations
* @rig: The rig handle
* @vfo: The target VFO
* @op: The Memory/VFO operation to perform
*
* The rig_mv_ctl() function performs Memory/VFO operation.
@ -1521,7 +1553,7 @@ int rig_get_mem(RIG *rig, int *ch)
*
*/
int rig_mv_ctl(RIG *rig, mv_op_t op)
int rig_mv_ctl(RIG *rig, vfo_t vfo, mv_op_t op)
{
if (!rig || !rig->caps)
return -RIG_EINVAL;
@ -1529,12 +1561,13 @@ int rig_mv_ctl(RIG *rig, mv_op_t op)
if (rig->caps->mv_ctl == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->mv_ctl(rig, op);
return rig->caps->mv_ctl(rig, vfo, op);
}
/**
* rig_set_bank - set the current memory bank
* @rig: The rig handle
* @vfo: The target VFO
* @bank: The memory bank
*
* The rig_set_bank() function sets the current memory bank.
@ -1548,7 +1581,7 @@ int rig_mv_ctl(RIG *rig, mv_op_t op)
* SEE ALSO: rig_set_mem()
*/
int rig_set_bank(RIG *rig, int bank)
int rig_set_bank(RIG *rig, vfo_t vfo, int bank)
{
if (!rig || !rig->caps)
return -RIG_EINVAL;
@ -1556,7 +1589,7 @@ int rig_set_bank(RIG *rig, int bank)
if (rig->caps->set_bank == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->set_bank(rig, bank);
return rig->caps->set_bank(rig, vfo, bank);
}
@ -1589,6 +1622,7 @@ int rig_set_channel(RIG *rig, const channel_t *chan)
/**
* rig_get_channel - get channel data
* @rig: The rig handle
* @vfo: The target VFO
* @chan: The location where to store the channel data
*
* The rig_get_channel() function retrieves the data associated
@ -1648,6 +1682,7 @@ rig_get_range(const freq_range_t range_list[], freq_t freq, rmode_t mode)
/**
* rig_set_trn - control the transceive mode
* @rig: The rig handle
* @vfo: The target VFO
* @trn: The transceive status to set to
*
* The rig_set_trn() function enable/disable the transceive
@ -1660,7 +1695,7 @@ rig_get_range(const freq_range_t range_list[], freq_t freq, rmode_t mode)
* SEE ALSO: rig_get_trn()
*/
int rig_set_trn(RIG *rig, int trn)
int rig_set_trn(RIG *rig, vfo_t vfo, int trn)
{
int status;
@ -1677,7 +1712,7 @@ int rig_set_trn(RIG *rig, int trn)
*/
status = add_trn_rig(rig);
if (rig->caps->set_trn)
return rig->caps->set_trn(rig, RIG_TRN_ON);
return rig->caps->set_trn(rig, vfo, RIG_TRN_ON);
else
return status;
} else {
@ -1686,7 +1721,7 @@ int rig_set_trn(RIG *rig, int trn)
} else {
status = remove_trn_rig(rig);
if (rig->caps->set_trn)
return rig->caps->set_trn(rig, RIG_TRN_OFF);
return rig->caps->set_trn(rig, vfo, RIG_TRN_OFF);
else
return status;
}
@ -1697,6 +1732,7 @@ int rig_set_trn(RIG *rig, int trn)
/**
* rig_get_trn - get the current transceive mode
* @rig: The rig handle
* @vfo: The target VFO
* @trn: The location where to store the current transceive mode
*
* The rig_get_trn() function retrieves the current status
@ -1709,7 +1745,7 @@ int rig_set_trn(RIG *rig, int trn)
*
* SEE ALSO: rig_set_trn()
*/
int rig_get_trn(RIG *rig, int *trn)
int rig_get_trn(RIG *rig, vfo_t vfo, int *trn)
{
if (!rig || !rig->caps || !trn)
return -RIG_EINVAL;
@ -1717,7 +1753,7 @@ int rig_get_trn(RIG *rig, int *trn)
if (rig->caps->get_trn == NULL)
return -RIG_ENAVAIL;
else
return rig->caps->get_trn(rig, trn);
return rig->caps->get_trn(rig, vfo, trn);
}
/**