astyle all C files

pull/224/head
Michael Black 2020-02-23 11:26:09 -06:00
rodzic 414b557b71
commit ff8ddf018c
113 zmienionych plików z 1029 dodań i 610 usunięć

Wyświetl plik

@ -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)
{

Wyświetl plik

@ -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)
{

Wyświetl plik

@ -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,28 +1346,35 @@ 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;
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;
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);
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, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
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;
@ -1367,22 +1382,28 @@ static int dummy_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, ant_t
rig_debug(RIG_DEBUG_VERBOSE, "%s called, ant=0x%02x\n", __func__, ant);
*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;
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));
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;

Wyświetl plik

@ -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;
}
}

Wyświetl plik

@ -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, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
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];
@ -1783,10 +1791,12 @@ static int netrigctl_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, an
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);
}
@ -1802,17 +1812,20 @@ static int netrigctl_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, an
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);
}
@ -1823,11 +1836,12 @@ static int netrigctl_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, an
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);
}

Wyświetl plik

@ -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)
{

Wyświetl plik

@ -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;

Wyświetl plik

@ -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))

Wyświetl plik

@ -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);

Wyświetl plik

@ -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);

Wyświetl plik

@ -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;

Wyświetl plik

@ -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')
{

Wyświetl plik

@ -110,6 +110,7 @@ int drake_init(RIG *rig)
{
return -RIG_ENOMEM;
}
priv = rig->state.priv;
priv->curr_ch = 0;
@ -504,7 +505,8 @@ 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, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
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];
@ -543,6 +545,7 @@ int drake_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option, ant_t *ant_
*ant_curr = RIG_ANT_UNKNOWN;
return -RIG_EINVAL;
}
return RIG_OK;
}

Wyświetl plik

@ -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, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
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;
@ -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.

Wyświetl plik

