Merge pull request #193 from mdblack98/master

2020-02-05 Patches
pull/196/head
Michael Black 2020-02-05 23:24:48 -06:00 zatwierdzone przez GitHub
commit fdef21f068
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
65 zmienionych plików z 508 dodań i 265 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));
}
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;
}

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;
channel_t *curr = priv->curr;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
*ant = curr->ant;
rig_debug(RIG_DEBUG_VERBOSE, "%s called, ant=0x%02x\n", __func__, ant);
*ant_curr = curr->ant;
option->i = priv->ant_option;
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 buf[BUF_MAX];
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);
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);
@ -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;
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; }
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);
@ -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);
ret = sscanf(buf, "%d\n", ant);
ret = sscanf(buf, "%d\n", ant_curr);
if (ret != 1)
{
@ -1789,6 +1804,16 @@ static int netrigctl_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
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);
if (ret <= 0)

Wyświetl plik

@ -660,7 +660,7 @@ typedef enum {
/**
* \brief Antenna number
*/
typedef int ant_t;
typedef unsigned int ant_t;
#define RIG_ANT_NONE 0
#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_5 RIG_ANT_N(4)
#define RIG_ANT_CURR RIG_ANT_N(31)
#define RIG_ANT_MAX 32
@ -1147,7 +1149,7 @@ struct channel {
int channel_num; /*!< Channel number */
int bank_num; /*!< Bank number */
vfo_t vfo; /*!< VFO */
int ant; /*!< Selected antenna */
ant_t ant; /*!< Selected antenna */
freq_t freq; /*!< Receive frequency */
rmode_t mode; /*!< Receive 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 (*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 (*get_level)(RIG *rig, vfo_t vfo, setting_t level, value_t *val);
@ -2158,7 +2160,8 @@ rig_set_ant HAMLIB_PARAMS((RIG *rig,
extern HAMLIB_EXPORT(int)
rig_get_ant HAMLIB_PARAMS((RIG *rig,
vfo_t vfo,
ant_t *ant,
ant_t ant,
ant_t *ant_curr,
value_t *option));
extern HAMLIB_EXPORT(setting_t)

Wyświetl plik

@ -157,7 +157,7 @@ public:
shortfreq_t getXit(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);
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
* 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;
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_cleanup(RIG *rig);
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_get_mem(RIG *rig, vfo_t vfo, int *ch);
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
*/
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];
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_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, 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_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

@ -17,3 +17,27 @@ Notes on Icom backends
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.
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,
.model_name = "Delta II",
.mfg_name = "Ten-Tec",
.version = "0.1",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER,

Wyświetl plik

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

Wyświetl plik

@ -55,7 +55,9 @@ static const struct icom_priv_caps ic737_priv_caps =
0x3c, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic737_ts_sc_list
ic737_ts_sc_list,
.antack_len = 2,
.ant_count = 2
};
const struct rig_caps ic737_caps =
@ -63,7 +65,7 @@ const struct rig_caps ic737_caps =
.rig_model = RIG_MODEL_IC737,
.model_name = "IC-737",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.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, /* no XCHG */
ic756pro_ts_sc_list,
.antack_len = 2,
.ant_count = 2,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_OFF, .icom_level = 0 },
@ -113,7 +115,7 @@ const struct rig_caps ic7410_caps =
.rig_model = RIG_MODEL_IC7410,
.model_name = "IC-7410",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.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, /* no XCHG */
ic756pro_ts_sc_list,
.antack_len = 2,
.ant_count = 2,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_OFF, .icom_level = 0 },
@ -182,7 +184,7 @@ const struct rig_caps ic746_caps =
.rig_model = RIG_MODEL_IC746,
.model_name = "IC-746",
.mfg_name = "Icom",
.version = BACKEND_VER ".2",
.version = BACKEND_VER ".4",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,
@ -392,6 +394,8 @@ static const struct icom_priv_caps ic746pro_priv_caps =
0, /* 731 mode */
0, /* no XCHG */
ic756pro_ts_sc_list,
.antack_len = 2,
.ant_count = 2,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_OFF, .icom_level = 0 },
@ -407,7 +411,7 @@ const struct rig_caps ic746pro_caps =
.rig_model = RIG_MODEL_IC746PRO,
.model_name = "IC-746PRO",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.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, /* no XCHG */
ic756_ts_sc_list,
.antack_len = 2,
.ant_count = 2,
.r2i_mode = r2i_mode,
.agc_levels_present = 1,
.agc_levels = {
@ -148,7 +150,7 @@ const struct rig_caps ic756_caps =
.rig_model = RIG_MODEL_IC756,
.model_name = "IC-756",
.mfg_name = "Icom",
.version = BACKEND_VER ".1",
.version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_ALPHA,
.rig_type = RIG_TYPE_TRANSCEIVER,
@ -290,6 +292,8 @@ static const struct icom_priv_caps ic756pro_priv_caps =
0, /* 731 mode */
0, /* no XCHG */
ic756pro_ts_sc_list,
.antack_len = 2,
.ant_count = 2,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_FAST, .icom_level = 1 },
@ -304,7 +308,7 @@ const struct rig_caps ic756pro_caps =
.rig_model = RIG_MODEL_IC756PRO,
.model_name = "IC-756PRO",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.rig_type = RIG_TYPE_TRANSCEIVER,
@ -455,6 +459,8 @@ static const struct icom_priv_caps ic756pro2_priv_caps =
0, /* 731 mode */
0, /* no XCHG */
ic756pro_ts_sc_list,
.antack_len = 2,
.ant_count = 2,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_FAST, .icom_level = 1 },
@ -537,7 +543,7 @@ const struct rig_caps ic756pro2_caps =
.rig_model = RIG_MODEL_IC756PROII,
.model_name = "IC-756PROII",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_ALPHA,
.rig_type = RIG_TYPE_TRANSCEIVER,
@ -881,6 +887,8 @@ static const struct icom_priv_caps ic756pro3_priv_caps =
0, /* 731 mode */
0, /* no XCHG */
ic756pro_ts_sc_list,
.antack_len = 2,
.ant_count = 2,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_FAST, .icom_level = 1 },
@ -955,7 +963,7 @@ const struct rig_caps ic756pro3_caps =
.rig_model = RIG_MODEL_IC756PROIII,
.model_name = "IC-756PROIII",
.mfg_name = "Icom",
.version = BACKEND_VER ".1",
.version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.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, /* no XCHG */
ic756pro_ts_sc_list,
.antack_len = 3,
.ant_count = 2,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_FAST, .icom_level = 1 },
@ -168,7 +170,7 @@ const struct rig_caps ic7600_caps =
.rig_model = RIG_MODEL_IC7600,
.model_name = "IC-7600",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.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, /* no XCHG */
ic756pro_ts_sc_list,
.antack_len = 2,
.ant_count = 2,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_FAST, .icom_level = 1 },
@ -166,7 +168,7 @@ const struct rig_caps ic7610_caps =
.rig_model = RIG_MODEL_IC7610,
.model_name = "IC-7610",
.mfg_name = "Icom",
.version = BACKEND_VER ".1",
.version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.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, /* no XCHG */
ic756pro_ts_sc_list,
.antack_len = 4,
.ant_count = 3,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_OFF, .icom_level = 0 },
@ -151,7 +153,7 @@ const struct rig_caps ic7700_caps =
.rig_model = RIG_MODEL_IC7700,
.model_name = "IC-7700",
.mfg_name = "Icom",
.version = BACKEND_VER ".1",
.version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.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, /* no XCHG */
ic756pro_ts_sc_list,
.antack_len = 4,
.ant_count = 3,
.agc_levels_present = 1,
.agc_levels = {
{ .level = RIG_AGC_OFF, .icom_level = 0 },
@ -151,7 +153,7 @@ const struct rig_caps ic7800_caps =
.rig_model = RIG_MODEL_IC7800,
.model_name = "IC-7800",
.mfg_name = "Icom",
.version = BACKEND_VER ".2",
.version = BACKEND_VER ".3",
.copyright = "LGPL",
.status = RIG_STATUS_UNTESTED,
.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..
*/
static const struct icom_priv_caps ic785x_priv_caps =
static struct icom_priv_caps ic785x_priv_caps =
{
0x8e, /* default address */
0, /* 731 mode */
0, /* no XCHG */
0x8e, /* default address */
0, /* 731 mode */
0, /* no XCHG */
ic756pro_ts_sc_list,
.antack_len = 3,
.ant_count = 4,
.agc_levels_present = 1,
.agc_levels = {
{ .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 */
1, /* no XCHG to avoid display flicker */
ic910_ts_sc_list, /* FIXME */
.antack_len = 2,
.ant_count = 2,
};
const struct rig_caps ic9100_caps =
@ -107,7 +109,7 @@ const struct rig_caps ic9100_caps =
.rig_model = RIG_MODEL_IC9100,
.model_name = "IC-9100",
.mfg_name = "Icom",
.version = BACKEND_VER".2",
.version = BACKEND_VER".3",
.copyright = "LGPL",
.status = RIG_STATUS_STABLE,
.rig_type = RIG_TYPE_TRANSCEIVER,

Wyświetl plik

@ -444,34 +444,34 @@ const struct confparams icom_ext_parms[] =
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_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_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_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_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_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_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_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_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_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_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_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_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_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_FEF}, C_CTL_SCP, S_SCP_FEF, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 12 },
{ {.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_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_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_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_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_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_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_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_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_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_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_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_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_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 },
{ {0} }
};
@ -566,10 +566,10 @@ int
icom_init(RIG *rig)
{
struct icom_priv_data *priv;
const struct icom_priv_caps *priv_caps;
const struct rig_caps *caps;
struct icom_priv_caps *priv_caps;
struct rig_caps *caps;
int retval;
int satmode;
int satmode = 0;
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
@ -585,10 +585,11 @@ icom_init(RIG *rig)
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)
{
@ -670,8 +671,7 @@ int icom_get_usb_echo_off(RIG *rig)
rs->rigport.retry = 1;
// Check for echo on first
priv->serial_USB_echo_off = 0;
retval = icom_transaction(rig, C_RD_TRXID, 0x00, NULL, 0, ackbuf, &ack_len);
retval = icom_transaction(rig, C_RD_FREQ, -1, NULL, 0, ackbuf, &ack_len);
if (retval == RIG_OK)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: USB echo on detected\n",
@ -711,6 +711,8 @@ icom_rig_open(RIG *rig)
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);
if (retval >= 0) { return RIG_OK; }
@ -747,7 +749,7 @@ int
icom_rig_close(RIG *rig)
{
// 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;
}
@ -1790,44 +1792,62 @@ int icom_set_cmd(RIG *rig, vfo_t vfo, struct cmdparams *par, value_t val)
unsigned char ackbuf[MAXFRAMELEN];
int acklen = 0;
if (!(par->submod & SC_MOD_WR)) return -RIG_EINVAL;
if ((par->submod & SC_MOD_RW12) == SC_MOD_RW12) {
if (!(par->submod & SC_MOD_WR)) { return -RIG_EINVAL; }
if ((par->submod & SC_MOD_RW12) == SC_MOD_RW12)
{
cmdbuf[0] = 0x01;
cmdlen = 1;
} else {
}
else
{
cmdlen = par->sublen;
memcpy(cmdbuf, par->subext, cmdlen);
}
int wrd = val.i;
int i;
switch (par->dattyp) {
case CMD_DAT_WRD:
for (i = 1; i <= par->datlen; i++) {
cmdbuf[cmdlen + par->datlen - i] = wrd & 0xff;
wrd >>= 8;
}
break;
case CMD_DAT_BUF:
memcpy(&cmdbuf[cmdlen], val.b.d, par->datlen);
break;
case CMD_DAT_INT:
case CMD_DAT_BOL:
to_bcd_be(&cmdbuf[cmdlen], val.i, (par->datlen * 2));
break;
case CMD_DAT_FLT:
to_bcd_be(&cmdbuf[cmdlen], (int) val.f, (cmdlen * 2));
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;
switch (par->dattyp)
{
case CMD_DAT_WRD:
for (i = 1; i <= par->datlen; i++)
{
cmdbuf[cmdlen + par->datlen - i] = wrd & 0xff;
wrd >>= 8;
}
break;
case CMD_DAT_BUF:
memcpy(&cmdbuf[cmdlen], val.b.d, par->datlen);
break;
case CMD_DAT_INT:
case CMD_DAT_BOL:
to_bcd_be(&cmdbuf[cmdlen], val.i, (par->datlen * 2));
break;
case CMD_DAT_FLT:
to_bcd_be(&cmdbuf[cmdlen], (int) val.f, (cmdlen * 2));
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;
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)
@ -1840,59 +1860,85 @@ int icom_get_cmd(RIG *rig, vfo_t vfo, struct cmdparams *par, value_t *val)
int reslen = sizeof(resbuf);
int retval;
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);
} else {
retval = icom_get_raw_buf(rig, par->command, par->subcmd,
par->sublen, (unsigned char *)par->subext, &reslen, resbuf);
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 (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;
}
switch (par->dattyp) {
case CMD_DAT_WRD: {
int wrd = 0;
int i;
for (i = 0; i < par->datlen; i++) {
wrd = (wrd << 8) + resbuf[i];
}
val->i = wrd;
}
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;
switch (par->dattyp)
{
case CMD_DAT_WRD:
{
int wrd = 0;
int i;
for (i = 0; i < par->datlen; i++)
{
wrd = (wrd << 8) + resbuf[i];
}
val->i = wrd;
}
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;
}
@ -1914,9 +1960,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__);
const struct cmdparams *cmd = priv_caps->riglevels;
for (i = 0; cmd && cmd[i].id.s != 0; i++) {
if (cmd[i].id.s == level) {
return icom_set_cmd(rig,vfo, (struct cmdparams *)&cmd[i], val);
for (i = 0; cmd && cmd[i].id.s != 0; i++)
{
if (cmd[i].id.s == level)
{
return icom_set_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val);
}
}
@ -2269,8 +2318,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 cmdparams *cmd = priv->riglevels;
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);
}
}
@ -2519,7 +2571,6 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
if (priv_caps->agc_levels_present)
{
int found = 0;
int i;
for (i = 0;
i <= RIG_AGC_LAST && priv_caps->agc_levels[i].level >= 0; i++)
@ -2742,22 +2793,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__);
for (i = 0; rig->caps->ext_tokens && rig->caps->ext_tokens[i] != TOK_BACKEND_NONE; i++) {
if (rig->caps->ext_tokens[i] == token) {
for (i = 0; rig->caps->ext_tokens
&& 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 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;
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);
} else i++;
}
else { i++; }
}
return -RIG_EINVAL;
}
}
return -RIG_EINVAL;
}
@ -2767,22 +2829,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__);
for (i = 0; rig->caps->ext_tokens && rig->caps->ext_tokens[i] != TOK_BACKEND_NONE; i++) {
if (rig->caps->ext_tokens[i] == token) {
for (i = 0; rig->caps->ext_tokens
&& 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 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;
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);
} else i++;
}
else { i++; }
}
return -RIG_EINVAL;
}
}
return -RIG_EINVAL;
}
@ -3990,7 +4063,8 @@ int icom_mem_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split,
*split = RIG_SPLIT_ON;
/* get it back to normal */
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)
{
@ -4508,11 +4582,15 @@ int icom_set_parm(RIG *rig, setting_t parm, value_t val)
int i;
const struct icom_priv_caps *priv = rig->caps->priv;
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);
}
}
switch (parm)
{
case RIG_PARM_ANN:
@ -4566,8 +4644,11 @@ int icom_get_parm(RIG *rig, setting_t parm, value_t *val)
const struct icom_priv_caps *priv = rig->caps->priv;
const struct cmdparams *cmd = priv->rigparms;
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);
}
}
@ -5040,7 +5121,7 @@ int icom_set_powerstat(RIG *rig, powerstat_t status)
}
i = 0;
retry = 2;
retry = 1;
if (status == RIG_POWER_ON) // wait for wakeup only
{
@ -5218,16 +5299,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)
{
unsigned char antarg;
unsigned char antopt[2];
unsigned char ackbuf[MAXFRAMELEN];
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__);
/*
* TODO: IC-756* and [RX ANT]
*/
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)) {
return -RIG_EINVAL;
}
if (ant > RIG_ANT_4) {
return -RIG_EDOM;
}
switch (ant)
{
case RIG_ANT_1:
@ -5247,17 +5333,56 @@ int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
break;
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;
}
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)
|| (rig->caps->rig_model == RIG_MODEL_ICR30)) ? 0 : 1;
if (priv_caps->antack_len == 0) { // we need to find out the antack_len
ant_t tmp_ant;
int ant = 0;
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
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;
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,
&antarg, ant_len, ackbuf, &ack_len);
antopt, antopt_len, ackbuf, &ack_len);
if (retval != RIG_OK)
{
@ -5279,32 +5404,53 @@ int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
* Assumes rig!=NULL, rig->state.priv!=NULL
* 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];
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)
{
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 ||
ackbuf[1] > 3)
{
rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__,
ackbuf[0], ack_len);
rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d, ant=%d\n", __func__,
ackbuf[0], ack_len, ackbuf[1]);
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]);
if (ack_len == 3) { // then this should be rx ant on/off status
rxant->i = RIG_ANT_N(ackbuf[2]);
// Note: with IC756/IC-756Pro/IC-7800 and more, ackbuf[2] deals with [RX ANT]
// Hopefully any ack_len=3 can fit in the option field
if (ack_len == 3)
{
option->i = ackbuf[2];
}
return RIG_OK;

Wyświetl plik

@ -30,7 +30,7 @@
#include <sys/time.h>
#endif
#define BACKEND_VER "0.23"
#define BACKEND_VER "0.25"
/*
* 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 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;
// the 4 elements above are mandatory
// everything below here is optional in the backends
int settle_time; /*!< Receiver settle time, in ms */
int (*r2i_mode)(RIG *rig, rmode_t mode, pbwidth_t width,
unsigned char *md, signed char *pd); /*< backend specific code
@ -135,6 +137,8 @@ struct icom_priv_caps
to convert response
tokens to bandwidth and
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 offs_len; /* Number of bytes in offset frequency field. 0 defaults to 3 */
int serial_USB_echo_check; /* Flag to test USB echo state */
@ -253,7 +257,7 @@ 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, 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_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq,
rmode_t mode);

