Merge remote-tracking branch 'Hamlib/master'

pull/196/head
Malcolm Herring 2020-02-07 04:32:42 +00:00
commit b675362740
68 zmienionych plików z 644 dodań i 267 usunięć

Wyświetl plik

@ -540,9 +540,9 @@ void Rig::setAnt(value_t option, ant_t ant, vfo_t vfo)
CHECK_RIG(rig_set_ant(theRig, vfo, ant, option)); CHECK_RIG(rig_set_ant(theRig, vfo, ant, option));
} }
ant_t Rig::getAnt(value_t &option, ant_t &ant, vfo_t vfo) ant_t Rig::getAnt(value_t &option, ant_t ant, ant_t &ant_curr, vfo_t vfo)
{ {
CHECK_RIG( rig_get_ant(theRig, vfo, &ant, &option) ); CHECK_RIG( rig_get_ant(theRig, vfo, ant, &ant_curr, &option) );
return ant; return ant;
} }

Wyświetl plik

@ -1346,13 +1346,13 @@ static int dummy_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
} }
static int dummy_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option) static int dummy_get_ant(RIG *rig, vfo_t vfo, ant_t ant, ant_t *ant_curr, value_t *option)
{ {
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv; struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
channel_t *curr = priv->curr; channel_t *curr = priv->curr;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); rig_debug(RIG_DEBUG_VERBOSE, "%s called, ant=0x%02x\n", __func__, ant);
*ant = curr->ant; *ant_curr = curr->ant;
option->i = priv->ant_option; option->i = priv->ant_option;
return RIG_OK; return RIG_OK;

Wyświetl plik

@ -1736,14 +1736,24 @@ static int netrigctl_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
char cmd[CMD_MAX]; char cmd[CMD_MAX];
char buf[BUF_MAX]; char buf[BUF_MAX];
char vfostr[6] = ""; char vfostr[6] = "";
int i_ant = 0;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); rig_debug(RIG_DEBUG_VERBOSE, "%s called, ant=0x%02x, option=%d\n", __func__, ant, option.i);
switch(ant) {
case RIG_ANT_1: i_ant = 0; break;
case RIG_ANT_2: i_ant = 1; break;
case RIG_ANT_3: i_ant = 2; break;
case RIG_ANT_4: i_ant = 3; break;
default:
rig_debug(RIG_DEBUG_ERR,"%s: more than 4 antennas? ant=0x%02x\n", __func__, ant);
}
ret = netrigctl_vfostr(rig, vfostr, sizeof(vfostr), vfo); ret = netrigctl_vfostr(rig, vfostr, sizeof(vfostr), vfo);
if (ret != RIG_OK) { return ret; } if (ret != RIG_OK) { return ret; }
len = sprintf(cmd, "Y%s %d %d\n", vfostr, ant, option.i); len = sprintf(cmd, "Y%s %d %d\n", vfostr, i_ant, option.i);
ret = netrigctl_transaction(rig, cmd, len, buf); ret = netrigctl_transaction(rig, cmd, len, buf);
@ -1758,7 +1768,7 @@ static int netrigctl_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
} }
static int netrigctl_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option) static int netrigctl_get_ant(RIG *rig, vfo_t vfo, ant_t ant, ant_t *ant_curr, value_t *option)
{ {
int ret, len; int ret, len;
char cmd[CMD_MAX]; char cmd[CMD_MAX];
@ -1771,7 +1781,12 @@ static int netrigctl_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
if (ret != RIG_OK) { return ret; } if (ret != RIG_OK) { return ret; }
len = sprintf(cmd, "y%s\n", vfostr); if (ant == RIG_ANT_CURR) {
len = sprintf(cmd, "y%s\n", vfostr);
}
else {
len = sprintf(cmd, "y%s %d\n", vfostr, ant);
}
ret = netrigctl_transaction(rig, cmd, len, buf); ret = netrigctl_transaction(rig, cmd, len, buf);
@ -1781,7 +1796,7 @@ static int netrigctl_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
} }
rig_debug(RIG_DEBUG_TRACE, "%s: buf='%s'\n", __func__, buf); rig_debug(RIG_DEBUG_TRACE, "%s: buf='%s'\n", __func__, buf);
ret = sscanf(buf, "%d\n", ant); ret = sscanf(buf, "%d\n", ant_curr);
if (ret != 1) if (ret != 1)
{ {
@ -1789,6 +1804,16 @@ static int netrigctl_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
ret); ret);
} }
if (ant != RIG_ANT_CURR) {
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);
}
ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1); ret = read_string(&rig->state.rigport, buf, BUF_MAX, "\n", 1);
if (ret <= 0) if (ret <= 0)

Wyświetl plik

@ -660,7 +660,7 @@ typedef enum {
/** /**
* \brief Antenna number * \brief Antenna number
*/ */
typedef int ant_t; typedef unsigned int ant_t;
#define RIG_ANT_NONE 0 #define RIG_ANT_NONE 0
#define RIG_ANT_N(n) ((ant_t)1<<(n)) #define RIG_ANT_N(n) ((ant_t)1<<(n))
@ -670,6 +670,8 @@ typedef int ant_t;
#define RIG_ANT_4 RIG_ANT_N(3) #define RIG_ANT_4 RIG_ANT_N(3)
#define RIG_ANT_5 RIG_ANT_N(4) #define RIG_ANT_5 RIG_ANT_N(4)
#define RIG_ANT_CURR RIG_ANT_N(31)
#define RIG_ANT_MAX 32 #define RIG_ANT_MAX 32
@ -1147,7 +1149,7 @@ struct channel {
int channel_num; /*!< Channel number */ int channel_num; /*!< Channel number */
int bank_num; /*!< Bank number */ int bank_num; /*!< Bank number */
vfo_t vfo; /*!< VFO */ vfo_t vfo; /*!< VFO */
int ant; /*!< Selected antenna */ ant_t ant; /*!< Selected antenna */
freq_t freq; /*!< Receive frequency */ freq_t freq; /*!< Receive frequency */
rmode_t mode; /*!< Receive mode */ rmode_t mode; /*!< Receive mode */
pbwidth_t width; /*!< Receive passband width associated with mode */ pbwidth_t width; /*!< Receive passband width associated with mode */
@ -1569,7 +1571,7 @@ struct rig_caps {
int (*reset)(RIG *rig, reset_t reset); int (*reset)(RIG *rig, reset_t reset);
int (*set_ant)(RIG *rig, vfo_t vfo, ant_t ant, value_t option); 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 (*get_ant)(RIG *rig, vfo_t vfo, ant_t ant, ant_t *ant_curr, value_t *option);
int (*set_level)(RIG *rig, vfo_t vfo, setting_t level, value_t val); 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); int (*get_level)(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
@ -1594,6 +1596,8 @@ struct rig_caps {
int (*send_morse)(RIG *rig, vfo_t vfo, const char *msg); int (*send_morse)(RIG *rig, vfo_t vfo, const char *msg);
int (*send_voice_mem)(RIG *rig, vfo_t vfo, int ch);
int (*set_bank)(RIG *rig, vfo_t vfo, int bank); int (*set_bank)(RIG *rig, vfo_t vfo, int bank);
int (*set_mem)(RIG *rig, vfo_t vfo, int ch); int (*set_mem)(RIG *rig, vfo_t vfo, int ch);
@ -2156,7 +2160,8 @@ rig_set_ant HAMLIB_PARAMS((RIG *rig,
extern HAMLIB_EXPORT(int) extern HAMLIB_EXPORT(int)
rig_get_ant HAMLIB_PARAMS((RIG *rig, rig_get_ant HAMLIB_PARAMS((RIG *rig,
vfo_t vfo, vfo_t vfo,
ant_t *ant, ant_t ant,
ant_t *ant_curr,
value_t *option)); value_t *option));
extern HAMLIB_EXPORT(setting_t) extern HAMLIB_EXPORT(setting_t)
@ -2206,6 +2211,11 @@ rig_send_morse HAMLIB_PARAMS((RIG *rig,
vfo_t vfo, vfo_t vfo,
const char *msg)); const char *msg));
extern HAMLIB_EXPORT(int)
rig_send_voice_mem HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
int ch));
extern HAMLIB_EXPORT(int) extern HAMLIB_EXPORT(int)
rig_set_bank HAMLIB_PARAMS((RIG *rig, rig_set_bank HAMLIB_PARAMS((RIG *rig,
vfo_t vfo, vfo_t vfo,

Wyświetl plik

@ -157,7 +157,7 @@ public:
shortfreq_t getXit(vfo_t vfo = RIG_VFO_CURR); shortfreq_t getXit(vfo_t vfo = RIG_VFO_CURR);
void setAnt(value_t option, ant_t ant, 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); ant_t getAnt(value_t &option, ant_t ant, ant_t &ant_curr, vfo_t vfo = RIG_VFO_CURR);
void sendDtmf(const char *digits, 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); int recvDtmf(char *digits, vfo_t vfo = RIG_VFO_CURR);

Wyświetl plik

@ -504,7 +504,7 @@ int drake_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
* drake_get_ant * drake_get_ant
* Assumes rig!=NULL * Assumes rig!=NULL
*/ */
int drake_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option) int drake_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *option)
{ {
int mdbuf_len, retval; int mdbuf_len, retval;
char mdbuf[BUFSZ]; char mdbuf[BUFSZ];

Wyświetl plik

@ -39,7 +39,7 @@ int drake_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width);
int drake_init(RIG *rig); int drake_init(RIG *rig);
int drake_cleanup(RIG *rig); int drake_cleanup(RIG *rig);
int drake_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option); 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_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *option);
int drake_set_mem(RIG *rig, vfo_t vfo, int ch); int drake_set_mem(RIG *rig, vfo_t vfo, int ch);
int drake_get_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_set_chan(RIG *rig, const channel_t *chan);

Wyświetl plik

@ -2875,7 +2875,7 @@ int elad_set_ant_no_ack(RIG *rig, vfo_t vfo, ant_t ant)
/* /*
* get the aerial/antenna in use * get the aerial/antenna in use
*/ */
int elad_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option) int elad_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *option)
{ {
char ackbuf[8]; char ackbuf[8];
int offs; int offs;

Wyświetl plik

@ -140,7 +140,7 @@ int elad_reset(RIG *rig, reset_t reset);
int elad_send_morse(RIG *rig, vfo_t vfo, const char *msg); int elad_send_morse(RIG *rig, vfo_t vfo, const char *msg);
int elad_set_ant (RIG * rig, vfo_t vfo, ant_t ant, value_t option); 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_set_ant_no_ack(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_ant (RIG * rig, vfo_t vfo, ant_t dummy, ant_t * ant, value_t *option);
int elad_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt); 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(RIG *rig, vfo_t vfo, ptt_t ptt);
int elad_set_ptt_safe(RIG *rig, vfo_t vfo, ptt_t ptt); int elad_set_ptt_safe(RIG *rig, vfo_t vfo, ptt_t ptt);

Wyświetl plik

@ -17,3 +17,27 @@ Notes on Icom backends
as expected in most cases. Only problem: Bandwidth in Get_Mode is reported always as 0. as expected in most cases. Only problem: Bandwidth in Get_Mode is reported always as 0.
Besides this backend seems to be stable -> Changing State to RIG_STATUS_BETA. Besides this backend seems to be stable -> Changing State to RIG_STATUS_BETA.
2020-02, W9MDB: Antenna count and ack length for existing Icom's with antenna settings
Model #Ant ack length
7100 2 2
737 2 2
7410 2 2
746 2 2
746 2 2
756 2 2
756 2 2
756 2 2
756 2 2
7600 2 3
7610 2 3
7700 4 3
7800 4 3
785x 4 3
9100 2 2
icr30 2 2
icr6 2 2
icr75 2 2
icr8600 3 2
icr9000 2 2
icr9500 3 2

Wyświetl plik

@ -66,7 +66,7 @@ const struct rig_caps delta2_caps =
.rig_model = RIG_MODEL_DELTAII, .rig_model = RIG_MODEL_DELTAII,
.model_name = "Delta II", .model_name = "Delta II",
.mfg_name = "Ten-Tec", .mfg_name = "Ten-Tec",
.version = "0.1", .version = BACKEND_VER ".1",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_UNTESTED, .status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER, .rig_type = RIG_TYPE_TRANSCEIVER,

Wyświetl plik

@ -198,7 +198,9 @@ static const struct icom_priv_caps ic7100_priv_caps =
}, },
.rigparms = ic7100_rigparms, .rigparms = ic7100_rigparms,
.riglevels = ic7100_riglevels, .riglevels = ic7100_riglevels,
.extcmds = ic7100_extcmds .extcmds = ic7100_extcmds,
.antack_len = 2,
.ant_count = 2
}; };
const struct rig_caps ic7100_caps = const struct rig_caps ic7100_caps =

