Add NOCHANGE_PASSBAND to icom...cascading effect on adding vfo elsewhere...which is needed anyways

https://github.com/Hamlib/Hamlib/issues/448
pull/453/head
Michael Black W9MDB 2020-11-29 23:32:14 -06:00
rodzic 3490fed03c
commit c70d841b83
56 zmienionych plików z 218 dodań i 193 usunięć

3
NEWS
Wyświetl plik

@ -7,10 +7,11 @@ Copyright (C) 2000-2020 Michael Black W9MDB, and others
Please send Hamlib bug reports to hamlib-developer@lists.sourceforge.net
Version 4.0
2020-09-??
2020-11-29
* API/ABI changes, advance ABI to 4 0 0.
* Add GPIO and GPION options for DCD. Jeroen Vreeken
* New backend: ELAD FDM DUO. Giovanni, HB9EIK.
* All channel functions now take a vfo argument
* New rotator backend: iOptron. Bob, KD8CGH
* New model: Icom IC-R8600. Ekki, DF4OR
* New utility: rigctlcom. Mike, W9MDB

Wyświetl plik

@ -460,11 +460,11 @@ typedef channel_t * const_channel_t_p;
}
void set_channel(const struct channel *chan) {
self->error_status = rig_set_channel(self->rig, chan);
self->error_status = rig_set_channel(self->rig, RIG_VFO_NONE, chan);
}
void get_channel(struct channel *chan, int read_only) {
self->error_status = rig_get_channel(self->rig, chan, read_only);
self->error_status = rig_get_channel(self->rig, RIG_VFO_NONE, chan, read_only);
/* TODO: handle ext_level's */
}
@ -473,7 +473,7 @@ typedef channel_t * const_channel_t_p;
}
void get_chan_all(struct channel *chans) {
self->error_status = rig_get_chan_all(self->rig, chans);
self->error_status = rig_get_chan_all(self->rig, RIG_VFO_NONE, chans);
/* TODO: handle ext_level's */
}
@ -495,7 +495,7 @@ typedef channel_t * const_channel_t_p;
self->error_status = -RIG_ENOMEM;
return NULL;
}
self->error_status = rig_get_channel(self->rig, chan, read_only);
self->error_status = rig_get_channel(self->rig, RIG_VFO_NONE, chan, read_only);
/* TODO: copy ext_level's */
return chan;
}
@ -613,7 +613,7 @@ struct channel *Rig_get_chan_all(Rig *self)
self->error_status = -RIG_ENOMEM;
return NULL;
}
self->error_status = rig_get_chan_all(self->rig, chans);
self->error_status = rig_get_chan_all(self->rig, RIG_VFO_NONE, chans);
/* TODO: copy ext_level's */
return chans;
}

Wyświetl plik

@ -643,14 +643,14 @@ int Rig::getMem (vfo_t vfo)
return mem;
}
void Rig::setChannel (const channel_t *chan)
void Rig::setChannel (const channel_t *chan, vfo_t vfo)
{
CHECK_RIG( rig_set_channel(theRig, chan) );
CHECK_RIG( rig_set_channel(theRig, vfo, chan) );
}
void Rig::getChannel (channel_t *chan, int readOnly)
void Rig::getChannel (channel_t *chan,vfo_t vfo, int readOnly)
{
CHECK_RIG( rig_get_channel(theRig, chan, readOnly) );
CHECK_RIG( rig_get_channel(theRig, vfo, chan, readOnly) );
}

Wyświetl plik

@ -1813,13 +1813,13 @@ struct rig_caps {
int (*decode_event)(RIG *rig);
int (*set_channel)(RIG *rig, const channel_t *chan);
int (*get_channel)(RIG *rig, channel_t *chan, int read_only);
int (*set_channel)(RIG *rig, vfo_t vfo, const channel_t *chan);
int (*get_channel)(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
const char * (*get_info)(RIG *rig);
int (*set_chan_all_cb)(RIG *rig, chan_cb_t chan_cb, rig_ptr_t);
int (*get_chan_all_cb)(RIG *rig, chan_cb_t chan_cb, rig_ptr_t);
int (*set_chan_all_cb)(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t);
int (*get_chan_all_cb)(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t);
int (*set_mem_all_cb)(RIG *rig,
chan_cb_t chan_cb,
@ -2561,46 +2561,56 @@ rig_has_scan HAMLIB_PARAMS((RIG *rig,
scan_t scan));
extern HAMLIB_EXPORT(int)
rig_set_channel HAMLIB_PARAMS((RIG *rig,
rig_set_channel HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
const channel_t *chan)); /* mem */
extern HAMLIB_EXPORT(int)
rig_get_channel HAMLIB_PARAMS((RIG *rig,
rig_get_channel HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
channel_t *chan, int read_only));
extern HAMLIB_EXPORT(int)
rig_set_chan_all HAMLIB_PARAMS((RIG *rig,
rig_set_chan_all HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
const channel_t chans[]));
extern HAMLIB_EXPORT(int)
rig_get_chan_all HAMLIB_PARAMS((RIG *rig,
rig_get_chan_all HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
channel_t chans[]));
extern HAMLIB_EXPORT(int)
rig_set_chan_all_cb HAMLIB_PARAMS((RIG *rig,
rig_set_chan_all_cb HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
chan_cb_t chan_cb,
rig_ptr_t));
extern HAMLIB_EXPORT(int)
rig_get_chan_all_cb HAMLIB_PARAMS((RIG *rig,
rig_get_chan_all_cb HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
chan_cb_t chan_cb,
rig_ptr_t));
extern HAMLIB_EXPORT(int)
rig_set_mem_all_cb HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
chan_cb_t chan_cb,
confval_cb_t parm_cb,
rig_ptr_t));
extern HAMLIB_EXPORT(int)
rig_get_mem_all_cb HAMLIB_PARAMS((RIG *rig,
rig_get_mem_all_cb HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
chan_cb_t chan_cb,
confval_cb_t parm_cb,
rig_ptr_t));
extern HAMLIB_EXPORT(int)
rig_set_mem_all HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
const channel_t *chan,
const struct confparams *,
const value_t *));
extern HAMLIB_EXPORT(int)
rig_get_mem_all HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
channel_t *chan,
const struct confparams *,
value_t *));

Wyświetl plik

@ -126,8 +126,8 @@ public:
void setMem(int ch, vfo_t vfo = RIG_VFO_CURR);
int getMem(vfo_t vfo = RIG_VFO_CURR);
void setChannel(const channel_t *chan);
void getChannel(channel_t *chan, int readOnly);
void setChannel(const channel_t *chan, vfo_t vfo);
void getChannel(channel_t *chan, vfo_t vfo, int readOnly);
void setPowerStat(powerstat_t status);
powerstat_t getPowerStat(void);

Wyświetl plik

