kopia lustrzana https://github.com/Hamlib/Hamlib
Merge branch 'master' of https://github.com/mdblack98/Hamlib
commit
d888a5b529
|
@ -67,7 +67,7 @@ int kpa_init(AMP *amp)
|
|||
}
|
||||
|
||||
amp->state.priv = (struct kpa_priv_data *)
|
||||
malloc(sizeof(struct kpa_priv_data));
|
||||
malloc(sizeof(struct kpa_priv_data));
|
||||
|
||||
if (!amp->state.priv)
|
||||
{
|
||||
|
|
|
@ -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, ant_t &ant_curr, vfo_t vfo)
|
||||
ant_t Rig::getAnt(ant_t &ant_rx, ant_t &ant_tx, ant_t ant, value_t &option, ant_t &ant_curr, vfo_t vfo)
|
||||
{
|
||||
CHECK_RIG( rig_get_ant(theRig, vfo, ant, &ant_curr, &option) );
|
||||
CHECK_RIG( rig_get_ant(theRig, vfo, ant, &option, &ant_curr, &ant_tx, &ant_rx) );
|
||||
|
||||
return ant;
|
||||
}
|
||||
|
|
|
@ -653,16 +653,28 @@ Returns TX Mode as a token and TX Passband in Hz as in
|
|||
above.
|
||||
.
|
||||
.TP
|
||||
.BR Y ", " set_ant " \(aq" \fIAntenna\fP \(aq
|
||||
.BR Y ", " set_ant " \(aq" \fIAntenna\fP "\(aq \(aq" \fIOption\fP \(aq
|
||||
Set
|
||||
.RI \(aq Antenna \(aq
|
||||
number (\(oq0\(cq, \(oq1\(cq, \(oq2\(cq, ...).
|
||||
and
|
||||
.RI \(aq Option \(aq.
|
||||
.IP
|
||||
Number is 1-based antenna# (\(oq1\(cq, \(oq2\(cq, \(oq3\(cq, ...).
|
||||
.IP
|
||||
Option depends on rig..for Icom it probably sets the RX only flag. See your manual for specific option values.
|
||||
.
|
||||
.TP
|
||||
.BR y ", " get_ant
|
||||
.BR y ", " get_ant " \(aq" \fIAntenna\fP \(aq
|
||||
Get
|
||||
.RI \(aq Antenna \(aq
|
||||
number (\(oq0\(cq, \(oq1\(cq, \(oq2\(cq, ...).
|
||||
.IP
|
||||
A value of 0 for Antenna will return the current TX antenna
|
||||
.IP
|
||||
> 0 is 1-based antenna# (\(oq1\(cq, \(oq2\(cq, \(oq3\(cq, ...).
|
||||
|
||||
|
||||
.IP
|
||||
Option returned depends on rig..for Icom is likely the RX only flag.
|
||||
.
|
||||
.TP
|
||||
.BR b ", " send_morse " \(aq" \fIMorse\fP \(aq
|
||||
|
|
|
@ -63,7 +63,7 @@ static int dummy_amp_init(AMP *amp)
|
|||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
amp->state.priv = (struct dummy_amp_priv_data *)
|
||||
malloc(sizeof(struct dummy_amp_priv_data));
|
||||
malloc(sizeof(struct dummy_amp_priv_data));
|
||||
|
||||
if (!amp->state.priv)
|
||||
{
|
||||
|
|
|
@ -56,7 +56,7 @@ struct dummy_priv_data
|
|||
powerstat_t powerstat;
|
||||
int bank;
|
||||
value_t parms[RIG_SETTING_MAX];
|
||||
int ant_option;
|
||||
int ant_option[4]; /* simulate 4 antennas */
|
||||
|
||||
channel_t *curr; /* points to vfo_a, vfo_b or mem[] */
|
||||
|
||||
|
@ -510,45 +510,53 @@ static int dummy_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
|
|||
case RIG_PTT_SERIAL_DTR:
|
||||
if (rig->state.pttport.fd >= 0)
|
||||
{
|
||||
if (RIG_OK != (rc = ser_get_dtr(&rig->state.pttport, &status))) return rc;
|
||||
if (RIG_OK != (rc = ser_get_dtr(&rig->state.pttport, &status))) { return rc; }
|
||||
|
||||
*ptt = status ? RIG_PTT_ON : RIG_PTT_OFF;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case RIG_PTT_SERIAL_RTS:
|
||||
if (rig->state.pttport.fd >= 0)
|
||||
{
|
||||
if (RIG_OK != (rc = ser_get_rts(&rig->state.pttport, &status))) return rc;
|
||||
if (RIG_OK != (rc = ser_get_rts(&rig->state.pttport, &status))) { return rc; }
|
||||
|
||||
*ptt = status ? RIG_PTT_ON : RIG_PTT_OFF;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case RIG_PTT_PARALLEL:
|
||||
if (rig->state.pttport.fd >= 0)
|
||||
{
|
||||
if (RIG_OK != (rc = par_ptt_get(&rig->state.pttport, ptt))) return rc;
|
||||
if (RIG_OK != (rc = par_ptt_get(&rig->state.pttport, ptt))) { return rc; }
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case RIG_PTT_CM108:
|
||||
if (rig->state.pttport.fd >= 0)
|
||||
{
|
||||
if (RIG_OK != (rc = cm108_ptt_get(&rig->state.pttport, ptt))) return rc;
|
||||
if (RIG_OK != (rc = cm108_ptt_get(&rig->state.pttport, ptt))) { return rc; }
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case RIG_PTT_GPIO:
|
||||
case RIG_PTT_GPION:
|
||||
if (rig->state.pttport.fd >= 0)
|
||||
{
|
||||
if (RIG_OK != (rc = gpio_ptt_get(&rig->state.pttport, ptt))) return rc;
|
||||
if (RIG_OK != (rc = gpio_ptt_get(&rig->state.pttport, ptt))) { return rc; }
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
*ptt = priv->ptt;
|
||||
break;
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
@ -1338,22 +1346,65 @@ static int dummy_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
|
|||
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
||||
channel_t *curr = priv->curr;
|
||||
|
||||
curr->ant = ant;
|
||||
priv->ant_option = option.i;
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called ant=%d, option=%d\n", __func__, ant, option.i);
|
||||
switch (ant)
|
||||
{
|
||||
case RIG_ANT_CURR:
|
||||
break;
|
||||
|
||||
case RIG_ANT_1:
|
||||
case RIG_ANT_2:
|
||||
case RIG_ANT_3:
|
||||
case RIG_ANT_4:
|
||||
curr->ant = ant;
|
||||
break;
|
||||
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unknown antenna requested=0x%02x\n", __func__,
|
||||
ant);
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
priv->ant_option[rig_setting2idx(curr->ant)] = option.i;
|
||||
rig_debug(RIG_DEBUG_VERBOSE,
|
||||
"%s called ant=0x%02x, option=%d, curr->ant=0x%02x\n", __func__, ant, option.i,
|
||||
curr->ant);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
||||
static int dummy_get_ant(RIG *rig, vfo_t vfo, ant_t ant, ant_t *ant_curr, value_t *option)
|
||||
static int dummy_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option,
|
||||
ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
|
||||
{
|
||||
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
||||
channel_t *curr = priv->curr;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called, ant=0x%02x\n", __func__, ant);
|
||||
*ant_curr = curr->ant;
|
||||
option->i = priv->ant_option;
|
||||
|
||||
*ant_tx = *ant_rx = RIG_ANT_UNKNOWN;
|
||||
|
||||
switch (ant)
|
||||
{
|
||||
case RIG_ANT_CURR:
|
||||
*ant_curr = curr->ant;
|
||||
break;
|
||||
|
||||
case RIG_ANT_1:
|
||||
case RIG_ANT_2:
|
||||
case RIG_ANT_3:
|
||||
case RIG_ANT_4:
|
||||
*ant_curr = ant;
|
||||
break;
|
||||
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unknown antenna requested=0x%02x\n", __func__,
|
||||
ant);
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: ant_curr=0x%02x, idx=%d\n", __func__, *ant_curr,
|
||||
rig_setting2idx(*ant_curr));
|
||||
option->i = priv->ant_option[rig_setting2idx(*ant_curr)];
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -1827,9 +1878,9 @@ const struct rig_caps dummy_caps =
|
|||
.rig_model = RIG_MODEL_DUMMY,
|
||||
.model_name = "Dummy",
|
||||
.mfg_name = "Hamlib",
|
||||
.version = "0.5",
|
||||
.version = "0.7",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_BETA,
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_OTHER,
|
||||
.targetable_vfo = 0,
|
||||
.ptt_type = RIG_PTT_RIG,
|
||||
|
@ -1857,19 +1908,22 @@ const struct rig_caps dummy_caps =
|
|||
.preamp = { 10, RIG_DBLST_END, },
|
||||
.rx_range_list1 = { {
|
||||
.startf = kHz(150), .endf = MHz(1500), .modes = DUMMY_MODES,
|
||||
.low_power = -1, .high_power = -1, DUMMY_VFOS, RIG_ANT_1 | RIG_ANT_2
|
||||
.low_power = -1, .high_power = -1, DUMMY_VFOS, RIG_ANT_1 | RIG_ANT_2 | RIG_ANT_3 | RIG_ANT_4,
|
||||
.label = "Dummy#1"
|
||||
},
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
.tx_range_list1 = { {
|
||||
.startf = kHz(150), .endf = MHz(1500), .modes = DUMMY_MODES,
|
||||
.low_power = W(5), .high_power = W(100), DUMMY_VFOS, RIG_ANT_1 | RIG_ANT_2
|
||||
.low_power = W(5), .high_power = W(100), DUMMY_VFOS, RIG_ANT_1 | RIG_ANT_2 | RIG_ANT_3 | RIG_ANT_4,
|
||||
.label = "Dummy#1"
|
||||
},
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
.rx_range_list2 = { {
|
||||
.startf = kHz(150), .endf = MHz(1500), .modes = DUMMY_MODES,
|
||||
.low_power = -1, .high_power = -1, DUMMY_VFOS, RIG_ANT_1 | RIG_ANT_2
|
||||
.low_power = -1, .high_power = -1, DUMMY_VFOS, RIG_ANT_1 | RIG_ANT_2 | RIG_ANT_3 | RIG_ANT_4,
|
||||
.label = "Dummy#2"
|
||||
},
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
|
|
|
@ -503,7 +503,7 @@ static int flrig_init(RIG *rig)
|
|||
rig_debug(RIG_DEBUG_TRACE, "%s version %s\n", __func__, BACKEND_VER);
|
||||
|
||||
rig->state.priv = (struct flrig_priv_data *)malloc(sizeof(
|
||||
struct flrig_priv_data));
|
||||
struct flrig_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
@ -890,10 +890,10 @@ static int flrig_cleanup(RIG *rig)
|
|||
|
||||
for (i = 0; modeMap[i].mode_hamlib != 0; ++i)
|
||||
{
|
||||
if (modeMap[i].mode_flrig)
|
||||
{
|
||||
free(modeMap[i].mode_flrig);
|
||||
modeMap[i].mode_flrig = NULL;
|
||||
if (modeMap[i].mode_flrig)
|
||||
{
|
||||
free(modeMap[i].mode_flrig);
|
||||
modeMap[i].mode_flrig = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -646,7 +646,7 @@ static int netrigctl_set_vfo(RIG *rig, vfo_t vfo)
|
|||
int ret, len;
|
||||
char cmd[CMD_MAX];
|
||||
char buf[BUF_MAX];
|
||||
char vfostr[6] = "";
|
||||
char vfostr[16] = "";
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
|
@ -1738,15 +1738,22 @@ static int netrigctl_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
|
|||
char vfostr[6] = "";
|
||||
int i_ant = 0;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called, ant=0x%02x, option=%d\n", __func__, ant, option.i);
|
||||
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);
|
||||
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);
|
||||
|
@ -1768,7 +1775,8 @@ 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, ant_t *ant_curr, value_t *option)
|
||||
static int netrigctl_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option,
|
||||
ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
|
||||
{
|
||||
int ret, len;
|
||||
char cmd[CMD_MAX];
|
||||
|
@ -1777,14 +1785,18 @@ static int netrigctl_get_ant(RIG *rig, vfo_t vfo, ant_t ant, ant_t *ant_curr, v
|
|||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
*ant_tx = *ant_rx = RIG_ANT_UNKNOWN;
|
||||
|
||||
ret = netrigctl_vfostr(rig, vfostr, sizeof(vfostr), vfo);
|
||||
|
||||
if (ret != RIG_OK) { return ret; }
|
||||
|
||||
if (ant == RIG_ANT_CURR) {
|
||||
if (ant == RIG_ANT_CURR)
|
||||
{
|
||||
len = sprintf(cmd, "y%s\n", vfostr);
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
len = sprintf(cmd, "y%s %d\n", vfostr, ant);
|
||||
}
|
||||
|
||||
|
@ -1800,17 +1812,20 @@ static int netrigctl_get_ant(RIG *rig, vfo_t vfo, ant_t ant, ant_t *ant_curr, v
|
|||
|
||||
if (ret != 1)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: expected 1 ant integer in '%s', got %d\n", __func__, buf,
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: expected 1 ant integer in '%s', got %d\n",
|
||||
__func__, buf,
|
||||
ret);
|
||||
}
|
||||
|
||||
if (ant != RIG_ANT_CURR) {
|
||||
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,
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: expected 1 option integer in '%s', got %d\n",
|
||||
__func__, buf,
|
||||
ret);
|
||||
}
|
||||
|
||||
|
@ -1821,11 +1836,12 @@ static int netrigctl_get_ant(RIG *rig, vfo_t vfo, ant_t ant, ant_t *ant_curr, v
|
|||
return (ret < 0) ? ret : -RIG_EPROTO;
|
||||
}
|
||||
|
||||
ret = sscanf(buf, "%d\n",&(option->i));
|
||||
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,
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: expected 1 option integer in '%s', got %d\n",
|
||||
__func__, buf,
|
||||
ret);
|
||||
}
|
||||
|
||||
|
@ -2094,7 +2110,7 @@ const struct rig_caps netrigctl_caps =
|
|||
.rig_model = RIG_MODEL_NETRIGCTL,
|
||||
.model_name = "NET rigctl",
|
||||
.mfg_name = "Hamlib",
|
||||
.version = "1.2",
|
||||
.version = "1.3",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_OTHER,
|
||||
|
|
|
@ -56,7 +56,7 @@ static int dummy_rot_init(ROT *rot)
|
|||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
rot->state.priv = (struct dummy_rot_priv_data *)
|
||||
malloc(sizeof(struct dummy_rot_priv_data));
|
||||
malloc(sizeof(struct dummy_rot_priv_data));
|
||||
|
||||
if (!rot->state.priv)
|
||||
{
|
||||
|
|
|
@ -265,7 +265,8 @@ static int trxmanager_init(RIG *rig)
|
|||
rig_debug(RIG_DEBUG_TRACE, "%s version %s\n", __func__, BACKEND_VER);
|
||||
|
||||
rig->state.priv = (struct trxmanager_priv_data *)malloc(
|
||||
sizeof(struct trxmanager_priv_data));
|
||||
sizeof(struct trxmanager_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
return -RIG_ENOMEM;
|
||||
|
|
|
@ -146,7 +146,7 @@
|
|||
|
||||
/* UHF: 300 MHz - 3 GHz */
|
||||
#define FRQ_RNG_70cm_REGION2(md,lp,hp,v,a) \
|
||||
{ MHz(430),MHz(440), (md), (lp), (hp), (v), (a) }
|
||||
{ MHz(430),MHz(450), (md), (lp), (hp), (v), (a) }
|
||||
|
||||
#define FRQ_RNG_23cm_REGION2(md,lp,hp,v,a) \
|
||||
{ MHz(1240),MHz(1300), (md), (lp), (hp), (v), (a) }
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <inttypes.h>
|
||||
#include <time.h>
|
||||
|
||||
/* Rig list is in a separate file so as not to mess up w/ this one */
|
||||
#include <hamlib/riglist.h>
|
||||
|
@ -670,6 +671,7 @@ typedef unsigned int ant_t;
|
|||
#define RIG_ANT_4 RIG_ANT_N(3)
|
||||
#define RIG_ANT_5 RIG_ANT_N(4)
|
||||
|
||||
#define RIG_ANT_UNKNOWN RIG_ANT_N(30)
|
||||
#define RIG_ANT_CURR RIG_ANT_N(31)
|
||||
|
||||
#define RIG_ANT_MAX 32
|
||||
|
@ -802,7 +804,8 @@ enum rig_parm_e {
|
|||
RIG_PARM_BEEP = (1 << 4), /*!< \c BEEP -- Beep on keypressed, int (0,1) */
|
||||
RIG_PARM_TIME = (1 << 5), /*!< \c TIME -- hh:mm:ss, int in seconds from 00:00:00 */
|
||||
RIG_PARM_BAT = (1 << 6), /*!< \c BAT -- battery level, float [0.0 ... 1.0] */
|
||||
RIG_PARM_KEYLIGHT = (1 << 7) /*!< \c KEYLIGHT -- Button backlight, on/off */
|
||||
RIG_PARM_KEYLIGHT = (1 << 7), /*!< \c KEYLIGHT -- Button backlight, on/off */
|
||||
RIG_PARM_SCREENSAVER = (1 << 8) /*!< \c SCREENSAVER -- rig specific timeouts */
|
||||
};
|
||||
|
||||
#define RIG_PARM_FLOAT_LIST (RIG_PARM_BACKLIGHT|RIG_PARM_BAT|RIG_PARM_KEYLIGHT)
|
||||
|
@ -1038,18 +1041,13 @@ typedef struct freq_range_list {
|
|||
int low_power; /*!< Lower RF power in mW, -1 for no power (ie. rx list) */
|
||||
int high_power; /*!< Higher RF power in mW, -1 for no power (ie. rx list) */
|
||||
vfo_t vfo; /*!< VFO list equipped with this range */
|
||||
ant_t ant; /*!< Antenna list equipped with this range, 0 means all */
|
||||
ant_t ant; /*!< Antenna list equipped with this range, 0 means all, RIG_ANT_CURR means dedicated to certain bands and automatically switches, no set_ant command */
|
||||
char *label; /*!< Label for this range that explains why. e.g. Icom rigs USA, EUR, ITR, TPE, KOR */
|
||||
} freq_range_t;
|
||||
|
||||
#define RIG_FRNG_END {Hz(0),Hz(0),RIG_MODE_NONE,0,0,RIG_VFO_NONE}
|
||||
#define RIG_IS_FRNG_END(r) ((r).startf == Hz(0) && (r).endf == Hz(0))
|
||||
|
||||
|
||||
#define RIG_ITU_REGION1 1
|
||||
#define RIG_ITU_REGION2 2
|
||||
#define RIG_ITU_REGION3 3
|
||||
|
||||
|
||||
/**
|
||||
* \brief Tuning step definition
|
||||
*
|
||||
|
@ -1448,10 +1446,20 @@ struct rig_caps {
|
|||
|
||||
chan_t chan_list[CHANLSTSIZ]; /*!< Channel list, zero ended */
|
||||
|
||||
freq_range_t rx_range_list1[FRQRANGESIZ]; /*!< Receive frequency range list for ITU region 1 */
|
||||
freq_range_t tx_range_list1[FRQRANGESIZ]; /*!< Transmit frequency range list for ITU region 1 */
|
||||
freq_range_t rx_range_list2[FRQRANGESIZ]; /*!< Receive frequency range list for ITU region 2 */
|
||||
freq_range_t tx_range_list2[FRQRANGESIZ]; /*!< Transmit frequency range list for ITU region 2 */
|
||||
// As of 2020-02-12 we know of 5 models from Icom USA, EUR, ITR, TPE, KOR for the IC-9700
|
||||
// So we currently have 5 ranges we need to deal with
|
||||
// The backend for the model should fill in the label field to explain what model it is
|
||||
// The the IC-9700 in ic7300.c for an example
|
||||
freq_range_t rx_range_list1[FRQRANGESIZ]; /*!< Receive frequency range list #1 */
|
||||
freq_range_t tx_range_list1[FRQRANGESIZ]; /*!< Transmit frequency range list #1 */
|
||||
freq_range_t rx_range_list2[FRQRANGESIZ]; /*!< Receive frequency range list #2 */
|
||||
freq_range_t tx_range_list2[FRQRANGESIZ]; /*!< Transmit frequency range list #2 */
|
||||
freq_range_t rx_range_list3[FRQRANGESIZ]; /*!< Receive frequency range list #3 */
|
||||
freq_range_t tx_range_list3[FRQRANGESIZ]; /*!< Transmit frequency range list #3 */
|
||||
freq_range_t rx_range_list4[FRQRANGESIZ]; /*!< Receive frequency range list #4 */
|
||||
freq_range_t tx_range_list4[FRQRANGESIZ]; /*!< Transmit frequency range list #4 */
|
||||
freq_range_t rx_range_list5[FRQRANGESIZ]; /*!< Receive frequency range list #5 */
|
||||
freq_range_t tx_range_list5[FRQRANGESIZ]; /*!< Transmit frequency range list #5 */
|
||||
|
||||
struct tuning_step_list tuning_steps[TSLSTSIZ]; /*!< Tuning step list */
|
||||
struct filter_list filters[FLTLSTSIZ]; /*!< mode/filter table, at -6dB */
|
||||
|
@ -1572,7 +1580,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, ant_t *ant_curr, value_t *option);
|
||||
int (*get_ant)(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx);
|
||||
|
||||
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);
|
||||
|
@ -1778,8 +1786,8 @@ struct rig_state {
|
|||
int transmit; /*!< rig should be transmitting i.e. hard
|
||||
wired PTT asserted - used by rigs that
|
||||
don't do CAT while in Tx */
|
||||
freq_t lo_freq; /*!< Local oscillator frequency of any
|
||||
transverter */
|
||||
freq_t lo_freq; /*!< Local oscillator frequency of any transverter */
|
||||
time_t twiddling; /*!< time when vfo twiddling was detected */
|
||||
};
|
||||
|
||||
|
||||
|
@ -2176,8 +2184,10 @@ extern HAMLIB_EXPORT(int)
|
|||
rig_get_ant HAMLIB_PARAMS((RIG *rig,
|
||||
vfo_t vfo,
|
||||
ant_t ant,
|
||||
value_t *option,
|
||||
ant_t *ant_curr,
|
||||
value_t *option));
|
||||
ant_t *ant_tx,
|
||||
ant_t *ant_rx));
|
||||
|
||||
extern HAMLIB_EXPORT(setting_t)
|
||||
rig_has_get_level HAMLIB_PARAMS((RIG *rig,
|
||||
|
|
|
@ -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, ant_t &ant_curr, vfo_t vfo = RIG_VFO_CURR);
|
||||
ant_t getAnt(ant_t &ant_rx, ant_t &ant_tx, ant_t ant, value_t &option, 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);
|
||||
|
|
|
@ -23,8 +23,13 @@
|
|||
#ifndef _RIGLIST_H
|
||||
#define _RIGLIST_H 1
|
||||
|
||||
#define RIG_MAKE_MODEL(a,b) ((a)*100+(b))
|
||||
#define RIG_BACKEND_NUM(a) ((a)/100)
|
||||
// The rig model number is designed to fit in a 32-bit int
|
||||
// As of 2020-02-18 we have 33 backends defined
|
||||
// With a max of 1000 models per backend we get total a model number range of 1001-33001
|
||||
// This MAX was 100 prior to 2020-02-18 and Icom was close to running out of the 100 range
|
||||
#define MAX_MODELS_PER_BACKEND 1000
|
||||
#define RIG_MAKE_MODEL(a,b) ((a)*MAX_MODELS_PER_BACKEND+(b))
|
||||
#define RIG_BACKEND_NUM(a) ((a)/MAX_MODELS_PER_BACKEND)
|
||||
|
||||
/*! \file riglist.h
|
||||
* \brief Hamlib rig(radio) model definitions.
|
||||
|
@ -623,7 +628,7 @@
|
|||
/*! \typedef typedef int rig_model_t
|
||||
\brief Convenience type definition for rig model.
|
||||
*/
|
||||
typedef int rig_model_t;
|
||||
typedef uint32_t rig_model_t;
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -1404,7 +1404,7 @@ int win32_serial_open(const char *filename, int flags, ...)
|
|||
}
|
||||
else
|
||||
{
|
||||
strncpy(fullfilename, filename, sizeof(fullfilename)-1);
|
||||
strncpy(fullfilename, filename, sizeof(fullfilename) - 1);
|
||||
}
|
||||
|
||||
if (port_opened(fullfilename))
|
||||
|
|
|
@ -461,13 +461,16 @@ int aor_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
mdbuf2_len = strlen(mdbuf2);
|
||||
|
||||
retval = aor_transaction(rig, mdbuf2, mdbuf2_len, NULL, NULL);
|
||||
|
||||
if (retval != RIG_OK) { return retval; }
|
||||
|
||||
strncpy(mdbuf2, mdbuf + 4, 3); /* Extract first 'BW' part */
|
||||
mdbuf2_len = strlen(mdbuf2);
|
||||
|
||||
retval = aor_transaction(rig, mdbuf2, mdbuf2_len, NULL, NULL);
|
||||
|
||||
if (retval != RIG_OK) { return retval; }
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -625,6 +628,7 @@ int aor_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
unsigned att = 0;
|
||||
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < MAXDBLSTSIZ && !RIG_IS_DBLST_END(rs->attenuator[i]); i++)
|
||||
{
|
||||
if (rs->attenuator[i] == val.i)
|
||||
|
@ -1262,6 +1266,7 @@ int aor_get_channel(RIG *rig, channel_t *chan)
|
|||
* find mem_caps in caps, we'll need it later
|
||||
*/
|
||||
int i;
|
||||
|
||||
for (i = 0; i < CHANLSTSIZ && !RIG_IS_CHAN_END(chan_list[i]); i++)
|
||||
{
|
||||
if (channel_num >= chan_list[i].startc &&
|
||||
|
@ -1284,6 +1289,7 @@ int aor_get_channel(RIG *rig, channel_t *chan)
|
|||
* and sizing memorized.
|
||||
*/
|
||||
mem_num = channel_num % 100;
|
||||
|
||||
if (mem_num >= 50 && priv->bank_base1 != priv->bank_base2)
|
||||
{
|
||||
bank_base = priv->bank_base2;
|
||||
|
@ -1440,7 +1446,7 @@ const char *aor_get_info(RIG *rig)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (retval > 2) idbuf[2] = '\0';
|
||||
if (retval > 2) { idbuf[2] = '\0'; }
|
||||
|
||||
retval = aor_transaction(rig, "VR" EOM, 3, frmbuf, &frm_len);
|
||||
|
||||
|
|
|
@ -432,6 +432,7 @@ int format5k_mode(RIG *rig, char *buf, rmode_t mode, pbwidth_t width)
|
|||
if (width != RIG_PASSBAND_NOCHANGE)
|
||||
{
|
||||
int aorwidth;
|
||||
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
{
|
||||
width = rig_passband_normal(rig, mode);
|
||||
|
|
|
@ -428,7 +428,7 @@ int execRoutine(RIG *rig, enum ROUTINE_e rtn)
|
|||
*/
|
||||
static int setAddr(RIG *rig, enum PAGE_e page, unsigned int addr)
|
||||
{
|
||||
int rc=RIG_OK;
|
||||
int rc = RIG_OK;
|
||||
unsigned char v;
|
||||
|
||||
assert(NULL != rig);
|
||||
|
@ -459,6 +459,7 @@ static int setAddr(RIG *rig, enum PAGE_e page, unsigned int addr)
|
|||
v = SRH((0x0f0 & addr) >> 4);
|
||||
|
||||
rc = write_block(&rig->state.rigport, (char *) &v, 1);
|
||||
|
||||
if (rc != RIG_OK)
|
||||
{
|
||||
return -RIG_EIO;
|
||||
|
|
|
@ -729,7 +729,8 @@ int sr2200_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
|
||||
switch (level)
|
||||
{
|
||||
float tmp;
|
||||
float tmp;
|
||||
|
||||
case RIG_LEVEL_STRENGTH:
|
||||
if (ack_len < 7 || ackbuf[0] != 'L' || ackbuf[1] != 'B')
|
||||
{
|
||||
|
|
|
@ -110,6 +110,7 @@ int drake_init(RIG *rig)
|
|||
{
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
priv = rig->state.priv;
|
||||
|
||||
priv->curr_ch = 0;
|
||||
|
@ -504,12 +505,15 @@ 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 dummy, ant_t *ant, value_t *option)
|
||||
int drake_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option,
|
||||
ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
|
||||
{
|
||||
int mdbuf_len, retval;
|
||||
char mdbuf[BUFSZ];
|
||||
char cant;
|
||||
|
||||
*ant_tx = *ant_rx = RIG_ANT_UNKNOWN;
|
||||
|
||||
retval = drake_transaction(rig, "RM" EOM, 3, mdbuf, &mdbuf_len);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
|
@ -528,19 +532,20 @@ int drake_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *option)
|
|||
|
||||
switch (cant & 0x3c)
|
||||
{
|
||||
case '0': *ant = RIG_ANT_1; break;
|
||||
case '0': *ant_curr = RIG_ANT_1; break;
|
||||
|
||||
case '4': *ant = RIG_ANT_3; break;
|
||||
case '4': *ant_curr = RIG_ANT_3; break;
|
||||
|
||||
case '8': *ant = RIG_ANT_2; break;
|
||||
case '8': *ant_curr = RIG_ANT_2; break;
|
||||
|
||||
default :
|
||||
rig_debug(RIG_DEBUG_ERR,
|
||||
"drake_get_ant: unsupported antenna %c\n",
|
||||
cant);
|
||||
*ant = RIG_ANT_NONE;
|
||||
*ant_curr = RIG_ANT_UNKNOWN;
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 dummy, ant_t *ant, value_t *option);
|
||||
int drake_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx);
|
||||
int drake_set_mem(RIG *rig, vfo_t vfo, int ch);
|
||||
int drake_get_mem(RIG *rig, vfo_t vfo, int *ch);
|
||||
int drake_set_chan(RIG *rig, const channel_t *chan);
|
||||
|
|
|
@ -530,6 +530,7 @@ int elad_init(RIG *rig)
|
|||
{
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
priv = rig->state.priv;
|
||||
|
||||
memset(priv, 0x00, sizeof(struct elad_priv_data));
|
||||
|
@ -1110,8 +1111,8 @@ int elad_get_split_vfo_if(RIG *rig, vfo_t rxvfo, split_t *split, vfo_t *txvfo)
|
|||
/* find where is the txvfo.. */
|
||||
/* Elecraft info[30] does not track split VFO when transmitting */
|
||||
transmitting = '1' == priv->info[28]
|
||||
&& RIG_MODEL_K2 != rig->caps->rig_model
|
||||
&& RIG_MODEL_K3 != rig->caps->rig_model;
|
||||
&& RIG_MODEL_K2 != rig->caps->rig_model
|
||||
&& RIG_MODEL_K3 != rig->caps->rig_model;
|
||||
|
||||
switch (priv->info[30])
|
||||
{
|
||||
|
@ -2028,7 +2029,7 @@ int get_elad_level(RIG *rig, const char *cmd, float *f)
|
|||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
if ( !f )
|
||||
if (!f)
|
||||
{
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
@ -2875,7 +2876,8 @@ 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 dummy, ant_t *ant, value_t *option)
|
||||
int elad_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option,
|
||||
ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
|
||||
{
|
||||
char ackbuf[8];
|
||||
int offs;
|
||||
|
@ -2904,7 +2906,7 @@ int elad_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *option)
|
|||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
*ant = RIG_ANT_N(ackbuf[offs] - '1');
|
||||
*ant_curr = RIG_ANT_N(ackbuf[offs] - '1');
|
||||
|
||||
/* XXX check that the returned antenna is valid for the current rig */
|
||||
|
||||
|
@ -3167,6 +3169,7 @@ int elad_send_morse(RIG *rig, vfo_t vfo, const char *msg)
|
|||
while (msg_len > 0)
|
||||
{
|
||||
int buff_len;
|
||||
|
||||
/*
|
||||
* Check with "KY" if char buffer is available.
|
||||
* if not, sleep.
|
||||
|
|
|
@ -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 dummy, ant_t * ant, value_t *option);
|
||||
int elad_get_ant (RIG * rig, vfo_t vfo, ant_t dummy, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx);
|
||||
int 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);
|
||||
|
|
|
@ -378,11 +378,15 @@ static int fetch_meter(RIG *rig, int *label, float *data, int npts)
|
|||
}
|
||||
|
||||
buf_len = sizeof(float) * npts;
|
||||
if (sizeof(float)!=4) {
|
||||
rig_debug(RIG_DEBUG_ERR,"%s: sizeof(float)!=4, instead = %d\n",__func__, (int)sizeof(float));
|
||||
|
||||
if (sizeof(float) != 4)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: sizeof(float)!=4, instead = %d\n", __func__,
|
||||
(int)sizeof(float));
|
||||
return -RIG_EINTERNAL;
|
||||
}
|
||||
ret = read_block(&priv->meter_port, (char *)(void*)data, buf_len);
|
||||
|
||||
ret = read_block(&priv->meter_port, (char *)(void *)data, buf_len);
|
||||
|
||||
if (ret != buf_len)
|
||||
{
|
||||
|
@ -483,7 +487,8 @@ int dttsp_init(RIG *rig)
|
|||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
rig->state.priv = (struct dttsp_priv_data *)calloc(1, sizeof(struct dttsp_priv_data));
|
||||
rig->state.priv = (struct dttsp_priv_data *)calloc(1,
|
||||
sizeof(struct dttsp_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
|
|
@ -199,7 +199,8 @@ int sdr1k_init(RIG *rig)
|
|||
{
|
||||
struct sdr1k_priv_data *priv;
|
||||
|
||||
rig->state.priv = (struct sdr1k_priv_data *)malloc(sizeof(struct sdr1k_priv_data));
|
||||
rig->state.priv = (struct sdr1k_priv_data *)malloc(sizeof(
|
||||
struct sdr1k_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
|
|
@ -276,7 +276,8 @@ int icm710_init(RIG *rig)
|
|||
|
||||
priv_caps = (const struct icm710_priv_caps *) caps->priv;
|
||||
|
||||
rig->state.priv = (struct icm710_priv_data *)calloc(1, sizeof(struct icm710_priv_data));
|
||||
rig->state.priv = (struct icm710_priv_data *)calloc(1,
|
||||
sizeof(struct icm710_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
|
|
@ -136,7 +136,8 @@ int icmarine_init(RIG *rig)
|
|||
|
||||
priv_caps = (const struct icmarine_priv_caps *) caps->priv;
|
||||
|
||||
rig->state.priv = (struct icmarine_priv_data *)malloc(sizeof(struct icmarine_priv_data));
|
||||
rig->state.priv = (struct icmarine_priv_data *)malloc(sizeof(
|
||||
struct icmarine_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
@ -578,7 +579,7 @@ int icmarine_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
|||
rig_debug(RIG_DEBUG_TRACE, "%s:\n", __func__);
|
||||
|
||||
retval = icmarine_transaction(rig, CMD_PTT,
|
||||
ptt == RIG_PTT_ON ? "TX" : "RX", NULL);
|
||||
ptt == RIG_PTT_ON ? "TX" : "RX", NULL);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
|
|
|
@ -307,7 +307,8 @@ int icom_transaction(RIG *rig, int cmd, int subcmd,
|
|||
{
|
||||
break;
|
||||
}
|
||||
hl_usleep(500*1000); // pause a half second
|
||||
|
||||
hl_usleep(500 * 1000); // pause a half second
|
||||
}
|
||||
while (retry-- > 0);
|
||||
|
||||
|
@ -487,6 +488,7 @@ int rig2icom_mode(RIG *rig, rmode_t mode, pbwidth_t width,
|
|||
void icom2rig_mode(RIG *rig, unsigned char md, int pd, rmode_t *mode,
|
||||
pbwidth_t *width)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: mode=0x%02x, pd=%d\n", __func__, md, pd);
|
||||
*width = RIG_PASSBAND_NORMAL;
|
||||
|
||||
switch (md)
|
||||
|
@ -561,9 +563,9 @@ void icom2rig_mode(RIG *rig, unsigned char md, int pd, rmode_t *mode,
|
|||
rigs these are presets, which can be programmed for 30 - 41 bandwidths,
|
||||
depending on mode */
|
||||
|
||||
if (rig->caps->rig_model == RIG_MODEL_IC706MKIIG ||
|
||||
rig->caps->rig_model == RIG_MODEL_IC706 ||
|
||||
rig->caps->rig_model == RIG_MODEL_IC706MKII) { pd++; }
|
||||
if (pd >= 0 && (rig->caps->rig_model == RIG_MODEL_IC706MKIIG ||
|
||||
rig->caps->rig_model == RIG_MODEL_IC706 ||
|
||||
rig->caps->rig_model == RIG_MODEL_IC706MKII)) { pd++; }
|
||||
|
||||
switch (pd)
|
||||
{
|
||||
|
|
|
@ -141,7 +141,7 @@ static int ic706_r2i_mode(RIG *rig, rmode_t mode, pbwidth_t width,
|
|||
static const struct icom_priv_caps ic706_priv_caps =
|
||||
{
|
||||
0x48, /* default address */
|
||||
0, /* 731 mode */
|
||||
1, /* 731 mode */
|
||||
0, /* no XCHG */
|
||||
ic706_ts_sc_list,
|
||||
.serial_USB_echo_check = 1, /* USB CI-V may not echo */
|
||||
|
@ -279,7 +279,7 @@ const struct rig_caps ic706_caps =
|
|||
static const struct icom_priv_caps ic706mkii_priv_caps =
|
||||
{
|
||||
0x4e, /* default address */
|
||||
0, /* 731 mode */
|
||||
1, /* 731 mode */
|
||||
0, /* no XCHG */
|
||||
ic706_ts_sc_list,
|
||||
.serial_USB_echo_check = 1, /* USB CI-V may not echo */
|
||||
|
@ -441,7 +441,7 @@ const struct rig_caps ic706mkii_caps =
|
|||
static const struct icom_priv_caps ic706mkiig_priv_caps =
|
||||
{
|
||||
0x58, /* default address */
|
||||
0, /* 731 mode */
|
||||
1, /* 731 mode */
|
||||
0, /* no XCHG */
|
||||
ic706_ts_sc_list,
|
||||
.serial_USB_echo_check = 1, /* USB CI-V may not echo */
|
||||
|
@ -453,7 +453,7 @@ const struct rig_caps ic706mkiig_caps =
|
|||
.rig_model = RIG_MODEL_IC706MKIIG,
|
||||
.model_name = "IC-706MkIIG",
|
||||
.mfg_name = "Icom",
|
||||
.version = BACKEND_VER ".3",
|
||||
.version = BACKEND_VER ".4",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_MOBILE,
|
||||
|
|
|
@ -102,16 +102,18 @@
|
|||
#define IC7100_PARM_ALL (RIG_PARM_ANN|RIG_PARM_BACKLIGHT|RIG_PARM_KEYLIGHT|RIG_PARM_BEEP|RIG_PARM_TIME)
|
||||
|
||||
int ic7100_tokens[] = { TOK_DSTAR_CODE, TOK_DSTAR_DSQL, TOK_DSTAR_CALL_SIGN, TOK_DSTAR_MESSAGE,
|
||||
TOK_DSTAR_STATUS, TOK_DSTAR_MY_CS, TOK_DSTAR_TX_CS, TOK_DSTAR_TX_MESS,
|
||||
TOK_BACKEND_NONE };
|
||||
TOK_DSTAR_STATUS, TOK_DSTAR_MY_CS, TOK_DSTAR_TX_CS, TOK_DSTAR_TX_MESS,
|
||||
TOK_BACKEND_NONE
|
||||
};
|
||||
|
||||
struct cmdparams ic7100_extcmds[] = {
|
||||
{ {.s=RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x03}, CMD_DAT_BOL, 1 },
|
||||
{ {.s=RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x04}, CMD_DAT_LVL, 2 },
|
||||
{ {.s=RIG_PARM_KEYLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x05}, CMD_DAT_LVL, 2 },
|
||||
{ {.s=RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x21}, CMD_DAT_TIM, 2 },
|
||||
{ {.s=RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x65}, CMD_DAT_INT, 1 },
|
||||
{ {.s=RIG_PARM_NONE} }
|
||||
struct cmdparams ic7100_extcmds[] =
|
||||
{
|
||||
{ {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x03}, CMD_DAT_BOL, 1 },
|
||||
{ {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x04}, CMD_DAT_LVL, 2 },
|
||||
{ {.s = RIG_PARM_KEYLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x05}, CMD_DAT_LVL, 2 },
|
||||
{ {.s = RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x21}, CMD_DAT_TIM, 2 },
|
||||
{ {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x65}, CMD_DAT_INT, 1 },
|
||||
{ {.s = RIG_PARM_NONE} }
|
||||
};
|
||||
|
||||
// IC-7100 S-meter calibration data based on manual
|
||||
|
|
|
@ -57,12 +57,13 @@
|
|||
|
||||
#define IC7300_ANTS (RIG_ANT_1) /* ant-1 is Hf-6m */
|
||||
|
||||
struct cmdparams ic7300_extcmds[] = {
|
||||
{ {.s=RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x23}, CMD_DAT_BOL, 1 },
|
||||
{ {.s=RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x81}, CMD_DAT_LVL, 2 },
|
||||
{ {.s=RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x95}, CMD_DAT_TIM, 2 },
|
||||
{ {.s=RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x91}, CMD_DAT_INT, 1 },
|
||||
{ {.s=RIG_PARM_NONE} }
|
||||
struct cmdparams ic7300_extcmds[] =
|
||||
{
|
||||
{ {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x23}, CMD_DAT_BOL, 1 },
|
||||
{ {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x81}, CMD_DAT_LVL, 2 },
|
||||
{ {.s = RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x95}, CMD_DAT_TIM, 2 },
|
||||
{ {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x91}, CMD_DAT_INT, 1 },
|
||||
{ {.s = RIG_PARM_NONE} }
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -128,17 +129,20 @@ struct cmdparams ic7300_extcmds[] = {
|
|||
* IC9700 items that differ from IC7300
|
||||
*/
|
||||
#define IC9700_VFOS (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MAIN|RIG_VFO_SUB|RIG_VFO_MEM|RIG_VFO_MAIN_A|RIG_VFO_MAIN_B|RIG_VFO_SUB_A|RIG_VFO_SUB_B)
|
||||
#define IC9700_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT|RIG_PARM_TIME|RIG_PARM_BEEP|RIG_PARM_SCREENSAVER)
|
||||
#define IC9700_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_LOCK|RIG_FUNC_RIT|RIG_FUNC_SCOPE|RIG_FUNC_SATMODE|RIG_FUNC_AFC)
|
||||
|
||||
#define IC9700_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL)
|
||||
#define IC9700_ALL_TX_MODES (RIG_MODE_FM|RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_DSTAR|RIG_MODE_DD)
|
||||
#define IC9700_ALL_RX_MODES (RIG_MODE_FM|RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_DSTAR|RIG_MODE_DD)
|
||||
#define IC9700_ALL_TX_MODES (RIG_MODE_FM|RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_DSTAR|RIG_MODE_DD|RIG_MODE_DSTAR)
|
||||
#define IC9700_ALL_RX_MODES (RIG_MODE_FM|RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_DSTAR|RIG_MODE_DD|RIG_MODE_DSTAR)
|
||||
|
||||
struct cmdparams ic9700_extcmds[] = {
|
||||
{ {.s=RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x29}, CMD_DAT_BOL, 1 },
|
||||
{ {.s=RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x52}, CMD_DAT_LVL, 2 },
|
||||
{ {.s=RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x30}, CMD_DAT_INT, 1 },
|
||||
{ {.s=RIG_PARM_NONE} }
|
||||
struct cmdparams ic9700_extcmds[] =
|
||||
{
|
||||
{ {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x29}, CMD_DAT_BOL, 1 },
|
||||
{ {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x52}, CMD_DAT_LVL, 2 },
|
||||
{ {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x30}, CMD_DAT_INT, 1 },
|
||||
{ {.s = RIG_PARM_SCREENSAVER}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, CMD_DAT_INT, 1 },
|
||||
{ {.s = RIG_PARM_NONE} }
|
||||
};
|
||||
|
||||
#define IC9700_STR_CAL { 7, \
|
||||
|
@ -293,10 +297,10 @@ const struct rig_caps ic7300_caps =
|
|||
FRQ_RNG_60m(1, IC7300_OTHER_TX_MODES, W(2), W(100), IC7300_VFOS, RIG_ANT_1),
|
||||
FRQ_RNG_6m(1, IC7300_OTHER_TX_MODES, W(2), W(100), IC7300_VFOS, RIG_ANT_1),
|
||||
FRQ_RNG_4m(1, IC7300_OTHER_TX_MODES, W(2), W(100), IC7300_VFOS, RIG_ANT_1),
|
||||
FRQ_RNG_HF(1, IC7300_AM_TX_MODES, W(1), W(40), IC7300_VFOS, RIG_ANT_1), /* AM class */
|
||||
FRQ_RNG_60m(1, IC7300_AM_TX_MODES, W(1), W(40), IC7300_VFOS, RIG_ANT_1), /* AM class */
|
||||
FRQ_RNG_6m(1, IC7300_AM_TX_MODES, W(1), W(40), IC7300_VFOS, RIG_ANT_1), /* AM class */
|
||||
FRQ_RNG_4m(1, IC7300_AM_TX_MODES, W(1), W(40), IC7300_VFOS, RIG_ANT_1), /* AM class */
|
||||
FRQ_RNG_HF(1, IC7300_AM_TX_MODES, W(1), W(25), IC7300_VFOS, RIG_ANT_1), /* AM class */
|
||||
FRQ_RNG_60m(1, IC7300_AM_TX_MODES, W(1), W(25), IC7300_VFOS, RIG_ANT_1), /* AM class */
|
||||
FRQ_RNG_6m(1, IC7300_AM_TX_MODES, W(1), W(25), IC7300_VFOS, RIG_ANT_1), /* AM class */
|
||||
FRQ_RNG_4m(1, IC7300_AM_TX_MODES, W(1), W(12.5), IC7300_VFOS, RIG_ANT_1), /* AM class */
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
|
||||
|
@ -305,9 +309,9 @@ const struct rig_caps ic7300_caps =
|
|||
FRQ_RNG_HF(2, IC7300_OTHER_TX_MODES, W(2), W(100), IC7300_VFOS, RIG_ANT_1),
|
||||
FRQ_RNG_60m(2, IC7300_OTHER_TX_MODES, W(2), W(100), IC7300_VFOS, RIG_ANT_1),
|
||||
FRQ_RNG_6m(2, IC7300_OTHER_TX_MODES, W(2), W(100), IC7300_VFOS, RIG_ANT_1),
|
||||
FRQ_RNG_HF(2, IC7300_AM_TX_MODES, W(1), W(40), IC7300_VFOS, RIG_ANT_1), /* AM class */
|
||||
FRQ_RNG_60m(2, IC7300_AM_TX_MODES, W(1), W(40), IC7300_VFOS, RIG_ANT_1), /* AM class */
|
||||
FRQ_RNG_6m(2, IC7300_AM_TX_MODES, W(1), W(40), IC7300_VFOS, RIG_ANT_1), /* AM class */
|
||||
FRQ_RNG_HF(2, IC7300_AM_TX_MODES, W(1), W(25), IC7300_VFOS, RIG_ANT_1), /* AM class */
|
||||
FRQ_RNG_60m(2, IC7300_AM_TX_MODES, W(1), W(25), IC7300_VFOS, RIG_ANT_1), /* AM class */
|
||||
FRQ_RNG_6m(2, IC7300_AM_TX_MODES, W(1), W(25), IC7300_VFOS, RIG_ANT_1), /* AM class */
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
|
||||
|
@ -417,7 +421,7 @@ const struct rig_caps ic9700_caps =
|
|||
.rig_model = RIG_MODEL_IC9700,
|
||||
.model_name = "IC-9700",
|
||||
.mfg_name = "Icom",
|
||||
.version = BACKEND_VER ".3",
|
||||
.version = BACKEND_VER ".4",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -438,8 +442,8 @@ const struct rig_caps ic9700_caps =
|
|||
.has_set_func = IC9700_FUNCS,
|
||||
.has_get_level = IC7300_LEVELS,
|
||||
.has_set_level = RIG_LEVEL_SET(IC7300_LEVELS),
|
||||
.has_get_parm = IC7300_PARMS,
|
||||
.has_set_parm = RIG_PARM_SET(IC7300_PARMS),
|
||||
.has_get_parm = IC9700_PARMS,
|
||||
.has_set_parm = RIG_PARM_SET(IC9700_PARMS),
|
||||
.level_gran = {
|
||||
[LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } },
|
||||
[LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } },
|
||||
|
@ -459,28 +463,99 @@ const struct rig_caps ic9700_caps =
|
|||
.vfo_ops = IC9700_VFO_OPS,
|
||||
.scan_ops = IC7300_SCAN_OPS,
|
||||
.transceive = RIG_TRN_RIG,
|
||||
.bank_qty = 1,
|
||||
.bank_qty = 3,
|
||||
.chan_desc_sz = 0,
|
||||
|
||||
.chan_list = {
|
||||
{ 1, 99, RIG_MTYPE_MEM },
|
||||
{ 100, 101, RIG_MTYPE_EDGE }, /* two by two */
|
||||
RIG_CHAN_END,
|
||||
},
|
||||
|
||||
.rx_range_list1 = { {kHz(30), MHz(74.8), IC7300_ALL_RX_MODES, -1, -1, IC9700_VFOS}, RIG_FRNG_END, },
|
||||
.tx_range_list1 = {
|
||||
FRQ_RNG_2m(1, IC9700_ALL_TX_MODES, W(2), W(100), IC9700_VFOS, RIG_ANT_2),
|
||||
FRQ_RNG_70cm(1, IC9700_ALL_TX_MODES, W(2), W(75), IC9700_VFOS, RIG_ANT_2),
|
||||
FRQ_RNG_23cm(1, IC9700_ALL_TX_MODES, W(2), W(23), IC9700_VFOS, RIG_ANT_3),
|
||||
// Hopefully any future changes in bandplans can be fixed with firmware updates
|
||||
// So we use the global REGION2 macros in here
|
||||
.rx_range_list1 = { // USA Version
|
||||
{MHz(144), MHz(148), IC9700_ALL_RX_MODES, -1, -1, IC9700_VFOS, RIG_ANT_CURR, "USA"},
|
||||
{MHz(430), MHz(450), IC9700_ALL_RX_MODES, -1, -1, IC9700_VFOS, RIG_ANT_CURR, "USA"},
|
||||
{MHz(1240), MHz(1300), IC9700_ALL_RX_MODES, -1, -1, IC9700_VFOS, RIG_ANT_CURR, "USA"},
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
.tx_range_list1 = {
|
||||
{MHz(144), MHz(148), IC9700_ALL_TX_MODES ^ RIG_MODE_AM, W(0.5), W(100), IC9700_VFOS, RIG_ANT_CURR, "USA"},
|
||||
{MHz(430), MHz(450), IC9700_ALL_TX_MODES ^ RIG_MODE_AM, W(0.5), W(75), IC9700_VFOS, RIG_ANT_CURR, "USA"},
|
||||
{MHz(1240), MHz(1300), IC9700_ALL_TX_MODES ^ RIG_MODE_AM, W(0.1), W(10), IC9700_VFOS, RIG_ANT_CURR, "USA"},
|
||||
{MHz(144), MHz(148), RIG_MODE_AM, W(0.125), W(25), IC9700_VFOS, RIG_ANT_CURR, "USA"},
|
||||
{MHz(430), MHz(450), RIG_MODE_AM, W(0.125), W(18.75), IC9700_VFOS, RIG_ANT_CURR, "USA"},
|
||||
{MHz(1240), MHz(1300), RIG_MODE_AM, W(0.025), W(2.5), IC9700_VFOS, RIG_ANT_CURR, "USA"},
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
|
||||
.rx_range_list2 = { {kHz(30), MHz(74.8), IC7300_ALL_RX_MODES, -1, -1, IC9700_VFOS}, RIG_FRNG_END, },
|
||||
.tx_range_list2 = {
|
||||
FRQ_RNG_2m(1, IC9700_ALL_TX_MODES, W(2), W(100), IC9700_VFOS, RIG_ANT_2),
|
||||
FRQ_RNG_70cm(1, IC9700_ALL_TX_MODES, W(2), W(75), IC9700_VFOS, RIG_ANT_2),
|
||||
FRQ_RNG_23cm(1, IC9700_ALL_TX_MODES, W(2), W(23), IC9700_VFOS, RIG_ANT_3),
|
||||
.rx_range_list2 = { // EUR Version
|
||||
{MHz(144), MHz(146), IC9700_ALL_RX_MODES, -1, -1, IC9700_VFOS, RIG_ANT_CURR, "EUR"},
|
||||
{MHz(430), MHz(440), IC9700_ALL_RX_MODES, -1, -1, IC9700_VFOS, RIG_ANT_CURR, "EUR"},
|
||||
{MHz(1240), MHz(1300), IC9700_ALL_RX_MODES, -1, -1, IC9700_VFOS, RIG_ANT_CURR, "EUR"},
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
.tx_range_list2 = {
|
||||
{MHz(144), MHz(146), IC9700_ALL_TX_MODES ^ RIG_MODE_AM, W(0.5), W(100), IC9700_VFOS, RIG_ANT_CURR, "EUR"},
|
||||
{MHz(430), MHz(440), IC9700_ALL_TX_MODES ^ RIG_MODE_AM, W(0.5), W(75), IC9700_VFOS, RIG_ANT_CURR, "EUR"},
|
||||
{MHz(1240), MHz(1300), IC9700_ALL_TX_MODES ^ RIG_MODE_AM, W(0.1), W(10), IC9700_VFOS, RIG_ANT_CURR, "EUR"},
|
||||
{MHz(144), MHz(146), RIG_MODE_AM, W(0.125), W(25), IC9700_VFOS, RIG_ANT_CURR, "EUR"},
|
||||
{MHz(430), MHz(440), RIG_MODE_AM, W(0.125), W(18.75), IC9700_VFOS, RIG_ANT_CURR, "EUR"},
|
||||
{MHz(1240), MHz(1300), RIG_MODE_AM, W(0.025), W(2.5), IC9700_VFOS, RIG_ANT_CURR, "EUR"},
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
|
||||
.rx_range_list3 = { // ITR Version
|
||||
{MHz(144), MHz(146), IC9700_ALL_RX_MODES, -1, -1, IC9700_VFOS, RIG_ANT_CURR, "ITR"},
|
||||
{MHz(430), MHz(434), IC9700_ALL_RX_MODES, -1, -1, IC9700_VFOS, RIG_ANT_CURR, "ITR"},
|
||||
{MHz(435), MHz(438), IC9700_ALL_RX_MODES, -1, -1, IC9700_VFOS, RIG_ANT_CURR, "ITR"},
|
||||
{MHz(1240), MHz(1245), IC9700_ALL_RX_MODES, -1, -1, IC9700_VFOS, RIG_ANT_CURR, "ITR"},
|
||||
{MHz(1270), MHz(1298), IC9700_ALL_RX_MODES, -1, -1, IC9700_VFOS, RIG_ANT_CURR, "ITR"},
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
.tx_range_list3 = {
|
||||
{MHz(144), MHz(146), IC9700_ALL_TX_MODES ^ RIG_MODE_AM, W(0.5), W(100), IC9700_VFOS, RIG_ANT_CURR, "ITR"},
|
||||
{MHz(430), MHz(434), IC9700_ALL_TX_MODES ^ RIG_MODE_AM, W(0.5), W(75), IC9700_VFOS, RIG_ANT_CURR, "ITR"},
|
||||
{MHz(435), MHz(438), IC9700_ALL_TX_MODES ^ RIG_MODE_AM, W(0.5), W(75), IC9700_VFOS, RIG_ANT_CURR, "ITR"},
|
||||
{MHz(1240), MHz(1245), IC9700_ALL_TX_MODES ^ RIG_MODE_AM, W(0.1), W(10), IC9700_VFOS, RIG_ANT_CURR, "ITR"},
|
||||
{MHz(1270), MHz(1298), IC9700_ALL_TX_MODES ^ RIG_MODE_AM, W(0.1), W(10), IC9700_VFOS, RIG_ANT_CURR, "ITR"},
|
||||
{MHz(144), MHz(146), RIG_MODE_AM, W(0.125), W(25), IC9700_VFOS, RIG_ANT_CURR, "ITR"},
|
||||
{MHz(430), MHz(434), RIG_MODE_AM, W(0.125), W(18.75), IC9700_VFOS, RIG_ANT_CURR, "ITR"},
|
||||
{MHz(435), MHz(438), RIG_MODE_AM, W(0.125), W(18.75), IC9700_VFOS, RIG_ANT_CURR, "ITR"},
|
||||
{MHz(1240), MHz(1245), RIG_MODE_AM, W(0.025), W(2.5), IC9700_VFOS, RIG_ANT_CURR, "ITR"},
|
||||
{MHz(1270), MHz(1298), RIG_MODE_AM, W(0.025), W(2.5), IC9700_VFOS, RIG_ANT_CURR, "ITR"},
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
|
||||
.rx_range_list4 = { // TPE Version
|
||||
{MHz(144), MHz(146), IC9700_ALL_RX_MODES, -1, -1, IC9700_VFOS, RIG_ANT_CURR, "TPE"},
|
||||
{MHz(430), MHz(432), IC9700_ALL_RX_MODES, -1, -1, IC9700_VFOS, RIG_ANT_CURR, "TPE"},
|
||||
{MHz(1260), MHz(1265), IC9700_ALL_RX_MODES, -1, -1, IC9700_VFOS, RIG_ANT_CURR, "TPE"},
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
.tx_range_list4 = {
|
||||
{MHz(144), MHz(146), IC9700_ALL_TX_MODES ^ RIG_MODE_AM, W(0.5), W(100), IC9700_VFOS, RIG_ANT_CURR, "TPE"},
|
||||
{MHz(430), MHz(432), IC9700_ALL_TX_MODES ^ RIG_MODE_AM, W(0.5), W(75), IC9700_VFOS, RIG_ANT_CURR, "TPE"},
|
||||
{MHz(1260), MHz(1265), IC9700_ALL_TX_MODES ^ RIG_MODE_AM, W(0.1), W(10), IC9700_VFOS, RIG_ANT_CURR, "TPE"},
|
||||
{MHz(144), MHz(146), RIG_MODE_AM, W(0.125), W(25), IC9700_VFOS, RIG_ANT_CURR, "TPE"},
|
||||
{MHz(430), MHz(432), RIG_MODE_AM, W(0.125), W(18.75), IC9700_VFOS, RIG_ANT_CURR, "TPE"},
|
||||
{MHz(1260), MHz(1265), RIG_MODE_AM, W(0.025), W(2.5), IC9700_VFOS, RIG_ANT_CURR, "TPE"},
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
|
||||
.rx_range_list5 = { // KOR Version
|
||||
{MHz(144), MHz(146), IC9700_ALL_RX_MODES, -1, -1, IC9700_VFOS, RIG_ANT_CURR, "KOR"},
|
||||
{MHz(430), MHz(440), IC9700_ALL_RX_MODES, -1, -1, IC9700_VFOS, RIG_ANT_CURR, "KOR"},
|
||||
{MHz(1260), MHz(1300), IC9700_ALL_RX_MODES, -1, -1, IC9700_VFOS, RIG_ANT_CURR, "KOR"},
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
.tx_range_list5 = {
|
||||
{MHz(144), MHz(146), IC9700_ALL_TX_MODES ^ RIG_MODE_AM, W(0.5), W(100), IC9700_VFOS, RIG_ANT_CURR, "KOR"},
|
||||
{MHz(430), MHz(440), IC9700_ALL_TX_MODES ^ RIG_MODE_AM, W(0.5), W(75), IC9700_VFOS, RIG_ANT_CURR, "KOR"},
|
||||
{MHz(1260), MHz(1300), IC9700_ALL_TX_MODES ^ RIG_MODE_AM, W(0.1), W(10), IC9700_VFOS, RIG_ANT_CURR, "KOR"},
|
||||
{MHz(144), MHz(146), RIG_MODE_AM, W(0.125), W(25), IC9700_VFOS, RIG_ANT_CURR, "KOR"},
|
||||
{MHz(430), MHz(440), RIG_MODE_AM, W(0.125), W(18.75), IC9700_VFOS, RIG_ANT_CURR, "KOR"},
|
||||
{MHz(1260), MHz(1300), RIG_MODE_AM, W(0.025), W(2.5), IC9700_VFOS, RIG_ANT_CURR, "KOR"},
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
|
||||
|
|
|
@ -964,19 +964,22 @@ int ic746pro_get_channel(RIG *rig, channel_t *chan)
|
|||
* chanbuf should contain Cn,Sc, Chan #, Data area
|
||||
*/
|
||||
// Do we get chan_len==1 || chan_len==5 on empty memory?
|
||||
// The IC746Pro returns 1a 00 00 01 ff on a blank channel
|
||||
// The IC746Pro returns 1a 00 00 01 ff on a blank channel
|
||||
// So this logic should apply to any Icom with chan_len==5 hopefully
|
||||
if (chan_len == 5 && chanbuf[4]==0xff) {
|
||||
rig_debug(RIG_DEBUG_TRACE,"%s: chan %d is empty\n", __func__, chan->channel_num);
|
||||
if (chan_len == 5 && chanbuf[4] == 0xff)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: chan %d is empty\n", __func__,
|
||||
chan->channel_num);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
if ((chan_len != freq_len * 2 + 40) && (chan_len != 1))
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: wrong frame len=%d\n", __func__,
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: wrong frame len=%d\n", __func__,
|
||||
chan_len);
|
||||
return -RIG_ERJCTED;
|
||||
}
|
||||
|
||||
/* do this only if not a blank channel */
|
||||
if (chan_len != 1)
|
||||
{
|
||||
|
@ -991,7 +994,9 @@ int ic746pro_get_channel(RIG *rig, channel_t *chan)
|
|||
chan->flags = (membuf->chan_flag & 0x01) ? RIG_CHFLAG_SKIP : RIG_CHFLAG_NONE;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: chan->flags=0x%02x\n", __func__, chan->flags);
|
||||
/* data mode on */
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: membuf->rx.data=0x%02x\n", __func__, membuf->rx.data);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: membuf->rx.data=0x%02x\n", __func__,
|
||||
membuf->rx.data);
|
||||
|
||||
if (membuf->rx.data) { chan->flags |= RIG_CHFLAG_DATA; }
|
||||
|
||||
/*
|
||||
|
@ -1004,7 +1009,8 @@ int ic746pro_get_channel(RIG *rig, channel_t *chan)
|
|||
&chan->mode, &chan->width);
|
||||
|
||||
chan->rptr_shift = (rptr_shift_t)(membuf->rx.dup >> 8);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: chan->rptr_shift=%d\n", __func__, chan->rptr_shift);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: chan->rptr_shift=%d\n", __func__,
|
||||
chan->rptr_shift);
|
||||
|
||||
/* offset is default for the band & is not stored in channel memory.
|
||||
The following retrieves the system default for the band */
|
||||
|
@ -1023,12 +1029,15 @@ int ic746pro_get_channel(RIG *rig, channel_t *chan)
|
|||
}
|
||||
|
||||
chan->rptr_offs = from_bcd(databuf + 3, 6) * 100;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: chan->rptr_offs=%d\n", __func__, (int)chan->rptr_offs);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: chan->rptr_offs=%d\n", __func__,
|
||||
(int)chan->rptr_offs);
|
||||
|
||||
chan->ctcss_tone = from_bcd_be(membuf->rx.tone, 6);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: chan->ctcss_tone=%d\n", __func__, chan->ctcss_tone);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: chan->ctcss_tone=%d\n", __func__,
|
||||
chan->ctcss_tone);
|
||||
chan->ctcss_sql = from_bcd_be(membuf->rx.tone_sql, 6);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: chan->ctcss_sql=%d\n", __func__, chan->ctcss_sql);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: chan->ctcss_sql=%d\n", __func__,
|
||||
chan->ctcss_sql);
|
||||
chan->dcs_code = from_bcd_be(membuf->rx.dcs.code, 4);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: chan->dcs_code=%d\n", __func__, chan->dcs_code);
|
||||
/* The dcs information include in the channel includes polarity information
|
||||
|
@ -1040,7 +1049,8 @@ int ic746pro_get_channel(RIG *rig, channel_t *chan)
|
|||
&chan->tx_mode, &chan->tx_width);
|
||||
strncpy(chan->channel_desc, membuf->name, 9);
|
||||
chan->channel_desc[9] = '\0'; /* add null terminator */
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: chan->channel_desc=%s\n", __func__, chan->channel_desc);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: chan->channel_desc=%s\n", __func__,
|
||||
chan->channel_desc);
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
|
@ -1052,146 +1062,180 @@ int ic746pro_get_channel(RIG *rig, channel_t *chan)
|
|||
*/
|
||||
int ic746pro_set_channel(RIG *rig, const channel_t *chan)
|
||||
{
|
||||
struct icom_priv_data *priv;
|
||||
struct rig_state *rs;
|
||||
mem_buf_t membuf = {0};
|
||||
unsigned char chanbuf[MAXFRAMELEN], ackbuf[MAXFRAMELEN];
|
||||
int chan_len, ack_len, freq_len, retval;
|
||||
struct icom_priv_data *priv;
|
||||
struct rig_state *rs;
|
||||
mem_buf_t membuf = {0};
|
||||
unsigned char chanbuf[MAXFRAMELEN], ackbuf[MAXFRAMELEN];
|
||||
int chan_len, ack_len, freq_len, retval;
|
||||
|
||||
rs = &rig->state;
|
||||
priv = (struct icom_priv_data *)rs->priv;
|
||||
rs = &rig->state;
|
||||
priv = (struct icom_priv_data *)rs->priv;
|
||||
|
||||
freq_len = priv->civ_731_mode ? 4 : 5;
|
||||
freq_len = priv->civ_731_mode ? 4 : 5;
|
||||
|
||||
// set memory channel
|
||||
to_bcd_be(chanbuf, chan->channel_num, 4);
|
||||
chan_len = 2;
|
||||
// set memory channel
|
||||
to_bcd_be(chanbuf, chan->channel_num, 4);
|
||||
chan_len = 2;
|
||||
|
||||
// if good value, we change the memory otherwise clear
|
||||
if (chan->freq != 0 || chan->mode != 0)
|
||||
// if good value, we change the memory otherwise clear
|
||||
if (chan->freq != 0 || chan->mode != 0)
|
||||
{
|
||||
if (chan->split == RIG_SPLIT_ON)
|
||||
membuf.chan_flag |= 0x10;
|
||||
else
|
||||
membuf.chan_flag |= (chan->flags & RIG_CHFLAG_SKIP) ? 0x01 : 0x00;
|
||||
|
||||
// RX
|
||||
to_bcd(membuf.rx.freq, chan->freq, freq_len * 2);
|
||||
|
||||
retval = rig2icom_mode(rig, chan->mode, chan->width,
|
||||
&membuf.rx.mode, &membuf.rx.pb);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
if (chan->split == RIG_SPLIT_ON)
|
||||
{
|
||||
return retval;
|
||||
membuf.chan_flag |= 0x10;
|
||||
}
|
||||
else
|
||||
{
|
||||
membuf.chan_flag |= (chan->flags & RIG_CHFLAG_SKIP) ? 0x01 : 0x00;
|
||||
}
|
||||
|
||||
if(membuf.rx.pb == -1)
|
||||
membuf.rx.pb = PD_MEDIUM_3;
|
||||
// RX
|
||||
to_bcd(membuf.rx.freq, chan->freq, freq_len * 2);
|
||||
|
||||
membuf.rx.data = (chan->flags & RIG_CHFLAG_DATA) ? 1 : 0;
|
||||
membuf.rx.dup = chan->rptr_shift;
|
||||
retval = rig2icom_mode(rig, chan->mode, chan->width,
|
||||
&membuf.rx.mode, &membuf.rx.pb);
|
||||
|
||||
// not empty otherwise the call fail
|
||||
if (chan->ctcss_tone == 0)
|
||||
to_bcd_be(membuf.rx.tone, 885, 6);
|
||||
else
|
||||
to_bcd_be(membuf.rx.tone, chan->ctcss_tone, 6);
|
||||
if (chan->ctcss_sql == 0)
|
||||
to_bcd_be(membuf.rx.tone_sql, 885, 6);
|
||||
else
|
||||
to_bcd_be(membuf.rx.tone_sql, chan->ctcss_sql, 6);
|
||||
|
||||
if (chan->dcs_code == 0)
|
||||
to_bcd_be(membuf.rx.dcs.code, 23, 4);
|
||||
else
|
||||
to_bcd_be(membuf.rx.dcs.code, chan->dcs_code, 4);
|
||||
|
||||
// TX
|
||||
to_bcd(membuf.tx.freq, chan->tx_freq, freq_len * 2);
|
||||
|
||||
retval = rig2icom_mode(rig, chan->tx_mode, chan->tx_width,
|
||||
&membuf.tx.mode, &membuf.tx.pb);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
return retval;
|
||||
}
|
||||
|
||||
if(membuf.tx.pb == -1)
|
||||
membuf.tx.pb = PD_MEDIUM_3;
|
||||
|
||||
membuf.tx.data = (chan->flags | RIG_CHFLAG_DATA) ? 1 : 0;
|
||||
membuf.tx.dup = chan->rptr_shift;
|
||||
|
||||
// not empty otherwise the call fail
|
||||
if (chan->ctcss_tone == 0)
|
||||
to_bcd_be(membuf.tx.tone, 885, 6);
|
||||
else
|
||||
to_bcd_be(membuf.tx.tone, chan->ctcss_tone, 6);
|
||||
if (chan->ctcss_sql == 0)
|
||||
to_bcd_be(membuf.tx.tone_sql, 885, 6);
|
||||
else
|
||||
to_bcd_be(membuf.tx.tone_sql, chan->ctcss_sql, 6);
|
||||
|
||||
if (chan->dcs_code == 0)
|
||||
to_bcd_be(membuf.tx.dcs.code, 23, 4);
|
||||
else
|
||||
to_bcd_be(membuf.tx.dcs.code, chan->dcs_code, 4);
|
||||
|
||||
// set description
|
||||
memcpy(membuf.name, chan->channel_desc, sizeof(membuf.name));
|
||||
|
||||
memcpy(chanbuf+chan_len, &membuf, sizeof(mem_buf_t));
|
||||
chan_len += sizeof(mem_buf_t);
|
||||
|
||||
retval = icom_transaction(rig, C_CTL_MEM, S_MEM_CNTNT,
|
||||
chanbuf, chan_len, ackbuf, &ack_len);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
if (membuf.rx.pb == -1)
|
||||
{
|
||||
return retval;
|
||||
membuf.rx.pb = PD_MEDIUM_3;
|
||||
}
|
||||
|
||||
if (ack_len != 1 || ackbuf[0] != ACK)
|
||||
membuf.rx.data = (chan->flags & RIG_CHFLAG_DATA) ? 1 : 0;
|
||||
membuf.rx.dup = chan->rptr_shift;
|
||||
|
||||
// not empty otherwise the call fail
|
||||
if (chan->ctcss_tone == 0)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "icom_set_channel: ack NG (%#.2x), "
|
||||
"len=%d\n", ackbuf[0], ack_len);
|
||||
return -RIG_ERJCTED;
|
||||
to_bcd_be(membuf.rx.tone, 885, 6);
|
||||
}
|
||||
else
|
||||
{
|
||||
to_bcd_be(membuf.rx.tone, chan->ctcss_tone, 6);
|
||||
}
|
||||
|
||||
if (chan->ctcss_sql == 0)
|
||||
{
|
||||
to_bcd_be(membuf.rx.tone_sql, 885, 6);
|
||||
}
|
||||
else
|
||||
{
|
||||
to_bcd_be(membuf.rx.tone_sql, chan->ctcss_sql, 6);
|
||||
}
|
||||
|
||||
if (chan->dcs_code == 0)
|
||||
{
|
||||
to_bcd_be(membuf.rx.dcs.code, 23, 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
to_bcd_be(membuf.rx.dcs.code, chan->dcs_code, 4);
|
||||
}
|
||||
|
||||
// TX
|
||||
to_bcd(membuf.tx.freq, chan->tx_freq, freq_len * 2);
|
||||
|
||||
retval = rig2icom_mode(rig, chan->tx_mode, chan->tx_width,
|
||||
&membuf.tx.mode, &membuf.tx.pb);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
if (membuf.tx.pb == -1)
|
||||
{
|
||||
membuf.tx.pb = PD_MEDIUM_3;
|
||||
}
|
||||
|
||||
membuf.tx.data = (chan->flags | RIG_CHFLAG_DATA) ? 1 : 0;
|
||||
membuf.tx.dup = chan->rptr_shift;
|
||||
|
||||
// not empty otherwise the call fail
|
||||
if (chan->ctcss_tone == 0)
|
||||
{
|
||||
to_bcd_be(membuf.tx.tone, 885, 6);
|
||||
}
|
||||
else
|
||||
{
|
||||
to_bcd_be(membuf.tx.tone, chan->ctcss_tone, 6);
|
||||
}
|
||||
|
||||
if (chan->ctcss_sql == 0)
|
||||
{
|
||||
to_bcd_be(membuf.tx.tone_sql, 885, 6);
|
||||
}
|
||||
else
|
||||
{
|
||||
to_bcd_be(membuf.tx.tone_sql, chan->ctcss_sql, 6);
|
||||
}
|
||||
|
||||
if (chan->dcs_code == 0)
|
||||
{
|
||||
to_bcd_be(membuf.tx.dcs.code, 23, 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
to_bcd_be(membuf.tx.dcs.code, chan->dcs_code, 4);
|
||||
}
|
||||
|
||||
// set description
|
||||
memcpy(membuf.name, chan->channel_desc, sizeof(membuf.name));
|
||||
|
||||
memcpy(chanbuf + chan_len, &membuf, sizeof(mem_buf_t));
|
||||
chan_len += sizeof(mem_buf_t);
|
||||
|
||||
retval = icom_transaction(rig, C_CTL_MEM, S_MEM_CNTNT,
|
||||
chanbuf, chan_len, ackbuf, &ack_len);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
if (ack_len != 1 || ackbuf[0] != ACK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "icom_set_channel: ack NG (%#.2x), "
|
||||
"len=%d\n", ackbuf[0], ack_len);
|
||||
return -RIG_ERJCTED;
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
retval = icom_transaction(rig, C_SET_MEM, -1,
|
||||
chanbuf, chan_len, ackbuf, &ack_len);
|
||||
retval = icom_transaction(rig, C_SET_MEM, -1,
|
||||
chanbuf, chan_len, ackbuf, &ack_len);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
return retval;
|
||||
}
|
||||
|
||||
if (ack_len != 1 || ackbuf[0] != ACK)
|
||||
if (ack_len != 1 || ackbuf[0] != ACK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "icom_set_channel: ack NG (%#.2x), "
|
||||
"len=%d\n", ackbuf[0], ack_len);
|
||||
return -RIG_ERJCTED;
|
||||
rig_debug(RIG_DEBUG_ERR, "icom_set_channel: ack NG (%#.2x), "
|
||||
"len=%d\n", ackbuf[0], ack_len);
|
||||
return -RIG_ERJCTED;
|
||||
}
|
||||
|
||||
retval = icom_transaction(rig, C_CLR_MEM, -1, NULL, 0, ackbuf, &ack_len);
|
||||
retval = icom_transaction(rig, C_CLR_MEM, -1, NULL, 0, ackbuf, &ack_len);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
return retval;
|
||||
}
|
||||
|
||||
if (ack_len != 1 || ackbuf[0] != ACK)
|
||||
if (ack_len != 1 || ackbuf[0] != ACK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "icom_set_channel: ack NG (%#.2x), "
|
||||
"len=%d\n", ackbuf[0], ack_len);
|
||||
return -RIG_ERJCTED;
|
||||
rig_debug(RIG_DEBUG_ERR, "icom_set_channel: ack NG (%#.2x), "
|
||||
"len=%d\n", ackbuf[0], ack_len);
|
||||
return -RIG_ERJCTED;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return RIG_OK;
|
||||
return RIG_OK;
|
||||
}
|
||||
|
|
|
@ -62,12 +62,13 @@
|
|||
|
||||
#define IC756_ANTS (RIG_ANT_1|RIG_ANT_2)
|
||||
|
||||
struct cmdparams ic756pro_cmdparms[] = {
|
||||
{ {.s=RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x20}, CMD_DAT_BOL, 1 },
|
||||
{ {.s=RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x09}, CMD_DAT_LVL, 2 },
|
||||
{ {.s=RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x16}, CMD_DAT_TIM, 2 },
|
||||
{ {.s=RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x60}, CMD_DAT_INT, 1 },
|
||||
{ {.s=RIG_PARM_NONE} }
|
||||
struct cmdparams ic756pro_cmdparms[] =
|
||||
{
|
||||
{ {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x20}, CMD_DAT_BOL, 1 },
|
||||
{ {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x09}, CMD_DAT_LVL, 2 },
|
||||
{ {.s = RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x16}, CMD_DAT_TIM, 2 },
|
||||
{ {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x60}, CMD_DAT_INT, 1 },
|
||||
{ {.s = RIG_PARM_NONE} }
|
||||
};
|
||||
|
||||
#define IC756PRO_STR_CAL { 16, \
|
||||
|
|
|
@ -53,12 +53,13 @@
|
|||
|
||||
#define IC7600_ANTS (RIG_ANT_1|RIG_ANT_2)
|
||||
|
||||
struct cmdparams ic7600_extcmds[] = {
|
||||
{ {.s=RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x59}, CMD_DAT_BOL, 1 },
|
||||
{ {.s=RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x38}, CMD_DAT_LVL, 2 },
|
||||
{ {.s=RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x54}, CMD_DAT_TIM, 2 },
|
||||
{ {.s=RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, CMD_DAT_INT, 1 },
|
||||
{ {.s=RIG_PARM_NONE} }
|
||||
struct cmdparams ic7600_extcmds[] =
|
||||
{
|
||||
{ {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x59}, CMD_DAT_BOL, 1 },
|
||||
{ {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x38}, CMD_DAT_LVL, 2 },
|
||||
{ {.s = RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x54}, CMD_DAT_TIM, 2 },
|
||||
{ {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, CMD_DAT_INT, 1 },
|
||||
{ {.s = RIG_PARM_NONE} }
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -342,6 +342,7 @@ int ic7800_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
{
|
||||
/* Convert dB to index */
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 7; i++)
|
||||
{
|
||||
if (val.i == rig->state.attenuator[i])
|
||||
|
|
|
@ -124,8 +124,8 @@ static struct icom_priv_caps ic785x_priv_caps =
|
|||
0, /* 731 mode */
|
||||
0, /* no XCHG */
|
||||
ic756pro_ts_sc_list,
|
||||
.antack_len = 3,
|
||||
.ant_count = 4,
|
||||
.antack_len = 3,
|
||||
.ant_count = 4,
|
||||
.agc_levels_present = 1,
|
||||
.agc_levels = {
|
||||
{ .level = RIG_AGC_OFF, .icom_level = 0 },
|
||||
|
|
397
rigs/icom/icom.c
397
rigs/icom/icom.c
|
@ -47,6 +47,8 @@
|
|||
#define VFO_HAS_MAIN_SUB_ONLY ((!VFO_HAS_A_B) & VFO_HAS_MAIN_SUB)
|
||||
#define VFO_HAS_MAIN_SUB_A_B_ONLY (VFO_HAS_A_B & VFO_HAS_MAIN_SUB)
|
||||
#define VFO_HAS_A_B_ONLY (VFO_HAS_A_B & (!VFO_HAS_MAIN_SUB))
|
||||
#define VFO_DUAL (RIG_VFO_MAIN_A|RIG_VFO_MAIN_B|RIG_VFO_SUB_A|RIG_VFO_SUB_B)
|
||||
#define VFO_HAS_DUAL ((rig->state.vfo_list & VFO_DUAL == VFO_DUAL)
|
||||
|
||||
static int set_vfo_curr(RIG *rig, vfo_t vfo, vfo_t curr_vfo);
|
||||
|
||||
|
@ -584,8 +586,6 @@ icom_init(RIG *rig)
|
|||
struct icom_priv_data *priv;
|
||||
struct icom_priv_caps *priv_caps;
|
||||
struct rig_caps *caps;
|
||||
int retval;
|
||||
int satmode = 0;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
|
@ -628,14 +628,6 @@ icom_init(RIG *rig)
|
|||
priv->tx_vfo = RIG_VFO_NONE;
|
||||
priv->rx_vfo = RIG_VFO_NONE;
|
||||
priv->curr_vfo = RIG_VFO_NONE;
|
||||
retval = rig_get_func(rig, RIG_VFO_CURR, RIG_FUNC_SATMODE, &satmode);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: satmode=%d\n", __func__, satmode);
|
||||
|
||||
if (retval == RIG_OK && satmode)
|
||||
{
|
||||
priv->rx_vfo = RIG_VFO_MAIN;
|
||||
priv->tx_vfo = RIG_VFO_SUB;
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: done\n", __func__);
|
||||
|
||||
|
@ -691,6 +683,7 @@ int icom_get_usb_echo_off(RIG *rig)
|
|||
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)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: USB echo on detected\n",
|
||||
|
@ -727,6 +720,9 @@ int
|
|||
icom_rig_open(RIG *rig)
|
||||
{
|
||||
int retval = RIG_OK;
|
||||
int satmode = 0;
|
||||
struct rig_state *rs = &rig->state;
|
||||
struct icom_priv_data *priv = (struct icom_priv_data *) rs->priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s %d \n", __func__, __LINE__);
|
||||
|
||||
|
@ -755,9 +751,28 @@ icom_rig_open(RIG *rig)
|
|||
// Now that we're powered up let's try again
|
||||
retval = icom_get_usb_echo_off(rig);
|
||||
|
||||
if (retval >= 0) { return RIG_OK; }
|
||||
if (retval < 0)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Unable to determine USB echo status\n", __func__);
|
||||
return retval;
|
||||
}
|
||||
|
||||
retval = rig_get_func(rig, RIG_VFO_CURR, RIG_FUNC_SATMODE, &satmode);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: satmode=%d\n", __func__, satmode);
|
||||
|
||||
// RIG_OK return means this rig has satmode capabiltiy and Main/Sub VFOs
|
||||
// Should we also set/force VFOA for Main&Sub here?
|
||||
if (retval == RIG_OK && satmode)
|
||||
{
|
||||
priv->rx_vfo = RIG_VFO_MAIN;
|
||||
priv->tx_vfo = RIG_VFO_SUB;
|
||||
}
|
||||
else if (retval == RIG_OK && !satmode)
|
||||
{
|
||||
priv->rx_vfo = RIG_VFO_MAIN;
|
||||
priv->tx_vfo = RIG_VFO_MAIN;
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Unable to determine USB echo status\n", __func__);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -772,6 +787,40 @@ icom_rig_close(RIG *rig)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
// return true if band is changing from last set_freq
|
||||
// Assumes rig is currently on the VFO being changed
|
||||
// This handles the case case Main/Sub cannot be on the same band
|
||||
int icom_band_changing(RIG *rig, freq_t test_freq)
|
||||
{
|
||||
freq_t curr_freq, freq1, freq2;
|
||||
int retval;
|
||||
|
||||
// We should be sitting on the VFO we want to change so just get it's frequency
|
||||
retval = icom_get_freq(rig, RIG_VFO_CURR, &curr_freq);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: icom_get_freq failed??\n", __func__);
|
||||
return 0; // I guess we need to say no change in this case
|
||||
}
|
||||
|
||||
// Make our HF=0, 2M = 1, 70cm = 4, and 23cm=12
|
||||
freq1 = floor(curr_freq / 1e8);
|
||||
freq2 = floor(test_freq / 1e8);
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: lastfreq=%.0f, thisfreq=%.0f\n", __func__,
|
||||
freq1, freq2);
|
||||
|
||||
if (freq1 != freq2)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: Band change detected\n", __func__);
|
||||
return 1;
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: Band change not detected\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* icom_set_freq
|
||||
* Assumes rig!=NULL, rig->state.priv!=NULL
|
||||
|
@ -783,57 +832,22 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
unsigned char freqbuf[MAXFRAMELEN], ackbuf[MAXFRAMELEN];
|
||||
int freq_len, ack_len = sizeof(ackbuf), retval;
|
||||
int cmd, subcmd;
|
||||
freq_t curr_freq;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called %s=%" PRIfreq "\n", __func__,
|
||||
rig_strvfo(vfo), freq);
|
||||
rs = &rig->state;
|
||||
priv = (struct icom_priv_data *) rs->priv;
|
||||
|
||||
// IC-9700 cannot set freq MAIN to same band as SUB
|
||||
// So we query both and ensure they won't match
|
||||
// If a potential collision we just swap VFOs
|
||||
// This covers setting VFOA, VFOB, Main or Sub
|
||||
#if 0
|
||||
|
||||
if (rig->caps->rig_model == RIG_MODEL_IC9700)
|
||||
if (vfo == RIG_VFO_CURR)
|
||||
{
|
||||
// the 0x07 0xd2 is not working as of IC-9700 firmwave 1.05
|
||||
// When it does work this can be unblocked
|
||||
freq_t freqMain, freqSub;
|
||||
retval = rig_get_freq(rig, RIG_VFO_MAIN, &freqMain);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
retval = rig_get_freq(rig, RIG_VFO_SUB, &freqSub);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
// Make our 2M = 1, 70cm = 4, and 23cm=12
|
||||
freqMain = freqMain / 1e8;
|
||||
freqSub = freqMain / 1e8;
|
||||
freq_t freq2 = freq / 1e8;
|
||||
// Check if changing bands on Main and it matches Sub band
|
||||
int mainCollides = freq2 != freqMain && freq2 == freqSub;
|
||||
|
||||
if (mainCollides)
|
||||
{
|
||||
// we'll just swap Main/Sub
|
||||
retval = icom_vfo_op(rig, vfo, RIG_OP_XCHG);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
vfo = priv->curr_vfo;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: currVFO asked for so vfo set to %s\n", __func__,
|
||||
rig_strvfo(vfo));
|
||||
}
|
||||
|
||||
#endif
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: set_vfo_curr=%s\n", __func__,
|
||||
rig_strvfo(priv->curr_vfo));
|
||||
retval = set_vfo_curr(rig, vfo, priv->curr_vfo);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
|
@ -841,6 +855,13 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
return retval;
|
||||
}
|
||||
|
||||
retval = icom_get_freq(rig, RIG_VFO_CURR, &curr_freq);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
freq_len = priv->civ_731_mode ? 4 : 5;
|
||||
/*
|
||||
* to_bcd requires nibble len
|
||||
|
@ -854,7 +875,30 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
// We might have a failed command if we're changing bands
|
||||
// For example, IC9700 setting Sub=VHF when Main=VHF will fail
|
||||
// So we'll try a VFO swap and see if that helps things
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: special check for vfo swap\n", __func__);
|
||||
|
||||
if (icom_band_changing(rig, freq))
|
||||
{
|
||||
if (rig_has_vfo_op(rig, RIG_OP_XCHG))
|
||||
{
|
||||
if (RIG_OK != (retval = icom_vfo_op(rig, vfo, RIG_OP_XCHG)))
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
|
||||
// Try the command again and fall through to handle errors
|
||||
retval = icom_transaction(rig, cmd, subcmd, freqbuf, freq_len, ackbuf,
|
||||
&ack_len);
|
||||
}
|
||||
}
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
if (ack_len != 1 || ackbuf[0] != ACK)
|
||||
|
@ -864,6 +908,16 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
return -RIG_ERJCTED;
|
||||
}
|
||||
|
||||
if (vfo == RIG_VFO_MAIN)
|
||||
{
|
||||
priv->main_freq = freq;
|
||||
}
|
||||
else if (vfo == RIG_VFO_SUB)
|
||||
{
|
||||
priv->sub_freq = freq;
|
||||
}
|
||||
|
||||
priv->curr_freq = freq;
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
@ -1554,6 +1608,10 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
|
||||
retval = icom_transaction(rig, C_RD_MODE, -1, NULL, 0, modebuf, &mode_len);
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: modebuf[0]=0x%02x, modebuf[1]=0x%02x, mode_len=%d\n", __func__, modebuf[0],
|
||||
modebuf[1], mode_len);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
return retval;
|
||||
|
@ -1598,7 +1656,7 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
* Lets check for dsp filters
|
||||
*/
|
||||
|
||||
if ((retval = icom_get_dsp_flt(rig, *mode)) != 0)
|
||||
if (width && (retval = icom_get_dsp_flt(rig, *mode)) != 0)
|
||||
{
|
||||
*width = retval;
|
||||
}
|
||||
|
@ -1653,13 +1711,34 @@ int icom_set_vfo(RIG *rig, vfo_t vfo)
|
|||
struct rig_state *rs = &rig->state;
|
||||
struct icom_priv_data *priv = (struct icom_priv_data *) rs->priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s\n", __func__, rig_strvfo(vfo));
|
||||
|
||||
if (vfo == RIG_VFO_CURR)
|
||||
{
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
if (vfo == RIG_VFO_CURR)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: Asking for currVFO, currVFO=%s\n", __func__,
|
||||
rig_strvfo(priv->curr_vfo));
|
||||
vfo = priv->curr_vfo;
|
||||
}
|
||||
|
||||
if (vfo == RIG_VFO_MAIN && VFO_HAS_A_B_ONLY)
|
||||
{
|
||||
vfo = RIG_VFO_A;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: Rig does not have MAIN/SUB so Main=%s\n",
|
||||
__func__, rig_strvfo(vfo));
|
||||
}
|
||||
else if (vfo == RIG_VFO_SUB && VFO_HAS_A_B_ONLY)
|
||||
{
|
||||
vfo = RIG_VFO_B;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: Rig does not have MAIN/SUB so Sub=%s\n",
|
||||
__func__, rig_strvfo(vfo));
|
||||
}
|
||||
|
||||
/* This method works also in memory mode(RIG_VFO_MEM) */
|
||||
if ((vfo == RIG_VFO_A || vfo == RIG_VFO_B) && !VFO_HAS_A_B)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: Rig does not have VFO A/B?\n", __func__);
|
||||
|
@ -1673,6 +1752,13 @@ int icom_set_vfo(RIG *rig, vfo_t vfo)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
if (vfo != priv->curr_vfo)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: VFO changing from %s to %s\n", __func__,
|
||||
rig_strvfo(priv->curr_vfo), rig_strvfo(vfo));
|
||||
priv->curr_freq = 0; // reset curr_freq so set_freq works 1st time
|
||||
}
|
||||
|
||||
switch (vfo)
|
||||
{
|
||||
case RIG_VFO_A:
|
||||
|
@ -3352,19 +3438,25 @@ int icom_get_split_vfos(const RIG *rig, vfo_t *rx_vfo, vfo_t *tx_vfo)
|
|||
*rx_vfo = RIG_VFO_A;
|
||||
*tx_vfo = RIG_VFO_B; /* rig doesn't enforce this but
|
||||
convention is needed here */
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: VFO_HAS_A_B_ONLY, rx=%s, tx=%s\n", __func__,
|
||||
rig_strvfo(*rx_vfo), rig_strvfo(*tx_vfo));
|
||||
}
|
||||
else if (VFO_HAS_MAIN_SUB_ONLY)
|
||||
{
|
||||
*rx_vfo = RIG_VFO_MAIN;
|
||||
*tx_vfo = RIG_VFO_SUB;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: VFO_HAS_MAIN_SUB_ONLY, rx=%s, tx=%s\n",
|
||||
__func__, rig_strvfo(*rx_vfo), rig_strvfo(*tx_vfo));
|
||||
}
|
||||
else if (VFO_HAS_MAIN_SUB_A_B_ONLY)
|
||||
{
|
||||
// TBD -- newer rigs we need to find active VFO
|
||||
// priv->curvfo if VFOA then A/B response else priv->curvfo=Main Main/Sub response
|
||||
// For now we return Main/Sub
|
||||
*rx_vfo = priv->rx_vfo;
|
||||
*tx_vfo = priv->tx_vfo;
|
||||
*rx_vfo = priv->rx_vfo = RIG_VFO_MAIN;
|
||||
*tx_vfo = priv->tx_vfo = RIG_VFO_SUB;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: VFO_HAS_MAIN_SUB_A_B_ONLY, rx=%s, tx=%s\n",
|
||||
__func__, rig_strvfo(*rx_vfo), rig_strvfo(*tx_vfo));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3391,11 +3483,10 @@ int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
|||
unsigned char ackbuf[MAXFRAMELEN];
|
||||
int ack_len = sizeof(ackbuf);
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called for %s\n", __func__, rig_strvfo(vfo));
|
||||
rs = &rig->state;
|
||||
priv = (struct icom_priv_data *) rs->priv;
|
||||
|
||||
/* This method works also in memory mode(RIG_VFO_MEM) */
|
||||
if (!priv->no_xchg && rig_has_vfo_op(rig, RIG_OP_XCHG))
|
||||
{
|
||||
if (RIG_OK != (rc = icom_vfo_op(rig, vfo, RIG_OP_XCHG)))
|
||||
|
@ -3446,6 +3537,9 @@ int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
|||
return rc;
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: rx_vfo=%s, tx_vfo=%s\n", __func__,
|
||||
rig_strvfo(rx_vfo), rig_strvfo(tx_vfo));
|
||||
|
||||
if (RIG_OK != (rc = icom_set_vfo(rig, tx_vfo)))
|
||||
{
|
||||
return rc;
|
||||
|
@ -3473,6 +3567,15 @@ int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
|||
}
|
||||
}
|
||||
|
||||
if (vfo == RIG_VFO_MAIN)
|
||||
{
|
||||
priv->main_freq = tx_freq;
|
||||
}
|
||||
else if (vfo == RIG_VFO_SUB)
|
||||
{
|
||||
priv->sub_freq = tx_freq;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -4024,21 +4127,36 @@ int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
|||
int ack_len = sizeof(ackbuf), rc;
|
||||
int split_sc;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
rig_debug(RIG_DEBUG_VERBOSE,
|
||||
"%s called vfo='%s', split=%d, tx_vfo=%s, curr_vfo=%s\n", __func__,
|
||||
rig_strvfo(vfo), split, rig_strvfo(tx_vfo), rig_strvfo(priv->curr_vfo));
|
||||
|
||||
if (vfo == RIG_VFO_CURR)
|
||||
{
|
||||
vfo = priv->curr_vfo;
|
||||
}
|
||||
|
||||
switch (split)
|
||||
{
|
||||
case RIG_SPLIT_OFF:
|
||||
|
||||
// if either VFOA or B is the vfo we set to VFOA when split is turned off
|
||||
if (vfo == RIG_VFO_A || vfo == RIG_VFO_B)
|
||||
if (tx_vfo == RIG_VFO_A || tx_vfo == RIG_VFO_B)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: set_vfo to VFO_A because tx_vfo=%s\n", __func__,
|
||||
rig_strvfo(tx_vfo));
|
||||
rig_set_vfo(rig, RIG_VFO_A);
|
||||
priv->tx_vfo = RIG_VFO_A;
|
||||
priv->rx_vfo = RIG_VFO_A;
|
||||
}
|
||||
// otherwise if Main or Sub we set Main as the current vfo
|
||||
else if (vfo == RIG_VFO_MAIN || vfo == RIG_VFO_SUB)
|
||||
else if (tx_vfo == RIG_VFO_MAIN || tx_vfo == RIG_VFO_SUB)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: set_vfo to VFO_MAIN because tx_vfo=%s\n",
|
||||
__func__, rig_strvfo(tx_vfo));
|
||||
rig_set_vfo(rig, RIG_VFO_MAIN);
|
||||
priv->tx_vfo = RIG_VFO_MAIN;
|
||||
priv->rx_vfo = RIG_VFO_MAIN;
|
||||
}
|
||||
|
||||
split_sc = S_SPLT_OFF;
|
||||
|
@ -4047,14 +4165,38 @@ int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
|||
case RIG_SPLIT_ON:
|
||||
split_sc = S_SPLT_ON;
|
||||
|
||||
// Need to allow for SATMODE split in here
|
||||
/* ensure VFO A is Rx and VFO B is Tx as we assume that elsewhere */
|
||||
if (VFO_HAS_A_B)
|
||||
if (VFO_HAS_A_B && (tx_vfo == RIG_VFO_A || tx_vfo == RIG_VFO_B))
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: set_vfo to VFO_A because tx_vfo=%s\n", __func__,
|
||||
rig_strvfo(tx_vfo));
|
||||
|
||||
if (RIG_OK != (rc = icom_set_vfo(rig, RIG_VFO_A)))
|
||||
{
|
||||
return rc;
|
||||
}
|
||||
|
||||
priv->tx_vfo = RIG_VFO_B;
|
||||
priv->rx_vfo = RIG_VFO_A;
|
||||
}
|
||||
// Does this allow for SATMODE split?
|
||||
else if (VFO_HAS_MAIN_SUB && (tx_vfo == RIG_VFO_MAIN || tx_vfo == RIG_VFO_SUB))
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: set_vfo because tx_vfo=%s\n", __func__,
|
||||
rig_strvfo(tx_vfo));
|
||||
|
||||
if (RIG_OK != (rc = icom_set_vfo(rig, tx_vfo)))
|
||||
{
|
||||
return rc;
|
||||
}
|
||||
|
||||
split_sc = S_SPLT_ON;
|
||||
}
|
||||
else
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: split on vfo=%s not known\n", __func__,
|
||||
rig_strvfo(vfo));
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -4096,7 +4238,7 @@ int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
|||
int icom_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
|
||||
{
|
||||
unsigned char splitbuf[MAXFRAMELEN];
|
||||
int split_len, retval;
|
||||
int split_len, retval, satmode = 0;
|
||||
struct icom_priv_data *priv = (struct icom_priv_data *) rig->state.priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
@ -4136,6 +4278,15 @@ int icom_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
|
|||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
rig_get_func(rig, RIG_VFO_CURR, RIG_FUNC_SATMODE, &satmode);
|
||||
|
||||
// don't care about retval here...only care about satmode=1
|
||||
if (satmode)
|
||||
{
|
||||
priv->tx_vfo = RIG_VFO_SUB;
|
||||
priv->rx_vfo = RIG_VFO_MAIN;
|
||||
}
|
||||
|
||||
*tx_vfo = priv->tx_vfo;
|
||||
priv->split_on = RIG_SPLIT_ON == *split;
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s rx_vfo=%s tx_vfo=%s split=%d\n",
|
||||
|
@ -5415,14 +5566,21 @@ int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
|
|||
const struct icom_priv_caps *priv_caps = (const struct icom_priv_caps *)
|
||||
rig->caps->priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called, ant=0x%02x, option=%d\n", __func__, ant, option.i);
|
||||
rig_debug(RIG_DEBUG_VERBOSE,
|
||||
"%s called, ant=0x%02x, option=%d, antack_len=%d\n", __func__, ant, option.i,
|
||||
priv_caps->antack_len);
|
||||
|
||||
// query the antennas once and find out how many we have
|
||||
if (ant >= rig_idx2setting(priv_caps->ant_count)) {
|
||||
if (ant >= rig_idx2setting(priv_caps->ant_count))
|
||||
{
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
if (ant > RIG_ANT_4) {
|
||||
|
||||
if (ant > RIG_ANT_4)
|
||||
{
|
||||
return -RIG_EDOM;
|
||||
}
|
||||
|
||||
switch (ant)
|
||||
{
|
||||
case RIG_ANT_1:
|
||||
|
@ -5447,14 +5605,18 @@ int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
|
|||
}
|
||||
|
||||
|
||||
if (priv_caps->antack_len == 0) { // we need to find out the antack_len
|
||||
ant_t tmp_ant;
|
||||
if (priv_caps->antack_len == 0) // we need to find out the antack_len
|
||||
{
|
||||
ant_t tmp_ant, ant_tx, ant_rx;
|
||||
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;
|
||||
retval = rig_get_ant(rig, vfo, ant, &tmp_option, &tmp_ant, &ant_tx, &ant_rx);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: rig_get_ant error: %s \n", __func__,
|
||||
rigerror(retval));
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5470,15 +5632,18 @@ int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
|
|||
antopt_len = 1;
|
||||
antopt[0] = option.i;
|
||||
// we have to set the rx option by itself apparently
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: setting antopt=%d\n", __func__, antopt[0]);
|
||||
retval = icom_transaction(rig, C_CTL_ANT, i_ant,
|
||||
antopt, antopt_len, ackbuf, &ack_len);
|
||||
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",
|
||||
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)
|
||||
|
@ -5522,7 +5687,8 @@ 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, ant_t *ant_curr, value_t *option)
|
||||
int icom_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option,
|
||||
ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
|
||||
{
|
||||
unsigned char ackbuf[MAXFRAMELEN];
|
||||
int ack_len = sizeof(ackbuf), retval;
|
||||
|
@ -5531,16 +5697,47 @@ int icom_get_ant(RIG *rig, vfo_t vfo, ant_t ant, ant_t *ant_curr, value_t *optio
|
|||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called, ant=0x%02x\n", __func__, ant);
|
||||
|
||||
if (ant == RIG_ANT_CURR) {
|
||||
*ant_tx = *ant_rx = RIG_ANT_UNKNOWN;
|
||||
|
||||
if (ant != RIG_ANT_CURR)
|
||||
{
|
||||
ant = rig_setting2idx(ant);
|
||||
|
||||
if (ant >= priv_caps->ant_count)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: ant index=%d > ant_count=%d\n", __func__, ant,
|
||||
priv_caps->ant_count);
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
}
|
||||
|
||||
// Should be able to use just C_CTL_ANT for 1 or 2 antennas hopefully
|
||||
if (ant == RIG_ANT_CURR || priv_caps->ant_count <= 2)
|
||||
{
|
||||
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 if (rig->caps->rig_model == RIG_MODEL_IC785x)
|
||||
{
|
||||
unsigned char buf[2];
|
||||
buf[0] = 0x03;
|
||||
buf[1] = 0x05 + ant;
|
||||
*ant_curr = ant;
|
||||
retval = icom_transaction(rig, C_CTL_MEM, 0x05, buf, sizeof(buf), ackbuf,
|
||||
&ack_len);
|
||||
|
||||
if (retval == RIG_OK)
|
||||
{
|
||||
option->i = ackbuf[4];
|
||||
return RIG_OK;
|
||||
}
|
||||
}
|
||||
else {
|
||||
rig_debug(RIG_DEBUG_ERR,"%s: asking for non-current antenna and ant_count==0?\n", __func__);
|
||||
return -RIG_EINVAL;
|
||||
else
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR,
|
||||
"%s: asking for non-current antenna and ant_count==0?\n", __func__);
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: need to implement ant control for this rig?\n",
|
||||
__func__);
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
if (retval != RIG_OK)
|
||||
|
@ -5562,9 +5759,12 @@ int icom_get_ant(RIG *rig, vfo_t vfo, ant_t ant, ant_t *ant_curr, value_t *optio
|
|||
return -RIG_ERJCTED;
|
||||
}
|
||||
|
||||
*ant_curr = ackbuf[1];
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: ackbuf= 0x%02x 0x%02x 0x%02x\n", __func__,
|
||||
ackbuf[0], ackbuf[1], ackbuf[2]);
|
||||
|
||||
// Note: with IC756/IC-756Pro/IC-7800 and more, ackbuf[2] deals with [RX ANT]
|
||||
*ant_curr = rig_idx2setting(ackbuf[1]);
|
||||
|
||||
// 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)
|
||||
{
|
||||
|
@ -6170,6 +6370,27 @@ static int set_vfo_curr(RIG *rig, vfo_t vfo, vfo_t curr_vfo)
|
|||
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s, curr_vfo=%s\n", __func__,
|
||||
rig_strvfo(vfo), rig_strvfo(curr_vfo));
|
||||
|
||||
if (vfo == RIG_VFO_CURR)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: Asking for currVFO, currVFO=%s\n", __func__,
|
||||
rig_strvfo(priv->curr_vfo));
|
||||
vfo = priv->curr_vfo;
|
||||
}
|
||||
|
||||
if (vfo == RIG_VFO_MAIN && VFO_HAS_A_B_ONLY)
|
||||
{
|
||||
vfo = RIG_VFO_A;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: Rig does not have MAIN/SUB so Main=%s\n",
|
||||
__func__, rig_strvfo(vfo));
|
||||
}
|
||||
else if (vfo == RIG_VFO_SUB && VFO_HAS_A_B_ONLY)
|
||||
{
|
||||
vfo = RIG_VFO_B;
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: Rig does not have MAIN/SUB so Sub=%s\n",
|
||||
__func__, rig_strvfo(vfo));
|
||||
}
|
||||
|
||||
/* This method works also in memory mode(RIG_VFO_MEM) */
|
||||
// first time we will set default to VFOA or Main as
|
||||
// So if you ask for frequency or such without setting VFO first you'll get VFOA
|
||||
if (priv->curr_vfo == RIG_VFO_NONE && vfo == RIG_VFO_CURR)
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND_VER "0.25"
|
||||
#define BACKEND_VER "0.31"
|
||||
|
||||
/*
|
||||
* defines used by comp_cal_str in rig.c
|
||||
|
@ -122,7 +122,28 @@ struct cmdparams { /* Lookup table item for levels & parms */
|
|||
struct icom_priv_caps
|
||||
{
|
||||
unsigned char re_civ_addr; /* the remote dlft equipment's CI-V address*/
|
||||
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 plus passband setting */
|
||||
// According to the CI-V+ manual the IC-781, IC-R9000, and IC-R7000 can select pas$
|
||||
// The other rigs listed apparently cannot and may need the civ_731_mode=1 which are
|
||||
// 1-706
|
||||
// 2-706MKII
|
||||
// 3-706MKIIG
|
||||
// 4-707
|
||||
// 5-718
|
||||
// 6-746
|
||||
// 7-746PRO
|
||||
// 8-756
|
||||
// 9-756PRO
|
||||
// 10-756PROII
|
||||
// 11-820H
|
||||
// 12-821H
|
||||
// 13-910H
|
||||
// 14-R10
|
||||
// 15-R8500
|
||||
// 16-703
|
||||
// 17-7800
|
||||
|
||||
|
||||
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
|
||||
|
@ -162,6 +183,9 @@ struct icom_priv_data
|
|||
vfo_t curr_vfo;
|
||||
vfo_t rx_vfo;
|
||||
vfo_t tx_vfo;
|
||||
freq_t curr_freq; // our current freq depending on which vfo is selected
|
||||
freq_t main_freq; // track last setting of main -- not being used yet
|
||||
freq_t sub_freq; // track last setting of sub -- not being used yet
|
||||
};
|
||||
|
||||
extern const struct ts_sc_list r8500_ts_sc_list[];
|
||||
|
@ -257,7 +281,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, ant_t *ant_curr, value_t *option);
|
||||
int icom_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx);
|
||||
int icom_decode_event(RIG *rig);
|
||||
int icom_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq,
|
||||
rmode_t mode);
|
||||
|
|
|
@ -53,21 +53,24 @@
|
|||
#define TOK_REC TOKEN_BACKEND(003)
|
||||
|
||||
int icr30_tokens[] = { TOK_ANL, TOK_EAR, TOK_REC,
|
||||
TOK_DSTAR_DSQL, TOK_DSTAR_CALL_SIGN, TOK_DSTAR_MESSAGE, TOK_DSTAR_STATUS,
|
||||
TOK_DSTAR_GPS_DATA, TOK_DSTAR_GPS_MESS, TOK_DSTAR_CODE, TOK_DSTAR_TX_DATA,
|
||||
TOK_BACKEND_NONE };
|
||||
TOK_DSTAR_DSQL, TOK_DSTAR_CALL_SIGN, TOK_DSTAR_MESSAGE, TOK_DSTAR_STATUS,
|
||||
TOK_DSTAR_GPS_DATA, TOK_DSTAR_GPS_MESS, TOK_DSTAR_CODE, TOK_DSTAR_TX_DATA,
|
||||
TOK_BACKEND_NONE
|
||||
};
|
||||
|
||||
struct confparams icr30_ext[] = {
|
||||
struct confparams icr30_ext[] =
|
||||
{
|
||||
{ TOK_ANL, "anl", "Auto noise limiter", "", "", RIG_CONF_CHECKBUTTON, {} },
|
||||
{ TOK_EAR, "ear", "Earphone mode", "", "", RIG_CONF_CHECKBUTTON, {} },
|
||||
{ TOK_REC, "record", "Recorder on/off", "", "", RIG_CONF_CHECKBUTTON, {} },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
struct cmdparams icr30_extcmds[] = {
|
||||
{ {.t=TOK_ANL}, C_CTL_MEM, S_MEM_ANL, SC_MOD_RW, 0, {}, CMD_DAT_BOL, 1 },
|
||||
{ {.t=TOK_EAR}, C_CTL_MEM, S_MEM_EAR, SC_MOD_RW, 0, {}, CMD_DAT_BOL, 1 },
|
||||
{ {.t=TOK_REC}, C_CTL_MEM, S_MEM_REC, SC_MOD_WR, 0, {}, CMD_DAT_BOL, 1 },
|
||||
struct cmdparams icr30_extcmds[] =
|
||||
{
|
||||
{ {.t = TOK_ANL}, C_CTL_MEM, S_MEM_ANL, SC_MOD_RW, 0, {}, CMD_DAT_BOL, 1 },
|
||||
{ {.t = TOK_EAR}, C_CTL_MEM, S_MEM_EAR, SC_MOD_RW, 0, {}, CMD_DAT_BOL, 1 },
|
||||
{ {.t = TOK_REC}, C_CTL_MEM, S_MEM_REC, SC_MOD_WR, 0, {}, CMD_DAT_BOL, 1 },
|
||||
{ {0} }
|
||||
};
|
||||
|
||||
|
|
|
@ -67,19 +67,21 @@
|
|||
{ 255, 60 }, \
|
||||
} }
|
||||
|
||||
struct cmdparams icr8600_extcmds[] = {
|
||||
{ {.s=RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x38}, CMD_DAT_BOL, 1 },
|
||||
{ {.s=RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x15}, CMD_DAT_LVL, 2 },
|
||||
{ {.s=RIG_PARM_KEYLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x16}, CMD_DAT_LVL, 2 },
|
||||
{ {.s=RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x32}, CMD_DAT_TIM, 2 },
|
||||
{ {.s=RIG_PARM_NONE} }
|
||||
struct cmdparams icr8600_extcmds[] =
|
||||
{
|
||||
{ {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x38}, CMD_DAT_BOL, 1 },
|
||||
{ {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x15}, CMD_DAT_LVL, 2 },
|
||||
{ {.s = RIG_PARM_KEYLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x16}, CMD_DAT_LVL, 2 },
|
||||
{ {.s = RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x32}, CMD_DAT_TIM, 2 },
|
||||
{ {.s = RIG_PARM_NONE} }
|
||||
};
|
||||
|
||||
int icr8600_tokens[] = { TOK_DSTAR_DSQL, TOK_DSTAR_CALL_SIGN, TOK_DSTAR_MESSAGE, TOK_DSTAR_STATUS,
|
||||
TOK_DSTAR_GPS_DATA, TOK_DSTAR_GPS_MESS, TOK_DSTAR_CODE, TOK_DSTAR_TX_DATA,
|
||||
TOK_SCOPE_DAT, TOK_SCOPE_STS, TOK_SCOPE_DOP, TOK_SCOPE_MSS, TOK_SCOPE_MOD, TOK_SCOPE_SPN,
|
||||
TOK_SCOPE_HLD, TOK_SCOPE_REF, TOK_SCOPE_SWP, TOK_SCOPE_TYP, TOK_SCOPE_VBW, TOK_SCOPE_FEF,
|
||||
TOK_BACKEND_NONE };
|
||||
TOK_DSTAR_GPS_DATA, TOK_DSTAR_GPS_MESS, TOK_DSTAR_CODE, TOK_DSTAR_TX_DATA,
|
||||
TOK_SCOPE_DAT, TOK_SCOPE_STS, TOK_SCOPE_DOP, TOK_SCOPE_MSS, TOK_SCOPE_MOD, TOK_SCOPE_SPN,
|
||||
TOK_SCOPE_HLD, TOK_SCOPE_REF, TOK_SCOPE_SWP, TOK_SCOPE_TYP, TOK_SCOPE_VBW, TOK_SCOPE_FEF,
|
||||
TOK_BACKEND_NONE
|
||||
};
|
||||
|
||||
/*
|
||||
* channel caps.
|
||||
|
|
|
@ -67,9 +67,10 @@
|
|||
#define ID51_PARM_ALL RIG_PARM_NONE
|
||||
|
||||
int id51_tokens[] = { TOK_DSTAR_DSQL, TOK_DSTAR_CALL_SIGN, TOK_DSTAR_MESSAGE, TOK_DSTAR_STATUS,
|
||||
TOK_DSTAR_GPS_DATA, TOK_DSTAR_GPS_MESS, TOK_DSTAR_CODE, TOK_DSTAR_TX_DATA,
|
||||
TOK_DSTAR_MY_CS, TOK_DSTAR_TX_CS, TOK_DSTAR_TX_MESS,
|
||||
TOK_BACKEND_NONE };
|
||||
TOK_DSTAR_GPS_DATA, TOK_DSTAR_GPS_MESS, TOK_DSTAR_CODE, TOK_DSTAR_TX_DATA,
|
||||
TOK_DSTAR_MY_CS, TOK_DSTAR_TX_CS, TOK_DSTAR_TX_MESS,
|
||||
TOK_BACKEND_NONE
|
||||
};
|
||||
|
||||
/*
|
||||
* FIXME: real measurement
|
||||
|
|
|
@ -199,7 +199,7 @@ const struct rig_caps id5100_caps =
|
|||
.get_parm = icom_get_parm,
|
||||
.set_ext_parm = icom_set_ext_parm,
|
||||
.get_ext_parm = icom_get_ext_parm,
|
||||
|
||||
|
||||
.set_ptt = icom_set_ptt,
|
||||
.get_ptt = icom_get_ptt,
|
||||
.get_dcd = icom_get_dcd,
|
||||
|
|
|
@ -253,7 +253,7 @@ int optoscan_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length)
|
|||
do
|
||||
{
|
||||
int retval = icom_transaction(rig, C_CTL_MISC, S_OPTO_RDDTMF,
|
||||
NULL, 0, dtmfbuf, &len);
|
||||
NULL, 0, dtmfbuf, &len);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
|
|
|
@ -445,11 +445,13 @@ 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 dummy, ant_t *ant, value_t *option)
|
||||
int ic10_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option,
|
||||
ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
|
||||
{
|
||||
char infobuf[50];
|
||||
int info_len, retval;
|
||||
|
||||
*ant_tx = *ant_rx = RIG_ANT_UNKNOWN;
|
||||
info_len = 4;
|
||||
retval = ic10_transaction(rig, "AN;", 3, infobuf, &info_len);
|
||||
|
||||
|
@ -465,7 +467,7 @@ int ic10_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *option)
|
|||
return -RIG_ERJCTED;
|
||||
}
|
||||
|
||||
*ant = infobuf[2] == '1' ? RIG_ANT_1 : RIG_ANT_2;
|
||||
*ant_curr = infobuf[2] == '1' ? RIG_ANT_1 : RIG_ANT_2;
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -740,10 +742,13 @@ int ic10_set_channel(RIG *rig, const channel_t *chan)
|
|||
md
|
||||
);
|
||||
retval = ic10_transaction(rig, membuf, len, ackbuf, &ack_len);
|
||||
|
||||
// I assume we need to check the retval here -- W9MDB
|
||||
// This was found from cppcheck
|
||||
if (retval != RIG_OK) {
|
||||
rig_debug(RIG_DEBUG_ERR,"%s: transaction failed: %s\n", __func__, strerror(retval));
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: transaction failed: %s\n", __func__,
|
||||
strerror(retval));
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 dummy, ant_t *ant, value_t *option);
|
||||
int ic10_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx);
|
||||
int 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);
|
||||
|
|
|
@ -912,17 +912,20 @@ int k3_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
{
|
||||
case RIG_MODE_PKTLSB:
|
||||
mode = RIG_MODE_RTTY;
|
||||
snprintf(cmd_m, sizeof(cmd_m), "DT1"); /* AFSK A mode - AFSK on LSB optimised for RTTY, VFO dial is MARK */
|
||||
snprintf(cmd_m, sizeof(cmd_m),
|
||||
"DT1"); /* AFSK A mode - AFSK on LSB optimised for RTTY, VFO dial is MARK */
|
||||
break;
|
||||
|
||||
case RIG_MODE_PKTUSB:
|
||||
mode = RIG_MODE_RTTY;
|
||||
snprintf(cmd_m, sizeof(cmd_m), "DT0"); /* DATA A mode - AFSK on USB general, VFO dial is suppressed carrier QRG */
|
||||
snprintf(cmd_m, sizeof(cmd_m),
|
||||
"DT0"); /* DATA A mode - AFSK on USB general, VFO dial is suppressed carrier QRG */
|
||||
break;
|
||||
|
||||
case RIG_MODE_RTTY:
|
||||
case RIG_MODE_RTTYR:
|
||||
snprintf(cmd_m, sizeof(cmd_m), "DT2"); /* FSK D mode - direct FSK keying, LSB is "normal", VFO dial is MARK */
|
||||
snprintf(cmd_m, sizeof(cmd_m),
|
||||
"DT2"); /* FSK D mode - direct FSK keying, LSB is "normal", VFO dial is MARK */
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -1215,17 +1218,20 @@ int k3_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width)
|
|||
{
|
||||
case RIG_MODE_PKTLSB:
|
||||
tx_mode = RIG_MODE_RTTY;
|
||||
snprintf(cmd_m, sizeof(cmd_m), "DT1"); /* AFSK A mode - AFSK on LSB optimised for RTTY, VFO dial is MARK */
|
||||
snprintf(cmd_m, sizeof(cmd_m),
|
||||
"DT1"); /* AFSK A mode - AFSK on LSB optimised for RTTY, VFO dial is MARK */
|
||||
break;
|
||||
|
||||
case RIG_MODE_PKTUSB:
|
||||
tx_mode = RIG_MODE_RTTY;
|
||||
snprintf(cmd_m, sizeof(cmd_m), "DT0"); /* DATA A mode - AFSK on USB general, VFO dial is suppressed carrier QRG */
|
||||
snprintf(cmd_m, sizeof(cmd_m),
|
||||
"DT0"); /* DATA A mode - AFSK on USB general, VFO dial is suppressed carrier QRG */
|
||||
break;
|
||||
|
||||
case RIG_MODE_RTTY:
|
||||
case RIG_MODE_RTTYR:
|
||||
snprintf(cmd_m, sizeof(cmd_m), "DT2"); /* FSK D mode - direct FSK keying, LSB is "normal", VFO dial is MARK */
|
||||
snprintf(cmd_m, sizeof(cmd_m),
|
||||
"DT2"); /* FSK D mode - direct FSK keying, LSB is "normal", VFO dial is MARK */
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -1542,16 +1548,19 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
|
||||
switch (level)
|
||||
{
|
||||
float firmware_have;
|
||||
float firmware_need;
|
||||
float firmware_have;
|
||||
float firmware_need;
|
||||
|
||||
case RIG_LEVEL_STRENGTH:
|
||||
/* As of FW rev 4.37 the K3 supports an 'SMH' command that
|
||||
* offers a higher resolution, 0-100 (mine went to 106),
|
||||
* rawstr value for more precise S-meter reporting.
|
||||
*/
|
||||
firmware_have = 0;
|
||||
if (priv->fw_rev != NULL) sscanf(priv->fw_rev,"%f",&firmware_have);
|
||||
sscanf("4.37","%f",&firmware_need);
|
||||
|
||||
if (priv->fw_rev != NULL) { sscanf(priv->fw_rev, "%f", &firmware_have); }
|
||||
|
||||
sscanf("4.37", "%f", &firmware_need);
|
||||
|
||||
if (firmware_have < firmware_need)
|
||||
{
|
||||
|
|
|
@ -223,7 +223,7 @@ const struct confparams kenwood_cfg_params[] =
|
|||
int kenwood_transaction(RIG *rig, const char *cmdstr, char *data,
|
||||
size_t datasize)
|
||||
{
|
||||
char buffer[KENWOOD_MAX_BUF_LEN]; /* use our own buffer since
|
||||
char buffer[KENWOOD_MAX_BUF_LEN]; /* use our own buffer since
|
||||
verification may need a longer
|
||||
buffer than the user supplied one */
|
||||
char cmdtrm[2]; /* Default Command/Reply termination char */
|
||||
|
@ -591,6 +591,7 @@ int kenwood_init(RIG *rig)
|
|||
{
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
priv = rig->state.priv;
|
||||
|
||||
memset(priv, 0x00, sizeof(struct kenwood_priv_data));
|
||||
|
@ -636,7 +637,7 @@ int kenwood_open(RIG *rig)
|
|||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
// Ensure rig is on
|
||||
rig_set_powerstat(rig,1);
|
||||
rig_set_powerstat(rig, 1);
|
||||
|
||||
|
||||
if (RIG_MODEL_TS590S == rig->caps->rig_model)
|
||||
|
@ -1206,8 +1207,8 @@ int kenwood_get_split_vfo_if(RIG *rig, vfo_t rxvfo, split_t *split,
|
|||
/* find where is the txvfo.. */
|
||||
/* Elecraft info[30] does not track split VFO when transmitting */
|
||||
transmitting = '1' == priv->info[28]
|
||||
&& RIG_MODEL_K2 != rig->caps->rig_model
|
||||
&& RIG_MODEL_K3 != rig->caps->rig_model;
|
||||
&& RIG_MODEL_K2 != rig->caps->rig_model
|
||||
&& RIG_MODEL_K3 != rig->caps->rig_model;
|
||||
|
||||
switch (priv->info[30])
|
||||
{
|
||||
|
@ -3095,7 +3096,8 @@ 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 dummy, ant_t *ant, value_t *option)
|
||||
int kenwood_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option,
|
||||
ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
|
||||
{
|
||||
char ackbuf[8];
|
||||
int offs;
|
||||
|
@ -3103,7 +3105,9 @@ int kenwood_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *optio
|
|||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
if (!ant)
|
||||
*ant_tx = *ant_rx = RIG_ANT_UNKNOWN;
|
||||
|
||||
if (!ant_curr)
|
||||
{
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
@ -3129,7 +3133,7 @@ int kenwood_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *optio
|
|||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
*ant = RIG_ANT_N(ackbuf[offs] - '1');
|
||||
*ant_curr = RIG_ANT_N(ackbuf[offs] - '1');
|
||||
|
||||
/* XXX check that the returned antenna is valid for the current rig */
|
||||
|
||||
|
@ -3340,7 +3344,8 @@ int kenwood_get_trn(RIG *rig, int *trn)
|
|||
*/
|
||||
int kenwood_set_powerstat(RIG *rig, powerstat_t status)
|
||||
{
|
||||
int retval = kenwood_transaction(rig, (status == RIG_POWER_ON) ? "PS1" : "PS0", NULL, 0);
|
||||
int retval = kenwood_transaction(rig, (status == RIG_POWER_ON) ? "PS1" : "PS0",
|
||||
NULL, 0);
|
||||
int i = 0;
|
||||
int retry = 3 / rig->state.rigport.retry;
|
||||
|
||||
|
@ -3470,6 +3475,7 @@ int kenwood_send_morse(RIG *rig, vfo_t vfo, const char *msg)
|
|||
while (msg_len > 0)
|
||||
{
|
||||
int buff_len;
|
||||
|
||||
/*
|
||||
* Check with "KY" if char buffer is available.
|
||||
* if not, sleep.
|
||||
|
|
|
@ -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 dummy, ant_t *ant, value_t *option);
|
||||
int kenwood_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx);
|
||||
int 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);
|
||||
|
|
|
@ -564,7 +564,7 @@ int pihspdr_get_channel(RIG *rig, channel_t *chan)
|
|||
}
|
||||
|
||||
int pihspdr_set_channel(RIG *rig, const channel_t *chan)
|
||||
{
|
||||
{
|
||||
char sqltype;
|
||||
char shift;
|
||||
char buf[128];
|
||||
|
|
|
@ -2196,6 +2196,7 @@ int th_get_channel(RIG *rig, channel_t *chan)
|
|||
if (chan->channel_desc[0] == '\0')
|
||||
{
|
||||
size_t ack_len;
|
||||
|
||||
if (chan_caps[1].type == RIG_MTYPE_PRIO)
|
||||
{
|
||||
sprintf(membuf, "MNA %sI-%01d", mr_extra, channel_num);
|
||||
|
@ -2453,21 +2454,21 @@ int th_set_channel(RIG *rig, const channel_t *chan)
|
|||
|
||||
/* Step can be hexa */
|
||||
snprintf(membuf, sizeof(membuf),
|
||||
"%8s,%011"PRIll",%X,%d,%d,%d,%d,%d,%02d,%02d,%03d,%09"PRIll",%d%10s",
|
||||
req, (int64_t)chan->freq, step, shift, rev, tone,
|
||||
ctcss, dcs, tonefq, ctcssfq, dcscode,
|
||||
(int64_t)labs((long)(chan->rptr_offs)), mode, lockoutstr
|
||||
);
|
||||
"%8s,%011"PRIll",%X,%d,%d,%d,%d,%d,%02d,%02d,%03d,%09"PRIll",%d%10s",
|
||||
req, (int64_t)chan->freq, step, shift, rev, tone,
|
||||
ctcss, dcs, tonefq, ctcssfq, dcscode,
|
||||
(int64_t)labs((long)(chan->rptr_offs)), mode, lockoutstr
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
/* Without DCS,mode */
|
||||
sprintf(membuf, "%s,%011"PRIll",%X,%d,%d,%d,%d,,%02d,,%02d,%09"PRIll"%s",
|
||||
req, (int64_t)chan->freq, step, shift, rev, tone,
|
||||
ctcss, tonefq, ctcssfq,
|
||||
(int64_t)labs((long)(chan->rptr_offs)), lockoutstr
|
||||
);
|
||||
req, (int64_t)chan->freq, step, shift, rev, tone,
|
||||
ctcss, tonefq, ctcssfq,
|
||||
(int64_t)labs((long)(chan->rptr_offs)), lockoutstr
|
||||
);
|
||||
}
|
||||
|
||||
retval = kenwood_transaction(rig, membuf, NULL, 0);
|
||||
|
@ -2552,13 +2553,16 @@ 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 dummy, ant_t *ant, value_t *option)
|
||||
int th_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option,
|
||||
ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
|
||||
{
|
||||
char buf[8];
|
||||
int retval;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s\n", __func__);
|
||||
|
||||
*ant_tx = *ant_rx = RIG_ANT_UNKNOWN;
|
||||
|
||||
retval = kenwood_safe_transaction(rig, "ANT", buf, sizeof(buf), 5);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
|
@ -2571,9 +2575,9 @@ int th_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *option)
|
|||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
*ant = RIG_ANT_N(buf[4] - '0');
|
||||
*ant_curr = RIG_ANT_N(buf[4] - '0');
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: ant = %d\n", __func__, *ant);
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: ant = %d\n", __func__, *ant_curr);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include "idx_builtin.h"
|
||||
|
||||
#define TH_VER "0.5"
|
||||
#define TH_VER "0.6"
|
||||
|
||||
extern int th_transaction (RIG *rig, const char *cmdstr, char *data, size_t datasize);
|
||||
extern int th_get_vfo_char(RIG *rig, vfo_t *vfo, char *vfoch);
|
||||
|
@ -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 dummy, ant_t * ant, value_t *option);
|
||||
extern int th_get_ant (RIG * rig, vfo_t vfo, ant_t dummy, value_t *option, ant_t * ant_curr, ant_t *ant_tx, ant_t *ant_rx);
|
||||
extern int th_reset(RIG *rig, reset_t reset);
|
||||
extern int th_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch);
|
||||
|
||||
|
|
|
@ -282,20 +282,11 @@ const struct rig_caps thf6a_caps =
|
|||
|
||||
int thf6a_init(RIG *rig)
|
||||
{
|
||||
rig->state.itu_region = RIG_ITU_REGION2;
|
||||
return kenwood_init(rig);
|
||||
}
|
||||
|
||||
int thf6a_open(RIG *rig)
|
||||
{
|
||||
/* TH-F7E is Region 1 only.
|
||||
* Region 2 is supported by TH-F6A
|
||||
*/
|
||||
if (rig->state.itu_region != RIG_ITU_REGION2)
|
||||
{
|
||||
return -RIG_ECONF;
|
||||
}
|
||||
|
||||
return kenwood_open(rig);
|
||||
}
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ const struct rig_caps thf7e_caps =
|
|||
.rig_model = RIG_MODEL_THF7E,
|
||||
.model_name = "TH-F7E",
|
||||
.mfg_name = "Kenwood",
|
||||
.version = TH_VER ".1",
|
||||
.version = TH_VER ".2",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_BETA,
|
||||
.rig_type = RIG_TYPE_HANDHELD,
|
||||
|
@ -276,20 +276,11 @@ const struct rig_caps thf7e_caps =
|
|||
|
||||
int thf7e_init(RIG *rig)
|
||||
{
|
||||
rig->state.itu_region = RIG_ITU_REGION1;
|
||||
return kenwood_init(rig);
|
||||
}
|
||||
|
||||
int thf7e_open(RIG *rig)
|
||||
{
|
||||
/* TH-F7E is Region 1 only.
|
||||
* Region 2 is supported by TH-F6A
|
||||
*/
|
||||
if (rig->state.itu_region != RIG_ITU_REGION1)
|
||||
{
|
||||
return -RIG_ECONF;
|
||||
}
|
||||
|
||||
return kenwood_open(rig);
|
||||
}
|
||||
|
||||
|
|
|
@ -508,7 +508,7 @@ int thg71_open(RIG *rig)
|
|||
for (i = 0; i < FRQRANGESIZ; i++)
|
||||
{
|
||||
freq_range_t frng;
|
||||
char *strl,*stru;
|
||||
char *strl, *stru;
|
||||
|
||||
strl = strtok(NULL, ",");
|
||||
stru = strtok(NULL, ",");
|
||||
|
|
|
@ -348,7 +348,8 @@ ts570_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
{
|
||||
sprintf(levelbuf, "PA0");
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAXDBLSTSIZ; i++)
|
||||
|
|
|
@ -172,7 +172,8 @@ int dds60_init(RIG *rig)
|
|||
{
|
||||
struct dds60_priv_data *priv;
|
||||
|
||||
rig->state.priv = (struct dds60_priv_data *)malloc(sizeof(struct dds60_priv_data));
|
||||
rig->state.priv = (struct dds60_priv_data *)malloc(sizeof(
|
||||
struct dds60_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
|
|
@ -172,7 +172,8 @@ int drt1_init(RIG *rig)
|
|||
{
|
||||
struct drt1_priv_data *priv;
|
||||
|
||||
rig->state.priv = (struct drt1_priv_data *)malloc(sizeof(struct drt1_priv_data));
|
||||
rig->state.priv = (struct drt1_priv_data *)malloc(sizeof(
|
||||
struct drt1_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
|
|
@ -229,7 +229,8 @@ int dwtdll_init(RIG *rig)
|
|||
{
|
||||
struct dwtdll_priv_data *priv;
|
||||
|
||||
rig->state.priv = (struct dwtdll_priv_data *)malloc(sizeof(struct dwtdll_priv_data));
|
||||
rig->state.priv = (struct dwtdll_priv_data *)malloc(sizeof(
|
||||
struct dwtdll_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
|
|
@ -165,7 +165,7 @@ int elektor304_init(RIG *rig)
|
|||
struct elektor304_priv_data *priv;
|
||||
|
||||
rig->state.priv = (struct elektor304_priv_data *)malloc(sizeof(struct
|
||||
elektor304_priv_data));
|
||||
elektor304_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
|
|
@ -54,7 +54,8 @@ 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 dummy, ant_t *ant, value_t *option);
|
||||
static int elektor507_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option,
|
||||
ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx);
|
||||
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);
|
||||
|
||||
|
@ -380,7 +381,7 @@ int elektor507_init(RIG *rig)
|
|||
struct elektor507_priv_data *priv;
|
||||
|
||||
rig->state.priv = (struct elektor507_priv_data *)calloc(sizeof(struct
|
||||
elektor507_priv_data), 1);
|
||||
elektor507_priv_data), 1);
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
@ -1191,12 +1192,13 @@ 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 dummy, ant_t *ant, value_t *option)
|
||||
int elektor507_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option,
|
||||
ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
|
||||
{
|
||||
struct elektor507_priv_data *priv = (struct elektor507_priv_data *)
|
||||
rig->state.priv;
|
||||
|
||||
*ant = priv->ant;
|
||||
*ant_curr = priv->ant;
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
|
|
@ -333,7 +333,7 @@ int fifisdr_init(RIG *rig)
|
|||
struct fifisdr_priv_instance_data *priv;
|
||||
|
||||
rig->state.priv = (struct fifisdr_priv_instance_data *)calloc(sizeof(
|
||||
struct fifisdr_priv_instance_data), 1);
|
||||
struct fifisdr_priv_instance_data), 1);
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
|
|
@ -233,7 +233,8 @@ int funcube_init(RIG *rig)
|
|||
hamlib_port_t *rp = &rig->state.rigport;
|
||||
struct funcube_priv_data *priv;
|
||||
|
||||
rig->state.priv = (struct funcube_priv_data *)calloc(sizeof(struct funcube_priv_data), 1);
|
||||
rig->state.priv = (struct funcube_priv_data *)calloc(sizeof(
|
||||
struct funcube_priv_data), 1);
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
@ -262,7 +263,8 @@ int funcubeplus_init(RIG *rig)
|
|||
hamlib_port_t *rp = &rig->state.rigport;
|
||||
struct funcube_priv_data *priv;
|
||||
|
||||
rig->state.priv = (struct funcube_priv_data *)calloc(sizeof(struct funcube_priv_data), 1);
|
||||
rig->state.priv = (struct funcube_priv_data *)calloc(sizeof(
|
||||
struct funcube_priv_data), 1);
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
|
|
@ -294,7 +294,8 @@ int hiqsdr_init(RIG *rig)
|
|||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
rig->state.priv = (struct hiqsdr_priv_data *)malloc(sizeof(struct hiqsdr_priv_data));
|
||||
rig->state.priv = (struct hiqsdr_priv_data *)malloc(sizeof(
|
||||
struct hiqsdr_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
|
|
@ -572,7 +572,7 @@ int si570avrusb_init(RIG *rig)
|
|||
struct si570xxxusb_priv_data *priv;
|
||||
|
||||
rig->state.priv = (struct si570xxxusb_priv_data *)calloc(sizeof(struct
|
||||
si570xxxusb_priv_data), 1);
|
||||
si570xxxusb_priv_data), 1);
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
@ -613,7 +613,7 @@ int si570peaberry1_init(RIG *rig)
|
|||
struct si570xxxusb_priv_data *priv;
|
||||
|
||||
rig->state.priv = (struct si570xxxusb_priv_data *)calloc(sizeof(struct
|
||||
si570xxxusb_priv_data), 1);
|
||||
si570xxxusb_priv_data), 1);
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
@ -654,7 +654,7 @@ int si570peaberry2_init(RIG *rig)
|
|||
struct si570xxxusb_priv_data *priv;
|
||||
|
||||
rig->state.priv = (struct si570xxxusb_priv_data *)calloc(sizeof(struct
|
||||
si570xxxusb_priv_data), 1);
|
||||
si570xxxusb_priv_data), 1);
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
@ -695,7 +695,7 @@ int si570picusb_init(RIG *rig)
|
|||
struct si570xxxusb_priv_data *priv;
|
||||
|
||||
rig->state.priv = (struct si570xxxusb_priv_data *)calloc(sizeof(struct
|
||||
si570xxxusb_priv_data), 1);
|
||||
si570xxxusb_priv_data), 1);
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
@ -736,7 +736,7 @@ int fasdr_init(RIG *rig)
|
|||
struct si570xxxusb_priv_data *priv;
|
||||
|
||||
rig->state.priv = (struct si570xxxusb_priv_data *)calloc(sizeof(struct
|
||||
si570xxxusb_priv_data), 1);
|
||||
si570xxxusb_priv_data), 1);
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
@ -983,14 +983,15 @@ static int setBPF(RIG *rig, int enable)
|
|||
{
|
||||
int i;
|
||||
int retval = libusb_control_transfer(udh, REQUEST_TYPE_IN,
|
||||
REQUEST_FILTERS, enable, (nBytes / 2) - 1,
|
||||
(unsigned char *) FilterCrossOver, sizeof(FilterCrossOver),
|
||||
rig->state.rigport.timeout);
|
||||
REQUEST_FILTERS, enable, (nBytes / 2) - 1,
|
||||
(unsigned char *) FilterCrossOver, sizeof(FilterCrossOver),
|
||||
rig->state.rigport.timeout);
|
||||
|
||||
if (retval < 2)
|
||||
{
|
||||
return -RIG_EIO;
|
||||
}
|
||||
|
||||
nBytes = retval;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: Filter Bank 1:\n", __func__);
|
||||
|
|
|
@ -294,7 +294,7 @@ const char *lowe_get_info(RIG *rig)
|
|||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE,"%s: INF didn't work\n", __func__);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: INF didn't work\n", __func__);
|
||||
// non-fatal
|
||||
}
|
||||
|
||||
|
|
|
@ -862,6 +862,7 @@ pcr_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
if (width != RIG_PASSBAND_NOCHANGE)
|
||||
{
|
||||
int pcrfilter;
|
||||
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
{
|
||||
width = rig_passband_normal(rig, mode);
|
||||
|
|
|
@ -224,7 +224,8 @@ int ra37xx_init(RIG *rig)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
rig->state.priv = (struct ra37xx_priv_data *)malloc(sizeof(struct ra37xx_priv_data));
|
||||
rig->state.priv = (struct ra37xx_priv_data *)malloc(sizeof(
|
||||
struct ra37xx_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
@ -377,7 +378,7 @@ int ra37xx_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
int ra37xx_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
{
|
||||
//struct ra37xx_priv_data *priv = (struct ra37xx_priv_data*)rig->state.priv;
|
||||
int ra_mode, widthtype, widthnum=0;
|
||||
int ra_mode, widthtype, widthnum = 0;
|
||||
char buf[BUFSZ];
|
||||
|
||||
switch (mode)
|
||||
|
@ -407,7 +408,9 @@ int ra37xx_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
rig_passband_normal(rig, mode);
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: widthtype = %i, widthnum = %i not implemented\n", __func__, widthtype, widthnum);
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"%s: widthtype = %i, widthnum = %i not implemented\n", __func__, widthtype,
|
||||
widthnum);
|
||||
#ifdef XXREMOVEDXX
|
||||
widthtype = 0; /* FIXME: no bandwidth for now */
|
||||
widthnum = 0;
|
||||
|
@ -751,11 +754,14 @@ 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 dummy, ant_t *ant, value_t *option)
|
||||
int ra37xx_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option,
|
||||
ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
|
||||
{
|
||||
char buf[BUFSZ];
|
||||
int retval, buflen, ra_ant;
|
||||
|
||||
*ant_tx = *ant_rx = RIG_ANT_UNKNOWN;
|
||||
|
||||
retval = ra37xx_transaction(rig, "QANT", buf, &buflen);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
|
@ -770,10 +776,10 @@ int ra37xx_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *option
|
|||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
*ant = ((ra_ant & (1 << 0)) ? RIG_ANT_1 : 0) |
|
||||
((ra_ant & (1 << 1)) ? RIG_ANT_2 : 0) |
|
||||
((ra_ant & (1 << 2)) ? RIG_ANT_3 : 0) |
|
||||
((ra_ant & (1 << 3)) ? RIG_ANT_4 : 0);
|
||||
*ant_curr = ((ra_ant & (1 << 0)) ? RIG_ANT_1 : 0) |
|
||||
((ra_ant & (1 << 1)) ? RIG_ANT_2 : 0) |
|
||||
((ra_ant & (1 << 2)) ? RIG_ANT_3 : 0) |
|
||||
((ra_ant & (1 << 3)) ? RIG_ANT_4 : 0);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
|
|
@ -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 dummy, ant_t *ant, value_t *option);
|
||||
int ra37xx_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx);
|
||||
int 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);
|
||||
|
|
|
@ -128,7 +128,8 @@ int racal_init(RIG *rig)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
rig->state.priv = (struct racal_priv_data *)malloc(sizeof(struct racal_priv_data));
|
||||
rig->state.priv = (struct racal_priv_data *)malloc(sizeof(
|
||||
struct racal_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
|
|
@ -470,6 +470,7 @@ gp2000_get_info(RIG *rig)
|
|||
}
|
||||
|
||||
p = strtok(infobuf, ",");
|
||||
|
||||
while (p)
|
||||
{
|
||||
switch (p[0])
|
||||
|
|
|
@ -294,13 +294,15 @@ int tt538_init(RIG *rig)
|
|||
{
|
||||
struct tt538_priv_data *priv;
|
||||
|
||||
rig->state.priv = (struct tt538_priv_data *) malloc(sizeof(struct tt538_priv_data));
|
||||
rig->state.priv = (struct tt538_priv_data *) malloc(sizeof(
|
||||
struct tt538_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
/* whoops! memory shortage! */
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
priv = rig->state.priv;
|
||||
|
||||
memset(priv, 0, sizeof(struct tt538_priv_data));
|
||||
|
@ -816,7 +818,7 @@ int tt538_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
that integer (S units * 256) */
|
||||
{
|
||||
char hex[5];
|
||||
int i;
|
||||
int i;
|
||||
unsigned int ival;
|
||||
|
||||
for (i = 0; i < 4; i++) { hex[i] = lvlbuf[i + 1]; }
|
||||
|
|
|
@ -330,13 +330,15 @@ int tt588_init(RIG *rig)
|
|||
struct tt588_priv_data *priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s:\n", __func__);
|
||||
rig->state.priv = (struct tt588_priv_data *) malloc(sizeof(struct tt588_priv_data));
|
||||
rig->state.priv = (struct tt588_priv_data *) malloc(sizeof(
|
||||
struct tt588_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
/* whoops! memory shortage! */
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
priv = rig->state.priv;
|
||||
|
||||
memset(priv, 0, sizeof(struct tt588_priv_data));
|
||||
|
|
|
@ -229,9 +229,11 @@ static int tt565_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
|
|||
int tt565_init(RIG *rig)
|
||||
{
|
||||
struct tt565_priv_data *priv;
|
||||
rig->state.priv = (struct tt565_priv_data *)malloc(sizeof(struct tt565_priv_data));
|
||||
rig->state.priv = (struct tt565_priv_data *)malloc(sizeof(
|
||||
struct tt565_priv_data));
|
||||
|
||||
if (!rig->state.priv) { return -RIG_ENOMEM; } /* no memory available */
|
||||
|
||||
priv = rig->state.priv;
|
||||
|
||||
memset(priv, 0, sizeof(struct tt565_priv_data));
|
||||
|
@ -2116,11 +2118,14 @@ 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 dummy, ant_t *ant, value_t *option)
|
||||
int tt565_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option,
|
||||
ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
|
||||
{
|
||||
char respbuf[TT565_BUFSIZE];
|
||||
int resp_len, retval;
|
||||
|
||||
*ant_tx = *ant_rx = RIG_ANT_UNKNOWN;
|
||||
|
||||
resp_len = sizeof(respbuf);
|
||||
retval = tt565_transaction(rig, "?KA" EOM, 4, respbuf, &resp_len);
|
||||
|
||||
|
@ -2139,17 +2144,17 @@ int tt565_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *option)
|
|||
/* Look for first occurrence of M or S in ant 1, 2, 3 characters */
|
||||
if (respbuf[3] == which_receiver(rig, vfo) || respbuf[3] == 'B')
|
||||
{
|
||||
*ant = RIG_ANT_1;
|
||||
*ant_curr = RIG_ANT_1;
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
if (respbuf[4] == which_receiver(rig, vfo) || respbuf[4] == 'B')
|
||||
{
|
||||
*ant = RIG_ANT_2;
|
||||
*ant_curr = RIG_ANT_2;
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
*ant = RIG_ANT_NONE; /* ignore possible RIG_ANT_3 = rx only ant */
|
||||
*ant_curr = RIG_ANT_NONE; /* ignore possible RIG_ANT_3 = rx only ant */
|
||||
return RIG_OK;
|
||||
}
|
||||
/* End of orion.c */
|
||||
|
|
|
@ -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 dummy, ant_t *ant, value_t *option);
|
||||
static int tt565_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx);
|
||||
|
||||
/** \brief Orion private data */
|
||||
struct tt565_priv_data {
|
||||
|
|
|
@ -214,7 +214,8 @@ int tt585_init(RIG *rig)
|
|||
{
|
||||
struct tt585_priv_data *priv;
|
||||
|
||||
rig->state.priv = (struct tt585_priv_data *) malloc(sizeof(struct tt585_priv_data));
|
||||
rig->state.priv = (struct tt585_priv_data *) malloc(sizeof(
|
||||
struct tt585_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
|
|
@ -276,7 +276,7 @@ static int rx331_transaction(RIG *rig, const char *cmd, int cmd_len, char *data,
|
|||
return retval;
|
||||
}
|
||||
|
||||
snprintf(fmt,sizeof(fmt)-1,"%%i%%%ds",BUFSZ);
|
||||
snprintf(fmt, sizeof(fmt) - 1, "%%i%%%ds", BUFSZ);
|
||||
sscanf(data + 1, fmt, &rig_id, data);
|
||||
|
||||
if (rig_id != priv->receiver_id)
|
||||
|
@ -297,13 +297,15 @@ int rx331_init(RIG *rig)
|
|||
{
|
||||
struct rx331_priv_data *priv;
|
||||
|
||||
rig->state.priv = (struct rx331_priv_data *)malloc(sizeof(struct rx331_priv_data));
|
||||
rig->state.priv = (struct rx331_priv_data *)malloc(sizeof(
|
||||
struct rx331_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
/* whoops! memory shortage! */
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
priv = rig->state.priv;
|
||||
|
||||
memset(priv, 0, sizeof(struct rx331_priv_data));
|
||||
|
|
|
@ -111,7 +111,8 @@ int tentec_init(RIG *rig)
|
|||
{
|
||||
struct tentec_priv_data *priv;
|
||||
|
||||
rig->state.priv = (struct tentec_priv_data *)malloc(sizeof(struct tentec_priv_data));
|
||||
rig->state.priv = (struct tentec_priv_data *)malloc(sizeof(
|
||||
struct tentec_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
|
|
@ -367,7 +367,8 @@ tt550_init(RIG *rig)
|
|||
{
|
||||
struct tt550_priv_data *priv;
|
||||
|
||||
rig->state.priv = (struct tt550_priv_data *) malloc(sizeof(struct tt550_priv_data));
|
||||
rig->state.priv = (struct tt550_priv_data *) malloc(sizeof(
|
||||
struct tt550_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
|
|
@ -233,7 +233,8 @@ int g313_init(RIG *rig)
|
|||
{
|
||||
struct g313_priv_data *priv;
|
||||
|
||||
rig->state.priv = (struct g313_priv_data *)malloc(sizeof(struct g313_priv_data));
|
||||
rig->state.priv = (struct g313_priv_data *)malloc(sizeof(
|
||||
struct g313_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
|
|
@ -106,6 +106,7 @@ int wr_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
|
||||
default: return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default: return -RIG_EINVAL;
|
||||
|
|
|
@ -328,7 +328,8 @@ int ft100_init(RIG *rig)
|
|||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
rig->state.priv = (struct ft100_priv_data *) calloc(1, sizeof(struct ft100_priv_data));
|
||||
rig->state.priv = (struct ft100_priv_data *) calloc(1,
|
||||
sizeof(struct ft100_priv_data));
|
||||
|
||||
if (!rig->state.priv) { return -RIG_ENOMEM; }
|
||||
|
||||
|
|
|
@ -315,7 +315,8 @@ int ft1000d_init(RIG *rig)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
rig->state.priv = (struct ft1000d_priv_data *) calloc(1, sizeof(struct ft1000d_priv_data));
|
||||
rig->state.priv = (struct ft1000d_priv_data *) calloc(1,
|
||||
sizeof(struct ft1000d_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
@ -2364,7 +2365,8 @@ int ft1000d_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *value)
|
|||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: passed vfo %s\n", __func__, rig_strvfo(vfo));
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: passed level %s\n", __func__, rig_strlevel(level));
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: passed level %s\n", __func__,
|
||||
rig_strlevel(level));
|
||||
|
||||
priv = (struct ft1000d_priv_data *) rig->state.priv;
|
||||
|
||||
|
|
|
@ -599,12 +599,14 @@ int ft1000mp_init(RIG *rig)
|
|||
rig_debug(RIG_DEBUG_TRACE, "%s: called \n", __func__);
|
||||
|
||||
|
||||
rig->state.priv = (struct ft1000mp_priv_data *) calloc(1, sizeof(struct ft1000mp_priv_data));
|
||||
rig->state.priv = (struct ft1000mp_priv_data *) calloc(1,
|
||||
sizeof(struct ft1000mp_priv_data));
|
||||
|
||||
if (!rig->state.priv) /* whoops! memory shortage! */
|
||||
{
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
priv = rig->state.priv;
|
||||
|
||||
/*
|
||||
|
@ -613,7 +615,8 @@ int ft1000mp_init(RIG *rig)
|
|||
memcpy(priv->pcs, ncmd, sizeof(ncmd));
|
||||
|
||||
/* TODO: read pacing from preferences */
|
||||
priv->pacing = FT1000MP_PACING_DEFAULT_VALUE; /* set pacing to minimum for now */
|
||||
priv->pacing =
|
||||
FT1000MP_PACING_DEFAULT_VALUE; /* set pacing to minimum for now */
|
||||
priv->read_update_delay =
|
||||
FT1000MP_DEFAULT_READ_TIMEOUT; /* set update timeout to safe value */
|
||||
priv->current_vfo = RIG_VFO_A; /* default to VFO_A ? */
|
||||
|
|
|
@ -244,7 +244,8 @@ int ft600_init(RIG *rig)
|
|||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
rig->state.priv = (struct ft600_priv_data *) calloc(1, sizeof(struct ft600_priv_data));
|
||||
rig->state.priv = (struct ft600_priv_data *) calloc(1,
|
||||
sizeof(struct ft600_priv_data));
|
||||
|
||||
if (!rig->state.priv) { return -RIG_ENOMEM; }
|
||||
|
||||
|
|
|
@ -225,12 +225,14 @@ int ft736_open(RIG *rig)
|
|||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__);
|
||||
|
||||
rig->state.priv = (struct ft736_priv_data *) calloc(1, sizeof(struct ft736_priv_data));
|
||||
rig->state.priv = (struct ft736_priv_data *) calloc(1,
|
||||
sizeof(struct ft736_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
priv = rig->state.priv;
|
||||
|
||||
priv->split = RIG_SPLIT_OFF;
|
||||
|
|
|
@ -306,7 +306,8 @@ const struct rig_caps ft747_caps =
|
|||
|
||||
int ft747_init(RIG *rig)
|
||||
{
|
||||
rig->state.priv = (struct ft747_priv_data *) calloc(1, sizeof(struct ft747_priv_data));
|
||||
rig->state.priv = (struct ft747_priv_data *) calloc(1,
|
||||
sizeof(struct ft747_priv_data));
|
||||
|
||||
if (!rig->state.priv) /* whoops! memory shortage! */
|
||||
{
|
||||
|
|
|
@ -333,7 +333,8 @@ int ft757_init(RIG *rig)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
rig->state.priv = (struct ft757_priv_data *) calloc(1, sizeof(struct ft757_priv_data));
|
||||
rig->state.priv = (struct ft757_priv_data *) calloc(1,
|
||||
sizeof(struct ft757_priv_data));
|
||||
|
||||
if (!rig->state.priv) /* whoops! memory shortage! */
|
||||
{
|
||||
|
@ -346,7 +347,8 @@ int ft757_init(RIG *rig)
|
|||
|
||||
/* TODO: read pacing from preferences */
|
||||
|
||||
priv->pacing = FT757GX_PACING_DEFAULT_VALUE; /* set pacing to minimum for now */
|
||||
priv->pacing =
|
||||
FT757GX_PACING_DEFAULT_VALUE; /* set pacing to minimum for now */
|
||||
priv->read_update_delay =
|
||||
FT757GX_DEFAULT_READ_TIMEOUT; /* set update timeout to safe value */
|
||||
priv->current_vfo = RIG_VFO_A; /* default to VFO_A ? */
|
||||
|
|
|
@ -396,12 +396,14 @@ int ft767_init(RIG *rig)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
rig->state.priv = (struct ft767_priv_data *) calloc(1, sizeof(struct ft767_priv_data));
|
||||
rig->state.priv = (struct ft767_priv_data *) calloc(1,
|
||||
sizeof(struct ft767_priv_data));
|
||||
|
||||
if (!rig->state.priv) /* whoops! memory shortage! */
|
||||
{
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
priv = rig->state.priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__);
|
||||
|
@ -1475,9 +1477,12 @@ int ft767_send_block_and_ack(RIG *rig, unsigned char *cmd, size_t length)
|
|||
retval = read_block(&rig->state.rigport,
|
||||
(char *) cmd_echo_buf,
|
||||
YAESU_CMD_LENGTH);
|
||||
if (retval < 0) {
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: read_block failed: %s\n", __func__, rigerror(retval));
|
||||
return retval;
|
||||
|
||||
if (retval < 0)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: read_block failed: %s\n", __func__,
|
||||
rigerror(retval));
|
||||
return retval;
|
||||
}
|
||||
|
||||
/* see if it matches the command we sent */
|
||||
|
|
|
@ -528,8 +528,10 @@ int ft817_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
return -RIG_ENTARGET;
|
||||
}
|
||||
|
||||
if (check_cache_timeout(&p->fm_status_tv)) {
|
||||
if (check_cache_timeout(&p->fm_status_tv))
|
||||
{
|
||||
int n;
|
||||
|
||||
if ((n = ft817_get_status(rig, FT817_NATIVE_CAT_GET_FREQ_MODE_STATUS)) < 0)
|
||||
{
|
||||
return n;
|
||||
|
@ -647,8 +649,10 @@ int ft817_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
|
|||
return -RIG_ENTARGET;
|
||||
}
|
||||
|
||||
if (check_cache_timeout(&p->tx_status_tv)) {
|
||||
if (check_cache_timeout(&p->tx_status_tv))
|
||||
{
|
||||
int n;
|
||||
|
||||
if ((n = ft817_get_status(rig, FT817_NATIVE_CAT_GET_TX_STATUS)) < 0)
|
||||
{
|
||||
return n;
|
||||
|
@ -664,8 +668,10 @@ static int ft817_get_pometer_level(RIG *rig, value_t *val)
|
|||
{
|
||||
struct ft817_priv_data *p = (struct ft817_priv_data *) rig->state.priv;
|
||||
|
||||
if (check_cache_timeout(&p->tx_status_tv)) {
|
||||
if (check_cache_timeout(&p->tx_status_tv))
|
||||
{
|
||||
int n;
|
||||
|
||||
if ((n = ft817_get_status(rig, FT817_NATIVE_CAT_GET_TX_STATUS)) < 0)
|
||||
{
|
||||
return n;
|
||||
|
@ -734,8 +740,10 @@ static int ft817_get_raw_smeter_level(RIG *rig, value_t *val)
|
|||
{
|
||||
struct ft817_priv_data *p = (struct ft817_priv_data *) rig->state.priv;
|
||||
|
||||
if (check_cache_timeout(&p->rx_status_tv)) {
|
||||
if (check_cache_timeout(&p->rx_status_tv))
|
||||
{
|
||||
int n;
|
||||
|
||||
if ((n = ft817_get_status(rig, FT817_NATIVE_CAT_GET_RX_STATUS)) < 0)
|
||||
{
|
||||
return n;
|
||||
|
@ -787,13 +795,15 @@ int ft817_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
|
|||
return -RIG_ENTARGET;
|
||||
}
|
||||
|
||||
if (check_cache_timeout(&p->rx_status_tv)) {
|
||||
if (check_cache_timeout(&p->rx_status_tv))
|
||||
{
|
||||
int n;
|
||||
|
||||
if ((n = ft817_get_status(rig, FT817_NATIVE_CAT_GET_RX_STATUS)) < 0)
|
||||
{
|
||||
return n;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: consider bit 6 too ??? (CTCSS/DCS code match) */
|
||||
if (p->rx_status & 0x80)
|
||||
|
@ -1007,7 +1017,7 @@ int ft817_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
|
|||
if (ptt_response != ptt)
|
||||
{
|
||||
hl_usleep(1000l *
|
||||
FT817_RETRY_DELAY); // Wait before next try. Helps with slower rigs cloning FT817 protocol (e.g. MCHF)
|
||||
FT817_RETRY_DELAY); // Wait before next try. Helps with slower rigs cloning FT817 protocol (e.g. MCHF)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1291,7 +1301,7 @@ int ft817_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op)
|
|||
{
|
||||
switch (op)
|
||||
{
|
||||
int n;
|
||||
int n;
|
||||
|
||||
case RIG_OP_TOGGLE:
|
||||
rig_force_cache_timeout(&((struct ft817_priv_data *)
|
||||
|
|
|
@ -356,12 +356,14 @@ static int ft840_init(RIG *rig)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
rig->state.priv = (struct ft840_priv_data *) calloc(1, sizeof(struct ft840_priv_data));
|
||||
rig->state.priv = (struct ft840_priv_data *) calloc(1,
|
||||
sizeof(struct ft840_priv_data));
|
||||
|
||||
if (!rig->state.priv) /* whoops! memory shortage! */
|
||||
{
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
priv = rig->state.priv;
|
||||
|
||||
/*
|
||||
|
|
|
@ -532,13 +532,15 @@ int ft847_init(RIG *rig)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
rig->state.priv = (struct ft847_priv_data *) calloc(1, sizeof(struct ft847_priv_data));
|
||||
rig->state.priv = (struct ft847_priv_data *) calloc(1,
|
||||
sizeof(struct ft847_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
/* whoops! memory shortage! */
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
priv = rig->state.priv;
|
||||
|
||||
|
||||
|
@ -548,7 +550,8 @@ int ft847_init(RIG *rig)
|
|||
/* until these are set we won't know what the values are */
|
||||
priv->freqA = 1; /* 1Hz default */
|
||||
priv->freqB = 1; /* 1Hz default */
|
||||
priv->mode = RIG_MODE_USB; /* mode USB by default to avoid users not setting mode */
|
||||
priv->mode =
|
||||
RIG_MODE_USB; /* mode USB by default to avoid users not setting mode */
|
||||
priv->width = 1; /* 1Hz default */
|
||||
|
||||
return RIG_OK;
|
||||
|
|
|
@ -576,13 +576,15 @@ int ft857_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
return -RIG_ENTARGET;
|
||||
}
|
||||
|
||||
if (check_cache_timeout(&p->fm_status_tv)) {
|
||||
if (check_cache_timeout(&p->fm_status_tv))
|
||||
{
|
||||
int n;
|
||||
|
||||
if ((n = ft857_get_status(rig, FT857_NATIVE_CAT_GET_FREQ_MODE_STATUS)) < 0)
|
||||
{
|
||||
return n;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
*freq = from_bcd_be(p->fm_status, 8) * 10;
|
||||
|
||||
|
@ -667,8 +669,10 @@ int ft857_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
return -RIG_ENTARGET;
|
||||
}
|
||||
|
||||
if (check_cache_timeout(&p->fm_status_tv)) {
|
||||
if (check_cache_timeout(&p->fm_status_tv))
|
||||
{
|
||||
int n;
|
||||
|
||||
if ((n = ft857_get_status(rig, FT857_NATIVE_CAT_GET_FREQ_MODE_STATUS)) < 0)
|
||||
{
|
||||
return n;
|
||||
|
@ -748,12 +752,14 @@ int ft857_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
|
|||
int ft857_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
|
||||
{
|
||||
struct ft857_priv_data *p = (struct ft857_priv_data *) rig->state.priv;
|
||||
|
||||
if (vfo != RIG_VFO_CURR)
|
||||
{
|
||||
return -RIG_ENTARGET;
|
||||
}
|
||||
|
||||
if (check_cache_timeout(&p->tx_status_tv)) {
|
||||
if (check_cache_timeout(&p->tx_status_tv))
|
||||
{
|
||||
int n;
|
||||
|
||||
if ((n = ft857_get_status(rig, FT857_NATIVE_CAT_GET_TX_STATUS)) < 0)
|
||||
|
@ -771,8 +777,10 @@ static int ft857_get_pometer_level(RIG *rig, value_t *val)
|
|||
{
|
||||
struct ft857_priv_data *p = (struct ft857_priv_data *) rig->state.priv;
|
||||
|
||||
if (check_cache_timeout(&p->tx_status_tv)) {
|
||||
if (check_cache_timeout(&p->tx_status_tv))
|
||||
{
|
||||
int n;
|
||||
|
||||
if ((n = ft857_get_status(rig, FT857_NATIVE_CAT_GET_TX_STATUS)) < 0)
|
||||
{
|
||||
return n;
|
||||
|
@ -845,13 +853,15 @@ int ft857_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
|
|||
return -RIG_ENTARGET;
|
||||
}
|
||||
|
||||
if (check_cache_timeout(&p->rx_status_tv)) {
|
||||
if (check_cache_timeout(&p->rx_status_tv))
|
||||
{
|
||||
int n;
|
||||
|
||||
if ((n = ft857_get_status(rig, FT857_NATIVE_CAT_GET_RX_STATUS)) < 0)
|
||||
{
|
||||
return n;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: consider bit 6 too ??? (CTCSS/DCS code match) */
|
||||
if (p->rx_status & 0x80)
|
||||
|
|
|
@ -292,12 +292,14 @@ static int ft890_init(RIG *rig)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
rig->state.priv = (struct ft890_priv_data *) calloc(1, sizeof(struct ft890_priv_data));
|
||||
rig->state.priv = (struct ft890_priv_data *) calloc(1,
|
||||
sizeof(struct ft890_priv_data));
|
||||
|
||||
if (!rig->state.priv) /* whoops! memory shortage! */
|
||||
{
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
priv = rig->state.priv;
|
||||
|
||||
/*
|
||||
|
@ -1307,9 +1309,13 @@ static int ft890_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
|
|||
{
|
||||
err = ft890_send_dynamic_cmd(rig, FT890_NATIVE_CLARIFIER_OPS,
|
||||
CLAR_RX_OFF, 0, 0, 0);
|
||||
if (err != RIG_OK) {
|
||||
rig_debug(RIG_DEBUG_ERR,"%s: clarifier off error: %s\n", __func__, strerror(err));
|
||||
|
||||
if (err != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: clarifier off error: %s\n", __func__,
|
||||
strerror(err));
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
@ -621,8 +621,9 @@ int ft897_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt)
|
|||
}
|
||||
|
||||
if (check_cache_timeout(&p->tx_status_tv))
|
||||
{
|
||||
{
|
||||
int n;
|
||||
|
||||
if ((n = ft897_get_status(rig, FT897_NATIVE_CAT_GET_TX_STATUS)) < 0)
|
||||
{
|
||||
return n;
|
||||
|
|
|
@ -294,12 +294,14 @@ static int ft900_init(RIG *rig)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
rig->state.priv = (struct ft900_priv_data *) calloc(1, sizeof(struct ft900_priv_data));
|
||||
rig->state.priv = (struct ft900_priv_data *) calloc(1,
|
||||
sizeof(struct ft900_priv_data));
|
||||
|
||||
if (!rig->state.priv) /* whoops! memory shortage! */
|
||||
{
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
priv = rig->state.priv;
|
||||
|
||||
/*
|
||||
|
@ -1313,9 +1315,13 @@ static int ft900_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit)
|
|||
{
|
||||
err = ft900_send_dynamic_cmd(rig, FT900_NATIVE_CLARIFIER_OPS,
|
||||
CLAR_RX_OFF, 0, 0, 0);
|
||||
if (err != RIG_OK) {
|
||||
rig_debug(RIG_DEBUG_ERR,"%s: clarifier off error: %s\n", __func__, strerror(err));
|
||||
|
||||
if (err != RIG_OK)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: clarifier off error: %s\n", __func__,
|
||||
strerror(err));
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
@ -372,12 +372,14 @@ static int ft920_init(RIG *rig)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
rig->state.priv = (struct ft920_priv_data *) calloc(1, sizeof(struct ft920_priv_data));
|
||||
rig->state.priv = (struct ft920_priv_data *) calloc(1,
|
||||
sizeof(struct ft920_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
return -RIG_ENOMEM; /* whoops! memory shortage! */
|
||||
}
|
||||
|
||||
priv = rig->state.priv;
|
||||
|
||||
/*
|
||||
|
|
|
@ -737,7 +737,7 @@ int ft980_open(RIG *rig)
|
|||
do
|
||||
{
|
||||
write_block(&rig->state.rigport, (char *) cmd_ON_OFF,
|
||||
YAESU_CMD_LENGTH);
|
||||
YAESU_CMD_LENGTH);
|
||||
retval = read_block(&rig->state.rigport, (char *) echo_back, YAESU_CMD_LENGTH);
|
||||
}
|
||||
while (retval != 5 && retry_count2++ < rig->state.rigport.retry);
|
||||
|
@ -766,7 +766,7 @@ int ft980_close(RIG *rig)
|
|||
do
|
||||
{
|
||||
write_block(&rig->state.rigport, (char *) cmd_ON_OFF,
|
||||
YAESU_CMD_LENGTH);
|
||||
YAESU_CMD_LENGTH);
|
||||
retval = read_block(&rig->state.rigport, (char *) echo_back, YAESU_CMD_LENGTH);
|
||||
}
|
||||
while (retval != 5 && retry_count2++ < rig->state.rigport.retry);
|
||||
|
|
|
@ -300,7 +300,8 @@ int ft990_init(RIG *rig)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
rig->state.priv = (struct ft990_priv_data *) calloc(1, sizeof(struct ft990_priv_data));
|
||||
rig->state.priv = (struct ft990_priv_data *) calloc(1,
|
||||
sizeof(struct ft990_priv_data));
|
||||
|
||||
if (!rig->state.priv)
|
||||
{
|
||||
|
@ -2313,7 +2314,8 @@ int ft990_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *value)
|
|||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: passed vfo %s\n", __func__, rig_strvfo(vfo));
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: passed level %s\n", __func__, rig_strlevel(level));
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: passed level %s\n", __func__,
|
||||
rig_strlevel(level));
|
||||
|
||||
priv = (struct ft990_priv_data *) rig->state.priv;
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ const struct rig_caps ft991_caps =
|
|||
.rig_model = RIG_MODEL_FT991,
|
||||
.model_name = "FT-991",
|
||||
.mfg_name = "Yaesu",
|
||||
.version = NEWCAT_VER ".6",
|
||||
.version = NEWCAT_VER ".9",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -101,31 +101,21 @@ const struct rig_caps ft991_caps =
|
|||
RIG_CHAN_END,
|
||||
},
|
||||
|
||||
// Rig only has 1 model
|
||||
.rx_range_list1 = {
|
||||
{kHz(30), MHz(470), FT991_ALL_RX_MODES, -1, -1, FT991_VFO_ALL, FT991_ANTS}, /* General coverage + ham */
|
||||
{kHz(30), MHz(56), FT991_ALL_RX_MODES, -1, -1, FT991_VFO_ALL, FT991_ANTS, "Operating"},
|
||||
{MHz(118), MHz(164), FT991_ALL_RX_MODES, -1, -1, FT991_VFO_ALL, FT991_ANTS, "Operating"},
|
||||
{MHz(420), MHz(470), FT991_ALL_RX_MODES, -1, -1, FT991_VFO_ALL, FT991_ANTS, "Operating"},
|
||||
RIG_FRNG_END,
|
||||
}, /* FIXME: Are these the correct Region 1 values? */
|
||||
},
|
||||
|
||||
.tx_range_list1 = {
|
||||
FRQ_RNG_HF(1, FT991_OTHER_TX_MODES, W(5), W(100), FT991_VFO_ALL, FT991_ANTS),
|
||||
FRQ_RNG_HF(1, FT991_AM_TX_MODES, W(2), W(25), FT991_VFO_ALL, FT991_ANTS), /* AM class */
|
||||
FRQ_RNG_6m(1, FT991_OTHER_TX_MODES, W(5), W(100), FT991_VFO_ALL, FT991_ANTS),
|
||||
FRQ_RNG_6m(1, FT991_AM_TX_MODES, W(2), W(25), FT991_VFO_ALL, FT991_ANTS), /* AM class */
|
||||
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
|
||||
.rx_range_list2 = {
|
||||
{kHz(30), MHz(470), FT991_ALL_RX_MODES, -1, -1, FT991_VFO_ALL, FT991_ANTS},
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
|
||||
.tx_range_list2 = {
|
||||
FRQ_RNG_HF(2, FT991_OTHER_TX_MODES, W(5), W(100), FT991_VFO_ALL, FT991_ANTS),
|
||||
FRQ_RNG_HF(2, FT991_AM_TX_MODES, W(2), W(25), FT991_VFO_ALL, FT991_ANTS), /* AM class */
|
||||
FRQ_RNG_6m(2, FT991_OTHER_TX_MODES, W(5), W(100), FT991_VFO_ALL, FT991_ANTS),
|
||||
FRQ_RNG_6m(2, FT991_AM_TX_MODES, W(2), W(25), FT991_VFO_ALL, FT991_ANTS), /* AM class */
|
||||
|
||||
{MHz(1.8), MHz(54), FT991_OTHER_TX_MODES, W(5), W(100), FT991_VFO_ALL, FT991_ANTS, "Operating"},
|
||||
{MHz(1.8), MHz(54), FT991_AM_TX_MODES, W(2), W(25), FT991_VFO_ALL, FT991_ANTS, "Operating"}, /* AM class */
|
||||
{MHz(144), MHz(148), FT991_OTHER_TX_MODES, W(5), W(100), FT991_VFO_ALL, FT991_ANTS, "Operating"},
|
||||
{MHz(144), MHz(148), FT991_AM_TX_MODES, W(2), W(25), FT991_VFO_ALL, FT991_ANTS, "Operating"}, /* AM class */
|
||||
{MHz(430), MHz(450), FT991_OTHER_TX_MODES, W(5), W(100), FT991_VFO_ALL, FT991_ANTS, "Operating"},
|
||||
{MHz(430), MHz(450), FT991_AM_TX_MODES, W(2), W(25), FT991_VFO_ALL, FT991_ANTS, "Operating"}, /* AM class */
|
||||
RIG_FRNG_END,
|
||||
},
|
||||
|
||||
|
@ -352,7 +342,8 @@ int ft991_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode,
|
|||
return err;
|
||||
}
|
||||
|
||||
strncat(restore_commands, priv->ret_data, NEWCAT_DATA_LEN-strlen(restore_commands));
|
||||
strncat(restore_commands, priv->ret_data,
|
||||
NEWCAT_DATA_LEN - strlen(restore_commands));
|
||||
|
||||
/* Change mode on VFOA */
|
||||
if (RIG_OK != (err = newcat_set_mode(rig, RIG_VFO_A, tx_mode,
|
||||
|
@ -374,6 +365,7 @@ int ft991_init(RIG *rig)
|
|||
rig->caps->version);
|
||||
|
||||
ret = newcat_init(rig);
|
||||
|
||||
if (ret != RIG_OK) { return ret; }
|
||||
|
||||
rig->state.current_vfo = RIG_VFO_A;
|
||||
|
|
|
@ -98,7 +98,8 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#define FT991_ANTS (RIG_ANT_1|RIG_ANT_2)
|
||||
// The FT991 does not have antenna selection
|
||||
#define FT991_ANTS (RIG_ANT_CURR)
|
||||
|
||||
#define FT991_MEM_CHNL_LENGTH 1 /* 0x10 P1 = 01 return size */
|
||||
#define FT991_OP_DATA_LENGTH 19 /* 0x10 P1 = 03 return size */
|
||||
|
|
|
@ -287,7 +287,8 @@ int newcat_init(RIG *rig)
|
|||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
rig->state.priv = (struct newcat_priv_data *) calloc(1, sizeof(struct newcat_priv_data));
|
||||
rig->state.priv = (struct newcat_priv_data *) calloc(1,
|
||||
sizeof(struct newcat_priv_data));
|
||||
|
||||
if (!rig->state.priv) /* whoops! memory shortage! */
|
||||
{
|
||||
|
@ -805,11 +806,11 @@ int newcat_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
priv->cmd_str[3] = 'C';
|
||||
break;
|
||||
|
||||
case RIG_MODE_AMN:
|
||||
case RIG_MODE_AMN:
|
||||
priv->cmd_str[3] = 'D';
|
||||
break;
|
||||
|
||||
case RIG_MODE_C4FM:
|
||||
case RIG_MODE_C4FM:
|
||||
priv->cmd_str[3] = 'E';
|
||||
break;
|
||||
|
||||
|
@ -1044,7 +1045,9 @@ int newcat_set_vfo(RIG *rig, vfo_t vfo)
|
|||
}
|
||||
|
||||
err = newcat_get_vfo_mode(rig, &vfo_mode);
|
||||
if (err != RIG_OK) {
|
||||
|
||||
if (err != RIG_OK)
|
||||
{
|
||||
return err;
|
||||
}
|
||||
|
||||
|
@ -1175,7 +1178,9 @@ int newcat_get_vfo(RIG *rig, vfo_t *vfo)
|
|||
|
||||
/* Check to see if RIG is in MEM mode */
|
||||
err = newcat_get_vfo_mode(rig, &vfo_mode);
|
||||
if (err != RIG_OK) {
|
||||
|
||||
if (err != RIG_OK)
|
||||
{
|
||||
return err;
|
||||
}
|
||||
|
||||
|
@ -2450,7 +2455,8 @@ 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 dummy, ant_t *ant, value_t *option)
|
||||
int newcat_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option,
|
||||
ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
|
||||
{
|
||||
struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv;
|
||||
int err;
|
||||
|
@ -2492,26 +2498,27 @@ int newcat_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, ant_t *ant, value_t *option
|
|||
switch (c)
|
||||
{
|
||||
case '1':
|
||||
*ant = RIG_ANT_1;
|
||||
*ant_curr = RIG_ANT_1;
|
||||
break;
|
||||
|
||||
case '2' :
|
||||
*ant = RIG_ANT_2;
|
||||
*ant_curr = RIG_ANT_2;
|
||||
break;
|
||||
|
||||
case '3' :
|
||||
*ant = RIG_ANT_3;
|
||||
*ant_curr = RIG_ANT_3;
|
||||
break;
|
||||
|
||||
case '4' :
|
||||
*ant = RIG_ANT_4;
|
||||
*ant_curr = RIG_ANT_4;
|
||||
break;
|
||||
|
||||
case '5' :
|
||||
*ant = RIG_ANT_5;
|
||||
*ant_curr = RIG_ANT_5;
|
||||
break;
|
||||
|
||||
default:
|
||||
*ant_curr = RIG_ANT_UNKNOWN;
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
|
@ -3398,9 +3405,32 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
|
||||
case RIG_LEVEL_STRENGTH: // Yaesu's return straight s-meter answers
|
||||
|
||||
// Return dbS9 -- does >S9 mean 10dB increments? If not, add to rig driver
|
||||
if (val->i > 0) { val->i = (atoi(retlvl) - 9) * 10; }
|
||||
else { val->i = (atoi(retlvl) - 9) * 6; } // Return dbS9 does >S9 mean 10dB increments?
|
||||
|
||||
if (newcat_is_rig(rig, RIG_MODEL_FT991))
|
||||
{
|
||||
// value of 0.448 determined by data from W6HN
|
||||
// seems to be pretty linear
|
||||
// SMeter, rig answer, %fullscale
|
||||
// S0 SM0000 0
|
||||
// S2 SM0026 10
|
||||
// S4 SM0051 20
|
||||
// S6 SM0081 30
|
||||
// S7.5 SM0105 40
|
||||
// S9 SM0130 50
|
||||
// +12db SM0157 60
|
||||
// +25db SM0186 70
|
||||
// +35db SM0203 80
|
||||
// +50db SM0237 90
|
||||
// +60db SM0255 100
|
||||
// 114dB range over 0-255 referenced to S0 of -54dB
|
||||
val->i = atoi(retlvl) * (114.0 / 255.0) - 54;
|
||||
}
|
||||
else // some Yaesu's return straight s-meter answers
|
||||
{
|
||||
// Return dbS9 -- does >S9 mean 10dB increments? If not, add to rig driver
|
||||
if (val->i > 0) { val->i = (atoi(retlvl) - 9) * 10; }
|
||||
else { val->i = (atoi(retlvl) - 9) * 6; } // Return dbS9 does >S9 mean 10dB increments?
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
@ -4583,8 +4613,8 @@ int newcat_get_channel(RIG *rig, channel_t *chan)
|
|||
|
||||
case 'E': chan->mode = RIG_MODE_C4FM; break;
|
||||
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR,"%s: unknown mode=%c\n", __func__, *retval);
|
||||
default:
|
||||
rig_debug(RIG_DEBUG_ERR, "%s: unknown mode=%c\n", __func__, *retval);
|
||||
chan->mode = RIG_MODE_LSB;
|
||||
}
|
||||
|
||||
|
@ -4922,7 +4952,9 @@ int newcat_get_tx_vfo(RIG *rig, vfo_t *tx_vfo)
|
|||
|
||||
/* Check to see if RIG is in MEM mode */
|
||||
err = newcat_get_vfo_mode(rig, &vfo_mode);
|
||||
if (err != RIG_OK) {
|
||||
|
||||
if (err != RIG_OK)
|
||||
{
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Ładowanie…
Reference in New Issue