Wyświetl plik

@ -418,7 +418,8 @@ const struct rig_caps ic7300_caps =
.get_powerstat = icom_get_powerstat, .get_powerstat = icom_get_powerstat,
.power2mW = icom_power2mW, .power2mW = icom_power2mW,
.mW2power = icom_mW2power, .mW2power = icom_mW2power,
.send_morse = icom_send_morse .send_morse = icom_send_morse,
.send_voice_mem = icom_send_voice_mem
}; };
const struct rig_caps ic9700_caps = const struct rig_caps ic9700_caps =
@ -592,5 +593,6 @@ const struct rig_caps ic9700_caps =
.set_powerstat = icom_set_powerstat, .set_powerstat = icom_set_powerstat,
.power2mW = icom_power2mW, .power2mW = icom_power2mW,
.mW2power = icom_mW2power, .mW2power = icom_mW2power,
.send_morse = icom_send_morse .send_morse = icom_send_morse,
.send_voice_mem = icom_send_voice_mem
}; };

Wyświetl plik

@ -55,7 +55,9 @@ static const struct icom_priv_caps ic737_priv_caps =
0x3c, /* default address */ 0x3c, /* default address */
0, /* 731 mode */ 0, /* 731 mode */
0, /* no XCHG */ 0, /* no XCHG */
ic737_ts_sc_list ic737_ts_sc_list,
.antack_len = 2,
.ant_count = 2
}; };
const struct rig_caps ic737_caps = const struct rig_caps ic737_caps =
@ -63,7 +65,7 @@ const struct rig_caps ic737_caps =
.rig_model = RIG_MODEL_IC737, .rig_model = RIG_MODEL_IC737,
.model_name = "IC-737", .model_name = "IC-737",
.mfg_name = "Icom", .mfg_name = "Icom",
.version = BACKEND_VER ".0", .version = BACKEND_VER ".2",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_UNTESTED, .status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER, .rig_type = RIG_TYPE_TRANSCEIVER,

Wyświetl plik