@ -1029,7 +1029,7 @@ int aor_set_bank(RIG *rig, vfo_t vfo, int bank)
}
int aor_set_channel(RIG *rig, const channel_t *chan)
int aor_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
struct aor_priv_caps *priv = (struct aor_priv_caps *)rig->caps->priv;
char aorcmd[BUFSZ];
@ -1240,7 +1240,7 @@ static int parse_chan_line(RIG *rig, channel_t *chan, char *basep,
}
int aor_get_channel(RIG *rig, channel_t *chan, int read_only)
int aor_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
struct aor_priv_caps *priv = (struct aor_priv_caps *)rig->caps->priv;
char aorcmd[BUFSZ];
@ -1346,7 +1346,7 @@ int aor_get_channel(RIG *rig, channel_t *chan, int read_only)
#define LINES_PER_MA 10
int aor_get_chan_all_cb(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
int aor_get_chan_all_cb(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t arg)
{
struct aor_priv_caps *priv = (struct aor_priv_caps *)rig->caps->priv;
int i, j, retval;

Wyświetl plik

@ -60,9 +60,9 @@ int aor_set_mem(RIG *rig, vfo_t vfo, int ch);
int aor_get_mem(RIG *rig, vfo_t vfo, int *ch);
int aor_set_bank(RIG *rig, vfo_t vfo, int bank);
int aor_get_channel(RIG *rig, channel_t *chan, int read_only);
int aor_set_channel(RIG *rig, const channel_t *chan);
int aor_get_chan_all_cb (RIG * rig, chan_cb_t chan_cb, rig_ptr_t);
int aor_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
int aor_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
int aor_get_chan_all_cb (RIG * rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t);
extern const struct rig_caps ar2700_caps;
extern const struct rig_caps ar8200_caps;

Wyświetl plik

@ -45,7 +45,7 @@ static int ar3030_set_mem(RIG *rig, vfo_t vfo, int ch);
static int ar3030_get_mem(RIG *rig, vfo_t vfo, int *ch);
static int ar3030_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
static int ar3030_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
static int ar3030_get_channel(RIG *rig, channel_t *chan, int read_only);
static int ar3030_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
static int ar3030_init(RIG *rig);
static int ar3030_cleanup(RIG *rig);
static int ar3030_close(RIG *rig);
@ -721,7 +721,7 @@ int ar3030_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
return RIG_OK;
}
int ar3030_get_channel(RIG *rig, channel_t *chan, int read_only)
int ar3030_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
struct ar3030_priv_data *priv = (struct ar3030_priv_data *)rig->state.priv;
char cmdbuf[BUFSZ], infobuf[BUFSZ];

Wyświetl plik

@ -1630,7 +1630,7 @@ static int ar7030p_decode_event(RIG *rig)
return (-RIG_ENIMPL);
}
static int ar7030p_set_channel(RIG *rig, const channel_t *chan)
static int ar7030p_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
assert(NULL != rig);
assert(NULL != chan);
@ -1638,7 +1638,7 @@ static int ar7030p_set_channel(RIG *rig, const channel_t *chan)
return (-RIG_ENIMPL);
}
static int ar7030p_get_channel(RIG *rig, channel_t *chan, int read_only)
static int ar7030p_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
int rc = RIG_OK;
unsigned char v;

Wyświetl plik

@ -615,7 +615,7 @@ int drake_get_mem(RIG *rig, vfo_t vfo, int *ch)
* drake_set_chan
* Assumes rig!=NULL
*/
int drake_set_chan(RIG *rig, const channel_t *chan)
int drake_set_chan(RIG *rig, vfo_t vfo, const channel_t *chan)
{
struct drake_priv_data *priv = rig->state.priv;
vfo_t old_vfo;
@ -671,7 +671,7 @@ int drake_set_chan(RIG *rig, const channel_t *chan)
* drake_get_chan
* Assumes rig!=NULL
*/
int drake_get_chan(RIG *rig, channel_t *chan, int read_only)
int drake_get_chan(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
struct drake_priv_data *priv = rig->state.priv;
vfo_t old_vfo;

Wyświetl plik

@ -42,8 +42,8 @@ int drake_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option);
int drake_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx);
int drake_set_mem(RIG *rig, vfo_t vfo, int ch);
int drake_get_mem(RIG *rig, vfo_t vfo, int *ch);
int drake_set_chan(RIG *rig, const channel_t *chan);
int drake_get_chan(RIG *rig, channel_t *chan, int read_only);
int drake_set_chan(RIG *rig, vfo_t vfo, const channel_t *chan);
int drake_get_chan(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
int drake_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
int drake_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
int drake_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);

Wyświetl plik

@ -1843,7 +1843,7 @@ static int dummy_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
return RIG_OK;
}
static int dummy_set_channel(RIG *rig, const channel_t *chan)
static int dummy_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
@ -1888,7 +1888,7 @@ static int dummy_set_channel(RIG *rig, const channel_t *chan)
}
static int dummy_get_channel(RIG *rig, channel_t *chan, int read_only)
static int dummy_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;

Wyświetl plik

@ -2100,13 +2100,13 @@ static int netrigctl_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
}
}
static int netrigctl_set_channel(RIG *rig, const channel_t *chan)
static int netrigctl_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
return -RIG_ENIMPL;
}
static int netrigctl_get_channel(RIG *rig, channel_t *chan, int read_only)
static int netrigctl_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
return -RIG_ENIMPL;
}

Wyświetl plik

