Merge remote-tracking branch 'Hamlib/master'

pull/196/head
Malcolm Herring 2020-01-29 13:49:29 +00:00
commit 0f87f74ff1
41 zmienionych plików z 391 dodań i 193 usunięć

Wyświetl plik

@ -344,7 +344,7 @@ typedef channel_t * const_channel_t_p;
METHOD3(set_rit, shortfreq_t)
METHOD3(set_xit, shortfreq_t)
METHOD3(set_ts, shortfreq_t)
METHOD3(set_ant, ant_t)
METHOD2(set_ant, ant_t, value_t)
METHOD2(set_func, setting_t, int)
METHOD3(set_bank, int)
METHOD3(set_mem, int)
@ -436,7 +436,7 @@ typedef channel_t * const_channel_t_p;
METHOD1VGET(get_rit, shortfreq_t)
METHOD1VGET(get_xit, shortfreq_t)
METHOD1VGET(get_ts, shortfreq_t)
METHOD1VGET(get_ant, ant_t)
extern void get_ant(value_t * OUTPUT, ant_t * OUTPUT, vfo_t vfo = RIG_VFO_CURR);
METHOD1VGET(get_mem, int)
METHOD1GET(get_powerstat, powerstat_t)
METHOD1GET(get_trn, int)
@ -557,6 +557,11 @@ void Rig_get_split_mode(Rig *self, rmode_t *mode, pbwidth_t *width, vfo_t vfo)
self->error_status = rig_get_split_mode(self->rig, vfo, mode, width);
}
void Rig_get_ant(Rig *self, value_t *option, ant_t *ant, vfo_t vfo)
{
self->error_status = rig_get_ant(self->rig, vfo, ant, option);
}
struct channel *Rig_get_chan_all(Rig *self)
{
struct channel *chans;

Wyświetl plik

@ -535,16 +535,14 @@ shortfreq_t Rig::getXit(vfo_t vfo)
return xit;
}
void Rig::setAnt(ant_t ant, vfo_t vfo)
void Rig::setAnt(value_t option, ant_t ant, vfo_t vfo)
{
CHECK_RIG(rig_set_ant(theRig, vfo, ant));
CHECK_RIG(rig_set_ant(theRig, vfo, ant, option));
}
ant_t Rig::getAnt(vfo_t vfo)
ant_t Rig::getAnt(value_t &option, ant_t &ant, vfo_t vfo)
{
ant_t ant;
CHECK_RIG( rig_get_ant(theRig, vfo, &ant) );
CHECK_RIG( rig_get_ant(theRig, vfo, &ant, &option) );
return ant;
}

Wyświetl plik