@ -97,6 +97,8 @@ static const struct icom_priv_caps ic7410_priv_caps =
0, /* 731 mode */ 0, /* 731 mode */
0, /* no XCHG */ 0, /* no XCHG */
ic756pro_ts_sc_list, ic756pro_ts_sc_list,
.antack_len = 2,
.ant_count = 2,
.agc_levels_present = 1, .agc_levels_present = 1,
.agc_levels = { .agc_levels = {
{ .level = RIG_AGC_OFF, .icom_level = 0 }, { .level = RIG_AGC_OFF, .icom_level = 0 },
@ -113,7 +115,7 @@ const struct rig_caps ic7410_caps =
.rig_model = RIG_MODEL_IC7410, .rig_model = RIG_MODEL_IC7410,
.model_name = "IC-7410", .model_name = "IC-7410",
.mfg_name = "Icom", .mfg_name = "Icom",
.version = BACKEND_VER ".0", .version = BACKEND_VER ".1",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_UNTESTED, .status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER, .rig_type = RIG_TYPE_TRANSCEIVER,

Wyświetl plik

@ -168,6 +168,8 @@ static const struct icom_priv_caps ic746_priv_caps =
0, /* 731 mode */ 0, /* 731 mode */
0, /* no XCHG */ 0, /* no XCHG */
ic756pro_ts_sc_list, ic756pro_ts_sc_list,
.antack_len = 2,
.ant_count = 2,
.agc_levels_present = 1, .agc_levels_present = 1,
.agc_levels = { .agc_levels = {
{ .level = RIG_AGC_OFF, .icom_level = 0 }, { .level = RIG_AGC_OFF, .icom_level = 0 },
@ -182,7 +184,7 @@ const struct rig_caps ic746_caps =
.rig_model = RIG_MODEL_IC746, .rig_model = RIG_MODEL_IC746,
.model_name = "IC-746", .model_name = "IC-746",
.mfg_name = "Icom", .mfg_name = "Icom",
.version = BACKEND_VER ".2", .version = BACKEND_VER ".4",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_STABLE, .status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER, .rig_type = RIG_TYPE_TRANSCEIVER,
@ -392,6 +394,8 @@ static const struct icom_priv_caps ic746pro_priv_caps =
0, /* 731 mode */ 0, /* 731 mode */
0, /* no XCHG */ 0, /* no XCHG */
ic756pro_ts_sc_list, ic756pro_ts_sc_list,
.antack_len = 2,
.ant_count = 2,
.agc_levels_present = 1, .agc_levels_present = 1,
.agc_levels = { .agc_levels = {
{ .level = RIG_AGC_OFF, .icom_level = 0 }, { .level = RIG_AGC_OFF, .icom_level = 0 },
@ -407,7 +411,7 @@ const struct rig_caps ic746pro_caps =
.rig_model = RIG_MODEL_IC746PRO, .rig_model = RIG_MODEL_IC746PRO,
.model_name = "IC-746PRO", .model_name = "IC-746PRO",
.mfg_name = "Icom", .mfg_name = "Icom",
.version = BACKEND_VER ".0", .version = BACKEND_VER ".2",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_STABLE, .status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER, .rig_type = RIG_TYPE_TRANSCEIVER,

Wyświetl plik

@ -133,6 +133,8 @@ static const struct icom_priv_caps ic756_priv_caps =
0, /* 731 mode */ 0, /* 731 mode */
0, /* no XCHG */ 0, /* no XCHG */
ic756_ts_sc_list, ic756_ts_sc_list,
.antack_len = 2,
.ant_count = 2,
.r2i_mode = r2i_mode, .r2i_mode = r2i_mode,
.agc_levels_present = 1, .agc_levels_present = 1,
.agc_levels = { .agc_levels = {
@ -148,7 +150,7 @@ const struct rig_caps ic756_caps =
.rig_model = RIG_MODEL_IC756, .rig_model = RIG_MODEL_IC756,
.model_name = "IC-756", .model_name = "IC-756",
.mfg_name = "Icom", .mfg_name = "Icom",
.version = BACKEND_VER ".1", .version = BACKEND_VER ".2",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_ALPHA, .status = RIG_STATUS_ALPHA,
.rig_type = RIG_TYPE_TRANSCEIVER, .rig_type = RIG_TYPE_TRANSCEIVER,
@ -290,6 +292,8 @@ static const struct icom_priv_caps ic756pro_priv_caps =
0, /* 731 mode */ 0, /* 731 mode */
0, /* no XCHG */ 0, /* no XCHG */
ic756pro_ts_sc_list, ic756pro_ts_sc_list,
.antack_len = 2,
.ant_count = 2,
.agc_levels_present = 1, .agc_levels_present = 1,
.agc_levels = { .agc_levels = {
{ .level = RIG_AGC_FAST, .icom_level = 1 }, { .level = RIG_AGC_FAST, .icom_level = 1 },
@ -304,7 +308,7 @@ const struct rig_caps ic756pro_caps =
.rig_model = RIG_MODEL_IC756PRO, .rig_model = RIG_MODEL_IC756PRO,
.model_name = "IC-756PRO", .model_name = "IC-756PRO",
.mfg_name = "Icom", .mfg_name = "Icom",
.version = BACKEND_VER ".0", .version = BACKEND_VER ".1",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_UNTESTED, .status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER, .rig_type = RIG_TYPE_TRANSCEIVER,
@ -455,6 +459,8 @@ static const struct icom_priv_caps ic756pro2_priv_caps =
0, /* 731 mode */ 0, /* 731 mode */
0, /* no XCHG */ 0, /* no XCHG */
ic756pro_ts_sc_list, ic756pro_ts_sc_list,
.antack_len = 2,
.ant_count = 2,
.agc_levels_present = 1, .agc_levels_present = 1,
.agc_levels = { .agc_levels = {
{ .level = RIG_AGC_FAST, .icom_level = 1 }, { .level = RIG_AGC_FAST, .icom_level = 1 },
@ -537,7 +543,7 @@ const struct rig_caps ic756pro2_caps =
.rig_model = RIG_MODEL_IC756PROII, .rig_model = RIG_MODEL_IC756PROII,
.model_name = "IC-756PROII", .model_name = "IC-756PROII",
.mfg_name = "Icom", .mfg_name = "Icom",
.version = BACKEND_VER ".0", .version = BACKEND_VER ".1",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_ALPHA, .status = RIG_STATUS_ALPHA,
.rig_type = RIG_TYPE_TRANSCEIVER, .rig_type = RIG_TYPE_TRANSCEIVER,
@ -881,6 +887,8 @@ static const struct icom_priv_caps ic756pro3_priv_caps =
0, /* 731 mode */ 0, /* 731 mode */
0, /* no XCHG */ 0, /* no XCHG */
ic756pro_ts_sc_list, ic756pro_ts_sc_list,
.antack_len = 2,
.ant_count = 2,
.agc_levels_present = 1, .agc_levels_present = 1,
.agc_levels = { .agc_levels = {
{ .level = RIG_AGC_FAST, .icom_level = 1 }, { .level = RIG_AGC_FAST, .icom_level = 1 },
@ -955,7 +963,7 @@ const struct rig_caps ic756pro3_caps =
.rig_model = RIG_MODEL_IC756PROIII, .rig_model = RIG_MODEL_IC756PROIII,
.model_name = "IC-756PROIII", .model_name = "IC-756PROIII",
.mfg_name = "Icom", .mfg_name = "Icom",
.version = BACKEND_VER ".1", .version = BACKEND_VER ".2",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_BETA, .status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_TRANSCEIVER, .rig_type = RIG_TYPE_TRANSCEIVER,

Wyświetl plik

@ -143,6 +143,8 @@ static const struct icom_priv_caps ic7600_priv_caps =
0, /* 731 mode */ 0, /* 731 mode */
0, /* no XCHG */ 0, /* no XCHG */
ic756pro_ts_sc_list, ic756pro_ts_sc_list,
.antack_len = 3,
.ant_count = 2,
.agc_levels_present = 1, .agc_levels_present = 1,
.agc_levels = { .agc_levels = {
{ .level = RIG_AGC_FAST, .icom_level = 1 }, { .level = RIG_AGC_FAST, .icom_level = 1 },
@ -168,7 +170,7 @@ const struct rig_caps ic7600_caps =
.rig_model = RIG_MODEL_IC7600, .rig_model = RIG_MODEL_IC7600,
.model_name = "IC-7600", .model_name = "IC-7600",
.mfg_name = "Icom", .mfg_name = "Icom",
.version = BACKEND_VER ".0", .version = BACKEND_VER ".1",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_BETA, .status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_TRANSCEIVER, .rig_type = RIG_TYPE_TRANSCEIVER,

Wyświetl plik

@ -135,6 +135,8 @@ static const struct icom_priv_caps ic7610_priv_caps =
0, /* 731 mode */ 0, /* 731 mode */
0, /* no XCHG */ 0, /* no XCHG */
ic756pro_ts_sc_list, ic756pro_ts_sc_list,
.antack_len = 2,
.ant_count = 2,
.agc_levels_present = 1, .agc_levels_present = 1,
.agc_levels = { .agc_levels = {
{ .level = RIG_AGC_FAST, .icom_level = 1 }, { .level = RIG_AGC_FAST, .icom_level = 1 },
@ -166,7 +168,7 @@ const struct rig_caps ic7610_caps =
.rig_model = RIG_MODEL_IC7610, .rig_model = RIG_MODEL_IC7610,
.model_name = "IC-7610", .model_name = "IC-7610",
.mfg_name = "Icom", .mfg_name = "Icom",
.version = BACKEND_VER ".1", .version = BACKEND_VER ".2",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_BETA, .status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_TRANSCEIVER, .rig_type = RIG_TYPE_TRANSCEIVER,

Wyświetl plik

@ -119,6 +119,8 @@ static const struct icom_priv_caps ic7700_priv_caps =
0, /* 731 mode */ 0, /* 731 mode */
0, /* no XCHG */ 0, /* no XCHG */
ic756pro_ts_sc_list, ic756pro_ts_sc_list,
.antack_len = 4,
.ant_count = 3,
.agc_levels_present = 1, .agc_levels_present = 1,
.agc_levels = { .agc_levels = {
{ .level = RIG_AGC_OFF, .icom_level = 0 }, { .level = RIG_AGC_OFF, .icom_level = 0 },
@ -151,7 +153,7 @@ const struct rig_caps ic7700_caps =
.rig_model = RIG_MODEL_IC7700, .rig_model = RIG_MODEL_IC7700,
.model_name = "IC-7700", .model_name = "IC-7700",
.mfg_name = "Icom", .mfg_name = "Icom",
.version = BACKEND_VER ".1", .version = BACKEND_VER ".2",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_STABLE, .status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER, .rig_type = RIG_TYPE_TRANSCEIVER,

Wyświetl plik

@ -119,6 +119,8 @@ static const struct icom_priv_caps ic7800_priv_caps =
0, /* 731 mode */ 0, /* 731 mode */
0, /* no XCHG */ 0, /* no XCHG */
ic756pro_ts_sc_list, ic756pro_ts_sc_list,
.antack_len = 4,
.ant_count = 3,
.agc_levels_present = 1, .agc_levels_present = 1,
.agc_levels = { .agc_levels = {
{ .level = RIG_AGC_OFF, .icom_level = 0 }, { .level = RIG_AGC_OFF, .icom_level = 0 },
@ -151,7 +153,7 @@ const struct rig_caps ic7800_caps =
.rig_model = RIG_MODEL_IC7800, .rig_model = RIG_MODEL_IC7800,
.model_name = "IC-7800", .model_name = "IC-7800",
.mfg_name = "Icom", .mfg_name = "Icom",
.version = BACKEND_VER ".2", .version = BACKEND_VER ".3",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_UNTESTED, .status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER, .rig_type = RIG_TYPE_TRANSCEIVER,

Wyświetl plik

@ -118,12 +118,14 @@ int ic785x_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
* *
* TODO: complete command set (esp. the $1A bunch!) and testing.. * TODO: complete command set (esp. the $1A bunch!) and testing..
*/ */
static const struct icom_priv_caps ic785x_priv_caps = static struct icom_priv_caps ic785x_priv_caps =
{ {
0x8e, /* default address */ 0x8e, /* default address */
0, /* 731 mode */ 0, /* 731 mode */
0, /* no XCHG */ 0, /* no XCHG */
ic756pro_ts_sc_list, ic756pro_ts_sc_list,
.antack_len = 3,
.ant_count = 4,
.agc_levels_present = 1, .agc_levels_present = 1,
.agc_levels = { .agc_levels = {
{ .level = RIG_AGC_OFF, .icom_level = 0 }, { .level = RIG_AGC_OFF, .icom_level = 0 },

Wyświetl plik

@ -100,6 +100,8 @@ static const struct icom_priv_caps ic9100_priv_caps =
0, /* 731 mode */ 0, /* 731 mode */
1, /* no XCHG to avoid display flicker */ 1, /* no XCHG to avoid display flicker */
ic910_ts_sc_list, /* FIXME */ ic910_ts_sc_list, /* FIXME */
.antack_len = 2,
.ant_count = 2,
}; };
const struct rig_caps ic9100_caps = const struct rig_caps ic9100_caps =
@ -107,7 +109,7 @@ const struct rig_caps ic9100_caps =
.rig_model = RIG_MODEL_IC9100, .rig_model = RIG_MODEL_IC9100,
.model_name = "IC-9100", .model_name = "IC-9100",
.mfg_name = "Icom", .mfg_name = "Icom",
.version = BACKEND_VER".2", .version = BACKEND_VER".3",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_STABLE, .status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER, .rig_type = RIG_TYPE_TRANSCEIVER,

Wyświetl plik

@ -444,34 +444,34 @@ const struct confparams icom_ext_parms[] =
const struct cmdparams icom_ext_cmd[] = const struct cmdparams icom_ext_cmd[] =
{ {
{ {.t=TOK_DSTAR_CALL_SIGN}, C_CTL_DIG, S_DIG_DSCALS, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 38 }, { {.t = TOK_DSTAR_CALL_SIGN}, C_CTL_DIG, S_DIG_DSCALS, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 38 },
{ {.t=TOK_DSTAR_MESSAGE}, C_CTL_DIG, S_DIG_DSMESS, SC_MOD_RW12, 2, {0}, CMD_DAT_STR, 32 }, { {.t = TOK_DSTAR_MESSAGE}, C_CTL_DIG, S_DIG_DSMESS, SC_MOD_RW12, 2, {0}, CMD_DAT_STR, 32 },
{ {.t=TOK_DSTAR_STATUS}, C_CTL_DIG, S_DIG_DSRSTS, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 1 }, { {.t = TOK_DSTAR_STATUS}, C_CTL_DIG, S_DIG_DSRSTS, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 1 },
{ {.t=TOK_DSTAR_GPS_DATA}, C_CTL_DIG, S_DIG_DSGPSD, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 52 }, { {.t = TOK_DSTAR_GPS_DATA}, C_CTL_DIG, S_DIG_DSGPSD, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 52 },
{ {.t=TOK_DSTAR_GPS_MESS}, C_CTL_DIG, S_DIG_DSGPSM, SC_MOD_RW12, 2, {0}, CMD_DAT_STR, 52 }, { {.t = TOK_DSTAR_GPS_MESS}, C_CTL_DIG, S_DIG_DSGPSM, SC_MOD_RW12, 2, {0}, CMD_DAT_STR, 52 },
{ {.t=TOK_DSTAR_DSQL}, C_CTL_DIG, S_DIG_DSCSQL, SC_MOD_RW, 1, {0}, CMD_DAT_BOL, 1 }, { {.t = TOK_DSTAR_DSQL}, C_CTL_DIG, S_DIG_DSCSQL, SC_MOD_RW, 1, {0}, CMD_DAT_BOL, 1 },
{ {.t=TOK_DSTAR_CODE}, C_CTL_DIG, S_DIG_DSCSQL, SC_MOD_RW12, 2, {0}, CMD_DAT_FLT, 1 }, { {.t = TOK_DSTAR_CODE}, C_CTL_DIG, S_DIG_DSCSQL, SC_MOD_RW12, 2, {0}, CMD_DAT_FLT, 1 },
{ {.t=TOK_DSTAR_TX_DATA}, C_CTL_DSD, S_DSD_DSTXDT, SC_MOD_RW, 1, {0}, CMD_DAT_BUF, 30 }, { {.t = TOK_DSTAR_TX_DATA}, C_CTL_DSD, S_DSD_DSTXDT, SC_MOD_RW, 1, {0}, CMD_DAT_BUF, 30 },
{ {.t=TOK_DSTAR_MY_CS}, C_CTL_DVT, S_DVT_DSMYCS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 12 }, { {.t = TOK_DSTAR_MY_CS}, C_CTL_DVT, S_DVT_DSMYCS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 12 },
{ {.t=TOK_DSTAR_TX_CS}, C_CTL_DVT, S_DVT_DSTXCS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 24 }, { {.t = TOK_DSTAR_TX_CS}, C_CTL_DVT, S_DVT_DSTXCS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 24 },
{ {.t=TOK_DSTAR_TX_MESS}, C_CTL_DVT, S_DVT_DSTXMS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 20 }, { {.t = TOK_DSTAR_TX_MESS}, C_CTL_DVT, S_DVT_DSTXMS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 20 },
{ {.t=TOK_DRIVE_GAIN}, C_CTL_LVL, S_LVL_DRIVE, SC_MOD_RW, 1, {0}, CMD_DAT_FLT, 2 }, { {.t = TOK_DRIVE_GAIN}, C_CTL_LVL, S_LVL_DRIVE, SC_MOD_RW, 1, {0}, CMD_DAT_FLT, 2 },
{ {.t=TOK_DIGI_SEL_FUNC}, C_CTL_FUNC, S_FUNC_DIGISEL, SC_MOD_RW, 1, {0}, CMD_DAT_BOL, 1 }, { {.t = TOK_DIGI_SEL_FUNC}, C_CTL_FUNC, S_FUNC_DIGISEL, SC_MOD_RW, 1, {0}, CMD_DAT_BOL, 1 },
{ {.t=TOK_DIGI_SEL_LEVEL}, C_CTL_LVL, S_LVL_DIGI, SC_MOD_RW, 1, {0}, CMD_DAT_FLT, 2 }, { {.t = TOK_DIGI_SEL_LEVEL}, C_CTL_LVL, S_LVL_DIGI, SC_MOD_RW, 1, {0}, CMD_DAT_FLT, 2 },
{ {.t=TOK_SCOPE_DAT}, C_CTL_SCP, S_SCP_DAT, SC_MOD_RD, 0, {0}, CMD_DAT_BUF, 481 }, { {.t = TOK_SCOPE_DAT}, C_CTL_SCP, S_SCP_DAT, SC_MOD_RD, 0, {0}, CMD_DAT_BUF, 481 },
{ {.t=TOK_SCOPE_STS}, C_CTL_SCP, S_SCP_STS, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, { {.t = TOK_SCOPE_STS}, C_CTL_SCP, S_SCP_STS, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 },
{ {.t=TOK_SCOPE_DOP}, C_CTL_SCP, S_SCP_DOP, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, { {.t = TOK_SCOPE_DOP}, C_CTL_SCP, S_SCP_DOP, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 },
{ {.t=TOK_SCOPE_MSS}, C_CTL_SCP, S_SCP_MSS, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, { {.t = TOK_SCOPE_MSS}, C_CTL_SCP, S_SCP_MSS, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 },
{ {.t=TOK_SCOPE_MOD}, C_CTL_SCP, S_SCP_MOD, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, { {.t = TOK_SCOPE_MOD}, C_CTL_SCP, S_SCP_MOD, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 },
{ {.t=TOK_SCOPE_SPN}, C_CTL_SCP, S_SCP_SPN, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 6 }, { {.t = TOK_SCOPE_SPN}, C_CTL_SCP, S_SCP_SPN, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 6 },
{ {.t=TOK_SCOPE_EDG}, C_CTL_SCP, S_SCP_EDG, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, { {.t = TOK_SCOPE_EDG}, C_CTL_SCP, S_SCP_EDG, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 },
{ {.t=TOK_SCOPE_HLD}, C_CTL_SCP, S_SCP_HLD, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, { {.t = TOK_SCOPE_HLD}, C_CTL_SCP, S_SCP_HLD, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 },
{ {.t=TOK_SCOPE_REF}, C_CTL_SCP, S_SCP_REF, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 4 }, { {.t = TOK_SCOPE_REF}, C_CTL_SCP, S_SCP_REF, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 4 },
{ {.t=TOK_SCOPE_SWP}, C_CTL_SCP, S_SCP_SWP, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, { {.t = TOK_SCOPE_SWP}, C_CTL_SCP, S_SCP_SWP, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 },
{ {.t=TOK_SCOPE_STX}, C_CTL_SCP, S_SCP_STX, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, { {.t = TOK_SCOPE_STX}, C_CTL_SCP, S_SCP_STX, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 },
{ {.t=TOK_SCOPE_TYP}, C_CTL_SCP, S_SCP_TYP, SC_MOD_RW, 0, {0}, CMD_DAT_INT, 1 }, { {.t = TOK_SCOPE_TYP}, C_CTL_SCP, S_SCP_TYP, SC_MOD_RW, 0, {0}, CMD_DAT_INT, 1 },
{ {.t=TOK_SCOPE_VBW}, C_CTL_SCP, S_SCP_VBW, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, { {.t = TOK_SCOPE_VBW}, C_CTL_SCP, S_SCP_VBW, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 },
{ {.t=TOK_SCOPE_FEF}, C_CTL_SCP, S_SCP_FEF, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 12 }, { {.t = TOK_SCOPE_FEF}, C_CTL_SCP, S_SCP_FEF, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 12 },
{ {0} } { {0} }
}; };
@ -566,10 +566,10 @@ int
icom_init(RIG *rig) icom_init(RIG *rig)
{ {
struct icom_priv_data *priv; struct icom_priv_data *priv;
const struct icom_priv_caps *priv_caps; struct icom_priv_caps *priv_caps;
const struct rig_caps *caps; struct rig_caps *caps;
int retval; int retval;
int satmode; int satmode = 0;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@ -585,10 +585,11 @@ icom_init(RIG *rig)
return -RIG_ECONF; return -RIG_ECONF;
} }
priv_caps = (const struct icom_priv_caps *) caps->priv; priv_caps = (struct icom_priv_caps *) caps->priv;
rig->state.priv = (struct icom_priv_data *) calloc(1, sizeof(struct icom_priv_data)); rig->state.priv = (struct icom_priv_data *) calloc(1,
sizeof(struct icom_priv_data));
if (!rig->state.priv) if (!rig->state.priv)
{ {
@ -670,8 +671,10 @@ int icom_get_usb_echo_off(RIG *rig)
rs->rigport.retry = 1; rs->rigport.retry = 1;
// Check for echo on first // Check for echo on first
priv->serial_USB_echo_off = 0; priv->serial_USB_echo_off = 0;
retval = icom_transaction(rig, C_RD_TRXID, 0x00, NULL, 0, ackbuf, &ack_len);
rig_debug(RIG_DEBUG_VERBOSE, "%s: retry temp set to 1\n", __func__);
retval = icom_transaction(rig, C_RD_FREQ, -1, NULL, 0, ackbuf, &ack_len);
if (retval == RIG_OK) if (retval == RIG_OK)
{ {
rig_debug(RIG_DEBUG_VERBOSE, "%s: USB echo on detected\n", rig_debug(RIG_DEBUG_VERBOSE, "%s: USB echo on detected\n",
@ -711,6 +714,8 @@ icom_rig_open(RIG *rig)
rig_debug(RIG_DEBUG_VERBOSE, "%s %d \n", __func__, __LINE__); rig_debug(RIG_DEBUG_VERBOSE, "%s %d \n", __func__, __LINE__);
rig_debug(RIG_DEBUG_VERBOSE, "%s: %s v%s\n", __func__, rig->caps->model_name,
rig->caps->version);
retval = icom_get_usb_echo_off(rig); retval = icom_get_usb_echo_off(rig);
if (retval >= 0) { return RIG_OK; } if (retval >= 0) { return RIG_OK; }
@ -747,7 +752,7 @@ int
icom_rig_close(RIG *rig) icom_rig_close(RIG *rig)
{ {
// Nothing to do yet // Nothing to do yet
rig_debug(RIG_DEBUG_TRACE,"%s: called\n", __func__); rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
return RIG_OK; return RIG_OK;
} }
@ -1790,44 +1795,62 @@ int icom_set_cmd(RIG *rig, vfo_t vfo, struct cmdparams *par, value_t val)
unsigned char ackbuf[MAXFRAMELEN]; unsigned char ackbuf[MAXFRAMELEN];
int acklen = 0; int acklen = 0;
if (!(par->submod & SC_MOD_WR)) return -RIG_EINVAL; if (!(par->submod & SC_MOD_WR)) { return -RIG_EINVAL; }
if ((par->submod & SC_MOD_RW12) == SC_MOD_RW12) {
if ((par->submod & SC_MOD_RW12) == SC_MOD_RW12)
{
cmdbuf[0] = 0x01; cmdbuf[0] = 0x01;
cmdlen = 1; cmdlen = 1;
} else { }
else
{
cmdlen = par->sublen; cmdlen = par->sublen;
memcpy(cmdbuf, par->subext, cmdlen); memcpy(cmdbuf, par->subext, cmdlen);
} }
int wrd = val.i; int wrd = val.i;
int i; int i;
switch (par->dattyp) {
case CMD_DAT_WRD: switch (par->dattyp)
for (i = 1; i <= par->datlen; i++) { {
cmdbuf[cmdlen + par->datlen - i] = wrd & 0xff; case CMD_DAT_WRD:
wrd >>= 8; for (i = 1; i <= par->datlen; i++)
} {
break; cmdbuf[cmdlen + par->datlen - i] = wrd & 0xff;
case CMD_DAT_BUF: wrd >>= 8;
memcpy(&cmdbuf[cmdlen], val.b.d, par->datlen); }
break;
case CMD_DAT_INT: break;
case CMD_DAT_BOL:
to_bcd_be(&cmdbuf[cmdlen], val.i, (par->datlen * 2)); case CMD_DAT_BUF:
break; memcpy(&cmdbuf[cmdlen], val.b.d, par->datlen);
case CMD_DAT_FLT: break;
to_bcd_be(&cmdbuf[cmdlen], (int) val.f, (cmdlen * 2));
break; case CMD_DAT_INT:
case CMD_DAT_LVL: case CMD_DAT_BOL:
to_bcd_be(&cmdbuf[cmdlen], (int)(val.f * 255.0), (cmdlen * 2)); to_bcd_be(&cmdbuf[cmdlen], val.i, (par->datlen * 2));
break; break;
case CMD_DAT_TIM:
to_bcd_be(&cmdbuf[cmdlen], ((((int)val.f / 3600) * 100) + (((int)val.f / 60) % 60)), (par->datlen * 2)); case CMD_DAT_FLT:
break; to_bcd_be(&cmdbuf[cmdlen], (int) val.f, (cmdlen * 2));
default: break;
break;
case CMD_DAT_LVL:
to_bcd_be(&cmdbuf[cmdlen], (int)(val.f * 255.0), (cmdlen * 2));
break;
case CMD_DAT_TIM:
to_bcd_be(&cmdbuf[cmdlen],
((((int)val.f / 3600) * 100) + (((int)val.f / 60) % 60)), (par->datlen * 2));
break;
default:
break;
} }
cmdlen += par->datlen; cmdlen += par->datlen;
return icom_transaction(rig, par->command, par->subcmd, cmdbuf, cmdlen, ackbuf, &acklen); return icom_transaction(rig, par->command, par->subcmd, cmdbuf, cmdlen, ackbuf,
&acklen);
} }
int icom_get_cmd(RIG *rig, vfo_t vfo, struct cmdparams *par, value_t *val) int icom_get_cmd(RIG *rig, vfo_t vfo, struct cmdparams *par, value_t *val)
@ -1840,59 +1863,85 @@ int icom_get_cmd(RIG *rig, vfo_t vfo, struct cmdparams *par, value_t *val)
int reslen = sizeof(resbuf); int reslen = sizeof(resbuf);
int retval; int retval;
if (!(par->submod & SC_MOD_RD)) return -RIG_EINVAL; if (!(par->submod & SC_MOD_RD)) { return -RIG_EINVAL; }
if ((par->submod & SC_MOD_RW12) == SC_MOD_RW12) {
retval = icom_get_raw_buf(rig, par->command, par->subcmd, 1, &ssc, &reslen, resbuf); if ((par->submod & SC_MOD_RW12) == SC_MOD_RW12)
} else { {
retval = icom_get_raw_buf(rig, par->command, par->subcmd, retval = icom_get_raw_buf(rig, par->command, par->subcmd, 1, &ssc, &reslen,
par->sublen, (unsigned char *)par->subext, &reslen, resbuf); resbuf);
} }
if (retval != RIG_OK) { else
{
retval = icom_get_raw_buf(rig, par->command, par->subcmd,
par->sublen, (unsigned char *)par->subext, &reslen, resbuf);
}
if (retval != RIG_OK)
{
return retval; return retval;
} }
switch (par->dattyp) {
case CMD_DAT_WRD: { switch (par->dattyp)
int wrd = 0; {
int i; case CMD_DAT_WRD:
for (i = 0; i < par->datlen; i++) { {
wrd = (wrd << 8) + resbuf[i]; int wrd = 0;
} int i;
val->i = wrd;
} for (i = 0; i < par->datlen; i++)
break; {
case CMD_DAT_STR: wrd = (wrd << 8) + resbuf[i];
if (strlen(val->s) < reslen) { }
return -RIG_EINTERNAL;
} val->i = wrd;
memcpy(val->s, resbuf, reslen);
val->s[reslen] = 0;
break;
case CMD_DAT_BUF:
if (reslen > val->b.l) {
return -RIG_EINTERNAL;
}
memcpy(val->b.d, resbuf, reslen);
val->b.l = reslen;
break;
case CMD_DAT_INT:
val->i = from_bcd_be(resbuf, (reslen * 2));
break;
case CMD_DAT_FLT:
val->f = (float) from_bcd_be(resbuf, (reslen * 2));
break;
case CMD_DAT_LVL:
val->f = (float) from_bcd_be(resbuf, (reslen * 2)) / 255.0;
break;
case CMD_DAT_BOL:
val->i = (from_bcd_be(resbuf, (reslen * 2)) == 0) ? 0 : 1;
break;
case CMD_DAT_TIM:
val->i = (from_bcd_be(resbuf, 2) * 3600) + (from_bcd_be(&resbuf[1], 2) * 60);
break;
default:
val->i = 0;
break;
} }
break;
case CMD_DAT_STR:
if (strlen(val->s) < reslen)
{
return -RIG_EINTERNAL;
}
memcpy(val->s, resbuf, reslen);
val->s[reslen] = 0;
break;
case CMD_DAT_BUF:
if (reslen > val->b.l)
{
return -RIG_EINTERNAL;
}
memcpy(val->b.d, resbuf, reslen);
val->b.l = reslen;
break;
case CMD_DAT_INT:
val->i = from_bcd_be(resbuf, (reslen * 2));
break;
case CMD_DAT_FLT:
val->f = (float) from_bcd_be(resbuf, (reslen * 2));
break;
case CMD_DAT_LVL:
val->f = (float) from_bcd_be(resbuf, (reslen * 2)) / 255.0;
break;
case CMD_DAT_BOL:
val->i = (from_bcd_be(resbuf, (reslen * 2)) == 0) ? 0 : 1;
break;
case CMD_DAT_TIM:
val->i = (from_bcd_be(resbuf, 2) * 3600) + (from_bcd_be(&resbuf[1], 2) * 60);
break;
default:
val->i = 0;
break;
}
return RIG_OK; return RIG_OK;
} }
@ -1914,9 +1963,12 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
const struct cmdparams *cmd = priv_caps->riglevels; const struct cmdparams *cmd = priv_caps->riglevels;
for (i = 0; cmd && cmd[i].id.s != 0; i++) {
if (cmd[i].id.s == level) { for (i = 0; cmd && cmd[i].id.s != 0; i++)
return icom_set_cmd(rig,vfo, (struct cmdparams *)&cmd[i], val); {
if (cmd[i].id.s == level)
{
return icom_set_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val);
} }
} }
@ -2269,8 +2321,11 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
const struct icom_priv_caps *priv = rig->caps->priv; const struct icom_priv_caps *priv = rig->caps->priv;
const struct cmdparams *cmd = priv->riglevels; const struct cmdparams *cmd = priv->riglevels;
int i; int i;
for (i = 0; cmd && cmd[i].id.s != 0; i++) {
if (cmd[i].id.s == level) { for (i = 0; cmd && cmd[i].id.s != 0; i++)
{
if (cmd[i].id.s == level)
{
return icom_get_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val); return icom_get_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val);
} }
} }
@ -2519,7 +2574,6 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
if (priv_caps->agc_levels_present) if (priv_caps->agc_levels_present)
{ {
int found = 0; int found = 0;
int i;
for (i = 0; for (i = 0;
i <= RIG_AGC_LAST && priv_caps->agc_levels[i].level >= 0; i++) i <= RIG_AGC_LAST && priv_caps->agc_levels[i].level >= 0; i++)
@ -2742,22 +2796,33 @@ int icom_get_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t *val)
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
for (i = 0; rig->caps->ext_tokens && rig->caps->ext_tokens[i] != TOK_BACKEND_NONE; i++) { for (i = 0; rig->caps->ext_tokens
if (rig->caps->ext_tokens[i] == token) { && rig->caps->ext_tokens[i] != TOK_BACKEND_NONE; i++)
{
if (rig->caps->ext_tokens[i] == token)
{
const struct icom_priv_caps *priv = rig->caps->priv; const struct icom_priv_caps *priv = rig->caps->priv;
const struct cmdparams *cmd = priv->extcmds ? priv->extcmds : icom_ext_cmd; const struct cmdparams *cmd = priv->extcmds ? priv->extcmds : icom_ext_cmd;
for (i = 0; (cmd[i].id.t != 0) || (cmd != icom_ext_cmd); ) {
if (cmd[i].id.t == 0) { for (i = 0; (cmd[i].id.t != 0) || (cmd != icom_ext_cmd);)
{
if (cmd[i].id.t == 0)
{
cmd = icom_ext_cmd; cmd = icom_ext_cmd;
i = 0; i = 0;
} else if (cmd[i].id.t == token) { }
else if (cmd[i].id.t == token)
{
return icom_get_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val); return icom_get_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val);
} else i++; }
else { i++; }
} }
return -RIG_EINVAL; return -RIG_EINVAL;
} }
} }
return -RIG_EINVAL; return -RIG_EINVAL;
} }
@ -2767,22 +2832,33 @@ int icom_set_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t val)
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
for (i = 0; rig->caps->ext_tokens && rig->caps->ext_tokens[i] != TOK_BACKEND_NONE; i++) { for (i = 0; rig->caps->ext_tokens
if (rig->caps->ext_tokens[i] == token) { && rig->caps->ext_tokens[i] != TOK_BACKEND_NONE; i++)
{
if (rig->caps->ext_tokens[i] == token)
{
const struct icom_priv_caps *priv = rig->caps->priv; const struct icom_priv_caps *priv = rig->caps->priv;
const struct cmdparams *cmd = priv->extcmds ? priv->extcmds : icom_ext_cmd; const struct cmdparams *cmd = priv->extcmds ? priv->extcmds : icom_ext_cmd;
for (i = 0; (cmd[i].id.t != 0) || (cmd != icom_ext_cmd); ) {
if (cmd[i].id.t == 0) { for (i = 0; (cmd[i].id.t != 0) || (cmd != icom_ext_cmd);)
{
if (cmd[i].id.t == 0)
{
cmd = icom_ext_cmd; cmd = icom_ext_cmd;
i = 0; i = 0;
} else if (cmd[i].id.t == token) { }
else if (cmd[i].id.t == token)
{
return icom_set_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val); return icom_set_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val);
} else i++; }
else { i++; }
} }
return -RIG_EINVAL; return -RIG_EINVAL;
} }
} }
return -RIG_EINVAL; return -RIG_EINVAL;
} }
@ -3990,7 +4066,8 @@ int icom_mem_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split,
*split = RIG_SPLIT_ON; *split = RIG_SPLIT_ON;
/* get it back to normal */ /* get it back to normal */
retval = icom_vfo_op(rig, vfo, RIG_OP_XCHG); retval = icom_vfo_op(rig, vfo, RIG_OP_XCHG);
if (retval != RIG_OK) return retval;
if (retval != RIG_OK) { return retval; }
} }
else if (retval == -RIG_ERJCTED) else if (retval == -RIG_ERJCTED)
{ {
@ -4508,11 +4585,15 @@ int icom_set_parm(RIG *rig, setting_t parm, value_t val)
int i; int i;
const struct icom_priv_caps *priv = rig->caps->priv; const struct icom_priv_caps *priv = rig->caps->priv;
const struct cmdparams *cmd = priv->rigparms; const struct cmdparams *cmd = priv->rigparms;
for (i = 0; cmd && cmd[i].id.s != 0; i++) {
if (cmd[i].id.s == parm) { for (i = 0; cmd && cmd[i].id.s != 0; i++)
{
if (cmd[i].id.s == parm)
{
return icom_set_cmd(rig, RIG_VFO_NONE, (struct cmdparams *)&cmd[i], val); return icom_set_cmd(rig, RIG_VFO_NONE, (struct cmdparams *)&cmd[i], val);
} }
} }
switch (parm) switch (parm)
{ {
case RIG_PARM_ANN: case RIG_PARM_ANN:
@ -4566,8 +4647,11 @@ int icom_get_parm(RIG *rig, setting_t parm, value_t *val)
const struct icom_priv_caps *priv = rig->caps->priv; const struct icom_priv_caps *priv = rig->caps->priv;
const struct cmdparams *cmd = priv->rigparms; const struct cmdparams *cmd = priv->rigparms;
int i; int i;
for (i = 0; cmd && cmd[i].id.s != 0; i++) {
if (cmd[i].id.s == parm) { for (i = 0; cmd && cmd[i].id.s != 0; i++)
{
if (cmd[i].id.s == parm)
{
return icom_get_cmd(rig, RIG_VFO_NONE, (struct cmdparams *)&cmd[i], val); return icom_get_cmd(rig, RIG_VFO_NONE, (struct cmdparams *)&cmd[i], val);
} }
} }
@ -5040,7 +5124,7 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
} }
i = 0; i = 0;
retry = 2; retry = 1;
if (status == RIG_POWER_ON) // wait for wakeup only if (status == RIG_POWER_ON) // wait for wakeup only
{ {
@ -5218,16 +5302,21 @@ int icom_set_bank(RIG *rig, vfo_t vfo, int bank)
*/ */
int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
{ {
unsigned char antarg; unsigned char antopt[2];
unsigned char ackbuf[MAXFRAMELEN]; unsigned char ackbuf[MAXFRAMELEN];
int ack_len = sizeof(ackbuf), retval, i_ant = 0; int ack_len = sizeof(ackbuf), retval, i_ant = 0;
int ant_len; int antopt_len = 0;
const struct icom_priv_caps *priv_caps = (const struct icom_priv_caps *)
rig->caps->priv;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); rig_debug(RIG_DEBUG_VERBOSE, "%s called, ant=0x%02x, option=%d\n", __func__, ant, option.i);
// query the antennas once and find out how many we have
/* if (ant >= rig_idx2setting(priv_caps->ant_count)) {
* TODO: IC-756* and [RX ANT] return -RIG_EINVAL;
*/ }
if (ant > RIG_ANT_4) {
return -RIG_EDOM;
}
switch (ant) switch (ant)
{ {
case RIG_ANT_1: case RIG_ANT_1:
@ -5247,17 +5336,65 @@ int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
break; break;
default: default:
rig_debug(RIG_DEBUG_ERR, "%s: unsupported ant %#x\n", __func__, ant); rig_debug(RIG_DEBUG_ERR, "%s: unsupported ant %#x", __func__, ant);
return -RIG_EINVAL; return -RIG_EINVAL;
} }
antarg = option.i;
ant_len = ((rig->caps->rig_model == RIG_MODEL_ICR75) if (priv_caps->antack_len == 0) { // we need to find out the antack_len
|| (rig->caps->rig_model == RIG_MODEL_ICR8600) || ant_t tmp_ant;
(rig->caps->rig_model == RIG_MODEL_ICR6) int ant = 0;
|| (rig->caps->rig_model == RIG_MODEL_ICR30)) ? 0 : 1; value_t tmp_option;
retval = rig_get_ant(rig, vfo, ant, &tmp_ant, &tmp_option);
if (retval != RIG_OK) {
rig_debug(RIG_DEBUG_ERR,"%s: rig_get_ant error: %s \n", __func__, rigerror(retval));
return retval;
}
}
// Some rigs have 3-byte ant cmd so there is an option to be set too
if (priv_caps->antack_len == 3)
{
if (option.i != 0 && option.i != 1)
{
rig_debug(RIG_DEBUG_ERR, "%s: option.i != 0 or 1, ==%d?\n", __func__, option.i);
return -RIG_EINVAL;
}
antopt_len = 1;
antopt[0] = option.i;
// we have to set the rx option by itself apparently
retval = icom_transaction(rig, C_CTL_ANT, i_ant,
antopt, antopt_len, ackbuf, &ack_len);
if (retval != RIG_OK)
{
return retval;
}
antopt_len = 0;
rig_debug(RIG_DEBUG_TRACE, "%s: antack_len=%d so antopt_len=%d, antopt=0x%02x\n",
__func__, priv_caps->antack_len, antopt_len, antopt[0]);
}
else if (priv_caps->antack_len == 2)
{
antopt_len = 0;
rig_debug(RIG_DEBUG_TRACE, "%s: antack_len=%d so antopt_len=%d\n", __func__,
priv_caps->antack_len, antopt_len);
}
else
{
rig_debug(RIG_DEBUG_TRACE, "%s: antack_len=%d so antopt_len=%d\n", __func__,
priv_caps->antack_len, antopt_len);
antopt_len = 0;
rig_debug(RIG_DEBUG_ERR,
"%s: rig does not have antenna select? antack_len=%d\n", __func__,
priv_caps->antack_len);
}
rig_debug(RIG_DEBUG_TRACE, "%s: i_ant=%d, antopt=0x%02x, antopt_len=%d\n",
__func__, i_ant, antopt[0], antopt_len);
retval = icom_transaction(rig, C_CTL_ANT, i_ant, retval = icom_transaction(rig, C_CTL_ANT, i_ant,
&antarg, ant_len, ackbuf, &ack_len); antopt, antopt_len, ackbuf, &ack_len);
if (retval != RIG_OK) if (retval != RIG_OK)
{ {
@ -5279,32 +5416,53 @@ int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
* Assumes rig!=NULL, rig->state.priv!=NULL * Assumes rig!=NULL, rig->state.priv!=NULL
* only meaningfull for HF * only meaningfull for HF
*/ */
int icom_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *rxant) int icom_get_ant(RIG *rig, vfo_t vfo, ant_t ant, ant_t *ant_curr, value_t *option)
{ {
unsigned char ackbuf[MAXFRAMELEN]; unsigned char ackbuf[MAXFRAMELEN];
int ack_len = sizeof(ackbuf), retval; int ack_len = sizeof(ackbuf), retval;
struct icom_priv_caps *priv_caps = (struct icom_priv_caps *) rig->caps->priv;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
retval = icom_transaction(rig, C_CTL_ANT, -1, NULL, 0, ackbuf, &ack_len); rig_debug(RIG_DEBUG_VERBOSE, "%s called, ant=0x%02x\n", __func__, ant);
if (ant == RIG_ANT_CURR) {
retval = icom_transaction(rig, C_CTL_ANT, -1, NULL, 0, ackbuf, &ack_len);
}
else if (priv_caps->ant_count > 0) {
//retval = icom_transaction(rig, C_CTL_ANT, rig_setting2idx(ant), NULL, 0, ackbuf, &ack_len);
retval = icom_transaction(rig, C_CTL_ANT, -1, NULL, 0, ackbuf, &ack_len);
}
else {
rig_debug(RIG_DEBUG_ERR,"%s: asking for non-current antenna and ant_count==0?\n", __func__);
return -RIG_EINVAL;
}
if (retval != RIG_OK) if (retval != RIG_OK)
{ {
return retval; return retval;
} }
// ack_len should be either 2 or 3
// ant cmd format is one of
// 0x12 0xaa
// 0x12 0xaa 0xrr
// Where aa is a zero-base antenna number and rr is a binary for rx only
if ((ack_len != 2 && ack_len != 3) || ackbuf[0] != C_CTL_ANT || if ((ack_len != 2 && ack_len != 3) || ackbuf[0] != C_CTL_ANT ||
ackbuf[1] > 3) ackbuf[1] > 3)
{ {
rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d, ant=%d\n", __func__,
ackbuf[0], ack_len); ackbuf[0], ack_len, ackbuf[1]);
return -RIG_ERJCTED; return -RIG_ERJCTED;
} }
/* Note: with IC756/IC-756Pro/IC-7800, ackbuf[2] deals with [RX ANT] */ *ant_curr = ackbuf[1];
*ant = RIG_ANT_N(ackbuf[1]); // Note: with IC756/IC-756Pro/IC-7800 and more, ackbuf[2] deals with [RX ANT]
if (ack_len == 3) { // then this should be rx ant on/off status // Hopefully any ack_len=3 can fit in the option field
rxant->i = RIG_ANT_N(ackbuf[2]); if (ack_len == 3)
{
option->i = ackbuf[2];
} }
return RIG_OK; return RIG_OK;
@ -5865,6 +6023,38 @@ int icom_get_level_raw(RIG *rig, setting_t level, int cmd, int subcmd,
return RIG_OK; return RIG_OK;
} }
/*
* icom_send_voice_mem
* Assumes rig!=NULL, rig->state.priv!=NULL
*/
int icom_send_voice_mem(RIG *rig, vfo_t vfo, int ch)
{
unsigned char chbuf[1];
unsigned char ackbuf[MAXFRAMELEN];
int ack_len = sizeof(ackbuf), retval;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
to_bcd_be(chbuf, ch, 2);
retval = icom_transaction(rig, C_SND_VOICE, 0, chbuf, 1,
ackbuf, &ack_len);
if (retval != RIG_OK)
{
return retval;
}
if (ack_len != 1 || ackbuf[0] != ACK)
{
rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__,
ackbuf[0], ack_len);
return -RIG_ERJCTED;
}
return RIG_OK;
}
// Sets rig vfo && priv->curr_vfo to default VFOA, or current vfo, or the vfo requested // Sets rig vfo && priv->curr_vfo to default VFOA, or current vfo, or the vfo requested
static int set_vfo_curr(RIG *rig, vfo_t vfo, vfo_t curr_vfo) static int set_vfo_curr(RIG *rig, vfo_t vfo, vfo_t curr_vfo)
{ {

Wyświetl plik

@ -30,7 +30,7 @@
#include <sys/time.h> #include <sys/time.h>
#endif #endif
#define BACKEND_VER "0.23" #define BACKEND_VER "0.25"
/* /*
* defines used by comp_cal_str in rig.c * defines used by comp_cal_str in rig.c
@ -125,6 +125,8 @@ struct icom_priv_caps
int civ_731_mode; /* Off: freqs on 10 digits, On: freqs on 8 digits */ int civ_731_mode; /* Off: freqs on 10 digits, On: freqs on 8 digits */
int no_xchg; /* Off: use VFO XCHG to set other VFO, On: use set VFO to set other VFO */ int no_xchg; /* Off: use VFO XCHG to set other VFO, On: use set VFO to set other VFO */
const struct ts_sc_list *ts_sc_list; const struct ts_sc_list *ts_sc_list;
// the 4 elements above are mandatory
// everything below here is optional in the backends
int settle_time; /*!< Receiver settle time, in ms */ int settle_time; /*!< Receiver settle time, in ms */
int (*r2i_mode)(RIG *rig, rmode_t mode, pbwidth_t width, int (*r2i_mode)(RIG *rig, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd); /*< backend specific code unsigned char *md, signed char *pd); /*< backend specific code
@ -135,6 +137,8 @@ struct icom_priv_caps
to convert response to convert response
tokens to bandwidth and tokens to bandwidth and
mode */ mode */
int antack_len; /* Length of 0x12 cmd may be 3 or 4 bytes as of 2020-01-22 e.g. 7851 */
int ant_count; /* number of antennas */
int serial_full_duplex; /*!< Whether RXD&TXD are not tied together */ int serial_full_duplex; /*!< Whether RXD&TXD are not tied together */
int offs_len; /* Number of bytes in offset frequency field. 0 defaults to 3 */ int offs_len; /* Number of bytes in offset frequency field. 0 defaults to 3 */
int serial_USB_echo_check; /* Flag to test USB echo state */ int serial_USB_echo_check; /* Flag to test USB echo state */
@ -253,13 +257,14 @@ int icom_get_conf(RIG *rig, token_t token, char *val);
int icom_set_powerstat(RIG *rig, powerstat_t status); int icom_set_powerstat(RIG *rig, powerstat_t status);
int icom_get_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, value_t option); 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_get_ant(RIG *rig, vfo_t vfo, ant_t ant, ant_t *ant_curr, value_t *option);
int icom_decode_event(RIG *rig); int icom_decode_event(RIG *rig);
int icom_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq, int icom_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq,
rmode_t mode); rmode_t mode);
int icom_mW2power(RIG *rig, float *power, unsigned int mwpower, freq_t freq, int icom_mW2power(RIG *rig, float *power, unsigned int mwpower, freq_t freq,
rmode_t mode); rmode_t mode);
int icom_send_morse(RIG *rig, vfo_t vfo, const char *msg); int icom_send_morse(RIG *rig, vfo_t vfo, const char *msg);
int icom_send_voice_mem(RIG *rig, vfo_t vfo, int bank);
/* Exposed routines */ /* Exposed routines */
int icom_get_split_vfos(const RIG *rig, vfo_t *rx_vfo, vfo_t *tx_vfo); int icom_get_split_vfos(const RIG *rig, vfo_t *rx_vfo, vfo_t *tx_vfo);
int icom_set_raw(RIG *rig, int cmd, int subcmd, int subcmdbuflen, int icom_set_raw(RIG *rig, int cmd, int subcmd, int subcmdbuflen,

Wyświetl plik

@ -96,8 +96,9 @@
#define C_CTL_DIG 0x20 /* Digital modes settings & status */ #define C_CTL_DIG 0x20 /* Digital modes settings & status */
#define C_CTL_RIT 0x21 /* RIT/XIT control */ #define C_CTL_RIT 0x21 /* RIT/XIT control */
#define C_CTL_DSD 0x22 /* D-STAR Data */ #define C_CTL_DSD 0x22 /* D-STAR Data */
#define C_SEND_SEL_FREQ 0x25 /* Send/Recv sel/unsel VFO frequency */ #define C_SEND_SEL_FREQ 0x25 /* Send/Recv sel/unsel VFO frequency */
#define C_CTL_SCP 0x27 /* Scope control & data */ #define C_CTL_SCP 0x27 /* Scope control & data */
#define C_SND_VOICE 0x28 /* Transmit Voice Memory Contents */
#define C_CTL_MTEXT 0x70 /* Microtelecom Extension */ #define C_CTL_MTEXT 0x70 /* Microtelecom Extension */
#define C_CTL_MISC 0x7f /* Miscellaneous control, Sc */ #define C_CTL_MISC 0x7f /* Miscellaneous control, Sc */

Wyświetl plik

@ -47,7 +47,7 @@
{ 160, 60 } /* +60 */ \ { 160, 60 } /* +60 */ \
} } } }
static const struct icom_priv_caps icr10_priv_caps = static struct icom_priv_caps icr10_priv_caps =
{ {
0x52, /* default address */ 0x52, /* default address */
0, /* 731 mode */ 0, /* 731 mode */

Wyświetl plik

@ -47,7 +47,7 @@
{ 255, 60 } /* +60 */ \ { 255, 60 } /* +60 */ \
} } } }
static const struct icom_priv_caps icr20_priv_caps = static struct icom_priv_caps icr20_priv_caps =
{ {
0x6c, /* default address */ 0x6c, /* default address */
0, /* 731 mode */ 0, /* 731 mode */

Wyświetl plik

@ -113,12 +113,14 @@ int icr30_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
} }
} }
static const struct icom_priv_caps icr30_priv_caps = static struct icom_priv_caps icr30_priv_caps =
{ {
0x9c, /* default address */ 0x9c, /* default address */
0, /* 731 mode */ 0, /* 731 mode */
0, /* no XCHG */ 0, /* no XCHG */
r8500_ts_sc_list, /* wrong, but don't have set_ts anyway */ r8500_ts_sc_list, /* wrong, but don't have set_ts anyway */
.antack_len = 2,
.ant_count = 2,
.r2i_mode = icr30_r2i_mode, .r2i_mode = icr30_r2i_mode,
.offs_len = 4, .offs_len = 4,
.extcmds = icr30_extcmds /* Custom ext_parm parameters */ .extcmds = icr30_extcmds /* Custom ext_parm parameters */
@ -129,7 +131,7 @@ const struct rig_caps icr30_caps =
.rig_model = RIG_MODEL_ICR30, .rig_model = RIG_MODEL_ICR30,
.model_name = "IC-R30", .model_name = "IC-R30",
.mfg_name = "Icom", .mfg_name = "Icom",
.version = BACKEND_VER ".0", .version = BACKEND_VER ".2",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_ALPHA, .status = RIG_STATUS_ALPHA,
.rig_type = RIG_TYPE_RECEIVER | RIG_FLAG_HANDHELD, .rig_type = RIG_TYPE_RECEIVER | RIG_FLAG_HANDHELD,

Wyświetl plik

@ -46,12 +46,14 @@
{ 255, 60 } /* +60 */ \ { 255, 60 } /* +60 */ \
} } } }
static const struct icom_priv_caps icr6_priv_caps = static struct icom_priv_caps icr6_priv_caps =
{ {
0x7e, /* default address */ 0x7e, /* default address */
0, /* 731 mode */ 0, /* 731 mode */
0, /* no XCHG */ 0, /* no XCHG */
r8500_ts_sc_list /* wrong, but don't have set_ts anyway */ r8500_ts_sc_list, /* wrong, but don't have set_ts anyway */
.antack_len = 2,
.ant_count = 2
}; };
const struct rig_caps icr6_caps = const struct rig_caps icr6_caps =
@ -59,7 +61,7 @@ const struct rig_caps icr6_caps =
.rig_model = RIG_MODEL_ICR6, .rig_model = RIG_MODEL_ICR6,
.model_name = "IC-R6", .model_name = "IC-R6",
.mfg_name = "Icom", .mfg_name = "Icom",
.version = BACKEND_VER ".0", .version = BACKEND_VER ".1",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_BETA, .status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_RECEIVER | RIG_FLAG_HANDHELD, .rig_type = RIG_TYPE_RECEIVER | RIG_FLAG_HANDHELD,

Wyświetl plik

@ -49,7 +49,7 @@ static int r7000_set_freq(RIG *rig, vfo_t vfo, freq_t freq);
/* FIXME: S-Meter measurements */ /* FIXME: S-Meter measurements */
#define ICR7100_STR_CAL UNKNOWN_IC_STR_CAL #define ICR7100_STR_CAL UNKNOWN_IC_STR_CAL
static const struct icom_priv_caps icr7000_priv_caps = static struct icom_priv_caps icr7000_priv_caps =
{ {
0x08, /* default address */ 0x08, /* default address */
0, /* 731 mode */ 0, /* 731 mode */
@ -164,7 +164,7 @@ const struct rig_caps icr7000_caps =
}; };
static const struct icom_priv_caps icr7100_priv_caps = static struct icom_priv_caps icr7100_priv_caps =
{ {
0x34, /* default address */ 0x34, /* default address */
0, /* 731 mode */ 0, /* 731 mode */

Wyświetl plik

@ -40,7 +40,7 @@
#define ICR71_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO) #define ICR71_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO)
#define ICR71_SCAN_OPS (RIG_SCAN_NONE) #define ICR71_SCAN_OPS (RIG_SCAN_NONE)
static const struct icom_priv_caps icr71_priv_caps = static struct icom_priv_caps icr71_priv_caps =
{ {
0x1a, /* default address */ 0x1a, /* default address */
0, /* 731 mode */ 0, /* 731 mode */

Wyświetl plik

@ -41,7 +41,7 @@
#define ICR71_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL) #define ICR71_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL)
#define ICR72_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_VFO|RIG_SCAN_SLCT|RIG_SCAN_PRIO) #define ICR72_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_VFO|RIG_SCAN_SLCT|RIG_SCAN_PRIO)
static const struct icom_priv_caps icr72_priv_caps = static struct icom_priv_caps icr72_priv_caps =
{ {
0x32, /* default address */ 0x32, /* default address */
0, /* 731 mode */ 0, /* 731 mode */

Wyświetl plik

@ -96,12 +96,14 @@ static int icr75_get_channel(RIG *rig, channel_t *chan);
int icr75_set_parm(RIG *rig, setting_t parm, value_t val); int icr75_set_parm(RIG *rig, setting_t parm, value_t val);
int icr75_get_parm(RIG *rig, setting_t parm, value_t *val); int icr75_get_parm(RIG *rig, setting_t parm, value_t *val);
static const struct icom_priv_caps icr75_priv_caps = static struct icom_priv_caps icr75_priv_caps =
{ {
0x5a, /* default address */ 0x5a, /* default address */
0, /* 731 mode */ 0, /* 731 mode */
0, /* no XCHG */ 0, /* no XCHG */
r75_ts_sc_list r75_ts_sc_list,
.antack_len = 2,
.ant_count = 2
}; };
const struct rig_caps icr75_caps = const struct rig_caps icr75_caps =
@ -109,7 +111,7 @@ const struct rig_caps icr75_caps =
.rig_model = RIG_MODEL_ICR75, .rig_model = RIG_MODEL_ICR75,
.model_name = "IC-R75", .model_name = "IC-R75",
.mfg_name = "Icom", .mfg_name = "Icom",
.version = BACKEND_VER ".0", .version = BACKEND_VER ".1",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_BETA, .status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_RECEIVER, .rig_type = RIG_TYPE_RECEIVER,

Wyświetl plik

@ -63,7 +63,7 @@
int icr8500_set_func(RIG *rig, vfo_t vfo, setting_t func, int status); int icr8500_set_func(RIG *rig, vfo_t vfo, setting_t func, int status);
static const struct icom_priv_caps icr8500_priv_caps = static struct icom_priv_caps icr8500_priv_caps =
{ {
0x4a, /* default address */ 0x4a, /* default address */
0, /* 731 mode */ 0, /* 731 mode */

Wyświetl plik

@ -102,12 +102,14 @@ struct cmdparams icr8600_extcmds[] = {
.flags = 1, \ .flags = 1, \
} }
static const struct icom_priv_caps icr8600_priv_caps = static struct icom_priv_caps icr8600_priv_caps =
{ {
0x96, /* default address */ 0x96, /* default address */
0, /* 731 mode */ 0, /* 731 mode */
0, /* no XCHG */ 0, /* no XCHG */
r8600_ts_sc_list, /* list of tuning steps */ r8600_ts_sc_list, /* list of tuning steps */
.antack_len = 2,
.ant_count = 3,
.offs_len = 4, /* Repeater offset is 4 bytes */ .offs_len = 4, /* Repeater offset is 4 bytes */
.serial_USB_echo_check = 1, /* USB CI-V may not echo */ .serial_USB_echo_check = 1, /* USB CI-V may not echo */
.rigparms = icr8600_rigparms, /* Custom parm parameters */ .rigparms = icr8600_rigparms, /* Custom parm parameters */
@ -119,7 +121,7 @@ const struct rig_caps icr8600_caps =
.rig_model = RIG_MODEL_ICR8600, .rig_model = RIG_MODEL_ICR8600,
.model_name = "IC-R8600", .model_name = "IC-R8600",
.mfg_name = "Icom", .mfg_name = "Icom",
.version = "0.8", .version = BACKEND_VER ".9",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_ALPHA, .status = RIG_STATUS_ALPHA,
.rig_type = RIG_TYPE_RECEIVER, .rig_type = RIG_TYPE_RECEIVER,

Wyświetl plik

@ -57,12 +57,14 @@
/* TODO: S-Meter measurements */ /* TODO: S-Meter measurements */
#define ICR9000_STR_CAL UNKNOWN_IC_STR_CAL #define ICR9000_STR_CAL UNKNOWN_IC_STR_CAL
static const struct icom_priv_caps icr9000_priv_caps = static struct icom_priv_caps icr9000_priv_caps =
{ {
0x2a, /* default address */ 0x2a, /* default address */
0, /* 731 mode */ 0, /* 731 mode */
0, /* no XCHG */ 0, /* no XCHG */
r9000_ts_sc_list r9000_ts_sc_list,
.antack_len = 2,
.ant_count = 2
}; };
/* /*

Wyświetl plik

@ -73,12 +73,14 @@
} } } }
static const struct icom_priv_caps icr9500_priv_caps = static struct icom_priv_caps icr9500_priv_caps =
{ {
0x72, /* default address */ 0x72, /* default address */
0, /* 731 mode */ 0, /* 731 mode */
0, /* no XCHG */ 0, /* no XCHG */
r9500_ts_sc_list .ts_sc_list = r9500_ts_sc_list,
.antack_len = 2,
.ant_count = 3
}; };
/* /*
@ -89,7 +91,7 @@ const struct rig_caps icr9500_caps =
.rig_model = RIG_MODEL_ICR9500, .rig_model = RIG_MODEL_ICR9500,
.model_name = "IC-R9500", .model_name = "IC-R9500",
.mfg_name = "Icom", .mfg_name = "Icom",
.version = BACKEND_VER ".2", .version = BACKEND_VER ".3",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_BETA, .status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_RECEIVER, .rig_type = RIG_TYPE_RECEIVER,

Wyświetl plik

@ -45,7 +45,7 @@
*/ */
#define ICRX7_STR_CAL UNKNOWN_IC_STR_CAL #define ICRX7_STR_CAL UNKNOWN_IC_STR_CAL
static const struct icom_priv_caps icrx7_priv_caps = static struct icom_priv_caps icrx7_priv_caps =
{ {
0x78, /* default address */ 0x78, /* default address */
0, /* 731 mode */ 0, /* 731 mode */

Wyświetl plik

@ -64,7 +64,7 @@ const struct ts_sc_list id1_ts_sc_list[] =
/* /*
*/ */
static const struct icom_priv_caps id1_priv_caps = static struct icom_priv_caps id1_priv_caps =
{ {
0x01, /* default address */ 0x01, /* default address */
0, /* 731 mode */ 0, /* 731 mode */

Wyświetl plik

@ -73,7 +73,7 @@
/* /*
*/ */
static const struct icom_priv_caps id31_priv_caps = static struct icom_priv_caps id31_priv_caps =
{ {
0xA0, /* default address */ 0xA0, /* default address */
0, /* 731 mode */ 0, /* 731 mode */

Wyświetl plik

@ -77,7 +77,7 @@
/* /*
*/ */
static const struct icom_priv_caps id4100_priv_caps = static struct icom_priv_caps id4100_priv_caps =
{ {
0x9A, /* default address */ 0x9A, /* default address */
0, /* 731 mode */ 0, /* 731 mode */

Wyświetl plik

@ -80,7 +80,7 @@ int id51_tokens[] = { TOK_DSTAR_DSQL, TOK_DSTAR_CALL_SIGN, TOK_DSTAR_MESSAGE, TO
/* /*
*/ */
static const struct icom_priv_caps id51_priv_caps = static struct icom_priv_caps id51_priv_caps =
{ {
0x86, /* default address */ 0x86, /* default address */
0, /* 731 mode */ 0, /* 731 mode */

Wyświetl plik

@ -77,7 +77,7 @@
/* /*
*/ */
static const struct icom_priv_caps id5100_priv_caps = static struct icom_priv_caps id5100_priv_caps =
{ {
0x8C, /* default address */ 0x8C, /* default address */
0, /* 731 mode */ 0, /* 731 mode */

Wyświetl plik

@ -55,7 +55,7 @@ static int omni6_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
static int omni6_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit); static int omni6_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit);
static int omni6_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit); static int omni6_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit);
static const struct icom_priv_caps omnivip_priv_caps = static struct icom_priv_caps omnivip_priv_caps =
{ {
0x04, /* default address */ 0x04, /* default address */
0, /* 731 mode */ 0, /* 731 mode */
@ -68,7 +68,7 @@ const struct rig_caps omnivip_caps =
.rig_model = RIG_MODEL_OMNIVIP, .rig_model = RIG_MODEL_OMNIVIP,
.model_name = "Omni VI Plus", .model_name = "Omni VI Plus",
.mfg_name = "Ten-Tec", .mfg_name = "Ten-Tec",
.version = "0.2", .version = BACKEND_VER ".2",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_BETA, .status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_TRANSCEIVER, .rig_type = RIG_TYPE_TRANSCEIVER,

Wyświetl plik

@ -64,7 +64,7 @@ extern struct confparams opto_ext_parms[];
* TODO: srch_dcs, srch_ctcss, rcv_dtmf, and make icom_probe opto aware * TODO: srch_dcs, srch_ctcss, rcv_dtmf, and make icom_probe opto aware
*/ */
static const struct icom_priv_caps os456_priv_caps = static struct icom_priv_caps os456_priv_caps =
{ {
0x80, /* default address */ 0x80, /* default address */
0, /* 731 mode */ 0, /* 731 mode */
@ -78,7 +78,7 @@ const struct rig_caps os456_caps =
.rig_model = RIG_MODEL_OS456, .rig_model = RIG_MODEL_OS456,
.model_name = "OptoScan456", .model_name = "OptoScan456",
.mfg_name = "Optoelectronics", .mfg_name = "Optoelectronics",
.version = "0.3", .version = BACKEND_VER ".3",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_BETA, .status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_SCANNER, .rig_type = RIG_TYPE_SCANNER,

Wyświetl plik

@ -56,7 +56,7 @@ extern struct confparams opto_ext_parms[];
* TODO: srch_dcs, srch_ctcss, rcv_dtmf, and make icom_probe opto aware * TODO: srch_dcs, srch_ctcss, rcv_dtmf, and make icom_probe opto aware
*/ */
static const struct icom_priv_caps os535_priv_caps = static struct icom_priv_caps os535_priv_caps =
{ {
0x80, /* default address */ 0x80, /* default address */
0, /* 731 mode */ 0, /* 731 mode */
@ -70,7 +70,7 @@ const struct rig_caps os535_caps =
.rig_model = RIG_MODEL_OS535, .rig_model = RIG_MODEL_OS535,
.model_name = "OptoScan535", .model_name = "OptoScan535",
.mfg_name = "Optoelectronics", .mfg_name = "Optoelectronics",
.version = "0.3", .version = BACKEND_VER ".3",
.copyright = "LGPL", .copyright = "LGPL",
.status = RIG_STATUS_BETA, .status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_SCANNER, .rig_type = RIG_TYPE_SCANNER,

Wyświetl plik

@ -63,7 +63,7 @@ static int perseus_r2i_mode(RIG *rig, rmode_t mode, pbwidth_t width,
static void perseus_i2r_mode(RIG *rig, unsigned char md, int pd, static void perseus_i2r_mode(RIG *rig, unsigned char md, int pd,
rmode_t *mode, pbwidth_t *width); rmode_t *mode, pbwidth_t *width);
static const struct icom_priv_caps perseus_priv_caps = static struct icom_priv_caps perseus_priv_caps =
{ {
0xE1, /* default address */ 0xE1, /* default address */
0, /* 731 mode */ 0, /* 731 mode */

Wyświetl plik

@ -124,7 +124,7 @@ static int x108g_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
* *
* TODO: complete command set (esp. the $1A bunch!) and testing.. * TODO: complete command set (esp. the $1A bunch!) and testing..
*/ */
static const struct icom_priv_caps x108g_priv_caps = static struct icom_priv_caps x108g_priv_caps =
{ {
0x70, /* default address */ 0x70, /* default address */
0, /* 731 mode */ 0, /* 731 mode */

Wyświetl plik

@ -445,7 +445,7 @@ int ic10_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
* ic10_get_ant * ic10_get_ant
* Assumes rig!=NULL, ptt!=NULL * Assumes rig!=NULL, ptt!=NULL
*/ */
int ic10_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option) int ic10_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *option)
{ {
char infobuf[50]; char infobuf[50];
int info_len, retval; int info_len, retval;

Wyświetl plik

@ -33,7 +33,7 @@ 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_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_freq(RIG *rig, vfo_t vfo, freq_t freq);
int ic10_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option); 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_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *option);
int ic10_set_func(RIG *rig, vfo_t vfo, setting_t func, int status); 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_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status);
int ic10_set_parm(RIG *rig, setting_t parm, value_t val); int ic10_set_parm(RIG *rig, setting_t parm, value_t val);

Wyświetl plik

@ -3095,7 +3095,7 @@ int kenwood_set_ant_no_ack(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
/* /*
* get the aerial/antenna in use * get the aerial/antenna in use
*/ */
int kenwood_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option) int kenwood_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *option)
{ {
char ackbuf[8]; char ackbuf[8];
int offs; int offs;

Wyświetl plik

@ -159,7 +159,7 @@ int kenwood_reset(RIG *rig, reset_t reset);
int kenwood_send_morse(RIG *rig, vfo_t vfo, const char *msg); int kenwood_send_morse(RIG *rig, vfo_t vfo, const char *msg);
int kenwood_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option); 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_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_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *option);
int kenwood_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt); 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(RIG *rig, vfo_t vfo, ptt_t ptt);
int kenwood_set_ptt_safe(RIG *rig, vfo_t vfo, ptt_t ptt); int kenwood_set_ptt_safe(RIG *rig, vfo_t vfo, ptt_t ptt);

Wyświetl plik

@ -2552,7 +2552,7 @@ int th_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
/* /*
* get the aerial/antenna in use * get the aerial/antenna in use
*/ */
int th_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option) int th_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *option)
{ {
char buf[8]; char buf[8];
int retval; int retval;

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

@ -77,7 +77,7 @@ 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); int ra37xx_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
const char* ra37xx_get_info(RIG *rig); const char* ra37xx_get_info(RIG *rig);
int ra37xx_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option); 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_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *option);
int ra37xx_set_mem(RIG *rig, vfo_t vfo, int ch); int ra37xx_set_mem(RIG *rig, vfo_t vfo, int ch);
int ra37xx_get_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); int ra37xx_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch);

Wyświetl plik

@ -2116,7 +2116,7 @@ int tt565_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
* *
* \sa tt565_set_ant * \sa tt565_set_ant
*/ */
int tt565_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option) int tt565_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *option)
{ {
char respbuf[TT565_BUFSIZE]; char respbuf[TT565_BUFSIZE];
int resp_len, retval; int resp_len, retval;

Wyświetl plik

@ -78,7 +78,7 @@ 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_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_func(RIG *rig, vfo_t vfo, setting_t func, int status);
static int tt565_set_ant(RIG * rig, vfo_t vfo, ant_t ant, value_t option); 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); static int tt565_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *option);
/** \brief Orion private data */ /** \brief Orion private data */
struct tt565_priv_data { struct tt565_priv_data {

Wyświetl plik

@ -2450,7 +2450,7 @@ 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_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *option)
{ {
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
int err; int err;

Wyświetl plik

@ -146,7 +146,7 @@ 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_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
int newcat_get_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, value_t option); 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_get_ant(RIG * rig, vfo_t vfo, ant_t dummy, ant_t * ant, value_t * option);
int newcat_set_level(RIG * rig, vfo_t vfo, setting_t level, value_t val); 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_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); int newcat_set_func(RIG * rig, vfo_t vfo, setting_t func, int status);

Wyświetl plik

@ -238,7 +238,7 @@ AMP *HAMLIB_API amp_init(amp_model_t amp_model)
case RIG_PORT_NETWORK: case RIG_PORT_NETWORK:
case RIG_PORT_UDP_NETWORK: case RIG_PORT_UDP_NETWORK:
strncpy(rs->ampport.pathname, "127.0.0.1:4534", FILPATHLEN - 1); strncpy(rs->ampport.pathname, "127.0.0.1:4531", FILPATHLEN - 1);
break; break;
default: default:

Wyświetl plik

@ -447,7 +447,7 @@ static int generic_save_channel(RIG *rig, channel_t *chan)
if (mem_cap->ant) if (mem_cap->ant)
{ {
rig_get_ant(rig, RIG_VFO_CURR, &chan->ant, &vdummy); rig_get_ant(rig, RIG_VFO_CURR, RIG_ANT_CURR, &chan->ant, &vdummy);
} }
if (mem_cap->tuning_step) if (mem_cap->tuning_step)

Wyświetl plik

@ -282,8 +282,6 @@ int HAMLIB_API sprintf_freq(char *str, freq_t freq)
*/ */
const char *HAMLIB_API rig_strstatus(enum rig_status_e status) const char *HAMLIB_API rig_strstatus(enum rig_status_e status)
{ {
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (status) switch (status)
{ {
case RIG_STATUS_ALPHA: case RIG_STATUS_ALPHA:

Wyświetl plik

@ -3551,7 +3551,7 @@ int HAMLIB_API rig_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
* *
* \sa rig_set_ant() * \sa rig_set_ant()
*/ */
int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option) int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t ant, ant_t *ant_curr, value_t *option)
{ {
const struct rig_caps *caps; const struct rig_caps *caps;
int retcode, rc2; int retcode, rc2;
@ -3559,7 +3559,7 @@ int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
if (CHECK_RIG_ARG(rig) || !ant) if (CHECK_RIG_ARG(rig) || !ant_curr)
{ {
return -RIG_EINVAL; return -RIG_EINVAL;
} }
@ -3575,7 +3575,7 @@ int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
|| vfo == RIG_VFO_CURR || vfo == RIG_VFO_CURR
|| vfo == rig->state.current_vfo) || vfo == rig->state.current_vfo)
{ {
return caps->get_ant(rig, vfo, ant, option); return caps->get_ant(rig, vfo, ant, ant_curr, option);
} }
if (!caps->set_vfo) if (!caps->set_vfo)
@ -3591,7 +3591,7 @@ int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
return retcode; return retcode;
} }
retcode = caps->get_ant(rig, vfo, ant, option); retcode = caps->get_ant(rig, vfo, ant, ant_curr, option);
/* try and revert even if we had an error above */ /* try and revert even if we had an error above */
rc2 = caps->set_vfo(rig, curr_vfo); rc2 = caps->set_vfo(rig, curr_vfo);
@ -4332,6 +4332,74 @@ int HAMLIB_API rig_send_morse(RIG *rig, vfo_t vfo, const char *msg)
} }
/**
* \brief send voice memory content
* \param rig The rig handle
* \param vfo The target VFO
* \param ch Voice memory number to be sent
*
* Sends voice memory content.
*
* \return RIG_OK if the operation has been sucessful, otherwise
* a negative value if an error occured (in which case, cause is
* set appropriately).
*
*/
int HAMLIB_API rig_send_voice_mem(RIG *rig, vfo_t vfo, int ch)
{
const struct rig_caps *caps;
int retcode, rc2;
vfo_t curr_vfo;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
if CHECK_RIG_ARG(rig)
{
return -RIG_EINVAL;
}
caps = rig->caps;
if (caps->send_voice_mem == NULL)
{
return -RIG_ENAVAIL;
}
if ((caps->targetable_vfo & RIG_TARGETABLE_PURE)
|| vfo == RIG_VFO_CURR
|| vfo == rig->state.current_vfo)
{
return caps->send_voice_mem(rig, vfo, ch);
}
if (!caps->set_vfo)
{
return -RIG_ENTARGET;
}
curr_vfo = rig->state.current_vfo;
retcode = caps->set_vfo(rig, vfo);
if (retcode != RIG_OK)
{
return retcode;
}
retcode = caps->send_voice_mem(rig, vfo, ch);
/* try and revert even if we had an error above */
rc2 = caps->set_vfo(rig, curr_vfo);
if (RIG_OK == retcode)
{
/* return the first error code */
retcode = rc2;
}
return retcode;
}
/** /**
* \brief find the freq_range of freq/mode * \brief find the freq_range of freq/mode
* \param range_list The range list to search from * \param range_list The range list to search from

Wyświetl plik

@ -687,6 +687,7 @@ int dumpcaps(RIG *rig, FILE *fout)
fprintf(fout, "Can send DTMF:\t%c\n", caps->send_dtmf != NULL ? 'Y' : 'N'); fprintf(fout, "Can send DTMF:\t%c\n", caps->send_dtmf != NULL ? 'Y' : 'N');
fprintf(fout, "Can recv DTMF:\t%c\n", caps->recv_dtmf != NULL ? 'Y' : 'N'); fprintf(fout, "Can recv DTMF:\t%c\n", caps->recv_dtmf != NULL ? 'Y' : 'N');
fprintf(fout, "Can send Morse:\t%c\n", caps->send_morse != NULL ? 'Y' : 'N'); fprintf(fout, "Can send Morse:\t%c\n", caps->send_morse != NULL ? 'Y' : 'N');
fprintf(fout, "Can send Voice:\t%c\n", caps->send_voice_mem != NULL ? 'Y' : 'N');
fprintf(fout, fprintf(fout,
"Can decode Events:\t%c\n", "Can decode Events:\t%c\n",

Wyświetl plik

@ -215,6 +215,7 @@ declare_proto_rig(set_ant);
declare_proto_rig(get_ant); declare_proto_rig(get_ant);
declare_proto_rig(reset); declare_proto_rig(reset);
declare_proto_rig(send_morse); declare_proto_rig(send_morse);
declare_proto_rig(send_voice_mem);
declare_proto_rig(send_cmd); declare_proto_rig(send_cmd);
declare_proto_rig(set_powerstat); declare_proto_rig(set_powerstat);
declare_proto_rig(get_powerstat); declare_proto_rig(get_powerstat);
@ -287,7 +288,7 @@ static struct test_table test_list[] =
{ 'Z', "set_xit", ACTION(set_xit), ARG_IN, "XIT" }, { 'Z', "set_xit", ACTION(set_xit), ARG_IN, "XIT" },
{ 'z', "get_xit", ACTION(get_xit), ARG_OUT, "XIT" }, { 'z', "get_xit", ACTION(get_xit), ARG_OUT, "XIT" },
{ 'Y', "set_ant", ACTION(set_ant), ARG_IN, "Antenna", "Option" }, { 'Y', "set_ant", ACTION(set_ant), ARG_IN, "Antenna", "Option" },
{ 'y', "get_ant", ACTION(get_ant), ARG_OUT, "Antenna", "Option" }, { 'y', "get_ant", ACTION(get_ant), ARG_IN1 | ARG_OUT2 |ARG_NOVFO, "Antenna", "Antenna", "Option" },
{ 0x87, "set_powerstat", ACTION(set_powerstat), ARG_IN | ARG_NOVFO, "Power Status" }, { 0x87, "set_powerstat", ACTION(set_powerstat), ARG_IN | ARG_NOVFO, "Power Status" },
{ 0x88, "get_powerstat", ACTION(get_powerstat), ARG_OUT | 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" }, { 0x89, "send_dtmf", ACTION(send_dtmf), ARG_IN, "Digits" },
@ -296,6 +297,7 @@ static struct test_table test_list[] =
{ 'w', "send_cmd", ACTION(send_cmd), ARG_IN1 | ARG_IN_LINE | ARG_OUT2 | ARG_NOVFO, "Cmd", "Reply" }, { 'w', "send_cmd", ACTION(send_cmd), ARG_IN1 | ARG_IN_LINE | ARG_OUT2 | ARG_NOVFO, "Cmd", "Reply" },
{ 'W', "send_cmd_rx", ACTION(send_cmd), ARG_IN | ARG_OUT2 | ARG_NOVFO, "Cmd", "Reply"}, { 'W', "send_cmd_rx", ACTION(send_cmd), ARG_IN | ARG_OUT2 | ARG_NOVFO, "Cmd", "Reply"},
{ 'b', "send_morse", ACTION(send_morse), ARG_IN | ARG_IN_LINE, "Morse" }, { 'b', "send_morse", ACTION(send_morse), ARG_IN | ARG_IN_LINE, "Morse" },
{ 0x94, "send_voice_mem", ACTION(send_voice_mem), ARG_IN , "Voice Mem#" },
{ 0x8b, "get_dcd", ACTION(get_dcd), ARG_OUT, "DCD" }, { 0x8b, "get_dcd", ACTION(get_dcd), ARG_OUT, "DCD" },
{ '2', "power2mW", ACTION(power2mW), ARG_IN1 | ARG_IN2 | ARG_IN3 | ARG_OUT1 | ARG_NOVFO, "Power [0.0..1.0]", "Frequency", "Mode", "Power mW" }, { '2', "power2mW", ACTION(power2mW), ARG_IN1 | ARG_IN2 | ARG_IN3 | ARG_OUT1 | ARG_NOVFO, "Power [0.0..1.0]", "Frequency", "Mode", "Power mW" },
{ '4', "mW2power", ACTION(mW2power), ARG_IN1 | ARG_IN2 | ARG_IN3 | ARG_OUT1 | ARG_NOVFO, "Power mW", "Frequency", "Mode", "Power [0.0..1.0]" }, { '4', "mW2power", ACTION(mW2power), ARG_IN1 | ARG_IN2 | ARG_IN3 | ARG_OUT1 | ARG_NOVFO, "Power mW", "Frequency", "Mode", "Power [0.0..1.0]" },
@ -3949,22 +3951,23 @@ declare_proto_rig(set_ant)
declare_proto_rig(get_ant) declare_proto_rig(get_ant)
{ {
int status; int status;
ant_t ant; ant_t ant, ant_curr;
value_t option; value_t option;
status = rig_get_ant(rig, vfo, &ant, &option); CHKSCN1ARG(sscanf(arg1, "%d", &ant));
status = rig_get_ant(rig, vfo, rig_idx2setting(ant), &ant_curr, &option);
if (status != RIG_OK) if (status != RIG_OK)
{ {
return status; return status;
} }
if ((interactive && prompt) || (interactive && !prompt && ext_resp)) if ((interactive && prompt) || (interactive && !prompt && ext_resp))
{ {
fprintf(fout, "%s: ", cmd->arg1); fprintf(fout, "%s: ", cmd->arg1);
} }
fprintf(fout, "%d%c", rig_setting2idx(ant), resp_sep); fprintf(fout, "%d%c", rig_setting2idx(ant_curr), resp_sep);
if ((interactive && prompt) || (interactive && !prompt && ext_resp)) if ((interactive && prompt) || (interactive && !prompt && ext_resp))
{ {
@ -3993,6 +3996,14 @@ declare_proto_rig(send_morse)
return rig_send_morse(rig, vfo, arg1); return rig_send_morse(rig, vfo, arg1);
} }
/* '8' */
declare_proto_rig(send_voice_mem)
{
int ch;
CHKSCN1ARG(sscanf(arg1, "%d", &ch));
return rig_send_voice_mem(rig, vfo, ch);
}
declare_proto_rig(send_dtmf) declare_proto_rig(send_dtmf)
{ {