@ -383,7 +383,7 @@ int read_icom_frame(hamlib_port_t *p, unsigned char rxbuffer[],
* TODO: be more exhaustive
* assumes rig!=NULL
*/
int rig2icom_mode(RIG *rig, rmode_t mode, pbwidth_t width,
int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd)
{
unsigned char icmode;
@ -391,6 +391,16 @@ int rig2icom_mode(RIG *rig, rmode_t mode, pbwidth_t width,
icmode_ext = -1;
if (width == RIG_PASSBAND_NOCHANGE) // then we read width so we can reuse it
{
rmode_t tmode;
int ret = rig_get_mode(rig, vfo, &tmode, &width);
if (ret != RIG_OK)
{
rig_debug(RIG_DEBUG_WARN, "%s: Failed to get width for passband nochange err=%s\n", __func__, rigerror(ret));
}
}
switch (mode)
{
case RIG_MODE_AM: icmode = S_AM; break;

Wyświetl plik

@ -32,7 +32,7 @@ int make_cmd_frame(char frame[], char re_id, char ctrl_id, char cmd, int subcmd,
int icom_transaction (RIG *rig, int cmd, int subcmd, const unsigned char *payload, int payload_len, unsigned char *data, int *data_len);
int read_icom_frame(hamlib_port_t *p, unsigned char rxbuffer[], int rxbuffer_len);
int rig2icom_mode(RIG *rig, rmode_t mode, pbwidth_t width, unsigned char *md, signed char *pd);
int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, unsigned char *md, signed char *pd);
void icom2rig_mode(RIG *rig, unsigned char md, int pd, rmode_t *mode, pbwidth_t *width);
#endif /* _FRAME_H */

Wyświetl plik

@ -138,12 +138,12 @@ struct cmdparams ic7000_extcmds[] =
/*
* This function does the special bandwidth coding for IC-7000
*/
static int ic7000_r2i_mode(RIG *rig, rmode_t mode, pbwidth_t width,
static int ic7000_r2i_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd)
{
int err;
err = rig2icom_mode(rig, mode, width, md, pd);
err = rig2icom_mode(rig, vfo, mode, width, md, pd);
if (err != RIG_OK)
{

Wyświetl plik

@ -38,12 +38,12 @@
* and IC-706MKIIG
* (0 - wide, 1 - normal, 2 - narrow)
*/
static int ic706_r2i_mode(RIG *rig, rmode_t mode, pbwidth_t width,
static int ic706_r2i_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd)
{
int err;
err = rig2icom_mode(rig, mode, width, md, pd);
err = rig2icom_mode(rig, vfo, mode, width, md, pd);
if (err != RIG_OK)
{

Wyświetl plik

@ -153,8 +153,8 @@ typedef channel_str_t band_stack_reg_t;
static int ic746_set_parm(RIG *rig, setting_t parm, value_t val);
static int ic746_get_parm(RIG *rig, setting_t parm, value_t *val);
static int ic746pro_get_channel(RIG *rig, channel_t *chan, int read_only);
static int ic746pro_set_channel(RIG *rig, const channel_t *chan);
static int ic746pro_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
static int ic746pro_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
static int ic746pro_set_ext_parm(RIG *rig, token_t token, value_t val);
static int ic746pro_get_ext_parm(RIG *rig, token_t token, value_t *val);
@ -905,7 +905,7 @@ int ic746_get_parm(RIG *rig, setting_t parm, value_t *val)
*
* If memory is empty it will return RIG_OK,but every thing will be null. Where do we boundary check?
*/
int ic746pro_get_channel(RIG *rig, channel_t *chan, int read_only)
int ic746pro_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
struct icom_priv_data *priv;
struct rig_state *rs;
@ -1071,7 +1071,7 @@ int ic746pro_get_channel(RIG *rig, channel_t *chan, int read_only)
* ic746pro_set_channel
* Assumes rig!=NULL, rig->state.priv!=NULL, chan!=NULL
*/
int ic746pro_set_channel(RIG *rig, const channel_t *chan)
int ic746pro_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
struct icom_priv_data *priv;
struct rig_state *rs;
@ -1103,7 +1103,7 @@ int ic746pro_set_channel(RIG *rig, const channel_t *chan)
// RX
to_bcd(membuf.rx.freq, chan->freq, freq_len * 2);
retval = rig2icom_mode(rig, chan->mode, chan->width,
retval = rig2icom_mode(rig, vfo, chan->mode, chan->width,
&membuf.rx.mode, &membuf.rx.pb);
if (retval != RIG_OK)
@ -1150,7 +1150,7 @@ int ic746pro_set_channel(RIG *rig, const channel_t *chan)
// TX
to_bcd(membuf.tx.freq, chan->tx_freq, freq_len * 2);
retval = rig2icom_mode(rig, chan->tx_mode, chan->tx_width,
retval = rig2icom_mode(rig, vfo, chan->tx_mode, chan->tx_width,
&membuf.tx.mode, &membuf.tx.pb);
if (retval != RIG_OK)

Wyświetl plik

@ -97,12 +97,12 @@ int ic756_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
* This function deals with the older type radios with only 2 filter widths
* (0 - normal, 1 - narrow)
*/
static int r2i_mode(RIG *rig, rmode_t mode, pbwidth_t width,
static int r2i_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd)
{
int err;
err = rig2icom_mode(rig, mode, width, md, pd);
err = rig2icom_mode(rig, vfo, mode, width, md, pd);
if (err != RIG_OK)
{

Wyświetl plik

@ -329,12 +329,12 @@ static int ic910_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
* This function does the special bandwidth coding for IC-910
* (1 - normal, 2 - narrow)
*/
static int ic910_r2i_mode(RIG *rig, rmode_t mode, pbwidth_t width,
static int ic910_r2i_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd)
{
int err;
err = rig2icom_mode(rig, mode, width, md, pd);
err = rig2icom_mode(rig, vfo, mode, width, md, pd);
if (*pd == PD_NARROW_3)
{

Wyświetl plik

@ -1631,7 +1631,7 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode,
{
unsigned char mode_icom; // not used as it will map to USB/LSB
signed char width_icom;
rig2icom_mode(rig, mode, width, &mode_icom, &width_icom);
rig2icom_mode(rig, vfo, mode, width, &mode_icom, &width_icom);
// since width_icom is 0-2 for rigs that need this here we have to make it 1-3
datamode[1] = datamode[0] ? width_icom : 0;
retval =
@ -1688,11 +1688,11 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
if (priv_caps->r2i_mode != NULL) /* call priv code if defined */
{
err = priv_caps->r2i_mode(rig, mode, width, &icmode, &icmode_ext);
err = priv_caps->r2i_mode(rig, vfo, mode, width, &icmode, &icmode_ext);
}
else /* else call default */
{
err = rig2icom_mode(rig, mode, width, &icmode, &icmode_ext);
err = rig2icom_mode(rig, vfo, mode, width, &icmode, &icmode_ext);
}
if (err < 0)

Wyświetl plik

@ -161,7 +161,7 @@ struct icom_priv_caps
// the 4 elements above are mandatory
// everything below here is optional in the backends
int settle_time; /*!< Receiver settle time, in ms */
int (*r2i_mode)(RIG *rig, rmode_t mode, pbwidth_t width,
int (*r2i_mode)(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd); /*< backend specific code
to convert bandwidth and
mode to cmd tokens */

Wyświetl plik

@ -85,12 +85,12 @@ struct cmdparams icr30_extcmds[] =
* (1 - normal, 2 - narrow)
*/
static int icr30_r2i_mode(RIG *rig, rmode_t mode, pbwidth_t width,
static int icr30_r2i_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd)
{
int err;
err = rig2icom_mode(rig, mode, width, md, pd);
err = rig2icom_mode(rig, vfo, mode, width, md, pd);
if (*pd == PD_NARROW_3)
{

Wyświetl plik

@ -91,8 +91,8 @@
.flags = 1, \
}
static int icr75_set_channel(RIG *rig, const channel_t *chan);
static int icr75_get_channel(RIG *rig, channel_t *chan, int read_only);
static int icr75_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
static int icr75_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
static int icr75_set_parm(RIG *rig, setting_t parm, value_t val);
static int icr75_get_parm(RIG *rig, setting_t parm, value_t *val);
@ -251,7 +251,7 @@ const struct rig_caps icr75_caps =
* Assumes rig!=NULL, rig->state.priv!=NULL, chan!=NULL
* TODO: still a WIP --SF
*/
int icr75_set_channel(RIG *rig, const channel_t *chan)
int icr75_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
struct icom_priv_data *priv;
struct rig_state *rs;
@ -276,7 +276,7 @@ int icr75_set_channel(RIG *rig, const channel_t *chan)
chan_len = 2 + freq_len + 1;
err = rig2icom_mode(rig, chan->mode, chan->width,
err = rig2icom_mode(rig, vfo, chan->mode, chan->width,
&icmode, &icmode_ext);
if (err != RIG_OK)
@ -320,7 +320,7 @@ int icr75_set_channel(RIG *rig, const channel_t *chan)
* Assumes rig!=NULL, rig->state.priv!=NULL, chan!=NULL
* TODO: still a WIP --SF
*/
int icr75_get_channel(RIG *rig, channel_t *chan, int read_only)
int icr75_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
struct icom_priv_data *priv;
struct rig_state *rs;

Wyświetl plik

@ -54,7 +54,7 @@ const struct confparams opto_ext_parms[] =
};
static int optoscan_get_status_block(RIG *rig, struct optostat *status_block);
static int optoscan_send_freq(RIG *rig, pltstate_t *state);
static int optoscan_send_freq(RIG *rig, vfo_t vfo, pltstate_t *state);
static int optoscan_RTS_toggle(RIG *rig);
static int optoscan_start_timer(RIG *rig, pltstate_t *state);
static int optoscan_wait_timer(RIG *rig, pltstate_t *state);
@ -643,7 +643,7 @@ int optoscan_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
}
/* Step 1 is implicit, since hamlib does this when it opens the device */
optoscan_send_freq(rig, state); /*Step 2*/
optoscan_send_freq(rig, vfo, state); /*Step 2*/
}
rc = 0;
@ -662,7 +662,7 @@ int optoscan_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch)
if (rc != RIG_SCAN_STOP)
{
optoscan_send_freq(rig, state); /*Step 4*/
optoscan_send_freq(rig, vfo, state); /*Step 4*/
}
optoscan_wait_timer(rig, state); /*Step 5*/
@ -768,7 +768,7 @@ static int optoscan_get_status_block(RIG *rig, struct optostat *status_block)
}
static int optoscan_send_freq(RIG *rig, pltstate_t *state)
static int optoscan_send_freq(RIG *rig, vfo_t vfo, pltstate_t *state)
{
unsigned char buff[OPTO_BUFF_SIZE];
char md, pd;
@ -782,7 +782,7 @@ static int optoscan_send_freq(RIG *rig, pltstate_t *state)
to_bcd(buff, freq, 5 * 2); /* to_bcd requires nibble len */
rig2icom_mode(rig, mode, 0, (unsigned char *) &md, (signed char *) &pd);
rig2icom_mode(rig, vfo, mode, 0, (unsigned char *) &md, (signed char *) &pd);
buff[5] = md;
/* read echo'd chars only...there will be no ACK from this command

Wyświetl plik

@ -58,7 +58,7 @@
} }
static int perseus_r2i_mode(RIG *rig, rmode_t mode, pbwidth_t width,
static int perseus_r2i_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd);
static void perseus_i2r_mode(RIG *rig, unsigned char md, int pd,
rmode_t *mode, pbwidth_t *width);
@ -184,12 +184,12 @@ const struct rig_caps perseus_caps =
*
* NB: the filter width will be ignored.
*/
static int perseus_r2i_mode(RIG *rig, rmode_t mode, pbwidth_t width,
static int perseus_r2i_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd)
{
int err;
err = rig2icom_mode(rig, mode, width, md, pd);
err = rig2icom_mode(rig, vfo, mode, width, md, pd);
if (err == 0 && mode == RIG_MODE_SAM)
{

Wyświetl plik

@ -1401,7 +1401,7 @@ int jrc_get_mem(RIG *rig, vfo_t vfo, int *ch)
* jrc_set_chan
* Assumes rig!=NULL
*/
int jrc_set_chan(RIG *rig, const channel_t *chan)
int jrc_set_chan(RIG *rig, vfo_t vfo, const channel_t *chan)
{
struct jrc_priv_caps *priv = (struct jrc_priv_caps *)rig->caps->priv;
char cmdbuf[BUFSZ];
@ -1413,7 +1413,7 @@ int jrc_set_chan(RIG *rig, const channel_t *chan)
/* read first to get current values */
current.channel_num = chan->channel_num;
if ((retval = jrc_get_chan(rig, &current, 1)) != RIG_OK) { return retval; }
if ((retval = jrc_get_chan(rig, vfo, &current, 1)) != RIG_OK) { return retval; }
sprintf(cmdbuf, "K%03d000", chan->channel_num);
@ -1465,7 +1465,7 @@ int jrc_set_chan(RIG *rig, const channel_t *chan)
* jrc_get_chan
* Assumes rig!=NULL
*/
int jrc_get_chan(RIG *rig, channel_t *chan, int read_only)
int jrc_get_chan(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
struct jrc_priv_caps *priv = (struct jrc_priv_caps *)rig->caps->priv;
char membuf[BUFSZ], cmdbuf[BUFSZ];

Wyświetl plik

@ -54,8 +54,8 @@ int jrc_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd);
int jrc_set_trn(RIG *rig, int trn);
int jrc_set_mem(RIG *rig, vfo_t vfo, int ch);
int jrc_get_mem(RIG *rig, vfo_t vfo, int *ch);
int jrc_set_chan(RIG *rig, const channel_t *chan);
int jrc_get_chan(RIG *rig, channel_t *chan, int read_only);
int jrc_set_chan(RIG *rig, vfo_t vfo, const channel_t *chan);
int jrc_get_chan(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
int jrc_set_powerstat(RIG *rig, powerstat_t status);
int jrc_get_powerstat(RIG *rig, powerstat_t *status);
int jrc_reset(RIG *rig, reset_t reset);

Wyświetl plik

@ -634,7 +634,7 @@ int ic10_set_mem(RIG *rig, vfo_t vfo, int ch)
}
int ic10_get_channel(RIG *rig, channel_t *chan, int read_only)
int ic10_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
char membuf[16], infobuf[32];
int retval, info_len, len;
@ -731,7 +731,7 @@ int ic10_get_channel(RIG *rig, channel_t *chan, int read_only)
}
int ic10_set_channel(RIG *rig, const channel_t *chan)
int ic10_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
char membuf[64];
int retval, len, md;

Wyświetl plik

@ -46,8 +46,8 @@ int ic10_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
int ic10_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
int ic10_set_mem(RIG *rig, vfo_t vfo, int ch);
int ic10_get_mem(RIG *rig, vfo_t vfo, int *ch);
int ic10_set_channel(RIG *rig, const channel_t *chan);
int ic10_get_channel(RIG *rig, channel_t *chan, int read_only);
int ic10_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
int ic10_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
int ic10_set_powerstat(RIG *rig, powerstat_t status);
int ic10_get_powerstat(RIG *rig, powerstat_t *status);
int ic10_set_trn(RIG *rig, int trn);

Wyświetl plik

@ -4242,7 +4242,7 @@ int kenwood_get_mem_if(RIG *rig, vfo_t vfo, int *ch)
return RIG_OK;
}
int kenwood_get_channel(RIG *rig, channel_t *chan, int read_only)
int kenwood_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
int err;
char buf[26];
@ -4364,7 +4364,7 @@ int kenwood_get_channel(RIG *rig, channel_t *chan, int read_only)
return RIG_OK;
}
int kenwood_set_channel(RIG *rig, const channel_t *chan)
int kenwood_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
char buf[128];
char mode, tx_mode = 0;

Wyświetl plik

@ -201,8 +201,8 @@ int kenwood_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
int kenwood_set_mem(RIG *rig, vfo_t vfo, int ch);
int kenwood_get_mem(RIG *rig, vfo_t vfo, int *ch);
int kenwood_get_mem_if(RIG *rig, vfo_t vfo, int *ch);
int kenwood_get_channel(RIG *rig, channel_t *chan, int read_only);
int kenwood_set_channel(RIG *rig, const channel_t *chan);
int kenwood_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
int kenwood_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
int kenwood_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch);
const char *kenwood_get_info(RIG *rig);
int kenwood_get_id(RIG *rig, char *buf);

Wyświetl plik

@ -64,8 +64,8 @@ static int pihpsdr_open(RIG *rig);
static int pihpsdr_get_level(RIG *rig, vfo_t vfo, setting_t level,
value_t *val);
static int pihpsdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
static int pihspdr_get_channel(RIG *rig, channel_t *chan, int read_only);
static int pihspdr_set_channel(RIG *rig, const channel_t *chan);
static int pihspdr_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
static int pihspdr_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
static struct kenwood_priv_caps ts2000_priv_caps =
@ -342,7 +342,7 @@ const struct rig_caps pihpsdr_caps =
*/
int pihspdr_get_channel(RIG *rig, channel_t *chan, int read_only)
int pihspdr_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
int err;
int tmp;
@ -580,7 +580,7 @@ int pihspdr_get_channel(RIG *rig, channel_t *chan, int read_only)
return RIG_OK;
}
int pihspdr_set_channel(RIG *rig, const channel_t *chan)
int pihspdr_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
char sqltype;
char shift;

Wyświetl plik

@ -1895,7 +1895,7 @@ int th_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
/* get and set channel tested on thg71&thf7e */
/* must work on other th and tm kenwood rigs */
/* --------------------------------------------------------------------- */
int th_get_channel(RIG *rig, channel_t *chan, int read_only)
int th_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
char membuf[64], ackbuf[ACKBUF_LEN];
int retval;
@ -1904,7 +1904,7 @@ int th_get_channel(RIG *rig, channel_t *chan, int read_only)
int step, shift, rev, tone, ctcss, tonefq, ctcssfq, dcs, dcscode, mode, lockout;
const char *mr_extra;
int channel_num;
vfo_t vfo;
vfo_t vfotmp;
const struct kenwood_priv_caps *priv = (const struct kenwood_priv_caps *)
rig->caps->priv;
const chan_t *chan_caps;
@ -1926,10 +1926,10 @@ int th_get_channel(RIG *rig, channel_t *chan, int read_only)
}
channel_num = chan->channel_num;
vfo = chan->vfo;
vfotmp = chan->vfo;
memset(chan, 0, sizeof(channel_t));
chan->channel_num = channel_num;
chan->vfo = vfo;
chan->vfo = vfotmp;
if (rig->caps->rig_model == RIG_MODEL_THF7E ||
rig->caps->rig_model == RIG_MODEL_THF6A)
@ -2215,7 +2215,7 @@ static int find_tone_index(const tone_t *tone_list, tone_t tone)
}
/* --------------------------------------------------------------------- */
int th_set_channel(RIG *rig, const channel_t *chan)
int th_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
char membuf[256];
int retval;

Wyświetl plik

@ -60,8 +60,8 @@ extern int th_get_mem(RIG *rig, vfo_t vfo, int *ch);
extern int th_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
extern int th_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
extern int th_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd);
extern int th_get_channel(RIG *rig, channel_t *chan, int read_only);
extern int th_set_channel(RIG *rig, const channel_t *chan);
extern int th_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
extern int th_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
extern int th_set_ant (RIG * rig, vfo_t vfo, ant_t ant, value_t option);
extern int th_get_ant (RIG * rig, vfo_t vfo, ant_t dummy, value_t *option, ant_t * ant_curr, ant_t *ant_tx, ant_t *ant_rx);
extern int th_reset(RIG *rig, reset_t reset);

Wyświetl plik

@ -1271,7 +1271,7 @@ static int thd72_get_mem(RIG *rig, vfo_t vfo, int *ch)
return RIG_OK;
}
static int thd72_set_channel(RIG *rig, const channel_t *chan)
static int thd72_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
@ -1358,7 +1358,7 @@ static int thd72_parse_channel(int kind, const char *buf, channel_t *chan)
return RIG_OK;
}
static int thd72_get_channel(RIG *rig, channel_t *chan, int read_only)
static int thd72_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
int retval;
char buf[72];

Wyświetl plik

@ -1188,7 +1188,7 @@ static int thd74_get_mem(RIG *rig, vfo_t vfo, int *ch)
return RIG_OK;
}
static int thd74_set_channel(RIG *rig, const channel_t *chan)
static int thd74_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
@ -1275,7 +1275,7 @@ static int thd74_parse_channel(int kind, const char *buf, channel_t *chan)
return RIG_OK;
}
static int thd74_get_channel(RIG *rig, channel_t *chan, int read_only)
static int thd74_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
int retval;
char buf[72];

Wyświetl plik

@ -70,8 +70,8 @@ static int tmd710_get_mem(RIG *rig, vfo_t vfo, int *ch);
static int tmd710_set_mem(RIG *rig, vfo_t vfo, int ch);
static int tmd710_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code);
static int tmd710_get_dcs_sql(RIG *rig, vfo_t vfo, tone_t *code);
static int tmd710_set_channel(RIG *rig, const channel_t *chan);
static int tmd710_get_channel(RIG *rig, channel_t *chan, int read_only);
static int tmd710_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
static int tmd710_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
static int tmd710_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
static int tmd710_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd);
static int tmd710_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
@ -1833,7 +1833,7 @@ int tmd710_set_mem(RIG *rig, vfo_t vfo, int ch)
return kenwood_safe_transaction(rig, cmd, membuf, sizeof(membuf), 8);
}
int tmd710_get_channel(RIG *rig, channel_t *chan, int read_only)
int tmd710_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
int retval;
tmd710_me me_struct;
@ -1946,7 +1946,7 @@ int tmd710_get_channel(RIG *rig, channel_t *chan, int read_only)
return RIG_OK;
}
int tmd710_set_channel(RIG *rig, const channel_t *chan)
int tmd710_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
int retval;
tmd710_me me_struct;

Wyświetl plik

@ -87,8 +87,8 @@ static int tmv7_decode_event(RIG *rig);
static int tmv7_set_vfo(RIG *rig, vfo_t vfo);
static int tmv7_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
static int tmv7_get_powerstat(RIG *rig, powerstat_t *status);
static int tmv7_get_channel(RIG *rig, channel_t *chan, int read_only);
static int tmv7_set_channel(RIG *rig, const channel_t *chan);
static int tmv7_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
static int tmv7_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
/*
* tm-v7 rig capabilities.
@ -496,7 +496,7 @@ int tmv7_get_powerstat(RIG *rig, powerstat_t *status)
/* --------------------------------------------------------------------- */
int tmv7_get_channel(RIG *rig, channel_t *chan, int read_only)
int tmv7_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
char membuf[64], ackbuf[ACKBUF_LEN];
int retval;
@ -662,7 +662,7 @@ int tmv7_get_channel(RIG *rig, channel_t *chan, int read_only)
return RIG_OK;
}
/* --------------------------------------------------------------------- */
int tmv7_set_channel(RIG *rig, const channel_t *chan)
int tmv7_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
char membuf[ACKBUF_LEN];
int retval;