Wyświetl plik

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

Wyświetl plik

@ -47,7 +47,7 @@
{ 255, 60 } /* +60 */ \
} }
static const struct icom_priv_caps icr20_priv_caps =
static struct icom_priv_caps icr20_priv_caps =
{
0x6c, /* default address */
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 */
0, /* 731 mode */
0, /* no XCHG */
r8500_ts_sc_list, /* wrong, but don't have set_ts anyway */
.antack_len = 2,
.ant_count = 2,
.r2i_mode = icr30_r2i_mode,
.offs_len = 4,
.extcmds = icr30_extcmds /* Custom ext_parm parameters */
@ -129,7 +131,7 @@ const struct rig_caps icr30_caps =
.rig_model = RIG_MODEL_ICR30,
.model_name = "IC-R30",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_ALPHA,
.rig_type = RIG_TYPE_RECEIVER | RIG_FLAG_HANDHELD,

Wyświetl plik

@ -46,12 +46,14 @@
{ 255, 60 } /* +60 */ \
} }
static const struct icom_priv_caps icr6_priv_caps =
static struct icom_priv_caps icr6_priv_caps =
{
0x7e, /* default address */
0, /* 731 mode */
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 =
@ -59,7 +61,7 @@ const struct rig_caps icr6_caps =
.rig_model = RIG_MODEL_ICR6,
.model_name = "IC-R6",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.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 */
#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 */
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 */
0, /* 731 mode */

Wyświetl plik

@ -40,7 +40,7 @@
#define ICR71_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO)
#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 */
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 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 */
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_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 */
0, /* 731 mode */
0, /* no XCHG */
r75_ts_sc_list
r75_ts_sc_list,
.antack_len = 2,
.ant_count = 2
};
const struct rig_caps icr75_caps =
@ -109,7 +111,7 @@ const struct rig_caps icr75_caps =
.rig_model = RIG_MODEL_ICR75,
.model_name = "IC-R75",
.mfg_name = "Icom",
.version = BACKEND_VER ".0",
.version = BACKEND_VER ".1",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.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);
static const struct icom_priv_caps icr8500_priv_caps =
static struct icom_priv_caps icr8500_priv_caps =
{
0x4a, /* default address */
0, /* 731 mode */

Wyświetl plik

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

Wyświetl plik

@ -57,12 +57,14 @@
/* TODO: S-Meter measurements */
#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 */
0, /* 731 mode */
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 */
0, /* 731 mode */
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,
.model_name = "IC-R9500",
.mfg_name = "Icom",
.version = BACKEND_VER ".2",
.version = BACKEND_VER ".3",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.rig_type = RIG_TYPE_RECEIVER,

Wyświetl plik

@ -45,7 +45,7 @@
*/
#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 */
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 */
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 */
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 */
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 */
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 */
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_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 */
0, /* 731 mode */
@ -68,7 +68,7 @@ const struct rig_caps omnivip_caps =
.rig_model = RIG_MODEL_OMNIVIP,
.model_name = "Omni VI Plus",
.mfg_name = "Ten-Tec",
.version = "0.2",
.version = BACKEND_VER ".2",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.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
*/
static const struct icom_priv_caps os456_priv_caps =
static struct icom_priv_caps os456_priv_caps =
{
0x80, /* default address */
0, /* 731 mode */
@ -78,7 +78,7 @@ const struct rig_caps os456_caps =
.rig_model = RIG_MODEL_OS456,
.model_name = "OptoScan456",
.mfg_name = "Optoelectronics",
.version = "0.3",
.version = BACKEND_VER ".3",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.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
*/
static const struct icom_priv_caps os535_priv_caps =
static struct icom_priv_caps os535_priv_caps =
{
0x80, /* default address */
0, /* 731 mode */
@ -70,7 +70,7 @@ const struct rig_caps os535_caps =
.rig_model = RIG_MODEL_OS535,
.model_name = "OptoScan535",
.mfg_name = "Optoelectronics",
.version = "0.3",
.version = BACKEND_VER ".3",
.copyright = "LGPL",
.status = RIG_STATUS_BETA,
.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,
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 */
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..
*/
static const struct icom_priv_caps x108g_priv_caps =
static struct icom_priv_caps x108g_priv_caps =
{
0x70, /* default address */
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
* 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];
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_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_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_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

@ -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
*/
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];
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_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_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_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

@ -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
*/
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];
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_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_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_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,
value_t *val);
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_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;
}
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 *)
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);
}
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];
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);
const char* ra37xx_get_info(RIG *rig);
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_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