@ -660,6 +660,14 @@ dnl Check for libdl and set DL_LIBS if found--used for linradio WR-G313 backend.
[AC_MSG_WARN([dlopen was not found in libdl--linradio backend will be disabled])])
])
# Still need -ldl if we have it
AS_IF([test x"${cf_with_winradio}" = "xno"],
[RIGS_BACKEND_LIST="$RIGS_BACKEND_LIST"
dnl Check for libdl and set DL_LIBS if found--used for linradio WR-G313 backend.
AC_CHECK_LIB([dl], [dlopen], [DL_LIBS="-ldl"],
[AC_MSG_WARN([dlopen was not found in libdl--linradio backend will be disabled])])
])
dnl Set conditional compilation for G-313.
AS_CASE(["$host_os"],
[mingw* | pw32* | cygwin ], [

Wyświetl plik

@ -111,7 +111,7 @@ Use
of Push-To-Talk device.
.IP
Supported types are \(oqRIG\(cq (CAT command), \(oqDTR\(cq, \(oqRTS\(cq,
\(oqPARALLEL\(cq, \(oqNONE\(cq, overriding PTT type defined in the rig's
\(oqPARALLEL\(cq, \(oqCM108\(cq, \(oqGPIO\(cq, \(oqGPION\(cq, \(oqNONE\(cq, overriding PTT type defined in the rig's
backend.
.IP
Some side effects of this command are that when type is set to DTR, read
@ -127,7 +127,7 @@ Use
of Data Carrier Detect device.
.IP
Supported types are \(oqRIG\(cq (CAT command), \(oqDSR\(cq, \(oqCTS\(cq,
\(oqCD\(cq, \(oqPARALLEL\(cq, \(oqNONE\(cq.
\(oqCD\(cq, \(oqPARALLEL\(cq, \(oqCM108\(cq, \(oqGPIO\(cq, \(oqGPION\(cq, \(oqNONE\(cq.
.
.TP
.BR \-s ", " \-\-serial\-speed = \fIbaud\fP

Wyświetl plik

@ -33,6 +33,8 @@
#include "hamlib/rig.h"
#include "serial.h"
#include "parallel.h"
#include "cm108.h"
#include "gpio.h"
#include "misc.h"
#include "tones.h"
#include "idx_builtin.h"
@ -54,6 +56,7 @@ struct dummy_priv_data
powerstat_t powerstat;
int bank;
value_t parms[RIG_SETTING_MAX];
int ant_option;
channel_t *curr; /* points to vfo_a, vfo_b or mem[] */
@ -495,29 +498,57 @@ static int dummy_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
static int dummy_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
{
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
int rc;
int status = 0;
ptt_t par_status = RIG_PTT_OFF;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
*ptt = priv->ptt;
// sneak a look at the hardware PTT and OR that in with our result
// as if it had keyed us
switch (rig->state.pttport.type.ptt)
{
case RIG_PTT_SERIAL_DTR: if (rig->state.pttport.fd >= 0) ser_get_dtr(
&rig->state.pttport, &status); break;
case RIG_PTT_SERIAL_DTR:
if (rig->state.pttport.fd >= 0)
{
if (RIG_OK != (rc = ser_get_dtr(&rig->state.pttport, &status))) return rc;
*ptt = status ? RIG_PTT_ON : RIG_PTT_OFF;
}
break;
case RIG_PTT_SERIAL_RTS: if (rig->state.pttport.fd >= 0) ser_get_rts(
&rig->state.pttport, &status); break;
case RIG_PTT_SERIAL_RTS:
if (rig->state.pttport.fd >= 0)
{
if (RIG_OK != (rc = ser_get_rts(&rig->state.pttport, &status))) return rc;
*ptt = status ? RIG_PTT_ON : RIG_PTT_OFF;
}
break;
case RIG_PTT_PARALLEL: if (rig->state.pttport.fd >= 0) par_ptt_get(
&rig->state.pttport, &par_status); break;
case RIG_PTT_PARALLEL:
if (rig->state.pttport.fd >= 0)
{
if (RIG_OK != (rc = par_ptt_get(&rig->state.pttport, ptt))) return rc;
}
break;
default: break;
case RIG_PTT_CM108:
if (rig->state.pttport.fd >= 0)
{
if (RIG_OK != (rc = cm108_ptt_get(&rig->state.pttport, ptt))) return rc;
}
break;
case RIG_PTT_GPIO:
case RIG_PTT_GPION:
if (rig->state.pttport.fd >= 0)
{
if (RIG_OK != (rc = gpio_ptt_get(&rig->state.pttport, ptt))) return rc;
}
break;
default:
*ptt = priv->ptt;
break;
}
*ptt = *ptt || status || RIG_PTT_ON == par_status;
return RIG_OK;
}
@ -1302,25 +1333,27 @@ static int dummy_get_ext_parm(RIG *rig, token_t token, value_t *val)
static int dummy_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
static int dummy_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
{
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
channel_t *curr = priv->curr;
curr->ant = ant;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
priv->ant_option = option.i;
rig_debug(RIG_DEBUG_VERBOSE, "%s called ant=%d, option=%d\n", __func__, ant, option.i);
return RIG_OK;
}
static int dummy_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
static int dummy_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
{
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
channel_t *curr = priv->curr;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
*ant = curr->ant;
option->i = priv->ant_option;
return RIG_OK;
}

Wyświetl plik

@ -1730,7 +1730,7 @@ static int netrigctl_get_parm(RIG *rig, setting_t parm, value_t *val)
}
static int netrigctl_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
static int netrigctl_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
{
int ret, len;
char cmd[CMD_MAX];
@ -1743,7 +1743,7 @@ static int netrigctl_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
if (ret != RIG_OK) { return ret; }
len = sprintf(cmd, "Y%s %d\n", vfostr, ant);
len = sprintf(cmd, "Y%s %d %d\n", vfostr, ant, option.i);
ret = netrigctl_transaction(rig, cmd, len, buf);
@ -1758,7 +1758,7 @@ static int netrigctl_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
}
static int netrigctl_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
static int netrigctl_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
{
int ret, len;
char cmd[CMD_MAX];
@ -1780,7 +1780,30 @@ static int netrigctl_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
return (ret < 0) ? ret : -RIG_EPROTO;
}
*ant = atoi(buf);
rig_debug(RIG_DEBUG_TRACE, "%s: buf='%s'\n", __func__, buf);
ret = sscanf(buf, "%d\n", ant);
if (ret != 1)
{
rig_debug(RIG_DEBUG_ERR, "%s: expected 1 ant integer in '%s', got %d\n", __func__, buf,
ret);
}
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
if (ret <= 0)
{
return (ret < 0) ? ret : -RIG_EPROTO;
}
ret = sscanf(buf, "%d\n",&(option->i));
if (ret != 1)
{
rig_debug(RIG_DEBUG_ERR, "%s: expected 1 option integer in '%s', got %d\n", __func__, buf,
ret);
}
return RIG_OK;
}

Wyświetl plik

@ -1568,8 +1568,8 @@ struct rig_caps {
int (*reset)(RIG *rig, reset_t reset);
int (*set_ant)(RIG *rig, vfo_t vfo, ant_t ant);
int (*get_ant)(RIG *rig, vfo_t vfo, ant_t *ant);
int (*set_ant)(RIG *rig, vfo_t vfo, ant_t ant, value_t option);
int (*get_ant)(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option);
int (*set_level)(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int (*get_level)(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
@ -2151,11 +2151,13 @@ rig_cleanup HAMLIB_PARAMS((RIG *rig));
extern HAMLIB_EXPORT(int)
rig_set_ant HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
ant_t ant)); /* antenna */
ant_t ant, /* antenna */
value_t option)); /* optional ant info */
extern HAMLIB_EXPORT(int)
rig_get_ant HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
ant_t *ant));
ant_t *ant,
value_t *option));
extern HAMLIB_EXPORT(setting_t)
rig_has_get_level HAMLIB_PARAMS((RIG *rig,

Wyświetl plik

@ -156,8 +156,8 @@ public:
void setXit(shortfreq_t xit, vfo_t vfo = RIG_VFO_CURR);
shortfreq_t getXit(vfo_t vfo = RIG_VFO_CURR);
void setAnt(ant_t ant, vfo_t vfo = RIG_VFO_CURR);
ant_t getAnt(vfo_t vfo = RIG_VFO_CURR);
void setAnt(value_t option, ant_t ant, vfo_t vfo = RIG_VFO_CURR);
ant_t getAnt(value_t &option, ant_t &ant, vfo_t vfo = RIG_VFO_CURR);
void sendDtmf(const char *digits, vfo_t vfo = RIG_VFO_CURR);
int recvDtmf(char *digits, vfo_t vfo = RIG_VFO_CURR);

Wyświetl plik

@ -487,7 +487,7 @@ int drake_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
* drake_set_ant
* Assumes rig!=NULL
*/
int drake_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
int drake_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
{
unsigned char buf[16], ackbuf[16];
int len, ack_len, retval;
@ -504,7 +504,7 @@ int drake_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
* drake_get_ant
* Assumes rig!=NULL
*/
int drake_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
int drake_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
{
int mdbuf_len, retval;
char mdbuf[BUFSZ];
@ -541,7 +541,6 @@ int drake_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
*ant = RIG_ANT_NONE;
return -RIG_EINVAL;
}
return RIG_OK;
}
@ -617,6 +616,9 @@ int drake_set_chan(RIG *rig, const channel_t *chan)
int old_chan;
char mdbuf[16], ackbuf[16];
int mdbuf_len, ack_len, retval;
value_t dummy;
dummy.i = 0;
drake_get_vfo(rig, &old_vfo);
old_chan = 0;
@ -634,7 +636,7 @@ int drake_set_chan(RIG *rig, const channel_t *chan)
}
/* set all memory features */
drake_set_ant(rig, RIG_VFO_CURR, chan->ant);
drake_set_ant(rig, RIG_VFO_CURR, chan->ant, dummy);
drake_set_freq(rig, RIG_VFO_CURR, chan->freq);
drake_set_mode(rig, RIG_VFO_CURR, chan->mode, chan->width);
drake_set_func(rig, RIG_VFO_CURR, RIG_FUNC_NB,

Wyświetl plik

@ -38,8 +38,8 @@ int drake_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
int drake_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
int drake_init(RIG *rig);
int drake_cleanup(RIG *rig);
int drake_set_ant(RIG *rig, vfo_t vfo, ant_t ant);
int drake_get_ant(RIG *rig, vfo_t vfo, ant_t *ant);
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 *ant, value_t *option);
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);

Wyświetl plik

@ -2785,7 +2785,7 @@ int elad_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone)
/*
* set the aerial/antenna to use
*/
int elad_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
int elad_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
{
char cmd[8];
char a;
@ -2875,7 +2875,7 @@ int elad_set_ant_no_ack(RIG *rig, vfo_t vfo, ant_t ant)
/*
* get the aerial/antenna in use
*/
int elad_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
int elad_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
{
char ackbuf[8];
int offs;

Wyświetl plik

@ -138,9 +138,9 @@ int elad_set_powerstat(RIG *rig, powerstat_t status);
int elad_get_powerstat(RIG *rig, powerstat_t *status);
int elad_reset(RIG *rig, reset_t reset);
int elad_send_morse(RIG *rig, vfo_t vfo, const char *msg);
int elad_set_ant (RIG * rig, vfo_t vfo, ant_t ant);
int elad_set_ant (RIG * rig, vfo_t vfo, ant_t ant, value_t option);
int elad_set_ant_no_ack(RIG * rig, vfo_t vfo, ant_t ant);
int elad_get_ant (RIG * rig, vfo_t vfo, ant_t * ant);
int elad_get_ant (RIG * rig, vfo_t vfo, ant_t * ant, value_t *option);
int elad_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
int elad_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
int elad_set_ptt_safe(RIG *rig, vfo_t vfo, ptt_t ptt);

Wyświetl plik

@ -94,7 +94,7 @@ static int dttsp_get_conf(RIG *rig, token_t token, char *val);
static int dttsp_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
static int dttsp_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
static int dttsp_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
static int dttsp_set_ant(RIG *rig, vfo_t vfo, ant_t ant);
static int dttsp_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option);
static int dttsp_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
static int dttsp_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit);
@ -992,13 +992,13 @@ int dttsp_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit)
}
int dttsp_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
int dttsp_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
{
struct dttsp_priv_data *priv = (struct dttsp_priv_data *)rig->state.priv;
rig_debug(RIG_DEBUG_TRACE, "%s: ant %d, try tuner\n",
__func__, ant);
return rig_set_ant(priv->tuner, vfo, ant);
return rig_set_ant(priv->tuner, vfo, ant, option);
}

Wyświetl plik

@ -42,7 +42,6 @@
*
* TODO:
* - advanced scanning functions
* - set_channel
* - set_ctcss_tone/ctcss_sql
* - set keyer?
* - test all that stuff..
@ -115,9 +114,9 @@
typedef struct
{
unsigned char freq[5]; /* little endian frequency */
unsigned char freq[5]; /* little endian frequency */
unsigned char mode;
unsigned char pb; /* passband or filter selection*/
signed char pb; /* passband or filter selection*/
unsigned char data; /* data port 0=off 1=on */
unsigned char dup; /* duplex, tone, tonesql and DTCS
Values in hex are "or"ed together
@ -131,8 +130,6 @@ typedef struct
unsigned char tone_sql[3]; /* tone squelch frequency as tone */
struct
{
//unsigned char
//pol; /* DTCS polarity by nibbles Tx pol | Rx pol; 0 = normal; 1 = rev */
unsigned char code[2]; /* DTCS code bigendian */
} dcs;
} channel_str_t;
@ -157,6 +154,7 @@ 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);
static int ic746pro_set_channel(RIG *rig, 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);
@ -576,6 +574,7 @@ const struct rig_caps ic746pro_caps =
.set_ext_parm = ic746pro_set_ext_parm,
.get_ext_parm = ic746pro_get_ext_parm,
.get_channel = ic746pro_get_channel,
.set_channel = ic746pro_set_channel,
};
@ -905,8 +904,7 @@ int ic746pro_get_channel(RIG *rig, channel_t *chan)
{
struct icom_priv_data *priv;
struct rig_state *rs;
unsigned char chanbuf[50];
mem_buf_t *membuf;
unsigned char chanbuf[MAXFRAMELEN];
int chan_len, freq_len, retval, data_len;
rs = &rig->state;
@ -981,10 +979,12 @@ int ic746pro_get_channel(RIG *rig, channel_t *chan)
int band;
int sc;
unsigned char databuf[32];
mem_buf_t *membuf;
membuf = (mem_buf_t *)(chanbuf + 4);
chan->flags = membuf->chan_flag && 0x01 ? RIG_CHFLAG_SKIP : RIG_CHFLAG_NONE;
chan->split = (membuf->chan_flag & 0x10) ? RIG_SPLIT_ON : RIG_SPLIT_OFF;
chan->flags = (membuf->chan_flag & 0x01) ? RIG_CHFLAG_SKIP : RIG_CHFLAG_NONE;
rig_debug(RIG_DEBUG_TRACE, "%s: chan->flags=0x%02x\n", __func__, chan->flags);
/* data mode on */
rig_debug(RIG_DEBUG_TRACE, "%s: membuf->rx.data=0x%02x\n", __func__, membuf->rx.data);
@ -1003,7 +1003,7 @@ int ic746pro_get_channel(RIG *rig, channel_t *chan)
rig_debug(RIG_DEBUG_TRACE, "%s: chan->rptr_shift=%d\n", __func__, chan->rptr_shift);
/* offset is default for the band & is not stored in channel memory.
The following retrieves the system default for the band */
The following retrieves the system default for the band */
band = (int) chan->freq / 1000000; /* hf, 2m or 6 m */
if (band < 50) { sc = S_MEM_HF_DUP_OFST; }
@ -1041,3 +1041,153 @@ int ic746pro_get_channel(RIG *rig, channel_t *chan)
return RIG_OK;
}
/*
* ic746pro_set_channel
* Assumes rig!=NULL, rig->state.priv!=NULL, chan!=NULL
*/
int ic746pro_set_channel(RIG *rig, const channel_t *chan)
{
struct icom_priv_data *priv;
struct rig_state *rs;
mem_buf_t membuf = {0};
unsigned char chanbuf[MAXFRAMELEN], ackbuf[MAXFRAMELEN];
int chan_len, ack_len, freq_len, retval;
rs = &rig->state;
priv = (struct icom_priv_data *)rs->priv;
freq_len = priv->civ_731_mode ? 4 : 5;
// set memory channel
to_bcd_be(chanbuf, chan->channel_num, 4);
chan_len = 2;
// if good value, we change the memory otherwise clear
if (chan->freq != 0 || chan->mode != 0)
{
if (chan->split == RIG_SPLIT_ON)
membuf.chan_flag |= 0x10;
else
membuf.chan_flag |= (chan->flags & RIG_CHFLAG_SKIP) ? 0x01 : 0x00;
// RX
to_bcd(membuf.rx.freq, chan->freq, freq_len * 2);
retval = rig2icom_mode(rig, chan->mode, chan->width,
&membuf.rx.mode, &membuf.rx.pb);
if (retval != RIG_OK)
{
return retval;
}
if(membuf.rx.pb == -1)
membuf.rx.pb = PD_MEDIUM_3;
membuf.rx.data = (chan->flags & RIG_CHFLAG_DATA) ? 1 : 0;
membuf.rx.dup = chan->rptr_shift;
// not empty otherwise the call fail
if (chan->ctcss_tone == 0)
to_bcd_be(membuf.rx.tone, 885, 6);
else
to_bcd_be(membuf.rx.tone, chan->ctcss_tone, 6);
if (chan->ctcss_sql == 0)
to_bcd_be(membuf.rx.tone_sql, 885, 6);
else
to_bcd_be(membuf.rx.tone_sql, chan->ctcss_sql, 6);
if (chan->dcs_code == 0)
to_bcd_be(membuf.rx.dcs.code, 23, 4);
else
to_bcd_be(membuf.rx.dcs.code, chan->dcs_code, 4);
// TX
to_bcd(membuf.tx.freq, chan->tx_freq, freq_len * 2);
retval = rig2icom_mode(rig, chan->tx_mode, chan->tx_width,
&membuf.tx.mode, &membuf.tx.pb);
if (retval != RIG_OK)
{
return retval;
}
if(membuf.tx.pb == -1)
membuf.tx.pb = PD_MEDIUM_3;
membuf.tx.data = (chan->flags | RIG_CHFLAG_DATA) ? 1 : 0;
membuf.tx.dup = chan->rptr_shift;
// not empty otherwise the call fail
if (chan->ctcss_tone == 0)
to_bcd_be(membuf.tx.tone, 885, 6);
else
to_bcd_be(membuf.tx.tone, chan->ctcss_tone, 6);
if (chan->ctcss_sql == 0)
to_bcd_be(membuf.tx.tone_sql, 885, 6);
else
to_bcd_be(membuf.tx.tone_sql, chan->ctcss_sql, 6);
if (chan->dcs_code == 0)
to_bcd_be(membuf.tx.dcs.code, 23, 4);
else
to_bcd_be(membuf.tx.dcs.code, chan->dcs_code, 4);
// set description
memcpy(membuf.name, chan->channel_desc, sizeof(membuf.name));
memcpy(chanbuf+chan_len, &membuf, sizeof(mem_buf_t));
chan_len += sizeof(mem_buf_t);
retval = icom_transaction(rig, C_CTL_MEM, S_MEM_CNTNT,
chanbuf, chan_len, ackbuf, &ack_len);
if (retval != RIG_OK)
{
return retval;
}
if (ack_len != 1 || ackbuf[0] != ACK)
{
rig_debug(RIG_DEBUG_ERR, "icom_set_channel: ack NG (%#.2x), "
"len=%d\n", ackbuf[0], ack_len);
return -RIG_ERJCTED;
}
}
else
{
retval = icom_transaction(rig, C_SET_MEM, -1,
chanbuf, chan_len, ackbuf, &ack_len);
if (retval != RIG_OK)
{
return retval;
}
if (ack_len != 1 || ackbuf[0] != ACK)
{
rig_debug(RIG_DEBUG_ERR, "icom_set_channel: ack NG (%#.2x), "
"len=%d\n", ackbuf[0], ack_len);
return -RIG_ERJCTED;
}
retval = icom_transaction(rig, C_CLR_MEM, -1, NULL, 0, ackbuf, &ack_len);
if (retval != RIG_OK)
{
return retval;
}
if (ack_len != 1 || ackbuf[0] != ACK)
{
rig_debug(RIG_DEBUG_ERR, "icom_set_channel: ack NG (%#.2x), "
"len=%d\n", ackbuf[0], ack_len);
return -RIG_ERJCTED;
}
}
return RIG_OK;
}

Wyświetl plik

@ -5040,7 +5040,7 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
}
i = 0;
retry = 10;
retry = 2;
if (status == RIG_POWER_ON) // wait for wakeup only
{
@ -5216,7 +5216,7 @@ int icom_set_bank(RIG *rig, vfo_t vfo, int bank)
* icom_set_ant
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
{
unsigned char antarg;
unsigned char ackbuf[MAXFRAMELEN];
@ -5247,11 +5247,11 @@ int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
break;
default:
rig_debug(RIG_DEBUG_ERR, "%s: unsupported ant %#x", __func__, ant);
rig_debug(RIG_DEBUG_ERR, "%s: unsupported ant %#x\n", __func__, ant);
return -RIG_EINVAL;
}
antarg = 0;
antarg = option.i;
ant_len = ((rig->caps->rig_model == RIG_MODEL_ICR75)
|| (rig->caps->rig_model == RIG_MODEL_ICR8600) ||
(rig->caps->rig_model == RIG_MODEL_ICR6)
@ -5279,7 +5279,7 @@ int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
* Assumes rig!=NULL, rig->state.priv!=NULL
* only meaningfull for HF
*/
int icom_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
int icom_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *rxant)
{
unsigned char ackbuf[MAXFRAMELEN];
int ack_len = sizeof(ackbuf), retval;
@ -5303,6 +5303,9 @@ int icom_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
/* Note: with IC756/IC-756Pro/IC-7800, ackbuf[2] deals with [RX ANT] */
*ant = RIG_ANT_N(ackbuf[1]);
if (ack_len == 3) { // then this should be rx ant on/off status
rxant->i = RIG_ANT_N(ackbuf[2]);
}
return RIG_OK;
}

Wyświetl plik

@ -252,8 +252,8 @@ int icom_set_conf(RIG *rig, token_t token, const char *val);
int icom_get_conf(RIG *rig, token_t token, char *val);
int icom_set_powerstat(RIG *rig, powerstat_t status);
int icom_get_powerstat(RIG *rig, powerstat_t *status);
int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant);
int icom_get_ant(RIG *rig, vfo_t vfo, ant_t *ant);
int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option);
int icom_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option);
int icom_decode_event(RIG *rig);
int icom_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq,
rmode_t mode);

Wyświetl plik

@ -428,7 +428,7 @@ int ic10_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
* ic10_set_ant
* Assumes rig!=NULL
*/
int ic10_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
int ic10_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
{
char buf[6], ackbuf[16];
int len, ack_len, retval;
@ -445,7 +445,7 @@ int ic10_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
* ic10_get_ant
* Assumes rig!=NULL, ptt!=NULL
*/
int ic10_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
int ic10_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
{
char infobuf[50];
int info_len, retval;

Wyświetl plik

@ -32,8 +32,8 @@ int ic10_set_split_vfo(RIG *rig, vfo_t vfo , split_t split, vfo_t txvfo);
int ic10_get_split_vfo(RIG *rig, vfo_t vfo , split_t *split, vfo_t *txvfo);
int ic10_get_freq(RIG *rig, vfo_t vfo, freq_t *freq);
int ic10_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
int ic10_set_ant(RIG *rig, vfo_t vfo, ant_t ant);
int ic10_get_ant(RIG *rig, vfo_t vfo, ant_t *ant);
int ic10_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option);
int ic10_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option);
int ic10_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
int ic10_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
int ic10_set_parm(RIG *rig, setting_t parm, value_t val);

Wyświetl plik

@ -3005,7 +3005,7 @@ int kenwood_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone)
/*
* set the aerial/antenna to use
*/
int kenwood_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
int kenwood_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
{
char cmd[8];
char a;
@ -3061,7 +3061,7 @@ int kenwood_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
return kenwood_transaction(rig, cmd, NULL, 0);
}
int kenwood_set_ant_no_ack(RIG *rig, vfo_t vfo, ant_t ant)
int kenwood_set_ant_no_ack(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
{
const char *cmd;
@ -3095,7 +3095,7 @@ int kenwood_set_ant_no_ack(RIG *rig, vfo_t vfo, ant_t ant)
/*
* get the aerial/antenna in use
*/
int kenwood_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
int kenwood_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
{
char ackbuf[8];
int offs;

Wyświetl plik

@ -157,9 +157,9 @@ int kenwood_set_powerstat(RIG *rig, powerstat_t status);
int kenwood_get_powerstat(RIG *rig, powerstat_t *status);
int kenwood_reset(RIG *rig, reset_t reset);
int kenwood_send_morse(RIG *rig, vfo_t vfo, const char *msg);
int kenwood_set_ant(RIG *rig, vfo_t vfo, ant_t ant);
int kenwood_set_ant_no_ack(RIG *rig, vfo_t vfo, ant_t ant);
int kenwood_get_ant(RIG *rig, vfo_t vfo, ant_t *ant);
int kenwood_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option);
int kenwood_set_ant_no_ack(RIG *rig, vfo_t vfo, ant_t ant, value_t option);
int kenwood_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option);
int kenwood_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
int kenwood_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
int kenwood_set_ptt_safe(RIG *rig, vfo_t vfo, ptt_t ptt);

Wyświetl plik

@ -2521,7 +2521,7 @@ int th_set_channel(RIG *rig, const channel_t *chan)
/*
* set the aerial/antenna to use
*/
int th_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
int th_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
{
const char *cmd;
@ -2552,7 +2552,7 @@ int th_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
/*
* get the aerial/antenna in use
*/
int th_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
int th_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
{
char buf[8];
int retval;

Wyświetl plik

@ -62,8 +62,8 @@ 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);
extern int th_set_channel(RIG *rig, const channel_t *chan);
extern int th_set_ant (RIG * rig, vfo_t vfo, ant_t ant);
extern int th_get_ant (RIG * rig, vfo_t vfo, ant_t * ant);
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 * ant, value_t *option);
extern int th_reset(RIG *rig, reset_t reset);
extern int th_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch);

Wyświetl plik

@ -53,8 +53,8 @@ static int elektor507_set_level(RIG *rig, vfo_t vfo, setting_t level,
value_t val);
static int elektor507_get_level(RIG *rig, vfo_t vfo, setting_t level,
value_t *val);
static int elektor507_set_ant(RIG *rig, vfo_t vfo, ant_t ant);
static int elektor507_get_ant(RIG *rig, vfo_t vfo, ant_t *ant);
static int elektor507_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option);
static int elektor507_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option);
static int elektor507_set_conf(RIG *rig, token_t token, const char *val);
static int elektor507_get_conf(RIG *rig, token_t token, char *val);
@ -1147,7 +1147,7 @@ int elektor507_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
}
int elektor507_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
int elektor507_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
{
struct elektor507_priv_data *priv = (struct elektor507_priv_data *)
rig->state.priv;
@ -1191,7 +1191,7 @@ int elektor507_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
return (ret != 0) ? -RIG_EIO : RIG_OK;
}
int elektor507_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
int elektor507_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
{
struct elektor507_priv_data *priv = (struct elektor507_priv_data *)
rig->state.priv;

Wyświetl plik

@ -66,7 +66,7 @@ static int hiqsdr_set_split_vfo(RIG *rig, vfo_t vfo, split_t split,
static int hiqsdr_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq);
static int hiqsdr_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
static int hiqsdr_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
static int hiqsdr_set_ant(RIG *rig, vfo_t vfo, ant_t ant);
static int hiqsdr_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option);
static int hiqsdr_set_conf(RIG *rig, token_t token, const char *val);
static int hiqsdr_get_conf(RIG *rig, token_t token, char *val);
@ -502,7 +502,7 @@ int hiqsdr_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
return ret;
}
int hiqsdr_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
int hiqsdr_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
{
struct hiqsdr_priv_data *priv = (struct hiqsdr_priv_data *)rig->state.priv;
int ret = RIG_OK;
@ -525,8 +525,6 @@ int hiqsdr_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
}
/*
*/
int hiqsdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
{
struct hiqsdr_priv_data *priv = (struct hiqsdr_priv_data *)rig->state.priv;

Wyświetl plik

@ -726,7 +726,7 @@ const char *ra37xx_get_info(RIG *rig)
return infobuf + 2;
}
int ra37xx_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
int ra37xx_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
{
char buf[BUFSZ];
int i_ant;
@ -751,7 +751,7 @@ int ra37xx_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
return ra37xx_transaction(rig, buf, NULL, NULL);
}
int ra37xx_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
int ra37xx_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
{
char buf[BUFSZ];
int retval, buflen, ra_ant;

Wyświetl plik

@ -76,8 +76,8 @@ int ra37xx_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
int ra37xx_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val);
int ra37xx_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
const char* ra37xx_get_info(RIG *rig);
int ra37xx_set_ant(RIG *rig, vfo_t vfo, ant_t ant);
int ra37xx_get_ant(RIG *rig, vfo_t vfo, ant_t *ant);
int ra37xx_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option);
int ra37xx_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option);
int ra37xx_set_mem(RIG *rig, vfo_t vfo, int ch);
int ra37xx_get_mem(RIG *rig, vfo_t vfo, int *ch);
int ra37xx_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch);

Wyświetl plik

@ -2019,7 +2019,7 @@ int tt565_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
* The efficient way would be to keep current config in rig priv area, but we will
* ask the rig what its state is each time...
*/
int tt565_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
int tt565_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
{
char respbuf[TT565_BUFSIZE];
int resp_len, retval;
@ -2116,7 +2116,7 @@ int tt565_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
*
* \sa tt565_set_ant
*/
int tt565_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
int tt565_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
{
char respbuf[TT565_BUFSIZE];
int resp_len, retval;

Wyświetl plik

@ -77,8 +77,8 @@ static const char* tt565_get_info(RIG *rig);
static int tt565_send_morse(RIG *rig, vfo_t vfo, const char *msg);
static int tt565_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
static int tt565_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
static int tt565_set_ant(RIG * rig, vfo_t vfo, ant_t ant);
static int tt565_get_ant(RIG *rig, vfo_t vfo, ant_t *ant);
static int tt565_set_ant(RIG * rig, vfo_t vfo, ant_t ant, value_t option);
static int tt565_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option);
/** \brief Orion private data */
struct tt565_priv_data {

Wyświetl plik

@ -2361,7 +2361,7 @@ int newcat_reset(RIG *rig, reset_t reset)
}
int newcat_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
int newcat_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
{
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
int err;
@ -2450,7 +2450,7 @@ int newcat_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
}
int newcat_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
int newcat_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
{
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
int err;

Wyświetl plik

@ -145,8 +145,8 @@ int newcat_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
int newcat_get_ptt(RIG * rig, vfo_t vfo, ptt_t * ptt);
int newcat_set_ant(RIG * rig, vfo_t vfo, ant_t ant);
int newcat_get_ant(RIG * rig, vfo_t vfo, ant_t * ant);
int newcat_set_ant(RIG * rig, vfo_t vfo, ant_t ant, value_t option);
int newcat_get_ant(RIG * rig, vfo_t vfo, ant_t * ant, value_t * option);
int newcat_set_level(RIG * rig, vfo_t vfo, setting_t level, value_t val);
int newcat_get_level(RIG * rig, vfo_t vfo, setting_t level, value_t * val);
int newcat_set_func(RIG * rig, vfo_t vfo, setting_t func, int status);

Wyświetl plik

@ -14,6 +14,6 @@ libhamlib_la_LDFLAGS = $(WINLDFLAGS) $(OSXLDFLAGS) -no-undefined -version-info $
libhamlib_la_LIBADD = $(top_builddir)/lib/libmisc.la \
$(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS) $(NET_LIBS) $(MATH_LIBS) $(LIBUSB_LIBS)
libhamlib_la_DEPENDENCIES = $(top_builddir)/lib/libmisc.la $(BACKENDEPS) $(RIG_BACKEND_DEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS)
libhamlib_la_DEPENDENCIES = $(top_builddir)/lib/libmisc.la $(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS)
EXTRA_DIST = Android.mk

Wyświetl plik

@ -49,6 +49,7 @@
#endif
#include <hamlib/rig.h>
#include <hamlib/rig_dll.h>
#include "misc.h"
#define DUMP_HEX_WIDTH 16
@ -60,13 +61,14 @@ static FILE *rig_debug_stream;
static vprintf_cb_t rig_vprintf_cb;
static rig_ptr_t rig_vprintf_arg;
extern HAMLIB_EXPORT(void) dump_hex(const unsigned char ptr[], size_t size);
/**
* \param ptr Pointer to memory area
* \param size Number of chars to words to dump
* \brief Do a hex dump of the unsigned char array.
*/
HAMLIB_EXPORT(void) dump_hex(const unsigned char ptr[], size_t size)
void dump_hex(const unsigned char ptr[], size_t size)
{
/* example
* 0000 4b 30 30 31 34 35 30 30 30 30 30 30 30 35 30 32 K001450000000502

Wyświetl plik

@ -53,6 +53,7 @@
#include "usb_port.h"
#include "network.h"
#include "cm108.h"
#include "gpio.h"
/**
* \brief Open a hamlib_port based on its rig port type
@ -184,8 +185,6 @@ int HAMLIB_API port_open(hamlib_port_t *p)
* \param p rig port descriptor
* \param port_type equivalent rig port type
* \return status
*
* This function may also be used with ptt and dcd ports.
*/
int HAMLIB_API port_close(hamlib_port_t *p, rig_port_t port_type)
{
@ -201,14 +200,6 @@ int HAMLIB_API port_close(hamlib_port_t *p, rig_port_t port_type)
ret = ser_close(p);
break;
case RIG_PORT_PARALLEL:
ret = par_close(p);
break;
case RIG_PORT_CM108:
ret = cm108_close(p);
break;
case RIG_PORT_USB:
ret = usb_port_close(p);
break;

Wyświetl plik

@ -363,6 +363,7 @@ static int generic_save_channel(RIG *rig, channel_t *chan)
vfo_t vfo;
setting_t setting;
const channel_cap_t *mem_cap = NULL;
value_t vdummy;
chan_num = chan->channel_num;
vfo = chan->vfo;
@ -446,7 +447,7 @@ static int generic_save_channel(RIG *rig, channel_t *chan)
if (mem_cap->ant)
{
rig_get_ant(rig, RIG_VFO_CURR, &chan->ant);
rig_get_ant(rig, RIG_VFO_CURR, &chan->ant, &vdummy);
}
if (mem_cap->tuning_step)
@ -529,6 +530,7 @@ static int generic_restore_channel(RIG *rig, const channel_t *chan)
struct ext_list *p;
setting_t setting;
const channel_cap_t *mem_cap = NULL;
value_t vdummy;
if (chan->vfo == RIG_VFO_MEM)
{
@ -596,7 +598,7 @@ static int generic_restore_channel(RIG *rig, const channel_t *chan)
if (mem_cap->ant)
{
rig_set_ant(rig, RIG_VFO_CURR, chan->ant);
rig_set_ant(rig, RIG_VFO_CURR, chan->ant, vdummy);
}
if (mem_cap->tuning_step)

Wyświetl plik

@ -690,31 +690,12 @@ int HAMLIB_API rig_open(RIG *rig)
break;
case RIG_PTT_GPIO:
rs->pttport.fd = gpio_open(&rs->pttport, 1, 1);
if (rs->pttport.fd < 0)
{
rig_debug(RIG_DEBUG_ERR,
"%s: cannot open PTT device \"%s\"\n",
__func__,
rs->pttport.pathname);
status = -RIG_EIO;
}
else
{
gpio_ptt_set(&rs->pttport, RIG_PTT_OFF);
gpio_close(&rs->pttport);
}
break;
case RIG_PTT_GPION:
rs->pttport.fd = gpio_open(&rs->pttport, 1, 0);
rs->pttport.fd = gpio_open(&rs->pttport, 1, RIG_PTT_GPION == rs->pttport.type.ptt ? 0 : 1);
if (rs->pttport.fd < 0)
{
rig_debug(RIG_DEBUG_ERR,
"%s: cannot open PTT device \"%s\"\n",
"%s: cannot open PTT device \"GPIO%s\"\n",
__func__,
rs->pttport.pathname);
status = -RIG_EIO;
@ -722,7 +703,6 @@ int HAMLIB_API rig_open(RIG *rig)
else
{
gpio_ptt_set(&rs->pttport, RIG_PTT_OFF);
gpio_close(&rs->pttport);
}
break;
@ -785,36 +765,16 @@ int HAMLIB_API rig_open(RIG *rig)
break;
case RIG_DCD_GPIO:
rs->dcdport.fd = gpio_open(&rs->dcdport, 0, 1);
if (rs->dcdport.fd < 0)
{
rig_debug(RIG_DEBUG_ERR,
"%s: cannot open DCD device \"%s\"\n",
__func__,
rs->dcdport.pathname);
status = -RIG_EIO;
}
else {
gpio_close(&rs->dcdport);
}
break;
case RIG_DCD_GPION:
rs->dcdport.fd = gpio_open(&rs->dcdport, 0, 0);
rs->dcdport.fd = gpio_open(&rs->dcdport, 0, RIG_DCD_GPION == rs->dcdport.type.dcd ? 0 : 1);
if (rs->dcdport.fd < 0)
{
rig_debug(RIG_DEBUG_ERR,
"%s: cannot open DCD device \"%s\"\n",
"%s: cannot open DCD device \"GPIO%s\"\n",
__func__,
rs->dcdport.pathname);
status = -RIG_EIO;
}
else {
gpio_close(&rs->dcdport);
}
break;
@ -969,18 +929,19 @@ int HAMLIB_API rig_close(RIG *rig)
case RIG_PTT_PARALLEL:
par_ptt_set(&rs->pttport, RIG_PTT_OFF);
port_close(&rs->pttport, RIG_PORT_PARALLEL);
par_close(&rs->pttport);
break;
case RIG_PTT_CM108:
cm108_ptt_set(&rs->pttport, RIG_PTT_OFF);
port_close(&rs->pttport, RIG_PORT_CM108);
cm108_close(&rs->pttport);
break;
case RIG_PTT_GPIO:
case RIG_PTT_GPION:
gpio_ptt_set(&rs->pttport, RIG_PTT_OFF);
port_close(&rs->pttport, RIG_PORT_GPIO);
gpio_close(&rs->pttport);
break;
default:
rig_debug(RIG_DEBUG_ERR,
@ -1006,12 +967,13 @@ int HAMLIB_API rig_close(RIG *rig)
break;
case RIG_DCD_PARALLEL:
port_close(&rs->dcdport, RIG_PORT_PARALLEL);
par_close(&rs->dcdport);
break;
case RIG_DCD_GPIO:
case RIG_DCD_GPION:
port_close(&rs->dcdport, RIG_PORT_GPIO);
gpio_close(&rs->dcdport);
break;
default:
rig_debug(RIG_DEBUG_ERR,
@ -3521,7 +3483,7 @@ int HAMLIB_API rig_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts)
*
* \sa rig_get_ant()
*/
int HAMLIB_API rig_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
int HAMLIB_API rig_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
{
const struct rig_caps *caps;
int retcode, rc2;
@ -3545,7 +3507,7 @@ int HAMLIB_API rig_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
|| vfo == RIG_VFO_CURR
|| vfo == rig->state.current_vfo)
{
return caps->set_ant(rig, vfo, ant);
return caps->set_ant(rig, vfo, ant, option);
}
if (!caps->set_vfo)
@ -3561,7 +3523,7 @@ int HAMLIB_API rig_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
return retcode;
}
retcode = caps->set_ant(rig, vfo, ant);
retcode = caps->set_ant(rig, vfo, ant, option);
/* try and revert even if we had an error above */
rc2 = caps->set_vfo(rig, curr_vfo);
@ -3589,7 +3551,7 @@ int HAMLIB_API rig_set_ant(RIG *rig, vfo_t vfo, ant_t ant)
*
* \sa rig_set_ant()
*/
int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
{
const struct rig_caps *caps;
int retcode, rc2;
@ -3613,7 +3575,7 @@ int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
|| vfo == RIG_VFO_CURR
|| vfo == rig->state.current_vfo)
{
return caps->get_ant(rig, vfo, ant);
return caps->get_ant(rig, vfo, ant, option);
}
if (!caps->set_vfo)
@ -3629,7 +3591,7 @@ int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t *ant)
return retcode;
}
retcode = caps->get_ant(rig, vfo, ant);
retcode = caps->get_ant(rig, vfo, ant, option);
/* try and revert even if we had an error above */
rc2 = caps->set_vfo(rig, curr_vfo);

Wyświetl plik

@ -28,7 +28,7 @@ rigmem_SOURCES = rigmem.c memsave.c memload.c memcsv.c sprintflst.c sprintflst.h
rigctl_CPPFLAGS = -I$(top_srcdir) $(AM_CPPFLAGS)
# all the programs need this
LDADD = $(top_builddir)/src/libhamlib.la $(top_builddir)/lib/libmisc.la
LDADD = $(top_builddir)/src/libhamlib.la $(top_builddir)/lib/libmisc.la $(DL_LIBS)
rigmem_CFLAGS = $(AM_CFLAGS) $(LIBXML2_CFLAGS)
rigctld_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS)
@ -36,7 +36,7 @@ rotctld_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS)
ampctld_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS)
rigctlcom_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS)
rigctl_LDADD = $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS)
rigctl_LDADD = $(PTHREAD_LIBS) $(READLINE_LIBS) $(LDADD)
rigctld_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS)
rotctl_LDADD = $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS)
rotctld_LDADD = $(NET_LIBS) $(PTHREAD_LIBS) $(LDADD) $(READLINE_LIBS)

Wyświetl plik

@ -548,11 +548,6 @@ void dump_csv_name(const channel_cap_t *mem_caps, FILE *f)
fprintf(f, "flags%c", csv_sep);
}
if (mem_caps->channel_desc)
{
fprintf(f, "channel_desc%c", csv_sep);
}
fprintf(f, "\n");
}
@ -708,11 +703,6 @@ int dump_csv_chan(RIG *rig,
fprintf(f, "%x%c", chan.flags, csv_sep);
}
if (mem_caps->channel_desc)
{
fprintf(f, "%s", chan.channel_desc);
}
fprintf(f, "\n");
/*

Wyświetl plik

@ -285,12 +285,6 @@ int dump_xml_chan(RIG *rig,
xmlNewProp(node, (unsigned char *) "flags", (unsigned char *) attrbuf);
}
if (mem_caps->channel_desc)
{
sprintf(attrbuf, "%s", chan.channel_desc);
xmlNewProp(node, (unsigned char *) "channel_desc", (unsigned char *) attrbuf);
}
return 0;
}
#endif

Wyświetl plik

@ -259,7 +259,8 @@ int main(int argc, char *argv[])
}
else
{
ptt_type = atoi(optarg);
puts("Unrecognised PTT type, using NONE");
ptt_type = RIG_PTT_NONE;
}
break;
@ -309,7 +310,8 @@ int main(int argc, char *argv[])
}
else
{
dcd_type = atoi(optarg);
puts("Unrecognised DCD type, using NONE");
dcd_type = RIG_DCD_NONE;
}
break;
@ -519,7 +521,7 @@ int main(int argc, char *argv[])
if (retcode != RIG_OK)
{
fprintf(stderr, "rig_open: error = %s \n", rigerror(retcode));
exit(2);
// exit(2);
}
if (verbose > 0)

Wyświetl plik

@ -286,8 +286,8 @@ static struct test_table test_list[] =
{ 'j', "get_rit", ACTION(get_rit), ARG_OUT, "RIT" },
{ 'Z', "set_xit", ACTION(set_xit), ARG_IN, "XIT" },
{ 'z', "get_xit", ACTION(get_xit), ARG_OUT, "XIT" },
{ 'Y', "set_ant", ACTION(set_ant), ARG_IN, "Antenna" },
{ 'y', "get_ant", ACTION(get_ant), ARG_OUT, "Antenna" },
{ 'Y', "set_ant", ACTION(set_ant), ARG_IN, "Antenna", "Option" },
{ 'y', "get_ant", ACTION(get_ant), ARG_OUT, "Antenna", "Option" },
{ 0x87, "set_powerstat", ACTION(set_powerstat), ARG_IN | ARG_NOVFO, "Power Status" },
{ 0x88, "get_powerstat", ACTION(get_powerstat), ARG_OUT | ARG_NOVFO, "Power Status" },
{ 0x89, "send_dtmf", ACTION(send_dtmf), ARG_IN, "Digits" },
@ -3936,9 +3936,12 @@ declare_proto_rig(dump_conf)
declare_proto_rig(set_ant)
{
ant_t ant;
value_t option; // some rigs have a another option for the antenna
CHKSCN1ARG(sscanf(arg1, "%d", &ant));
return rig_set_ant(rig, vfo, rig_idx2setting(ant));
CHKSCN1ARG(sscanf(arg2, "%d", &option.i)); // assuming they are integer values
return rig_set_ant(rig, vfo, rig_idx2setting(ant), option);
}
@ -3947,8 +3950,9 @@ declare_proto_rig(get_ant)
{
int status;
ant_t ant;
value_t option;
status = rig_get_ant(rig, vfo, &ant);
status = rig_get_ant(rig, vfo, &ant, &option);
if (status != RIG_OK)
{
@ -3962,6 +3966,13 @@ declare_proto_rig(get_ant)
fprintf(fout, "%d%c", rig_setting2idx(ant), resp_sep);
if ((interactive && prompt) || (interactive && !prompt && ext_resp))
{
fprintf(fout, "%s: ", cmd->arg2);
}
fprintf(fout, "%d%c", option.i, resp_sep);
return status;
}

Wyświetl plik

@ -352,13 +352,22 @@ int main(int argc, char *argv[])
{
ptt_type = RIG_PTT_CM108;
}
else if (!strcmp(optarg, "GPIO"))
{
ptt_type = RIG_PTT_GPIO;
}
else if (!strcmp(optarg, "GPION"))
{
ptt_type = RIG_PTT_GPION;
}
else if (!strcmp(optarg, "NONE"))
{
ptt_type = RIG_PTT_NONE;
}
else
{
ptt_type = atoi(optarg);
puts("Unrecognised PTT type, using NONE");
ptt_type = RIG_PTT_NONE;
}
break;
@ -390,13 +399,26 @@ int main(int argc, char *argv[])
{
dcd_type = RIG_DCD_PARALLEL;
}
else if (!strcmp(optarg, "CM108"))
{
dcd_type = RIG_DCD_CM108;
}
else if (!strcmp(optarg, "GPIO"))
{
dcd_type = RIG_DCD_GPIO;
}
else if (!strcmp(optarg, "GPION"))
{
dcd_type = RIG_DCD_GPION;
}
else if (!strcmp(optarg, "NONE"))
{
dcd_type = RIG_DCD_NONE;
}
else
{
dcd_type = atoi(optarg);
puts("Unrecognised DCD type, using NONE");
dcd_type = RIG_DCD_NONE;
}
break;