Wyświetl plik

@ -58,8 +58,8 @@
/* prototypes */
static int ts2000_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
static int ts2000_get_channel(RIG *rig, channel_t *chan, int read_only);
static int ts2000_set_channel(RIG *rig, const channel_t *chan);
static int ts2000_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
static int ts2000_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
/*
* 38 CTCSS sub-audible tones + 1750 tone
@ -369,7 +369,7 @@ const struct rig_caps ts2000_caps =
*/
int ts2000_get_channel(RIG *rig, channel_t *chan, int read_only)
int ts2000_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
int err;
int tmp;
@ -607,7 +607,7 @@ int ts2000_get_channel(RIG *rig, channel_t *chan, int read_only)
return RIG_OK;
}
int ts2000_set_channel(RIG *rig, const channel_t *chan)
int ts2000_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
char sqltype = '0';
char buf[128];

Wyświetl plik

@ -688,7 +688,7 @@ int ts570_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo)
.ctcss_tone=1 \
}
int ts570_set_channel(RIG *rig, const channel_t *chan)
int ts570_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
char cmdbuf[30];
int retval, cmd_len;

Wyświetl plik

@ -73,7 +73,7 @@ static struct kenwood_priv_caps ts850_priv_caps =
static int ts850_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
static int ts850_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit);
static int ts850_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
static int ts850_set_channel(RIG *rig, const channel_t *chan);
static int ts850_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
static const struct confparams ts850_ext_parms[] =
{
@ -513,7 +513,7 @@ int ts850_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
return retval; // Never gets here.
}
int ts850_set_channel(RIG *rig, const channel_t *chan)
int ts850_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
char cmdbuf[30];
int retval;