@ -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)
{

Wyświetl plik

@ -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)
{

Wyświetl plik

@ -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)
{

Wyświetl plik

@ -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)
{

Wyświetl plik

@ -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);
@ -563,8 +564,8 @@ void icom2rig_mode(RIG *rig, unsigned char md, int pd, rmode_t *mode,
depending on mode */
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++; }
rig->caps->rig_model == RIG_MODEL_IC706 ||
rig->caps->rig_model == RIG_MODEL_IC706MKII)) { pd++; }
switch (pd)
{

Wyświetl plik

@ -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

Wyświetl plik

@ -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} }
};
/*
@ -135,12 +136,13 @@ struct cmdparams ic7300_extcmds[] = {
#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_SCREENSAVER}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, 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, \
@ -470,20 +472,20 @@ const struct rig_caps ic9700_caps =
},
// Hopefully any future changes in bandplans can be fixed with firmware updates
// So we use the global REGION2 macros in here
// 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,
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"},
{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,
},
@ -491,15 +493,15 @@ const struct rig_caps ic9700_caps =
{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,
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"},
{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,
},
@ -509,19 +511,19 @@ const struct rig_caps ic9700_caps =
{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,
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"},
{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,
},
@ -529,15 +531,15 @@ const struct rig_caps ic9700_caps =
{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,
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"},
{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,
},
@ -545,15 +547,15 @@ const struct rig_caps ic9700_caps =
{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,
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"},
{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,
},

Wyświetl plik

@ -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;
}

Wyświetl plik

@ -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, \

Wyświetl plik

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

Wyświetl plik

@ -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])

Wyświetl plik

@ -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 },

Wyświetl plik

@ -683,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",
@ -750,9 +751,10 @@ 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) {
if (retval < 0)
{
rig_debug(RIG_DEBUG_ERR, "%s: Unable to determine USB echo status\n", __func__);
return retval;
return retval;
}
retval = rig_get_func(rig, RIG_VFO_CURR, RIG_FUNC_SATMODE, &satmode);
@ -794,22 +796,28 @@ int icom_band_changing(RIG *rig, freq_t test_freq)
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__);
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__);
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__);
rig_debug(RIG_DEBUG_TRACE, "%s: Band change not detected\n", __func__);
return 0;
}
@ -831,12 +839,15 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
rs = &rig->state;
priv = (struct icom_priv_data *) rs->priv;
if (vfo==RIG_VFO_CURR) {
vfo=priv->curr_vfo;
rig_debug(RIG_DEBUG_TRACE,"%s: currVFO asked for so vfo set to %s\n", __func__, rig_strvfo(vfo));
if (vfo == RIG_VFO_CURR)
{
vfo = priv->curr_vfo;
rig_debug(RIG_DEBUG_TRACE, "%s: currVFO asked for so vfo set to %s\n", __func__,
rig_strvfo(vfo));
}
rig_debug(RIG_DEBUG_TRACE, "%s: set_vfo_curr=%s\n", __func__, rig_strvfo(priv->curr_vfo));
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)
@ -845,6 +856,7 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
}
retval = icom_get_freq(rig, RIG_VFO_CURR, &curr_freq);
if (retval != RIG_OK)
{
return retval;
@ -858,25 +870,31 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
cmd = C_SET_FREQ;
subcmd = -1;
retval = icom_transaction(rig, cmd, subcmd, freqbuf, freq_len, ackbuf, &ack_len);
retval = icom_transaction(rig, cmd, subcmd, freqbuf, freq_len, ackbuf,
&ack_len);
if (retval != RIG_OK)
{
// We might have a failed command if we're changing bands
// 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)) {
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);
retval = icom_transaction(rig, cmd, subcmd, freqbuf, freq_len, ackbuf,
&ack_len);
}
}
if (retval != RIG_OK)
{
return retval;
@ -890,12 +908,15 @@ int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
return -RIG_ERJCTED;
}
if (vfo == RIG_VFO_MAIN) {
if (vfo == RIG_VFO_MAIN)
{
priv->main_freq = freq;
}
else if (vfo == RIG_VFO_SUB) {
else if (vfo == RIG_VFO_SUB)
{
priv->sub_freq = freq;
}
priv->curr_freq = freq;
return RIG_OK;
}
@ -1587,7 +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);
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;
@ -1694,19 +1718,24 @@ int icom_set_vfo(RIG *rig, vfo_t vfo)
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));
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));
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));
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) */
@ -1723,8 +1752,10 @@ 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));
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
}
@ -1852,6 +1883,7 @@ int icom_set_vfo(RIG *rig, vfo_t vfo)
ackbuf[0], ack_len);
return -RIG_ERJCTED;
}
priv->curr_vfo = vfo;
return RIG_OK;
}
@ -2857,7 +2889,7 @@ int icom_set_ext_func(RIG *rig, vfo_t vfo, token_t token, int status)
int icom_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
return icom_get_ext_cmd(rig, vfo, token, (value_t*)status);
return icom_get_ext_cmd(rig, vfo, token, (value_t *)status);
}
int icom_set_ext_parm(RIG *rig, token_t token, value_t val)
@ -3328,13 +3360,15 @@ 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));
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));
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)
{
@ -3343,7 +3377,8 @@ int icom_get_split_vfos(const RIG *rig, vfo_t *rx_vfo, vfo_t *tx_vfo)
// For now we return Main/Sub
*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));
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
{
@ -3423,7 +3458,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));
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)))
{
@ -3452,10 +3489,12 @@ int icom_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
}
}
if (vfo == RIG_VFO_MAIN) {
if (vfo == RIG_VFO_MAIN)
{
priv->main_freq = tx_freq;
}
else if (vfo == RIG_VFO_SUB) {
else if (vfo == RIG_VFO_SUB)
{
priv->sub_freq = tx_freq;
}
@ -4010,9 +4049,12 @@ 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 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));
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) {
if (vfo == RIG_VFO_CURR)
{
vfo = priv->curr_vfo;
}
@ -4023,7 +4065,8 @@ int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
// if either VFOA or B is the vfo we set to VFOA when split is turned off
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_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;
@ -4031,7 +4074,8 @@ int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
// otherwise if Main or Sub we set Main as the current vfo
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_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;
@ -4046,25 +4090,34 @@ int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
/* ensure VFO A is Rx and VFO B is Tx as we assume that elsewhere */
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));
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));
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));
else
{
rig_debug(RIG_DEBUG_ERR, "%s: split on vfo=%s not known\n", __func__,
rig_strvfo(vfo));
return -RIG_EINVAL;
}
@ -4107,7 +4160,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, satmode=0;
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__);
@ -4148,8 +4201,10 @@ int icom_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
}
rig_get_func(rig, RIG_VFO_CURR, RIG_FUNC_SATMODE, &satmode);
// don't care about retval here...only care about satmode=1
if (satmode) {
if (satmode)
{
priv->tx_vfo = RIG_VFO_SUB;
priv->rx_vfo = RIG_VFO_MAIN;
}
@ -5433,14 +5488,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, antack_len=%d\n", __func__, ant, option.i, priv_caps->antack_len);
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:
@ -5465,14 +5527,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
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_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;
if (retval != RIG_OK)
{
rig_debug(RIG_DEBUG_ERR, "%s: rig_get_ant error: %s \n", __func__,
rigerror(retval));
return retval;
}
}
@ -5488,16 +5554,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]);
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)
@ -5541,7 +5609,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, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
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;
@ -5555,31 +5624,42 @@ int icom_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, ant_t *ant_cur
if (ant != RIG_ANT_CURR)
{
ant = rig_setting2idx(ant);
if (ant >= priv_caps->ant_count)
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);
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) {
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 (rig->caps->rig_model == RIG_MODEL_IC785x) {
else if (rig->caps->rig_model == RIG_MODEL_IC785x)
{
unsigned char buf[2];
buf[0] = 0x03;
buf[1] = 0x05+ant;
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) {
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__);
rig_debug(RIG_DEBUG_ERR,"%s: need to implement ant control for this rig?\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)
@ -5600,12 +5680,13 @@ int icom_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, ant_t *ant_cur
ackbuf[0], ack_len, ackbuf[1]);
return -RIG_ERJCTED;
}
rig_debug(RIG_DEBUG_ERR, "%s: ackbuf= 0x%02x 0x%02x 0x%02x\n", __func__,
ackbuf[0], ackbuf[1], ackbuf[2]);
ackbuf[0], ackbuf[1], ackbuf[2]);
*ant_curr = rig_idx2setting(ackbuf[1]);
// Note: with IC756/IC-756Pro/IC-7800 and more, ackbuf[2] deals with [RX ANT]
// 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)
{
@ -6211,19 +6292,24 @@ 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));
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));
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));
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) */