@ -2116,7 +2116,7 @@ int tt565_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
*
* \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];
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_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_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 */
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;
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_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_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_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

@ -238,7 +238,7 @@ AMP *HAMLIB_API amp_init(amp_model_t amp_model)
case RIG_PORT_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;
default:

Wyświetl plik

@ -447,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, &vdummy);
rig_get_ant(rig, RIG_VFO_CURR, RIG_ANT_CURR, &chan->ant, &vdummy);
}
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)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
switch (status)
{
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()
*/
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;
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__);
if (CHECK_RIG_ARG(rig) || !ant)
if (CHECK_RIG_ARG(rig) || !ant_curr)
{
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->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)
@ -3591,7 +3591,7 @@ int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t *ant, value_t *option)
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 */
rc2 = caps->set_vfo(rig, curr_vfo);

Wyświetl plik

@ -288,7 +288,7 @@ static struct test_table test_list[] =
{ '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", "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" },
{ 0x88, "get_powerstat", ACTION(get_powerstat), ARG_OUT | ARG_NOVFO, "Power Status" },
{ 0x89, "send_dtmf", ACTION(send_dtmf), ARG_IN, "Digits" },
@ -3951,22 +3951,23 @@ declare_proto_rig(set_ant)
declare_proto_rig(get_ant)
{
int status;
ant_t ant;
ant_t ant, ant_curr;
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)
{
return status;
}
if ((interactive && prompt) || (interactive && !prompt && ext_resp))
{
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))
{