Wyświetl plik

@ -201,7 +201,7 @@ int prm80_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
memset(&chan, 0, sizeof(chan));
chan.vfo = RIG_VFO_CURR;
ret = prm80_get_channel(rig, &chan, 0);
ret = prm80_get_channel(rig, vfo, &chan, 0);
if (ret != RIG_OK)
{
@ -246,7 +246,7 @@ int prm80_get_mem(RIG *rig, vfo_t vfo, int *ch)
memset(&chan, 0, sizeof(chan));
chan.vfo = RIG_VFO_CURR;
ret = prm80_get_channel(rig, &chan, 0);
ret = prm80_get_channel(rig, vfo, &chan, 0);
if (ret != RIG_OK)
{
@ -276,7 +276,7 @@ static int hhtoi(const char *p)
* prm80_get_channel
* Assumes rig!=NULL
*/
int prm80_get_channel(RIG *rig, channel_t *chan, int read_only)
int prm80_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
char statebuf[BUFSZ];
int statebuf_len = BUFSZ;
@ -347,7 +347,7 @@ int prm80_get_channel(RIG *rig, channel_t *chan, int read_only)
* prm80_set_channel
* Assumes rig!=NULL
*/
int prm80_set_channel(RIG *rig, const channel_t *chan)
int prm80_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
char statebuf[BUFSZ];
int statebuf_len = BUFSZ;
@ -432,7 +432,7 @@ int prm80_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
memset(&chan, 0, sizeof(chan));
chan.vfo = RIG_VFO_CURR;
ret = prm80_get_channel(rig, &chan, 1);
ret = prm80_get_channel(rig, vfo, &chan, 1);
if (ret != RIG_OK)
{

Wyświetl plik

@ -42,8 +42,8 @@ int prm80_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int prm80_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int prm80_set_mem (RIG *rig, vfo_t vfo, int ch);
int prm80_get_mem (RIG *rig, vfo_t vfo, int *ch);
int prm80_set_channel(RIG * rig, const channel_t * chan);
int prm80_get_channel(RIG * rig, channel_t * chan, int read_only);
int prm80_set_channel(RIG * rig, vfo_t vfo, const channel_t * chan);
int prm80_get_channel(RIG * rig, vfo_t vfo, channel_t * chan, int read_only);
const char* prm80_get_info(RIG *rig);

Wyświetl plik

@ -590,7 +590,7 @@ int uniden_get_mem(RIG *rig, vfo_t vfo, int *ch)
* uniden_get_channel
* Assumes rig!=NULL
*/
int uniden_get_channel(RIG *rig, channel_t *chan, int read_only)
int uniden_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
char cmdbuf[BUFSZ], membuf[BUFSZ];
size_t cmd_len = BUFSZ, mem_len = BUFSZ;
@ -689,7 +689,7 @@ int uniden_get_channel(RIG *rig, channel_t *chan, int read_only)
*
* Only freq can be set?
*/
int uniden_set_channel(RIG *rig, const channel_t *chan)
int uniden_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
char cmdbuf[BUFSZ], membuf[BUFSZ];
size_t cmd_len = BUFSZ, mem_len = BUFSZ;

Wyświetl plik

@ -66,8 +66,8 @@ int uniden_get_mem(RIG *rig, vfo_t vfo, int *ch);
int uniden_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd);
int uniden_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int uniden_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int uniden_get_channel(RIG *rig, channel_t *chan, int read_only);
int uniden_set_channel(RIG *rig, const channel_t *chan);
int uniden_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
int uniden_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan);
const char* uniden_get_info(RIG *rig);
extern const struct rig_caps bc895_caps;

Wyświetl plik

@ -2666,7 +2666,7 @@ int ft1000d_get_mem(RIG *rig, vfo_t vfo, int *ch)
* -------------------------------------------------------------------------
* Returns RIG_OK on success or an error code on failure
*/
int ft1000d_set_channel(RIG *rig, const channel_t *chan)
int ft1000d_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@ -2698,7 +2698,7 @@ int ft1000d_set_channel(RIG *rig, const channel_t *chan)
* Status for split operation, active rig functions and tuning steps
* are only relevant for currVFO
*/
int ft1000d_get_channel(RIG *rig, channel_t *chan, int read_only)
int ft1000d_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
struct ft1000d_priv_data *priv;
ft1000d_op_data_t *p;

Wyświetl plik

@ -193,8 +193,8 @@ int ft1000d_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *value);
int ft1000d_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
int ft1000d_set_mem(RIG *rig, vfo_t vfo, int ch);
int ft1000d_get_mem(RIG *rig, vfo_t vfo, int *ch);
int ft1000d_set_channel (RIG *rig, const channel_t *chan);
int ft1000d_get_channel (RIG *rig, channel_t *chan, int read_only);
int ft1000d_set_channel (RIG *rig, vfo_t vfo, const channel_t *chan);
int ft1000d_get_channel (RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
/*

Wyświetl plik

@ -2615,7 +2615,7 @@ int ft990_get_mem(RIG *rig, vfo_t vfo, int *ch)
* -------------------------------------------------------------------------
* Returns RIG_OK on success or an error code on failure
*/
int ft990_set_channel(RIG *rig, const channel_t *chan)
int ft990_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@ -2647,7 +2647,7 @@ int ft990_set_channel(RIG *rig, const channel_t *chan)
* Status for split operation, active rig functions and tuning steps
* are only relevant for currVFO
*/
int ft990_get_channel(RIG *rig, channel_t *chan, int read_only)
int ft990_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
struct ft990_priv_data *priv;
ft990_op_data_t *p;

Wyświetl plik

@ -175,8 +175,8 @@ int ft990_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
int ft990_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op);
int ft990_set_mem(RIG *rig, vfo_t vfo, int ch);
int ft990_get_mem(RIG *rig, vfo_t vfo, int *ch);
int ft990_set_channel (RIG *rig, const channel_t *chan);
int ft990_get_channel (RIG *rig, channel_t *chan, int read_only);
int ft990_set_channel (RIG *rig, vfo_t vfo, const channel_t *chan);
int ft990_get_channel (RIG *rig, vfo_t vfo, channel_t *chan, int read_only);
/*

Wyświetl plik

@ -5336,7 +5336,7 @@ int newcat_set_mem(RIG *rig, vfo_t vfo, int ch)
/* Test for valid usable channel, skip if empty */
memset(&valid_chan, 0, sizeof(channel_t));
valid_chan.channel_num = ch;
err = newcat_get_channel(rig, &valid_chan, 1);
err = newcat_get_channel(rig, vfo, &valid_chan, 1);
if (err < 0)
{
@ -5620,7 +5620,7 @@ int newcat_decode_event(RIG *rig)
}
int newcat_set_channel(RIG *rig, const channel_t *chan)
int newcat_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
struct rig_state *state = &rig->state;
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
@ -5778,7 +5778,7 @@ int newcat_set_channel(RIG *rig, const channel_t *chan)
}
int newcat_get_channel(RIG *rig, channel_t *chan, int read_only)
int newcat_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only)
{
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
char *retval;

Wyświetl plik

@ -211,8 +211,8 @@ int newcat_set_ts(RIG * rig, vfo_t vfo, shortfreq_t ts);
int newcat_get_ts(RIG * rig, vfo_t vfo, shortfreq_t * ts);
int newcat_set_trn(RIG * rig, int trn);
int newcat_get_trn(RIG * rig, int *trn);
int newcat_set_channel(RIG * rig, const channel_t * chan);
int newcat_get_channel(RIG * rig, channel_t * chan, int read_only);
int newcat_set_channel(RIG * rig, vfo_t vfo, const channel_t * chan);
int newcat_get_channel(RIG * rig, vfo_t vfo, channel_t * chan, int read_only);
rmode_t newcat_rmode(char mode);
char newcat_modechar(rmode_t rmode);
rmode_t newcat_rmode_width(RIG *rig, vfo_t vfo, char mode, pbwidth_t *width);

Wyświetl plik

@ -685,12 +685,12 @@ static int generic_restore_channel(RIG *rig, const channel_t *chan)
*
* \sa rig_get_channel()
*/
int HAMLIB_API rig_set_channel(RIG *rig, const channel_t *chan)
int HAMLIB_API rig_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan)
{
struct rig_caps *rc;
int curr_chan_num, get_mem_status = RIG_OK;
vfo_t curr_vfo;
vfo_t vfo; /* requested vfo */
vfo_t vfotmp; /* requested vfo */
int retcode;
int can_emulate_by_vfo_mem, can_emulate_by_vfo_op;
@ -709,7 +709,7 @@ int HAMLIB_API rig_set_channel(RIG *rig, const channel_t *chan)
if (rc->set_channel)
{
return rc->set_channel(rig, chan);
return rc->set_channel(rig, vfo, chan);
}
/*
@ -717,15 +717,15 @@ int HAMLIB_API rig_set_channel(RIG *rig, const channel_t *chan)
* Optional: get_vfo, set_vfo,
*/
vfo = chan->vfo;
vfotmp = chan->vfo;
if (vfo == RIG_VFO_CURR)
if (vfotmp == RIG_VFO_CURR)
{
return generic_restore_channel(rig, chan);
}
/* any emulation requires set_mem() */
if (vfo == RIG_VFO_MEM && !rc->set_mem)
if (vfotmp == RIG_VFO_MEM && !rc->set_mem)
{
return -RIG_ENAVAIL;
}
@ -743,14 +743,14 @@ int HAMLIB_API rig_set_channel(RIG *rig, const channel_t *chan)
curr_vfo = rig->state.current_vfo;
if (vfo == RIG_VFO_MEM)
if (vfotmp == RIG_VFO_MEM)
{
get_mem_status = rig_get_mem(rig, RIG_VFO_CURR, &curr_chan_num);
}
if (can_emulate_by_vfo_mem && curr_vfo != vfo)
if (can_emulate_by_vfo_mem && curr_vfo != vfotmp)
{
retcode = rig_set_vfo(rig, vfo);
retcode = rig_set_vfo(rig, vfotmp);
if (retcode != RIG_OK)
{
@ -758,7 +758,7 @@ int HAMLIB_API rig_set_channel(RIG *rig, const channel_t *chan)
}
}
if (vfo == RIG_VFO_MEM)
if (vfotmp == RIG_VFO_MEM)
{
rig_set_mem(rig, RIG_VFO_CURR, chan->channel_num);
}
@ -776,7 +776,7 @@ int HAMLIB_API rig_set_channel(RIG *rig, const channel_t *chan)
}
/* restore current memory number */
if (vfo == RIG_VFO_MEM && get_mem_status == RIG_OK)
if (vfotmp == RIG_VFO_MEM && get_mem_status == RIG_OK)
{
rig_set_mem(rig, RIG_VFO_CURR, curr_chan_num);
}
@ -829,12 +829,12 @@ int HAMLIB_API rig_set_channel(RIG *rig, const channel_t *chan)
*
* \sa rig_set_channel()
*/
int HAMLIB_API rig_get_channel(RIG *rig, channel_t *chan, int read_only)
int HAMLIB_API rig_get_channel(RIG *rig, vfo_t vfox, channel_t *chan, int read_only)
{
struct rig_caps *rc;
int curr_chan_num, get_mem_status = RIG_OK;
vfo_t curr_vfo;
vfo_t vfo; /* requested vfo */
vfo_t vfotmp=RIG_VFO_NONE; /* requested vfo */
int retcode = RIG_OK;
int can_emulate_by_vfo_mem, can_emulate_by_vfo_op;
@ -853,7 +853,7 @@ int HAMLIB_API rig_get_channel(RIG *rig, channel_t *chan, int read_only)
if (rc->get_channel)
{
return rc->get_channel(rig, chan, read_only);
return rc->get_channel(rig, vfotmp, chan, read_only);
}
/*
@ -861,15 +861,15 @@ int HAMLIB_API rig_get_channel(RIG *rig, channel_t *chan, int read_only)
* Optional: get_vfo, set_vfo
* TODO: check return codes
*/
vfo = chan->vfo;
vfotmp = chan->vfo;
if (vfo == RIG_VFO_CURR)
if (vfotmp == RIG_VFO_CURR)
{
return generic_save_channel(rig, chan);
}
/* any emulation requires set_mem() */
if (vfo == RIG_VFO_MEM && !rc->set_mem)
if (vfotmp == RIG_VFO_MEM && !rc->set_mem)
{
return -RIG_ENAVAIL;
}
@ -887,16 +887,16 @@ int HAMLIB_API rig_get_channel(RIG *rig, channel_t *chan, int read_only)
curr_vfo = rig->state.current_vfo;
if (vfo == RIG_VFO_MEM)
if (vfotmp == RIG_VFO_MEM)
{
get_mem_status = rig_get_mem(rig, RIG_VFO_CURR, &curr_chan_num);
}
if (!read_only)
{
if (can_emulate_by_vfo_mem && curr_vfo != vfo)
if (can_emulate_by_vfo_mem && curr_vfo != vfotmp)
{
retcode = rig_set_vfo(rig, vfo);
retcode = rig_set_vfo(rig, vfotmp);
if (retcode != RIG_OK)
{
@ -904,7 +904,7 @@ int HAMLIB_API rig_get_channel(RIG *rig, channel_t *chan, int read_only)
}
}
if (vfo == RIG_VFO_MEM)
if (vfotmp == RIG_VFO_MEM)
{
rig_set_mem(rig, RIG_VFO_CURR, chan->channel_num);
}
@ -922,7 +922,7 @@ int HAMLIB_API rig_get_channel(RIG *rig, channel_t *chan, int read_only)
retcode = generic_save_channel(rig, chan);
/* restore current memory number */
if (vfo == RIG_VFO_MEM && get_mem_status == RIG_OK)
if (vfotmp == RIG_VFO_MEM && get_mem_status == RIG_OK)
{
rig_set_mem(rig, RIG_VFO_CURR, curr_chan_num);
}
@ -939,7 +939,7 @@ int HAMLIB_API rig_get_channel(RIG *rig, channel_t *chan, int read_only)
#ifndef DOC_HIDDEN
int get_chan_all_cb_generic(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
int get_chan_all_cb_generic(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t arg)
{
int i, j;
chan_t *chan_list = rig->state.chan_list;
@ -977,7 +977,7 @@ int get_chan_all_cb_generic(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
/*
* TODO: if doesn't have rc->get_channel, special generic
*/
retval = rig_get_channel(rig, chan, 1);
retval = rig_get_channel(rig, vfo, chan, 1);
if (retval == -RIG_ENAVAIL)
{
@ -1004,7 +1004,7 @@ int get_chan_all_cb_generic(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
}
int set_chan_all_cb_generic(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
int set_chan_all_cb_generic(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t arg)
{
int i, j, retval;
chan_t *chan_list = rig->state.chan_list;
@ -1019,7 +1019,7 @@ int set_chan_all_cb_generic(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
chan_cb(rig, &chan, j, chan_list, arg);
chan->vfo = RIG_VFO_MEM;
retval = rig_set_channel(rig, chan);
retval = rig_set_channel(rig, vfo, chan);
if (retval != RIG_OK)
{
@ -1076,7 +1076,7 @@ static int map_chan(RIG *rig,
*
* \sa rig_set_chan_all(), rig_get_chan_all_cb()
*/
int HAMLIB_API rig_set_chan_all_cb(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
int HAMLIB_API rig_set_chan_all_cb(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t arg)
{
struct rig_caps *rc;
int retval;
@ -1092,11 +1092,11 @@ int HAMLIB_API rig_set_chan_all_cb(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
if (rc->set_chan_all_cb)
{
return rc->set_chan_all_cb(rig, chan_cb, arg);
return rc->set_chan_all_cb(rig, vfo, chan_cb, arg);
}
/* if not available, emulate it */
retval = set_chan_all_cb_generic(rig, chan_cb, arg);
retval = set_chan_all_cb_generic(rig, vfo, chan_cb, arg);
return retval;
}
@ -1122,7 +1122,7 @@ int HAMLIB_API rig_set_chan_all_cb(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
*
* \sa rig_get_chan_all(), rig_set_chan_all_cb()
*/
int HAMLIB_API rig_get_chan_all_cb(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
int HAMLIB_API rig_get_chan_all_cb(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t arg)
{
struct rig_caps *rc;
int retval;
@ -1138,12 +1138,12 @@ int HAMLIB_API rig_get_chan_all_cb(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
if (rc->get_chan_all_cb)
{
return rc->get_chan_all_cb(rig, chan_cb, arg);
return rc->get_chan_all_cb(rig, vfo, chan_cb, arg);
}
/* if not available, emulate it */
retval = get_chan_all_cb_generic(rig, chan_cb, arg);
retval = get_chan_all_cb_generic(rig, vfo, chan_cb, arg);
return retval;
}
@ -1162,7 +1162,7 @@ int HAMLIB_API rig_get_chan_all_cb(RIG *rig, chan_cb_t chan_cb, rig_ptr_t arg)
*
* \sa rig_set_chan_all_cb(), rig_get_chan_all()
*/
int HAMLIB_API rig_set_chan_all(RIG *rig, const channel_t chans[])
int HAMLIB_API rig_set_chan_all(RIG *rig, vfo_t vfo, const channel_t chans[])
{
struct rig_caps *rc;
struct map_all_s map_arg;
@ -1180,12 +1180,12 @@ int HAMLIB_API rig_set_chan_all(RIG *rig, const channel_t chans[])
if (rc->set_chan_all_cb)
{
return rc->set_chan_all_cb(rig, map_chan, (rig_ptr_t)&map_arg);
return rc->set_chan_all_cb(rig, vfo, map_chan, (rig_ptr_t)&map_arg);
}
/* if not available, emulate it */
retval = set_chan_all_cb_generic(rig, map_chan, (rig_ptr_t)&map_arg);
retval = set_chan_all_cb_generic(rig, vfo, map_chan, (rig_ptr_t)&map_arg);
return retval;
}
@ -1204,7 +1204,7 @@ int HAMLIB_API rig_set_chan_all(RIG *rig, const channel_t chans[])
*
* \sa rig_get_chan_all_cb(), rig_set_chan_all()
*/
int HAMLIB_API rig_get_chan_all(RIG *rig, channel_t chans[])
int HAMLIB_API rig_get_chan_all(RIG *rig, vfo_t vfo, channel_t chans[])
{
struct rig_caps *rc;
struct map_all_s map_arg;
@ -1222,7 +1222,7 @@ int HAMLIB_API rig_get_chan_all(RIG *rig, channel_t chans[])
if (rc->get_chan_all_cb)
{
return rc->get_chan_all_cb(rig, map_chan, (rig_ptr_t)&map_arg);
return rc->get_chan_all_cb(rig, vfo, map_chan, (rig_ptr_t)&map_arg);
}
/*
@ -1230,7 +1230,7 @@ int HAMLIB_API rig_get_chan_all(RIG *rig, channel_t chans[])
*
* TODO: save_current_state, restore_current_state
*/
retval = get_chan_all_cb_generic(rig, map_chan, (rig_ptr_t)&map_arg);
retval = get_chan_all_cb_generic(rig, vfo, map_chan, (rig_ptr_t)&map_arg);
return retval;
}
@ -1283,14 +1283,14 @@ static int map_parm(RIG *rig, const struct confparams *cfgps, value_t *value,
}
int get_parm_all_cb_generic(RIG *rig, confval_cb_t parm_cb, rig_ptr_t cfgps,
int get_parm_all_cb_generic(RIG *rig, vfo_t vfo, confval_cb_t parm_cb, rig_ptr_t cfgps,
rig_ptr_t vals)
{
return -RIG_ENIMPL;
}
int set_parm_all_cb_generic(RIG *rig, confval_cb_t parm_cb, rig_ptr_t cfgps,
int set_parm_all_cb_generic(RIG *rig, vfo_t vfo, confval_cb_t parm_cb, rig_ptr_t cfgps,
rig_ptr_t vals)
{
return -RIG_ENIMPL;
@ -1318,6 +1318,7 @@ int set_parm_all_cb_generic(RIG *rig, confval_cb_t parm_cb, rig_ptr_t cfgps,
* \todo finish coding and testing of mem_all functions
*/
int HAMLIB_API rig_set_mem_all_cb(RIG *rig,
vfo_t vfo,
chan_cb_t chan_cb,
confval_cb_t parm_cb,
rig_ptr_t arg)
@ -1341,7 +1342,7 @@ int HAMLIB_API rig_set_mem_all_cb(RIG *rig,
/* if not available, emulate it */
retval = rig_set_chan_all_cb(rig, chan_cb, arg);
retval = rig_set_chan_all_cb(rig, vfo, chan_cb, arg);
if (retval != RIG_OK)
{
@ -1385,6 +1386,7 @@ int HAMLIB_API rig_set_mem_all_cb(RIG *rig,
* \todo finish coding and testing of mem_all functions
*/
int HAMLIB_API rig_get_mem_all_cb(RIG *rig,
vfo_t vfo,
chan_cb_t chan_cb,
confval_cb_t parm_cb,
rig_ptr_t arg)
@ -1407,7 +1409,7 @@ int HAMLIB_API rig_get_mem_all_cb(RIG *rig,
}
/* if not available, emulate it */
retval = rig_get_chan_all_cb(rig, chan_cb, arg);
retval = rig_get_chan_all_cb(rig, vfo, chan_cb, arg);
if (retval != RIG_OK)
{
@ -1450,6 +1452,7 @@ int HAMLIB_API rig_get_mem_all_cb(RIG *rig,
* \todo finish coding and testing of mem_all functions
*/
int HAMLIB_API rig_set_mem_all(RIG *rig,
vfo_t vfo,
const channel_t chans[],
const struct confparams cfgps[],
const value_t vals[])
@ -1475,7 +1478,7 @@ int HAMLIB_API rig_set_mem_all(RIG *rig,
(rig_ptr_t)&mem_all_arg);
/* if not available, emulate it */
retval = rig_set_chan_all(rig, chans);
retval = rig_set_chan_all(rig, vfo, chans);
if (retval != RIG_OK)
{
@ -1517,6 +1520,7 @@ int HAMLIB_API rig_set_mem_all(RIG *rig,
* \todo finish coding and testing of mem_all functions
*/
int HAMLIB_API rig_get_mem_all(RIG *rig,
vfo_t vfo,
channel_t chans[],
const struct confparams cfgps[],
value_t vals[])
@ -1546,14 +1550,14 @@ int HAMLIB_API rig_get_mem_all(RIG *rig,
*
* TODO: save_current_state, restore_current_state
*/
retval = rig_get_chan_all(rig, chans);
retval = rig_get_chan_all(rig, vfo, chans);
if (retval != RIG_OK)
{
return retval;
}
retval = get_parm_all_cb_generic(rig, map_parm,
retval = get_parm_all_cb_generic(rig, vfo, map_parm,
(rig_ptr_t)cfgps,
(rig_ptr_t)vals);

Wyświetl plik

@ -97,7 +97,7 @@ int csv_save(RIG *rig, const char *outfilename)
rig->caps->clone_combo_get);
}
status = rig_get_chan_all_cb(rig, dump_csv_chan, f);
status = rig_get_chan_all_cb(rig, RIG_VFO_NONE, dump_csv_chan, f);
fclose(f);
@ -175,7 +175,7 @@ int csv_load(RIG *rig, const char *infilename)
set_channel_data(rig, &chan, key_list, value_list);
/* Write a rig memory */
status = rig_set_channel(rig, &chan);
status = rig_set_channel(rig, RIG_VFO_NONE, &chan);
if (status != RIG_OK)
{

Wyświetl plik

@ -3659,7 +3659,7 @@ declare_proto_rig(set_channel)
#endif
status = rig_set_channel(rig, &chan);
status = rig_set_channel(rig, vfo, &chan);
return status;
}
@ -3687,7 +3687,7 @@ declare_proto_rig(get_channel)
CHKSCN1ARG(sscanf(arg2, "%d", &read_only));
status = rig_get_channel(rig, &chan, read_only);
status = rig_get_channel(rig, RIG_VFO_NONE, &chan, read_only);
if (status != RIG_OK)
{

Wyświetl plik

@ -509,7 +509,7 @@ int clear_chans(RIG *rig, const char *infilename)
{
chan.channel_num = j;
ret = rig_set_channel(rig, &chan);
ret = rig_set_channel(rig, RIG_VFO_NONE, &chan);
if (ret != RIG_OK)
{