Wyświetl plik

@ -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} }
};

Wyświetl plik

@ -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.

Wyświetl plik

@ -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

Wyświetl plik

@ -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,

Wyświetl plik

@ -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)
{

Wyświetl plik

@ -445,7 +445,8 @@ 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, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
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;
@ -741,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;
}

Wyświetl plik

@ -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)
{

Wyświetl plik

@ -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, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
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;
@ -3342,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;
@ -3472,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.

Wyświetl plik

@ -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];

Wyświetl plik

@ -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,7 +2553,8 @@ 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, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
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;

Wyświetl plik

@ -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, ",");

Wyświetl plik

@ -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++)

Wyświetl plik

@ -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)
{

Wyświetl plik

@ -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)
{

Wyświetl plik

@ -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)
{

Wyświetl plik

@ -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)
{

Wyświetl plik

@ -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, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx);
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,7 +1192,8 @@ 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, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
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;

Wyświetl plik

@ -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)
{

Wyświetl plik

@ -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)
{

Wyświetl plik

@ -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)
{

Wyświetl plik

@ -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__);

Wyświetl plik

@ -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
}

Wyświetl plik

@ -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);

Wyświetl plik

@ -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,7 +754,8 @@ 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, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
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;

Wyświetl plik

@ -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)
{

Wyświetl plik

@ -470,6 +470,7 @@ gp2000_get_info(RIG *rig)
}
p = strtok(infobuf, ",");
while (p)
{
switch (p[0])

Wyświetl plik

@ -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]; }

Wyświetl plik

@ -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));

Wyświetl plik

@ -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,7 +2118,8 @@ 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, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
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;

Wyświetl plik

@ -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)
{

Wyświetl plik

@ -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));

Wyświetl plik

@ -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)
{

Wyświetl plik

@ -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)
{

Wyświetl plik

@ -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)
{

Wyświetl plik

@ -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;

Wyświetl plik

@ -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; }

Wyświetl plik

@ -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;

Wyświetl plik

@ -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 ? */

Wyświetl plik

@ -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; }

Wyświetl plik

@ -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;

Wyświetl plik

@ -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! */
{

Wyświetl plik

@ -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 ? */

Wyświetl plik

@ -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 */

Wyświetl plik

@ -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 *)

Wyświetl plik

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

Wyświetl plik

@ -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;

Wyświetl plik

@ -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)

Wyświetl plik

@ -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;
}

Wyświetl plik

@ -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;

Wyświetl plik

@ -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;
}

Wyświetl plik

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

Wyświetl plik

@ -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);

Wyświetl plik

@ -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;

Wyświetl plik

@ -103,19 +103,19 @@ const struct rig_caps ft991_caps =
// Rig only has 1 model
.rx_range_list1 = {
{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"},
{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,
},
.tx_range_list1 = {
{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 */
{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,
},
@ -342,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,
@ -364,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;

Wyświetl plik

@ -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, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
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;
@ -3399,7 +3405,7 @@ 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
if (newcat_is_rig(rig, RIG_MODEL_FT991))
{
// value of 0.448 determined by data from W6HN
@ -3416,11 +3422,11 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
// +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;
// 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?
@ -4607,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;
}
@ -4946,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;
}

Wyświetl plik

@ -247,7 +247,8 @@ struct vr5000_priv_data
int vr5000_init(RIG *rig)
{
rig->state.priv = (struct vr5000_priv_data *) calloc(1, sizeof(struct vr5000_priv_data));
rig->state.priv = (struct vr5000_priv_data *) calloc(1,
sizeof(struct vr5000_priv_data));
if (!rig->state.priv) { return -RIG_ENOMEM; }

Wyświetl plik

@ -603,6 +603,7 @@ static int vx1700_init(RIG *rig)
rig->state.priv = calloc(1, sizeof(struct vx1700_priv_data));
if (rig->state.priv == NULL) { return -RIG_ENOMEM; }
priv = rig->state.priv;
priv->ch = 1;

Wyświetl plik

@ -378,7 +378,7 @@ const struct rot_caps f1tetracker_rot_caps =
.get_position = NULL, /* no position feedback available */
.set_position = gs232_rot_set_position,
#ifdef XXREMOVEDXX
#ifdef XXREMOVEDXX
.stop = gs232_rot_stop,
#endif
};

Wyświetl plik

@ -121,7 +121,7 @@ static int hd1780_rot_init(ROT *rot)
}
rot->state.priv = (struct hd1780_rot_priv_data *)
malloc(sizeof(struct hd1780_rot_priv_data));
malloc(sizeof(struct hd1780_rot_priv_data));
if (!rot->state.priv)
{

Wyświetl plik

@ -74,6 +74,7 @@ static int rc2800_parse(char *s, char *device, float *value)
rig_debug(RIG_DEBUG_TRACE, "%s: device return->%s", __func__, s);
len = strlen(s);
if (len == 0)
{
return -RIG_EPROTO;

Wyświetl plik

@ -166,7 +166,7 @@ static int meade_init(ROT *rot)
struct meade_priv_data *priv;
rot->state.priv = (struct meade_priv_data *)
calloc(1, sizeof(struct meade_priv_data));
calloc(1, sizeof(struct meade_priv_data));
if (!rot->state.priv)
{
@ -329,7 +329,7 @@ static int meade_get_position(ROT *rot, azimuth_t *az, elevation_t *el)
// GZ returns DDD*MM# or DDD*MM'SS#
// GA returns sDD*MM# or sDD*MM'SS#
n = sscanf(return_str, "%d%*c%d:%d#%d%*c%d:%d%c", &az_degrees, &az_minutes,
&az_seconds, &el_degrees, &el_minutes, &el_seconds, &eom);
&az_seconds, &el_degrees, &el_minutes, &el_seconds, &eom);
if (n != 7 || eom != '#')
{

Wyświetl plik

@ -118,7 +118,7 @@ transaction_write:
}
//check if reply match issued command
if ( cmdstr && data[0] == 0x02 && data[3] == cmdstr[2])
if (cmdstr && data[0] == 0x02 && data[3] == cmdstr[2])
{
rig_debug(RIG_DEBUG_VERBOSE, "%s Command %c reply received\n", __func__,
data[3]);

Wyświetl plik

@ -366,7 +366,7 @@ static int rotorez_rot_init(ROT *rot)
}
rot->state.priv = (struct rotorez_rot_priv_data *)
malloc(sizeof(struct rotorez_rot_priv_data));
malloc(sizeof(struct rotorez_rot_priv_data));
if (!rot->state.priv)
{
@ -375,7 +375,7 @@ static int rotorez_rot_init(ROT *rot)
rot->state.rotport.type.rig = RIG_PORT_SERIAL;
((struct rotorez_rot_priv_data*)rot->state.priv)->az = 0;
((struct rotorez_rot_priv_data *)rot->state.priv)->az = 0;
return RIG_OK;
}

Wyświetl plik

@ -48,6 +48,7 @@ int read_calibration(int buf[NUM_CHANNELS][2])
if (fread(cal, NUM_CHANNELS * 4, 1, f) == 1)
{
fclose(f);
for (j = 0; j < 2; j++)
for (i = 0; i < NUM_CHANNELS; i++)
{

Wyświetl plik

@ -46,6 +46,7 @@ int read_calibration(int buf[NUM_CHANNELS][2])
if (fread(cal, NUM_CHANNELS * 4, 1, f) == 1)
{
fclose(f);
for (j = 0; j < 2; j++)
for (i = 0; i < NUM_CHANNELS; i++)
{

Wyświetl plik

@ -56,7 +56,7 @@ static int ts7400_rot_init(ROT *rot)
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
rot->state.priv = (struct ts7400_rot_priv_data *)
malloc(sizeof(struct ts7400_rot_priv_data));
malloc(sizeof(struct ts7400_rot_priv_data));
if (!rot->state.priv)
{

Wyświetl plik

@ -581,6 +581,7 @@ static int frontend_get_conf(RIG *rig, token_t token, char *val)
break;
#if 0 // needs to be replace?
case TOK_ITU_REGION:
sprintf(val, "%d",
rs->itu_region == 1 ? RIG_ITU_REGION1 : RIG_ITU_REGION2);

Wyświetl plik

@ -87,6 +87,7 @@ void dump_hex(const unsigned char ptr[], size_t size)
for (i = 0; i < size; ++i)
{
unsigned char c;
if (i % DUMP_HEX_WIDTH == 0)
{
/* new line */

Wyświetl plik

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

Wyświetl plik

@ -766,6 +766,7 @@ static void *read_device(void *p)
{
int ret;
int maxdev;
//
// setting uh_is_initialized to zero in the main thread
// tells this one that it is all over now
@ -1136,6 +1137,7 @@ int uh_open_ptt()
if (!uh_is_initialized)
{
start_thread();
if (!uh_is_initialized)
{
return -1;
@ -1151,6 +1153,7 @@ int uh_open_wkey()
if (!uh_is_initialized)
{
start_thread();
if (!uh_is_initialized)
{
return -1;
@ -1177,6 +1180,7 @@ int uh_open_radio(int baud, int databits, int stopbits, int rtscts)
if (!uh_is_initialized)
{
start_thread();
if (!uh_is_initialized)
{
return -1;

Wyświetl plik

@ -419,7 +419,7 @@ int HAMLIB_API rig_strrmodes(rmode_t modes, char *buf, int buflen)
if (modes == RIG_MODE_NONE)
{
snprintf(buf,buflen,"NONE");
snprintf(buf, buflen, "NONE");
return RIG_OK;
}
@ -428,10 +428,13 @@ int HAMLIB_API rig_strrmodes(rmode_t modes, char *buf, int buflen)
if (modes & mode_str[i].mode)
{
char modebuf[16];
if (strlen(buf)==0) snprintf(modebuf, sizeof(modebuf), "%s", mode_str[i].str);
else snprintf(modebuf, sizeof(modebuf)," %s", mode_str[i].str);
strncat(buf, modebuf, buflen-strlen(buf)-1);
if (strlen(buf) > buflen-10) return -RIG_ETRUNC;
if (strlen(buf) == 0) { snprintf(modebuf, sizeof(modebuf), "%s", mode_str[i].str); }
else { snprintf(modebuf, sizeof(modebuf), " %s", mode_str[i].str); }
strncat(buf, modebuf, buflen - strlen(buf) - 1);
if (strlen(buf) > buflen - 10) { return -RIG_ETRUNC; }
}
}

Wyświetl plik

@ -98,7 +98,7 @@ static void handle_error(enum rig_debug_level_e lvl, const char *msg)
0,
NULL))
{
rig_debug(lvl, "%s: Network error %d: %s\n", msg, e, (char*)lpMsgBuf);
rig_debug(lvl, "%s: Network error %d: %s\n", msg, e, (char *)lpMsgBuf);
LocalFree(lpMsgBuf);
}
else

Wyświetl plik

@ -408,6 +408,7 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model)
rs->lo_freq = 0;
#if 0 // this is no longer applicable -- replace it with something?
// we need to be able to figure out what model radio we have
// before we can set up the rig_state with the rig's specific freq range
// if we can't figure out what model rig we have this is impossible
@ -431,6 +432,7 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model)
sizeof(struct freq_range_list)*FRQRANGESIZ);
break;
}
#endif
rs->vfo_list = 0;
rs->mode_list = 0;
@ -696,7 +698,9 @@ int HAMLIB_API rig_open(RIG *rig)
case RIG_PTT_GPIO:
case RIG_PTT_GPION:
rs->pttport.fd = gpio_open(&rs->pttport, 1, RIG_PTT_GPION == rs->pttport.type.ptt ? 0 : 1);
rs->pttport.fd = gpio_open(&rs->pttport, 1,
RIG_PTT_GPION == rs->pttport.type.ptt ? 0 : 1);
if (rs->pttport.fd < 0)
{
rig_debug(RIG_DEBUG_ERR,
@ -771,7 +775,9 @@ int HAMLIB_API rig_open(RIG *rig)
case RIG_DCD_GPIO:
case RIG_DCD_GPION:
rs->dcdport.fd = gpio_open(&rs->dcdport, 0, RIG_DCD_GPION == rs->dcdport.type.dcd ? 0 : 1);
rs->dcdport.fd = gpio_open(&rs->dcdport, 0,
RIG_DCD_GPION == rs->dcdport.type.dcd ? 0 : 1);
if (rs->dcdport.fd < 0)
{
rig_debug(RIG_DEBUG_ERR,
@ -1057,28 +1063,41 @@ static int twiddling(RIG *rig)
caps = rig->caps;
if ( caps->get_freq) { // gotta have get_freq of course
if (caps->get_freq) // gotta have get_freq of course
{
freq_t curr_freq = 0;
int retval2;
int elapsed;
retval2 = caps->get_freq(rig, RIG_VFO_CURR, &curr_freq);
if (retval2 == RIG_OK && rig->state.current_freq != curr_freq) {
rig_debug(RIG_DEBUG_TRACE,"%s: Somebody twiddling the VFO? last_freq=%.0f, curr_freq=%.0f\n", __func__, rig->state.current_freq, curr_freq);
if (rig->state.current_freq == 0) {
if (retval2 == RIG_OK && rig->state.current_freq != curr_freq)
{
rig_debug(RIG_DEBUG_TRACE,
"%s: Somebody twiddling the VFO? last_freq=%.0f, curr_freq=%.0f\n", __func__,
rig->state.current_freq, curr_freq);
if (rig->state.current_freq == 0)
{
rig->state.current_freq = curr_freq;
return 0; // not twiddling as first time freq is being set
}
rig->state.twiddling = time(NULL); // update last twiddle time
rig->state.current_freq = curr_freq; // we have a new freq to remember
}
elapsed = time(NULL) - rig->state.twiddling;
if (elapsed < 3) {
rig_debug(RIG_DEBUG_TRACE,"%s: Twiddle elapsed < 3, elapsed=%d\n", __func__, elapsed);
if (elapsed < 3)
{
rig_debug(RIG_DEBUG_TRACE, "%s: Twiddle elapsed < 3, elapsed=%d\n", __func__,
elapsed);
return 1; // would be better as error but other software won't handle it
}
}
return 0; //
return 0; //
}
/**
@ -1129,8 +1148,10 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
if ((caps->targetable_vfo & RIG_TARGETABLE_FREQ)
|| vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo)
{
if (twiddling(rig)) {
rig_debug(RIG_DEBUG_TRACE,"%s: Ignoring set_freq due to VFO twiddling\n", __func__);
if (twiddling(rig))
{
rig_debug(RIG_DEBUG_TRACE, "%s: Ignoring set_freq due to VFO twiddling\n",
__func__);
return RIG_OK; // would be better as error but other software won't handle errors
}
@ -1139,6 +1160,7 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
else
{
int rc2;
if (!caps->set_vfo)
{
return -RIG_ENTARGET;
@ -1152,8 +1174,10 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
return retcode;
}
if (twiddling(rig)) {
rig_debug(RIG_DEBUG_TRACE,"%s: Ignoring set_freq due to VFO twiddling\n", __func__);
if (twiddling(rig))
{
rig_debug(RIG_DEBUG_TRACE, "%s: Ignoring set_freq due to VFO twiddling\n",
__func__);
return RIG_OK; // would be better as error but other software won't handle errors
}
@ -1223,6 +1247,7 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
else
{
int rc2;
if (!caps->set_vfo)
{
return -RIG_ENAVAIL;
@ -1620,8 +1645,10 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo)
return -RIG_ENAVAIL;
}
if (twiddling(rig)) {
rig_debug(RIG_DEBUG_TRACE,"%s: Ignoring set_vfo due to VFO twiddling\n", __func__);
if (twiddling(rig))
{
rig_debug(RIG_DEBUG_TRACE, "%s: Ignoring set_vfo due to VFO twiddling\n",
__func__);
return RIG_OK; // would be better as error but other software won't handle errors
}
@ -3609,7 +3636,8 @@ int HAMLIB_API rig_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option)
*
* \sa rig_set_ant()
*/
int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx)
int HAMLIB_API rig_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)
{
const struct rig_caps *caps;
int retcode, rc2;

Some files were not shown because too many files have changed in this diff Show More