kopia lustrzana https://github.com/Hamlib/Hamlib
Merge remote-tracking branch 'Hamlib/master'
commit
60bf986776
24
adat/adat.c
24
adat/adat.c
|
@ -632,8 +632,6 @@ size_t trimwhitespace(char *out, size_t len, const char *str)
|
|||
end--;
|
||||
}
|
||||
|
||||
end++;
|
||||
|
||||
// Set output size to minimum of trimmed string length and buffer size minus 1
|
||||
//out_size = (end - str) < len-1 ? (end - str) : len - 1;
|
||||
out_size = strlen(str);
|
||||
|
@ -876,7 +874,7 @@ int adat_parse_mode(char *pcStr,
|
|||
// If input string is NULL ...
|
||||
|
||||
*nRIGMode = RIG_MODE_NONE;
|
||||
pcADATMode = NULL;
|
||||
*pcADATMode = 0;
|
||||
}
|
||||
|
||||
// Done
|
||||
|
@ -986,6 +984,8 @@ int adat_mode_anr2rnr(int nADATMode,
|
|||
}
|
||||
|
||||
|
||||
#ifdef XXREMOVEDXX
|
||||
// this function wasn't referenced anywhere
|
||||
// ---------------------------------------------------------------------------
|
||||
// adat_parse_vfo
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@ -1044,6 +1044,7 @@ int adat_parse_vfo(char *pcStr,
|
|||
|
||||
return nRC;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@ -1180,6 +1181,8 @@ int adat_parse_ptt(char *pcStr,
|
|||
}
|
||||
|
||||
|
||||
#ifdef XXREMOVEDXX
|
||||
// this function wasn't referenced anywhere
|
||||
// ---------------------------------------------------------------------------
|
||||
// adat_ptt_rnr2anr
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@ -1219,6 +1222,7 @@ int adat_ptt_rnr2anr(ptt_t nRIGPTTStatus,
|
|||
|
||||
return nRC;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@ -1487,7 +1491,6 @@ int adat_get_single_cmd_result(RIG *pRig)
|
|||
|
||||
char acBuf[ ADAT_RESPSZ + 1 ];
|
||||
char acBuf2[ ADAT_RESPSZ + 1 ];
|
||||
int nBufLength = 0;
|
||||
char *pcBufEnd = NULL;
|
||||
char *pcPos = NULL;
|
||||
char *pcResult = NULL;
|
||||
|
@ -1505,7 +1508,7 @@ int adat_get_single_cmd_result(RIG *pRig)
|
|||
|
||||
if ((nRC == RIG_OK) && (pcPos != NULL))
|
||||
{
|
||||
int nLength = 0;
|
||||
int nBufLength = 0;
|
||||
|
||||
if (*pcPos == '\0') // Adjust for 00 byte at beginning ...
|
||||
{
|
||||
|
@ -1519,7 +1522,7 @@ int adat_get_single_cmd_result(RIG *pRig)
|
|||
|
||||
if (pcPos < pcBufEnd)
|
||||
{
|
||||
nLength = strlen(pcPos);
|
||||
int nLength = strlen(pcPos);
|
||||
|
||||
if (nLength > 0)
|
||||
{
|
||||
|
@ -2502,7 +2505,6 @@ int adat_transaction(RIG *pRig,
|
|||
adat_cmd_list_ptr pCmdList)
|
||||
{
|
||||
int nRC = RIG_OK;
|
||||
int nFini = 0; // = 1 -> Stop executing commands
|
||||
|
||||
gFnLevel++;
|
||||
|
||||
|
@ -2517,6 +2519,7 @@ int adat_transaction(RIG *pRig,
|
|||
else
|
||||
{
|
||||
int nI = 0;
|
||||
int nFini = 0; // = 1 -> Stop executing commands
|
||||
adat_priv_data_ptr pPriv = (adat_priv_data_ptr) pRig->state.priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
|
@ -2554,10 +2557,10 @@ int adat_transaction(RIG *pRig,
|
|||
// TODO: Quell clang warning of conditional always evaluating to true.
|
||||
// if( pCmd->pacCmdStrs != NULL )
|
||||
// {
|
||||
int nJ = 0;
|
||||
|
||||
if (pCmd->nNrCmdStrs > 0)
|
||||
{
|
||||
int nJ = 0;
|
||||
rig_debug(RIG_DEBUG_TRACE,
|
||||
"*** ADAT: %d pacCmdStrs[%d] = %s\n",
|
||||
gFnLevel, nJ, pCmd->pacCmdStrs[ nJ ]);
|
||||
|
@ -3123,7 +3126,7 @@ int adat_get_level(RIG *pRig, vfo_t vfo, setting_t level, value_t *val)
|
|||
// Status: RELEASED
|
||||
int adat_set_mode(RIG *pRig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
{
|
||||
int nRC = RIG_OK;
|
||||
int nRC;
|
||||
|
||||
gFnLevel++;
|
||||
|
||||
|
@ -3574,7 +3577,8 @@ int adat_get_conf(RIG *pRig, token_t token, char *val)
|
|||
switch (token)
|
||||
{
|
||||
case TOKEN_ADAT_PRODUCT_NAME:
|
||||
val = pPriv->pcProductName;
|
||||
strcpy(val, pPriv->pcProductName != NULL ? pPriv->pcProductName :
|
||||
"Unknown product");
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -500,9 +500,15 @@ int adat_parse_freq(char *, adat_freq_parse_mode_t, int *, freq_t *);
|
|||
|
||||
int adat_parse_mode(char *, rmode_t *, char *);
|
||||
int adat_mode_rnr2anr(rmode_t, int *);
|
||||
#ifdef XXREMOVEDXX
|
||||
// this function wasn't referenced anywhere
|
||||
int adat_mode_anr2rnr(int, rmode_t *);
|
||||
#endif
|
||||
|
||||
#ifdef XXREMOVEDXX
|
||||
// this function wasn't referenced anywhere
|
||||
int adat_parse_vfo(char *, vfo_t *, int *);
|
||||
#endif
|
||||
int adat_vfo_rnr2anr(vfo_t, int *);
|
||||
int adat_vfo_anr2rnr(int, vfo_t *);
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ const struct rig_caps adt_200a_caps =
|
|||
.rig_model = RIG_MODEL_ADT_200A,
|
||||
.model_name = "ADT-200A",
|
||||
.mfg_name = "ADAT www.adat.ch",
|
||||
.version = "1.36",
|
||||
.version = "1.37",
|
||||
.copyright = "Frank Goenninger, DG1SBG. License: Creative Commons",
|
||||
.status = RIG_STATUS_BETA,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
|
|
@ -138,7 +138,8 @@ int alinco_transaction(RIG *rig,
|
|||
return retval;
|
||||
}
|
||||
|
||||
retval -= 2;
|
||||
if (retval > 2) { retval -= 2; }
|
||||
|
||||
echobuf[retval] = 0;
|
||||
|
||||
if (strcmp(echobuf, "OK") == 0)
|
||||
|
@ -695,7 +696,7 @@ int alinco_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
|||
|
||||
funcbuf[2] = '\0';
|
||||
settings = strtol(funcbuf, (char **)NULL, 16);
|
||||
*status = settings & 0x08 ? 1 : 0;
|
||||
*status = (settings & 0x08) ? 1 : 0;
|
||||
break;
|
||||
|
||||
case RIG_FUNC_FAGC:
|
||||
|
@ -708,7 +709,7 @@ int alinco_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
|||
|
||||
funcbuf[2] = '\0';
|
||||
settings = strtol(funcbuf, (char **)NULL, 16);
|
||||
*status = settings & 0x01 ? 1 : 0;
|
||||
*status = (settings & 0x01) ? 1 : 0;
|
||||
break;
|
||||
|
||||
case RIG_FUNC_NB:
|
||||
|
@ -721,7 +722,7 @@ int alinco_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
|||
|
||||
funcbuf[2] = '\0';
|
||||
settings = strtol(funcbuf, (char **)NULL, 16);
|
||||
*status = settings & 0x04 ? 1 : 0;
|
||||
*status = (settings & 0x04) ? 1 : 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -1054,8 +1055,7 @@ int alinco_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
|
|||
|
||||
caps = rig->caps;
|
||||
|
||||
/* TODO: replace 200 by something like RIGTONEMAX */
|
||||
for (i = 0; caps->ctcss_list[i] != 0 && i < 200; i++)
|
||||
for (i = 0; caps->ctcss_list[i] != 0; i++)
|
||||
{
|
||||
if (caps->ctcss_list[i] == tone)
|
||||
{
|
||||
|
|
|
@ -79,7 +79,7 @@ const struct rig_caps dx77_caps =
|
|||
.rig_model = RIG_MODEL_DX77,
|
||||
.model_name = "DX-77",
|
||||
.mfg_name = "Alinco",
|
||||
.version = "0.7",
|
||||
.version = "0.8",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_BETA,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
|
|
@ -119,7 +119,7 @@ int kpa_transaction(AMP *amp, const char *cmd, char *response, int response_len)
|
|||
|
||||
if (err != RIG_OK) { return err; }
|
||||
|
||||
int len = read_string(&rs->ampport, responsebuf, KPABUFSZ, ";", 1);
|
||||
len = read_string(&rs->ampport, responsebuf, KPABUFSZ, ";", 1);
|
||||
|
||||
if (len < 0) { return len; }
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ int kpa_get_freq(AMP *amp, freq_t *freq)
|
|||
if (retval != RIG_OK) { return retval; }
|
||||
|
||||
unsigned long tfreq;
|
||||
int nargs = sscanf(responsebuf, "^FR%ld", &tfreq);
|
||||
int nargs = sscanf(responsebuf, "^FR%lu", &tfreq);
|
||||
|
||||
if (nargs != 1)
|
||||
{
|
||||
|
@ -225,7 +225,7 @@ int kpa_set_freq(AMP *amp, freq_t freq)
|
|||
if (retval != RIG_OK) { return retval; }
|
||||
|
||||
unsigned long tfreq;
|
||||
int nargs = sscanf(responsebuf, "^FR%ld", &tfreq);
|
||||
int nargs = sscanf(responsebuf, "^FR%lu", &tfreq);
|
||||
|
||||
if (nargs != 1)
|
||||
{
|
||||
|
|
|
@ -41,7 +41,6 @@ struct kpa_priv_data *kpa1500_priv;
|
|||
*
|
||||
*/
|
||||
|
||||
static int kpa1500_init(AMP *amp);
|
||||
static int kpa1500_cleanup(AMP *amp);
|
||||
|
||||
/*
|
||||
|
@ -68,7 +67,7 @@ const struct amp_caps kpa1500_amp_caps =
|
|||
.amp_model = AMP_MODEL_ELECRAFT_KPA1500,
|
||||
.model_name = "KPA1500",
|
||||
.mfg_name = "Elecraft",
|
||||
.version = "2019-05-26",
|
||||
.version = "2019-12-06",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_ALPHA,
|
||||
.amp_type = AMP_TYPE_OTHER,
|
||||
|
@ -85,7 +84,7 @@ const struct amp_caps kpa1500_amp_caps =
|
|||
.retry = 2,
|
||||
|
||||
.amp_open = amp_open,
|
||||
.amp_init = kpa1500_init,
|
||||
.amp_init = kpa_init,
|
||||
.amp_cleanup = kpa1500_cleanup,
|
||||
.reset = kpa_reset,
|
||||
.get_info = kpa_get_info,
|
||||
|
@ -104,37 +103,6 @@ const struct amp_caps kpa1500_amp_caps =
|
|||
* ************************************
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Initialize data structures
|
||||
*/
|
||||
|
||||
static int kpa1500_init(AMP *amp)
|
||||
{
|
||||
struct kpa_priv_data *priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
if (!amp)
|
||||
{
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
priv = (struct kpa_priv_data *)
|
||||
malloc(sizeof(struct kpa_priv_data));
|
||||
|
||||
if (!priv)
|
||||
{
|
||||
return -RIG_ENOMEM;
|
||||
}
|
||||
|
||||
amp->state.priv = (void *)priv;
|
||||
|
||||
amp->state.ampport.type.rig = RIG_PORT_SERIAL;
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Clean up allocated memory structures
|
||||
*/
|
||||
|
|
24
aor/aor.c
24
aor/aor.c
|
@ -461,11 +461,13 @@ 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:
|
||||
|
@ -536,7 +538,7 @@ int aor_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
{
|
||||
struct aor_priv_caps *priv = (struct aor_priv_caps *)rig->caps->priv;
|
||||
char ackbuf[BUFSZ], *mdp;
|
||||
char ackbuf2[BUFSZ], *mdp2;
|
||||
char *mdp2;
|
||||
int ack_len, ack2_len, retval;
|
||||
|
||||
|
||||
|
@ -563,6 +565,7 @@ int aor_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
if (rig->caps->rig_model == RIG_MODEL_AR5000 ||
|
||||
rig->caps->rig_model == RIG_MODEL_AR5000A)
|
||||
{
|
||||
char ackbuf2[BUFSZ];
|
||||
retval = aor_transaction(rig, "BW" EOM, 3, ackbuf2, &ack2_len);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
|
@ -610,7 +613,6 @@ int aor_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
struct rig_state *rs;
|
||||
char lvlbuf[BUFSZ];
|
||||
int lvl_len;
|
||||
unsigned i;
|
||||
int agc;
|
||||
|
||||
rs = &rig->state;
|
||||
|
@ -622,6 +624,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)
|
||||
|
@ -1048,7 +1051,6 @@ static int parse_chan_line(RIG *rig, channel_t *chan, char *basep,
|
|||
const channel_cap_t *mem_caps)
|
||||
{
|
||||
struct aor_priv_caps *priv = (struct aor_priv_caps *)rig->caps->priv;
|
||||
int retval;
|
||||
char *tagp;
|
||||
int ts;
|
||||
|
||||
|
@ -1159,7 +1161,7 @@ static int parse_chan_line(RIG *rig, channel_t *chan, char *basep,
|
|||
tag2p = tagp;
|
||||
}
|
||||
|
||||
retval = priv->parse_aor_mode(rig, tagp[2], tag2p[2], &chan->mode,
|
||||
int retval = priv->parse_aor_mode(rig, tagp[2], tag2p[2], &chan->mode,
|
||||
&chan->width);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
|
@ -1236,11 +1238,10 @@ int aor_get_channel(RIG *rig, channel_t *chan)
|
|||
char aorcmd[BUFSZ];
|
||||
int cmd_len, chan_len;
|
||||
char chanbuf[BUFSZ];
|
||||
int retval, i;
|
||||
int retval;
|
||||
channel_cap_t *mem_caps = NULL;
|
||||
chan_t *chan_list;
|
||||
int mem_num, channel_num = chan->channel_num;
|
||||
char bank_base;
|
||||
int channel_num = chan->channel_num;
|
||||
|
||||
chan_list = rig->caps->chan_list;
|
||||
|
||||
|
@ -1257,6 +1258,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 &&
|
||||
|
@ -1278,8 +1280,8 @@ int aor_get_channel(RIG *rig, channel_t *chan)
|
|||
* MW should be called the first time instead,
|
||||
* and sizing memorized.
|
||||
*/
|
||||
mem_num = channel_num % 100;
|
||||
|
||||
int mem_num = channel_num % 100;
|
||||
char bank_base;
|
||||
if (mem_num >= 50 && priv->bank_base1 != priv->bank_base2)
|
||||
{
|
||||
bank_base = priv->bank_base2;
|
||||
|
@ -1427,7 +1429,7 @@ const char *aor_get_info(RIG *rig)
|
|||
static char infobuf[BUFSZ];
|
||||
int id_len, frm_len, retval;
|
||||
char idbuf[BUFSZ];
|
||||
char frmbuf[8];
|
||||
char frmbuf[32]; // only expect 6 chars...please check
|
||||
|
||||
retval = aor_transaction(rig, "\001" EOM, 2, idbuf, &id_len);
|
||||
|
||||
|
@ -1436,7 +1438,7 @@ const char *aor_get_info(RIG *rig)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
idbuf[2] = '\0';
|
||||
if (retval > 2) idbuf[2] = '\0';
|
||||
|
||||
retval = aor_transaction(rig, "VR" EOM, 3, frmbuf, &frm_len);
|
||||
|
||||
|
|
|
@ -561,12 +561,12 @@ int ar3030_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
int ar3030_set_mem(RIG *rig, vfo_t vfo, int ch)
|
||||
{
|
||||
struct ar3030_priv_data *priv = (struct ar3030_priv_data *)rig->state.priv;
|
||||
char cmdbuf[BUFSZ];
|
||||
int cmd_len, retval = RIG_OK;
|
||||
int retval = RIG_OK;
|
||||
|
||||
if (priv->curr_vfo == RIG_VFO_MEM)
|
||||
{
|
||||
cmd_len = sprintf(cmdbuf, "%02dM" CR, ch);
|
||||
char cmdbuf[BUFSZ];
|
||||
int cmd_len = sprintf(cmdbuf, "%02dM" CR, ch);
|
||||
retval = ar3030_transaction(rig, cmdbuf, cmd_len, NULL, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -402,7 +402,7 @@ const struct rig_caps ar5000a_caps =
|
|||
|
||||
int format5k_mode(RIG *rig, char *buf, rmode_t mode, pbwidth_t width)
|
||||
{
|
||||
int aormode, aorwidth;
|
||||
int aormode;
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
|
@ -431,6 +431,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);
|
||||
|
|
|
@ -736,7 +736,7 @@ static int ar7030_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
//val->i = round((smval1 * 6 + smval2) * 10 / 12) - 118;
|
||||
val->i = ((smval1 * 6 + smval2) * 10 / 12) - 118;
|
||||
}
|
||||
else if (smval1 >= 11)
|
||||
else
|
||||
{
|
||||
/* int ops => int result => round has no effect (besides compiler warning */
|
||||
//val->i = round((smval1 * 6 + smval2) * 10 / 6) - 173;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
/*
|
||||
* Hamlib AOR backend - AR7030 Plus description
|
||||
* Copyright (c) 2000-2010 by Stephane Fillod & Fritz Melchert
|
||||
|
@ -255,7 +254,6 @@ static int ar7030p_init(RIG *rig)
|
|||
{
|
||||
struct ar7030p_priv_data *priv;
|
||||
int rc = RIG_OK;
|
||||
int i;
|
||||
|
||||
assert(NULL != rig);
|
||||
|
||||
|
@ -281,6 +279,8 @@ static int ar7030p_init(RIG *rig)
|
|||
|
||||
memset(priv->mem, 0, sizeof(priv->mem));
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NB_CHAN; i++)
|
||||
{
|
||||
priv->mem[ i ].channel_num = i;
|
||||
|
@ -337,8 +337,6 @@ static int ar7030p_cleanup(RIG *rig)
|
|||
int rc = RIG_OK;
|
||||
int i;
|
||||
|
||||
assert(NULL != rig);
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
for (i = 0; i < NB_CHAN; i++)
|
||||
|
@ -371,7 +369,6 @@ static int ar7030p_cleanup(RIG *rig)
|
|||
static int ar7030p_open(RIG *rig)
|
||||
{
|
||||
int rc = RIG_OK;
|
||||
int i;
|
||||
unsigned char v;
|
||||
|
||||
assert(NULL != rig);
|
||||
|
@ -383,6 +380,8 @@ static int ar7030p_open(RIG *rig)
|
|||
/* Load calibration table */
|
||||
rig->state.str_cal.size = rig->caps->str_cal.size;
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < rig->state.str_cal.size; i++)
|
||||
{
|
||||
rc = readByte(rig, EEPROM1, SM_CAL + i, &v);
|
||||
|
@ -482,7 +481,6 @@ static const char *ar7030p_get_info(RIG *rig)
|
|||
static int ar7030p_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
||||
{
|
||||
int rc = RIG_OK;
|
||||
const struct rig_caps *caps;
|
||||
|
||||
assert(NULL != rig);
|
||||
|
||||
|
@ -490,7 +488,7 @@ static int ar7030p_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
|
||||
if (RIG_OK == rc)
|
||||
{
|
||||
caps = rig->caps;
|
||||
const struct rig_caps *caps = rig->caps;
|
||||
|
||||
if ((caps->rx_range_list1[ 0 ].endf > freq) &&
|
||||
(caps->rx_range_list1[ 0 ].startf < freq))
|
||||
|
@ -508,7 +506,8 @@ static int ar7030p_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
|
||||
default:
|
||||
rc = -RIG_EINVAL;
|
||||
};
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -517,7 +516,7 @@ static int ar7030p_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
|
||||
rc = execRoutine(rig, SET_ALL);
|
||||
|
||||
rc = lockRx(rig, LOCK_0);
|
||||
if (rc == RIG_OK) { rc = lockRx(rig, LOCK_0); }
|
||||
}
|
||||
|
||||
return (rc);
|
||||
|
@ -562,7 +561,8 @@ static int ar7030p_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
|
||||
default:
|
||||
rc = -RIG_EINVAL;
|
||||
};
|
||||
break;
|
||||
}
|
||||
|
||||
rc = lockRx(rig, LOCK_0);
|
||||
}
|
||||
|
@ -585,7 +585,6 @@ static int ar7030p_set_mode(RIG *rig, vfo_t vfo, rmode_t mode,
|
|||
int rc = RIG_OK;
|
||||
unsigned char ar_mode = (unsigned char) USB;
|
||||
unsigned char ar_filter = (unsigned char) FILTER_3;
|
||||
int i;
|
||||
|
||||
rc = lockRx(rig, LOCK_1);
|
||||
|
||||
|
@ -607,6 +606,8 @@ static int ar7030p_set_mode(RIG *rig, vfo_t vfo, rmode_t mode,
|
|||
/* TODO - get filter BWs at startup */
|
||||
ar_filter = (unsigned char) 6;
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 1; i <= 6; i++)
|
||||
{
|
||||
if (width <= filterTab[ i ])
|
||||
|
@ -818,7 +819,6 @@ static int ar7030p_set_level(RIG *rig, vfo_t vfo, setting_t level,
|
|||
value_t val)
|
||||
{
|
||||
int rc = RIG_OK;
|
||||
unsigned char v;
|
||||
|
||||
rc = lockRx(rig, LOCK_1);
|
||||
|
||||
|
@ -827,6 +827,8 @@ static int ar7030p_set_level(RIG *rig, vfo_t vfo, setting_t level,
|
|||
/* TODO - deal with selected VFO */
|
||||
switch (level)
|
||||
{
|
||||
unsigned char v;
|
||||
|
||||
case RIG_LEVEL_PREAMP:
|
||||
|
||||
/* Scale parameter */
|
||||
|
@ -843,7 +845,8 @@ static int ar7030p_set_level(RIG *rig, vfo_t vfo, setting_t level,
|
|||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: rfgain %d (%d)\n", __func__, val.i, v);
|
||||
|
||||
rc = execRoutine(rig, SET_ALL);
|
||||
if (rc == RIG_OK) { rc = execRoutine(rig, SET_ALL); }
|
||||
|
||||
break;
|
||||
|
||||
case RIG_LEVEL_ATT:
|
||||
|
@ -874,7 +877,8 @@ static int ar7030p_set_level(RIG *rig, vfo_t vfo, setting_t level,
|
|||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: rfgain %d (%d)\n", __func__, val.i, v);
|
||||
|
||||
rc = execRoutine(rig, SET_ALL);
|
||||
if (rc == RIG_OK) { rc = execRoutine(rig, SET_ALL); }
|
||||
|
||||
break;
|
||||
|
||||
case RIG_LEVEL_AF:
|
||||
|
@ -888,10 +892,12 @@ static int ar7030p_set_level(RIG *rig, vfo_t vfo, setting_t level,
|
|||
|
||||
v = ((v >> 1) & 0x1f); /* half value for L/R volume */
|
||||
|
||||
rc = writeByte(rig, WORKING, AF_VLL, v); /* af_vll */
|
||||
rc = writeByte(rig, WORKING, AF_VLR, v); /* af_vlr */
|
||||
if (rc == RIG_OK) { rc = writeByte(rig, WORKING, AF_VLL, v); } /* af_vll */
|
||||
|
||||
if (rc == RIG_OK) { rc = writeByte(rig, WORKING, AF_VLR, v); } /* af_vlr */
|
||||
|
||||
if (rc == RIG_OK) { rc = execRoutine(rig, SET_AUDIO); }
|
||||
|
||||
rc = execRoutine(rig, SET_AUDIO);
|
||||
break;
|
||||
|
||||
case RIG_LEVEL_RF:
|
||||
|
@ -902,7 +908,8 @@ static int ar7030p_set_level(RIG *rig, vfo_t vfo, setting_t level,
|
|||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: ifgain %f (%d)\n", __func__, val.f, v);
|
||||
|
||||
rc = execRoutine(rig, SET_ALL);
|
||||
if (rc == RIG_OK) { rc = execRoutine(rig, SET_ALL); }
|
||||
|
||||
break;
|
||||
|
||||
case RIG_LEVEL_SQL:
|
||||
|
@ -913,7 +920,8 @@ static int ar7030p_set_level(RIG *rig, vfo_t vfo, setting_t level,
|
|||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: sqlval %f (%d)\n", __func__, val.f, v);
|
||||
|
||||
rc = execRoutine(rig, SET_ALL);
|
||||
if (rc == RIG_OK) { rc = execRoutine(rig, SET_ALL); }
|
||||
|
||||
break;
|
||||
|
||||
case RIG_LEVEL_PBT_IN:
|
||||
|
@ -924,7 +932,8 @@ static int ar7030p_set_level(RIG *rig, vfo_t vfo, setting_t level,
|
|||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: pbsval %f (%d)\n", __func__, val.f, v);
|
||||
|
||||
rc = execRoutine(rig, SET_ALL);
|
||||
if (rc == RIG_OK) { rc = execRoutine(rig, SET_ALL); }
|
||||
|
||||
break;
|
||||
|
||||
case RIG_LEVEL_CWPITCH:
|
||||
|
@ -935,7 +944,8 @@ static int ar7030p_set_level(RIG *rig, vfo_t vfo, setting_t level,
|
|||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: bfoval %f (%d)\n", __func__, val.f, v);
|
||||
|
||||
rc = execRoutine(rig, SET_ALL);
|
||||
if (rc == RIG_OK) { rc = execRoutine(rig, SET_ALL); }
|
||||
|
||||
break;
|
||||
|
||||
case RIG_LEVEL_NOTCHF:
|
||||
|
@ -949,12 +959,14 @@ static int ar7030p_set_level(RIG *rig, vfo_t vfo, setting_t level,
|
|||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: agcspd %d (%d)\n", __func__, val.i, v);
|
||||
|
||||
rc = execRoutine(rig, SET_ALL);
|
||||
if (rc == RIG_OK) { rc = execRoutine(rig, SET_ALL); }
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
rc = -RIG_EINVAL;
|
||||
};
|
||||
break;
|
||||
}
|
||||
|
||||
rc = lockRx(rig, LOCK_0);
|
||||
}
|
||||
|
@ -978,7 +990,6 @@ static int ar7030p_get_level(RIG *rig, vfo_t vfo, setting_t level,
|
|||
{
|
||||
int rc = RIG_OK;
|
||||
unsigned char v;
|
||||
unsigned int x = 0;
|
||||
unsigned short s = 0;
|
||||
int i;
|
||||
|
||||
|
@ -1128,7 +1139,7 @@ static int ar7030p_get_level(RIG *rig, vfo_t vfo, setting_t level,
|
|||
|
||||
if (RIG_OK == rc)
|
||||
{
|
||||
x = (unsigned int) s;
|
||||
unsigned int x = (unsigned int) s;
|
||||
|
||||
/* Scale parameter */
|
||||
val->i = (int)((float)(x) / NOTCH_STEP_HZ);
|
||||
|
@ -1182,7 +1193,7 @@ static int ar7030p_get_level(RIG *rig, vfo_t vfo, setting_t level,
|
|||
rc = -RIG_EINVAL;
|
||||
}
|
||||
|
||||
rc = lockRx(rig, LOCK_0);
|
||||
if (RIG_OK == rc) { rc = lockRx(rig, LOCK_0); }
|
||||
}
|
||||
|
||||
return (rc);
|
||||
|
@ -1193,8 +1204,6 @@ static int ar7030p_set_vfo(RIG *rig, vfo_t vfo)
|
|||
int rc = RIG_OK;
|
||||
struct ar7030p_priv_data *priv = (struct ar7030p_priv_data *) rig->state.priv;
|
||||
|
||||
assert(NULL != rig);
|
||||
|
||||
switch (vfo)
|
||||
{
|
||||
case RIG_VFO_B:
|
||||
|
@ -1239,7 +1248,6 @@ static int ar7030p_get_vfo(RIG *rig, vfo_t *vfo)
|
|||
int rc = RIG_OK;
|
||||
struct ar7030p_priv_data *priv = (struct ar7030p_priv_data *) rig->state.priv;
|
||||
|
||||
assert(NULL != rig);
|
||||
assert(NULL != vfo);
|
||||
|
||||
*vfo = priv->curr_vfo;
|
||||
|
@ -1410,7 +1418,6 @@ static int ar7030p_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
|
|||
static int ar7030p_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts)
|
||||
{
|
||||
int rc = RIG_OK;
|
||||
unsigned short v;
|
||||
|
||||
assert(NULL != rig);
|
||||
|
||||
|
@ -1419,7 +1426,7 @@ static int ar7030p_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts)
|
|||
if (RIG_OK == rc)
|
||||
{
|
||||
/* Scale parameter */
|
||||
v = (unsigned short)((double)(ts + 1) / HZ_PER_STEP);
|
||||
unsigned short v = (unsigned short)((double)(ts + 1) / HZ_PER_STEP);
|
||||
|
||||
rc = writeShort(rig, WORKING, CHNSTP, v); /* chnstp */
|
||||
|
||||
|
@ -1430,7 +1437,7 @@ static int ar7030p_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts)
|
|||
rig_debug(RIG_DEBUG_VERBOSE, "%s: chnstp %d (%d)\n", __func__, (int)ts, v);
|
||||
}
|
||||
|
||||
rc = lockRx(rig, LOCK_0);
|
||||
if (RIG_OK == rc) { rc = lockRx(rig, LOCK_0); }
|
||||
}
|
||||
|
||||
return (rc);
|
||||
|
@ -1449,7 +1456,6 @@ static int ar7030p_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts)
|
|||
{
|
||||
int rc = RIG_OK;
|
||||
unsigned short v;
|
||||
double x;
|
||||
|
||||
assert(NULL != rig);
|
||||
assert(NULL != ts);
|
||||
|
@ -1462,7 +1468,7 @@ static int ar7030p_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts)
|
|||
|
||||
if (RIG_OK == rc)
|
||||
{
|
||||
x = (double) v;
|
||||
double x = (double) v;
|
||||
*ts = (shortfreq_t)(x * HZ_PER_STEP);
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: step= %d\n", __func__, (int)*ts);
|
||||
|
@ -1484,7 +1490,7 @@ static int ar7030p_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts)
|
|||
*/
|
||||
static int ar7030p_set_powerstat(RIG *rig, powerstat_t status)
|
||||
{
|
||||
int rc = -RIG_ENIMPL;
|
||||
int rc;
|
||||
|
||||
assert(NULL != rig);
|
||||
|
||||
|
@ -1615,7 +1621,6 @@ static int ar7030p_get_channel(RIG *rig, channel_t *chan)
|
|||
unsigned int f;
|
||||
unsigned char *p = NULL;
|
||||
int ch;
|
||||
int i;
|
||||
struct ar7030p_priv_data *priv = (struct ar7030p_priv_data *)rig->state.priv;
|
||||
channel_t *curr = priv->curr;
|
||||
|
||||
|
@ -1651,12 +1656,14 @@ static int ar7030p_get_channel(RIG *rig, channel_t *chan)
|
|||
if (100 > ch)
|
||||
{
|
||||
rc = read3Bytes(rig, EEPROM1, (MEM_FR + (ch * 4)), &f); /* mem_fr */
|
||||
rc = readByte(rig, EEPROM1, (MEM_MD + (ch * 4)), &v); /* mem_md */
|
||||
|
||||
if (RIG_OK == rc) { rc = readByte(rig, EEPROM1, (MEM_MD + (ch * 4)), &v); } /* mem_md */
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = read3Bytes(rig, EEPROM2, (MEX_FR + ((ch - 100) * 4)), &f); /* mex_fr */
|
||||
rc = readByte(rig, EEPROM2, (MEX_MD + ((ch - 100) * 4)), &v); /* mex_md */
|
||||
|
||||
if (RIG_OK == rc) { rc = readByte(rig, EEPROM2, (MEX_MD + ((ch - 100) * 4)), &v); } /* mex_md */
|
||||
}
|
||||
|
||||
if (RIG_OK == rc)
|
||||
|
@ -1697,6 +1704,8 @@ static int ar7030p_get_channel(RIG *rig, channel_t *chan)
|
|||
/* Memory ID values */
|
||||
p = (unsigned char *) chan->channel_desc;
|
||||
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 14; i++)
|
||||
{
|
||||
if (176 > ch)
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
/*
|
||||
* Hamlib AOR backend - AR7030 Plus utility functions
|
||||
* Copyright (c) 2009-2010 by Larry Gadallah (VE6VQ)
|
||||
|
@ -466,6 +465,7 @@ static int setAddr(RIG *rig, enum PAGE_e page, unsigned int addr)
|
|||
else
|
||||
{
|
||||
rc = -RIG_EIO;
|
||||
return rc;
|
||||
}
|
||||
|
||||
v = ADR((0x00f & addr));
|
||||
|
@ -615,6 +615,8 @@ int write3Bytes(RIG *rig, enum PAGE_e page, unsigned int addr, unsigned int x)
|
|||
return (rc);
|
||||
}
|
||||
|
||||
#ifdef XXREMOVEDXX
|
||||
// this function is not referenced anywhere
|
||||
/*
|
||||
* /brief Write unsigned int (4 bytes) to the receiver
|
||||
*
|
||||
|
@ -653,6 +655,7 @@ int writeInt(RIG *rig, enum PAGE_e page, unsigned int addr, unsigned int x)
|
|||
|
||||
return (rc);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* /brief Read one byte from the receiver
|
||||
|
@ -774,6 +777,8 @@ int read3Bytes(RIG *rig, enum PAGE_e page, unsigned int addr, unsigned int *x)
|
|||
return (rc);
|
||||
}
|
||||
|
||||
#ifdef XXREMOVEDXX
|
||||
// this function is not referenced anywhere
|
||||
/*
|
||||
* /brief Read an unsigned int (four bytes) from the receiver
|
||||
*
|
||||
|
@ -820,6 +825,7 @@ int readInt(RIG *rig, enum PAGE_e page, unsigned int addr, unsigned int *x)
|
|||
|
||||
return (rc);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* /brief Read raw AGC value from the radio
|
||||
|
@ -850,6 +856,8 @@ int readSignal(RIG *rig, unsigned char *x)
|
|||
return (rc);
|
||||
}
|
||||
|
||||
#ifdef XXREMOVEDXX
|
||||
// this function is not referenced anywhere
|
||||
/*
|
||||
* /brief Flush I/O with radio
|
||||
*
|
||||
|
@ -870,6 +878,7 @@ int flushBuffer(RIG *rig)
|
|||
|
||||
return (rc);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* /brief Lock receiver for remote operations
|
||||
|
@ -941,6 +950,8 @@ int bcd2Int(const unsigned char bcd)
|
|||
return (rc);
|
||||
}
|
||||
|
||||
#ifdef XXREMOVEDXX
|
||||
// this function is not referenced anywhere
|
||||
/*
|
||||
* \brief Convert int into 2 digit BCD number
|
||||
*
|
||||
|
@ -970,6 +981,7 @@ unsigned char int2BCD(const unsigned int val)
|
|||
|
||||
return (rc);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* \brief Convert raw AGC value to calibrated level in dBm
|
||||
|
@ -1203,6 +1215,8 @@ float pbsToHz(const unsigned char steps)
|
|||
return (rc);
|
||||
}
|
||||
|
||||
#ifdef XXREMOVEDXX
|
||||
// this function is not referenced anywhere
|
||||
/*
|
||||
* /brief Convert PBS/BFO offset frequency in Hz to steps
|
||||
*
|
||||
|
@ -1243,6 +1257,7 @@ unsigned char hzToPBS(const float freq)
|
|||
|
||||
return (rc);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* /brief Convert native Mode to Hamlib mode
|
||||
|
|
12
ars/ars.c
12
ars/ars.c
|
@ -272,11 +272,11 @@ ars_move(ROT *rot, int direction, int speed)
|
|||
int need_settle_delay = 0;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s called%s%s%s%s%s\n", __func__,
|
||||
direction & ROT_MOVE_LEFT ? " LEFT" : "",
|
||||
direction & ROT_MOVE_RIGHT ? " RIGHT" : "",
|
||||
direction & ROT_MOVE_UP ? " UP" : "",
|
||||
direction & ROT_MOVE_DOWN ? " DOWN" : "",
|
||||
direction == 0 ? " STOP" : "");
|
||||
(direction & ROT_MOVE_LEFT) ? " LEFT" : "",
|
||||
(direction & ROT_MOVE_RIGHT) ? " RIGHT" : "",
|
||||
(direction & ROT_MOVE_UP) ? " UP" : "",
|
||||
(direction & ROT_MOVE_DOWN) ? " DOWN" : "",
|
||||
(direction == 0) ? " STOP" : "");
|
||||
|
||||
par_lock(pport);
|
||||
|
||||
|
@ -714,7 +714,7 @@ const struct rot_caps rci_azel_rot_caps =
|
|||
.rot_model = ROT_MODEL_RCI_AZEL,
|
||||
.model_name = "ARS RCI AZ&EL",
|
||||
.mfg_name = "EA4TX",
|
||||
.version = "0.1",
|
||||
.version = "0.2",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_BETA,
|
||||
.rot_type = ROT_TYPE_AZEL, /* AZ&EL units */
|
||||
|
|
|
@ -74,7 +74,7 @@ const struct rig_caps barrett_caps =
|
|||
.rig_model = RIG_MODEL_BARRETT_2050,
|
||||
.model_name = "2050",
|
||||
.mfg_name = "Barrett",
|
||||
.version = BACKEND_VER,
|
||||
.version = BACKEND_VER ".1",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_BETA,
|
||||
.rig_type = RIG_TYPE_TRANSCEIVER,
|
||||
|
@ -332,7 +332,6 @@ int barrett_transaction(RIG *rig, char *cmd, int expected, char **result)
|
|||
|
||||
int barrett_init(RIG *rig)
|
||||
{
|
||||
struct barrett_priv_data *priv;
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s version %s\n", __func__,
|
||||
rig->caps->version);
|
||||
|
||||
|
@ -341,7 +340,7 @@ int barrett_init(RIG *rig)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
priv = (struct barrett_priv_data *)calloc(1, sizeof(struct barrett_priv_data));
|
||||
struct barrett_priv_data *priv = (struct barrett_priv_data *)calloc(1, sizeof(struct barrett_priv_data));
|
||||
|
||||
if (!priv)
|
||||
{
|
||||
|
|
|
@ -673,11 +673,10 @@ powerstat_t Rig::getPowerStat (void)
|
|||
rmode_t Rig::RngRxModes (freq_t freq)
|
||||
{
|
||||
unsigned modes = RIG_MODE_NONE;
|
||||
freq_range_t *rng;
|
||||
int i;
|
||||
|
||||
for (i=0; i<FRQRANGESIZ; i++) {
|
||||
rng = &theRig->state.rx_range_list[i];
|
||||
freq_range_t *rng = &theRig->state.rx_range_list[i];
|
||||
if (RIG_IS_FRNG_END(*rng)) {
|
||||
return (rmode_t)modes;
|
||||
}
|
||||
|
@ -691,11 +690,10 @@ rmode_t Rig::RngRxModes (freq_t freq)
|
|||
rmode_t Rig::RngTxModes (freq_t freq)
|
||||
{
|
||||
unsigned modes = RIG_MODE_NONE;
|
||||
freq_range_t *rng;
|
||||
int i;
|
||||
|
||||
for (i=0; i<FRQRANGESIZ; i++) {
|
||||
rng = &theRig->state.tx_range_list[i];
|
||||
freq_range_t *rng = &theRig->state.tx_range_list[i];
|
||||
if (RIG_IS_FRNG_END(*rng)) {
|
||||
return (rmode_t)modes;
|
||||
}
|
||||
|
|
|
@ -52,8 +52,6 @@ cnctrk_set_position(ROT *rot, azimuth_t az, elevation_t el)
|
|||
|
||||
sprintf(axcmd, "/usr/bin/axis-remote --mdi 'G00 X %6.2f Y %6.2f' \n", az, el);
|
||||
return retval = system(axcmd);
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -139,7 +139,7 @@ int drake_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
* 10Hz resolution
|
||||
* TODO: round nearest?
|
||||
*/
|
||||
freq_len = sprintf((char *) freqbuf, "F%07d" EOM, (unsigned int)freq / 10);
|
||||
freq_len = sprintf((char *) freqbuf, "F%07u" EOM, (unsigned int)freq / 10);
|
||||
retval = drake_transaction(rig, (char *) freqbuf, freq_len, (char *) ackbuf,
|
||||
&ack_len);
|
||||
|
||||
|
@ -242,7 +242,6 @@ int drake_get_vfo(RIG *rig, vfo_t *vfo)
|
|||
{
|
||||
int mdbuf_len, retval;
|
||||
char mdbuf[BUFSZ];
|
||||
char cvfo;
|
||||
|
||||
retval = drake_transaction(rig, "RA" EOM, 3, mdbuf, &mdbuf_len);
|
||||
|
||||
|
@ -264,7 +263,7 @@ int drake_get_vfo(RIG *rig, vfo_t *vfo)
|
|||
}
|
||||
else
|
||||
{
|
||||
cvfo = (mdbuf[9] & 0x38);
|
||||
char cvfo = (mdbuf[9] & 0x38);
|
||||
|
||||
switch (cvfo)
|
||||
{
|
||||
|
@ -289,7 +288,7 @@ int drake_get_vfo(RIG *rig, vfo_t *vfo)
|
|||
int drake_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
||||
{
|
||||
unsigned char mdbuf[16], ackbuf[16];
|
||||
unsigned char mode_sel, width_sel;
|
||||
unsigned char mode_sel;
|
||||
int mdbuf_len, ack_len, retval;
|
||||
|
||||
switch (mode)
|
||||
|
@ -328,6 +327,7 @@ int drake_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
{
|
||||
if (mode != RIG_MODE_FM)
|
||||
{
|
||||
unsigned int width_sel;
|
||||
|
||||
if (width == RIG_PASSBAND_NORMAL)
|
||||
{
|
||||
|
|
|
@ -528,7 +528,7 @@ static int dummy_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd)
|
|||
static int twiddle = 0;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
*dcd = twiddle++ & 1 ? RIG_DCD_ON : RIG_DCD_OFF;
|
||||
*dcd = (twiddle++ & 1) ? RIG_DCD_ON : RIG_DCD_OFF;
|
||||
|
||||
return RIG_OK;
|
||||
}
|
||||
|
@ -865,7 +865,7 @@ static int dummy_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status)
|
|||
struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv;
|
||||
channel_t *curr = priv->curr;
|
||||
|
||||
*status = curr->funcs & func ? 1 : 0;
|
||||
*status = (curr->funcs & func) ? 1 : 0;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__,
|
||||
rig_strfunc(func));
|
||||
|
|
|
@ -262,8 +262,8 @@ static char *xml_build(char *cmd, char *value, char *xmlbuf, int xmlbuflen)
|
|||
}
|
||||
|
||||
strncat(xml, "<methodCall><methodName>", sizeof(xml) - 1);
|
||||
strncat(xml, cmd, sizeof(xml) - 1);
|
||||
strncat(xml, "</methodName>\r\n", sizeof(xml) - 1);
|
||||
strncat(xml, cmd, sizeof(xml) - strlen(xml) - 1);
|
||||
strncat(xml, "</methodName>\r\n", sizeof(xml) - strlen(xml) - 1);
|
||||
|
||||
if (value && strlen(value) > 0)
|
||||
{
|
||||
|
@ -308,7 +308,7 @@ static char *xml_parse2(char *xml, char *value, int valueLen)
|
|||
}
|
||||
else if (streq(p, "array"))
|
||||
{
|
||||
p = strtok_r(NULL, delims, &pr);
|
||||
strtok_r(NULL, delims, &pr);
|
||||
p = strtok_r(NULL, delims, &pr);
|
||||
}
|
||||
|
||||
|
@ -516,7 +516,7 @@ static int flrig_init(RIG *rig)
|
|||
priv->curr_widthA = -1;
|
||||
priv->curr_widthB = -1;
|
||||
|
||||
if (!rig || !rig->caps)
|
||||
if (!rig->caps)
|
||||
{
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
@ -675,6 +675,9 @@ static int flrig_open(RIG *rig)
|
|||
/* see if get_bwA is available */
|
||||
pxml = xml_build("rig.get_bwA", NULL, xml, sizeof(xml));
|
||||
retval = write_transaction(rig, pxml, strlen(pxml));
|
||||
|
||||
if (retval != RIG_OK) { return retval; }
|
||||
|
||||
read_transaction(rig, xml, sizeof(xml));
|
||||
xml_parse(xml, value, sizeof(value));
|
||||
|
||||
|
@ -691,6 +694,9 @@ static int flrig_open(RIG *rig)
|
|||
|
||||
pxml = xml_build("rig.get_AB", value, xml, sizeof(xml));
|
||||
retval = write_transaction(rig, pxml, strlen(pxml));
|
||||
|
||||
if (retval != RIG_OK) { return retval; }
|
||||
|
||||
read_transaction(rig, xml, sizeof(xml));
|
||||
xml_parse(xml, value, sizeof(value));
|
||||
|
||||
|
@ -871,8 +877,6 @@ static int flrig_cleanup(RIG *rig)
|
|||
*/
|
||||
static int flrig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
||||
{
|
||||
int retval;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__,
|
||||
rig_strvfo(vfo));
|
||||
|
||||
|
@ -909,7 +913,7 @@ static int flrig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
pxml = xml_build("rig.get_vfoB", NULL, xml, sizeof(xml));
|
||||
}
|
||||
|
||||
retval = write_transaction(rig, pxml, strlen(pxml));
|
||||
int retval = write_transaction(rig, pxml, strlen(pxml));
|
||||
|
||||
if (retval < 0)
|
||||
{
|
||||
|
@ -1543,11 +1547,9 @@ static int flrig_set_vfo(RIG *rig, vfo_t vfo)
|
|||
/* so if we are in split and asked for A we have to turn split back on */
|
||||
if (priv->split && vfo == RIG_VFO_A)
|
||||
{
|
||||
char xml[MAXXMLLEN];
|
||||
char value[MAXCMDLEN];
|
||||
sprintf(value, "<params><param><value><i4>%d</i4></value></param></params>",
|
||||
priv->split);
|
||||
char *pxml = xml_build("rig.set_split", value, xml, sizeof(xml));
|
||||
pxml = xml_build("rig.set_split", value, xml, sizeof(xml));
|
||||
retval = write_transaction(rig, pxml, strlen(pxml));
|
||||
|
||||
if (retval < 0)
|
||||
|
|
|
@ -1084,7 +1084,7 @@ static int netrigctl_set_dcs_sql(RIG *rig, vfo_t vfo, unsigned int code)
|
|||
|
||||
if (ret != RIG_OK) { return ret; }
|
||||
|
||||
len = sprintf(cmd, "\\set_dcs_sql%s %d\n", vfostr, code);
|
||||
len = sprintf(cmd, "\\set_dcs_sql%s %u\n", vfostr, code);
|
||||
|
||||
ret = netrigctl_transaction(rig, cmd, len, buf);
|
||||
|
||||
|
@ -2044,7 +2044,7 @@ const struct rig_caps netrigctl_caps =
|
|||
.rig_model = RIG_MODEL_NETRIGCTL,
|
||||
.model_name = "NET rigctl",
|
||||
.mfg_name = "Hamlib",
|
||||
.version = "1.1b",
|
||||
.version = "1.2",
|
||||
.copyright = "LGPL",
|
||||
.status = RIG_STATUS_STABLE,
|
||||
.rig_type = RIG_TYPE_OTHER,
|
||||
|
@ -2052,8 +2052,8 @@ const struct rig_caps netrigctl_caps =
|
|||
.ptt_type = RIG_PTT_RIG_MICDATA,
|
||||
.dcd_type = RIG_DCD_RIG,
|
||||
.port_type = RIG_PORT_NETWORK,
|
||||
.timeout = 2000, /* enough for a network */
|
||||
.retry = 3,
|
||||
.timeout = 2500, /* enough for a network */
|
||||
.retry = 1,
|
||||
|
||||
/* following fields updated in rig_state at openning time */
|
||||
.has_get_func = RIG_FUNC_NONE,
|
||||
|
|
|
@ -279,7 +279,7 @@ static int trxmanager_init(RIG *rig)
|
|||
priv->vfo_curr = RIG_VFO_A;
|
||||
priv->split = 0;
|
||||
|
||||
if (!rig || !rig->caps)
|
||||
if (!rig->caps)
|
||||
{
|
||||
return -RIG_EINVAL;
|
||||
}
|
||||
|
@ -504,7 +504,7 @@ static int trxmanager_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
char cmd[MAXCMDLEN];
|
||||
char response[MAXCMDLEN] = "";
|
||||
char vfoab = vfo == RIG_VFO_A ? 'A' : 'B';
|
||||
snprintf(cmd, sizeof(cmd), "F%c%011ld;", vfoab, (unsigned long)freq);
|
||||
snprintf(cmd, sizeof(cmd), "F%c%011lu;", vfoab, (unsigned long)freq);
|
||||
retval = write_block(&rs->rigport, cmd, strlen(cmd));
|
||||
|
||||
if (retval < 0)
|
||||
|
@ -996,7 +996,7 @@ static int trxmanager_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
|
|||
|
||||
char cmd[MAXCMDLEN];
|
||||
char response[MAXCMDLEN] = "";
|
||||
snprintf(cmd, sizeof(cmd), "XT%011ld;", (unsigned long) tx_freq);
|
||||
snprintf(cmd, sizeof(cmd), "XT%011lu;", (unsigned long) tx_freq);
|
||||
retval = write_block(&rs->rigport, cmd, strlen(cmd));
|
||||
|
||||
if (retval < 0)
|
||||
|
@ -1165,7 +1165,7 @@ static int trxmanager_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t freq,
|
|||
//
|
||||
char cmd[MAXCMDLEN];
|
||||
char response[MAXCMDLEN] = "";
|
||||
snprintf(cmd, sizeof(cmd), "XT%011ld;", (unsigned long)freq);
|
||||
snprintf(cmd, sizeof(cmd), "XT%011lu;", (unsigned long)freq);
|
||||
retval = write_block(&rs->rigport, cmd, strlen(cmd));
|
||||
|
||||
if (retval < 0)
|
||||
|
|
|
@ -71,7 +71,7 @@ easycomm_transaction(ROT *rot, const char *cmdstr, char *data, size_t data_len)
|
|||
goto transaction_quit;
|
||||
}
|
||||
|
||||
if (data == NULL || data_len <= 0)
|
||||
if (data == NULL)
|
||||
{
|
||||
return RIG_OK; /* don't want a reply */
|
||||
}
|
||||
|
|
22
elad/elad.c
22
elad/elad.c
|
@ -511,12 +511,12 @@ rmode_t elad2rmode(unsigned char mode, const rmode_t mode_table[])
|
|||
|
||||
char rmode2elad(rmode_t mode, const rmode_t mode_table[])
|
||||
{
|
||||
int i;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
if (mode != RIG_MODE_NONE)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ELAD_MODE_TABLE_MAX; i++)
|
||||
{
|
||||
if (mode_table[i] == mode)
|
||||
|
@ -1720,7 +1720,7 @@ int elad_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
|
|||
}
|
||||
|
||||
snprintf(buf, sizeof(buf), "OM0%c", c); /* target vfo is ignored */
|
||||
int err = elad_transaction(rig, buf, NULL, 0);
|
||||
err = elad_transaction(rig, buf, NULL, 0);
|
||||
|
||||
if (vfo != RIG_VFO_CURR && vfo != curr_vfo)
|
||||
{
|
||||
|
@ -1990,7 +1990,7 @@ int elad_get_mode_if(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
|| rig->caps->rig_model == RIG_MODEL_TS950SDX)
|
||||
{
|
||||
|
||||
err = elad_get_filter(rig, width);
|
||||
elad_get_filter(rig, width);
|
||||
/* non fatal */
|
||||
}
|
||||
|
||||
|
@ -2630,7 +2630,7 @@ int elad_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
|
|||
caps = rig->caps;
|
||||
|
||||
/* TODO: replace 200 by something like RIGTONEMAX */
|
||||
for (i = 0; caps->ctcss_list[i] != 0 && i < 200; i++)
|
||||
for (i = 0; caps->ctcss_list[i] != 0; i++)
|
||||
{
|
||||
if (caps->ctcss_list[i] == tone)
|
||||
{
|
||||
|
@ -2659,11 +2659,11 @@ int elad_set_ctcss_tone_tn(RIG *rig, vfo_t vfo, tone_t tone)
|
|||
}
|
||||
|
||||
const struct rig_caps *caps = rig->caps;
|
||||
char buf[6];
|
||||
char buf[16];
|
||||
int i;
|
||||
|
||||
/* XXX 40 is a fixed constant */
|
||||
for (i = 0; caps->ctcss_list[i] != 0 && i < 40; i++)
|
||||
for (i = 0; caps->ctcss_list[i] != 0; i++)
|
||||
{
|
||||
if (tone == caps->ctcss_list[i])
|
||||
{
|
||||
|
@ -2812,10 +2812,10 @@ int elad_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone)
|
|||
}
|
||||
|
||||
const struct rig_caps *caps = rig->caps;
|
||||
char buf[6];
|
||||
char buf[16];
|
||||
int i;
|
||||
|
||||
for (i = 0; caps->ctcss_list[i] != 0 && i < 40; i++)
|
||||
for (i = 0; caps->ctcss_list[i] != 0; i++)
|
||||
{
|
||||
if (tone == caps->ctcss_list[i])
|
||||
{
|
||||
|
@ -3378,7 +3378,7 @@ int elad_send_morse(RIG *rig, vfo_t vfo, const char *msg)
|
|||
}
|
||||
|
||||
char morsebuf[40], m2[30];
|
||||
int msg_len, buff_len, retval, i;
|
||||
int msg_len, retval, i;
|
||||
const char *p;
|
||||
|
||||
p = msg;
|
||||
|
@ -3410,7 +3410,7 @@ int elad_send_morse(RIG *rig, vfo_t vfo, const char *msg)
|
|||
else { return -RIG_EINVAL; }
|
||||
}
|
||||
|
||||
buff_len = msg_len > 24 ? 24 : msg_len;
|
||||
int buff_len = msg_len > 24 ? 24 : msg_len;
|
||||
|
||||
strncpy(m2, p, 24);
|
||||
m2[24] = '\0';
|
||||
|
|
|
@ -343,11 +343,11 @@ static int fetch_meter(RIG *rig, int *label, float *data, int npts)
|
|||
{
|
||||
struct dttsp_priv_data *priv = (struct dttsp_priv_data *)rig->state.priv;
|
||||
int ret, buf_len;
|
||||
char buf[sizeof(float)*MAXMETERPTS * MAXRX];
|
||||
|
||||
if (priv->meter_port.type.rig == RIG_PORT_UDP_NETWORK)
|
||||
{
|
||||
buf_len = sizeof(int) + npts * sizeof(float);
|
||||
char buf[sizeof(float)*MAXMETERPTS * MAXRX];
|
||||
buf_len = sizeof(buf);
|
||||
|
||||
ret = read_block(&priv->meter_port, buf, buf_len);
|
||||
|
||||
|
|
|
@ -306,7 +306,9 @@ int sdr1k_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
double ftw;
|
||||
double DDS_step_size;
|
||||
freq_t frqval;
|
||||
int spur_red = 1;
|
||||
// why is spur_red always true?
|
||||
// int spur_red = 1;
|
||||
#define spur_red 1
|
||||
int ret;
|
||||
|
||||
ret = set_band(rig, freq);
|
||||
|
@ -324,6 +326,7 @@ int sdr1k_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
DDS_step_size, (double)freq / DDS_step_size,
|
||||
rint((double)freq / DDS_step_size));
|
||||
|
||||
// why is spur_red always true?
|
||||
if (spur_red)
|
||||
{
|
||||
frqval = (freq_t)(DDS_step_size * rint((double)freq / DDS_step_size));
|
||||
|
|
|
@ -495,7 +495,7 @@ int gr_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
int chan_num = vfo2chan_num(rig, vfo);
|
||||
channel_t *chan = &priv->chans[chan_num];
|
||||
freq_t tuner_freq;
|
||||
int ret, i;
|
||||
int ret;
|
||||
char fstr[20];
|
||||
|
||||
sprintf_freq(fstr, freq);
|
||||
|
@ -534,6 +534,7 @@ int gr_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
|
|||
/*
|
||||
* tuner freq changed, so adjust frequency offset of other channels
|
||||
*/
|
||||
int i;
|
||||
for (i = 0; i<NUM_CHAN; i++) {
|
||||
if (i != chan_num)
|
||||
update_freq(rig, i, tuner_freq, priv->chans[i].freq);
|
||||
|
|
|
@ -60,7 +60,7 @@ class LSBDemodChainCF : public DemodChainCF {
|
|||
LSBDemodChainCF (VrSource<d_iType> *src, VrSink<d_oType> *snk, rmode_t mode, pbwidth_t width, int input_rate, freq_t centerfreq = 0) :
|
||||
DemodChainCF(src, snk, mode, width, input_rate, centerfreq) {
|
||||
|
||||
float low_cutoff = 300;
|
||||
low_cutoff = 300;
|
||||
// centerfreq, relative to IF_center_freq
|
||||
centerfreq += (freq_t)(-low_cutoff - width/2);
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ transaction_write:
|
|||
goto transaction_quit;
|
||||
}
|
||||
|
||||
#if 0
|
||||
#ifdef XXREMOVEDXX
|
||||
|
||||
/* Check that command termination is correct */
|
||||
if (strchr(REPLY_EOM, data[strlen(data) - 1]) == NULL)
|
||||
|
@ -378,7 +378,7 @@ const struct rot_caps f1tetracker_rot_caps =
|
|||
|
||||
.get_position = NULL, /* no position feedback available */
|
||||
.set_position = gs232_rot_set_position,
|
||||
#if 0
|
||||
#ifdef XXREMOVEDXX
|
||||
.stop = gs232_rot_stop,
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -110,7 +110,7 @@ transaction_write:
|
|||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
#ifdef XXREMOVEDXX
|
||||
|
||||
/* Check that command termination is correct */
|
||||
if (strchr(REPLY_EOM, data[strlen(data) - 1]) == NULL)
|
||||
|
|
|
@ -169,6 +169,8 @@ int icmarine_cleanup(RIG *rig)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
#ifdef XXREMOVEDXX
|
||||
// This function not referenced -- doesn't do anything really
|
||||
int icmarine_open(RIG *rig)
|
||||
{
|
||||
char respbuf[BUFSZ + 1];
|
||||
|
@ -184,6 +186,7 @@ int icmarine_open(RIG *rig)
|
|||
|
||||
return RIG_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
int icmarine_set_conf(RIG *rig, token_t token, const char *val)
|
||||
|
@ -253,7 +256,7 @@ int icmarine_transaction(RIG *rig, const char *cmd, const char *param,
|
|||
serial_flush(&rs->rigport);
|
||||
|
||||
/* command formating */
|
||||
cmd_len = snprintf(cmdbuf, BUFSZ, "$PICOA,%02u,%02u,%s",
|
||||
cmd_len = snprintf(cmdbuf, BUFSZ, "$PICOA,%02d,%02u,%s",
|
||||
CONTROLLER_ID,
|
||||
priv->remote_id,
|
||||
cmd);
|
||||
|
|
|
@ -166,6 +166,9 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd,
|
|||
Unhold_Decode(rig);
|
||||
return retval;
|
||||
}
|
||||
if (retval < 1) {
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
switch (buf[retval - 1])
|
||||
{
|
||||
|
@ -227,6 +230,9 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd,
|
|||
/* other error: return it */
|
||||
return frm_len;
|
||||
}
|
||||
if (frm_len < 1) {
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
switch (buf[frm_len - 1])
|
||||
{
|
||||
|
|
|
@ -905,9 +905,9 @@ int ic746pro_get_channel(RIG *rig, channel_t *chan)
|
|||
{
|
||||
struct icom_priv_data *priv;
|
||||
struct rig_state *rs;
|
||||
unsigned char chanbuf[46], databuf[32];
|
||||
unsigned char chanbuf[46];
|
||||
mem_buf_t *membuf;
|
||||
int chan_len, freq_len, retval, data_len, sc, band;
|
||||
int chan_len, freq_len, retval, data_len;
|
||||
|
||||
rs = &rig->state;
|
||||
priv = (struct icom_priv_data *)rs->priv;
|
||||
|
@ -991,12 +991,14 @@ int ic746pro_get_channel(RIG *rig, channel_t *chan)
|
|||
|
||||
/* offset is default for the band & is not stored in channel memory.
|
||||
The following retrieves the system default for the band */
|
||||
band = (int) chan->freq / 1000000; /* hf, 2m or 6 m */
|
||||
int band = (int) chan->freq / 1000000; /* hf, 2m or 6 m */
|
||||
|
||||
int sc;
|
||||
if (band < 50) { sc = S_MEM_HF_DUP_OFST; }
|
||||
else if (band < 108) { sc = S_MEM_6M_DUP_OFST; }
|
||||
else { sc = S_MEM_2M_DUP_OFST; }
|
||||
|
||||
unsigned char databuf[32];
|
||||
retval = icom_transaction(rig, C_CTL_MEM, sc,
|
||||
NULL, 0, databuf, &data_len);
|
||||
|
||||
|
|
|
@ -330,7 +330,6 @@ const struct rig_caps ic7800_caps =
|
|||
int ic7800_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
||||
{
|
||||
unsigned char cmdbuf[MAXFRAMELEN];
|
||||
int i;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
|
||||
|
@ -340,6 +339,7 @@ int ic7800_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
if (val.i != 0)
|
||||
{
|
||||
/* Convert dB to index */
|
||||
int i;
|
||||
for (i = 0; i < 7; i++)
|
||||
{
|
||||
if (val.i == rig->state.attenuator[i])
|
||||
|
|
71
icom/icom.c
71
icom/icom.c
|
@ -44,9 +44,9 @@
|
|||
// So we need to distinguish between them
|
||||
#define VFO_HAS_A_B ((rig->state.vfo_list & (RIG_VFO_A|RIG_VFO_B)) == (RIG_VFO_A|RIG_VFO_B))
|
||||
#define VFO_HAS_MAIN_SUB ((rig->state.vfo_list & (RIG_VFO_MAIN|RIG_VFO_SUB)) == (RIG_VFO_MAIN|RIG_VFO_SUB))
|
||||
#define VFO_HAS_MAIN_SUB_ONLY (!VFO_HAS_A_B & VFO_HAS_MAIN_SUB)
|
||||
#define VFO_HAS_MAIN_SUB_ONLY ((!VFO_HAS_A_B) & VFO_HAS_MAIN_SUB)
|
||||
#define VFO_HAS_MAIN_SUB_A_B_ONLY (VFO_HAS_A_B & VFO_HAS_MAIN_SUB)
|
||||
#define VFO_HAS_A_B_ONLY (VFO_HAS_A_B & !VFO_HAS_MAIN_SUB)
|
||||
#define VFO_HAS_A_B_ONLY (VFO_HAS_A_B & (!VFO_HAS_MAIN_SUB))
|
||||
|
||||
static int set_vfo_curr(RIG *rig, vfo_t vfo, vfo_t curr_vfo);
|
||||
|
||||
|
@ -715,8 +715,6 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
// Newer Icoms can read main/sub frequency
|
||||
int cmd = C_RD_FREQ;
|
||||
int subcmd = -1;
|
||||
unsigned char data;
|
||||
int datalen = 0;
|
||||
|
||||
// Pick the appropriate VFO when VFO_TX is requested
|
||||
if (vfo == RIG_VFO_TX)
|
||||
|
@ -726,28 +724,28 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq)
|
|||
|
||||
if (priv->split_on)
|
||||
{
|
||||
vfo = rig->state.vfo_list & RIG_VFO_B ? RIG_VFO_B : RIG_VFO_SUB;
|
||||
vfo = (rig->state.vfo_list & RIG_VFO_B) ? RIG_VFO_B : RIG_VFO_SUB;
|
||||
}
|
||||
else
|
||||
{
|
||||
vfo = rig->state.vfo_list & RIG_VFO_B ? RIG_VFO_A : RIG_VFO_MAIN;
|
||||
vfo = (rig->state.vfo_list & RIG_VFO_B) ? RIG_VFO_A : RIG_VFO_MAIN;
|
||||
}
|
||||
}
|
||||
|
||||
retval = set_vfo_curr(rig, vfo, priv->curr_vfo);
|
||||
if (retval != RIG_OK) { return retval; }
|
||||
|
||||
// Pick the appropriate VFO when VFO_RX is requested
|
||||
if (vfo == RIG_VFO_RX)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: VFO_RX requested, vfo=%s\n", __func__,
|
||||
rig_strvfo(vfo));
|
||||
vfo = rig->state.vfo_list & RIG_VFO_B ? RIG_VFO_A : RIG_VFO_MAIN;
|
||||
vfo = (rig->state.vfo_list & RIG_VFO_B) ? RIG_VFO_A : RIG_VFO_MAIN;
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: using vfo=%s\n", __func__, rig_strvfo(vfo));
|
||||
|
||||
retval = icom_transaction(rig, cmd, subcmd, datalen == 0 ? NULL : &data,
|
||||
datalen, freqbuf, &freq_len);
|
||||
retval = icom_transaction(rig, cmd, subcmd, NULL, 0, freqbuf, &freq_len);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
{
|
||||
|
@ -995,9 +993,11 @@ pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef XXREMOVEDXX
|
||||
// not referenced anywhere
|
||||
int icom_set_dsp_flt(RIG *rig, rmode_t mode, pbwidth_t width)
|
||||
{
|
||||
int retval, rfstatus, i;
|
||||
int retval, rfstatus;
|
||||
unsigned char ackbuf[MAXFRAMELEN];
|
||||
unsigned char flt_ext;
|
||||
value_t rfwidth;
|
||||
|
@ -1017,6 +1017,7 @@ int icom_set_dsp_flt(RIG *rig, rmode_t mode, pbwidth_t width)
|
|||
{
|
||||
if (!rig_get_func(rig, RIG_VFO_CURR, RIG_FUNC_RF, &rfstatus) && (rfstatus))
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < RTTY_FIL_NB; i++)
|
||||
{
|
||||
if (rtty_fil[i] == width)
|
||||
|
@ -1071,6 +1072,7 @@ int icom_set_dsp_flt(RIG *rig, rmode_t mode, pbwidth_t width)
|
|||
|
||||
return RIG_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* icom_set_mode_with_data
|
||||
|
@ -1393,6 +1395,8 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width)
|
|||
return RIG_OK;
|
||||
}
|
||||
|
||||
#ifdef XXREMOVEDXX
|
||||
// not implemented yet
|
||||
/*
|
||||
* icom_get_vfo
|
||||
* The IC-9700 has introduced the ability to see MAIN/SUB selection
|
||||
|
@ -1425,6 +1429,7 @@ int icom_get_vfo(RIG *rig, vfo_t *vfo)
|
|||
*vfo = ackbuf[2] == 0 ? RIG_VFO_A : RIG_VFO_B;
|
||||
return RIG_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* icom_get_vfo
|
||||
|
@ -3141,7 +3146,7 @@ int icom_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t tx_freq,
|
|||
int ack_len = sizeof(ackbuf);
|
||||
vfo_t rx_vfo, tx_vfo;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s\n", __func__, rig_strvfo(vfo));
|
||||
|
||||
/* This method works also in memory mode(RIG_VFO_MEM) */
|
||||
if (!priv->no_xchg && rig_has_vfo_op(rig, RIG_OP_XCHG))
|
||||
|
@ -3162,7 +3167,7 @@ int icom_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t tx_freq,
|
|||
current VFO is VFO A and the split Tx VFO is always VFO B. These
|
||||
assumptions allow us to deal with the lack of VFO and split
|
||||
queries */
|
||||
if (VFO_HAS_A_B_ONLY
|
||||
if (VFO_HAS_A_B
|
||||
&& priv->split_on) /* broken if user changes split on rig :( */
|
||||
{
|
||||
/* VFO A/B style rigs swap VFO on split Tx so we need to disable
|
||||
|
@ -3178,7 +3183,10 @@ int icom_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t tx_freq,
|
|||
}
|
||||
}
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE,"%s: before get_split_vfos rx_vfo=%s tx_vfo=%s\n", __func__, rig_strvfo(priv->rx_vfo), rig_strvfo(priv->tx_vfo));
|
||||
if (RIG_OK != (rc = icom_get_split_vfos(rig, &rx_vfo, &tx_vfo))) { return rc; }
|
||||
rig_debug(RIG_DEBUG_VERBOSE,"%s: after get_split_vfos rx_vfo=%s tx_vfo=%s\n", __func__, rig_strvfo(priv->rx_vfo), rig_strvfo(priv->tx_vfo));
|
||||
|
||||
|
||||
if (RIG_OK != (rc = icom_set_vfo(rig, tx_vfo))) { return rc; }
|
||||
|
||||
|
@ -3189,7 +3197,7 @@ int icom_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t tx_freq,
|
|||
|
||||
if (RIG_OK != (rc = icom_set_vfo(rig, rx_vfo))) { return rc; }
|
||||
|
||||
if (VFO_HAS_A_B_ONLY && priv->split_on)
|
||||
if (VFO_HAS_A_B && priv->split_on)
|
||||
{
|
||||
/* Re-enable split */
|
||||
if (RIG_OK != (rc = icom_transaction(rig, C_CTL_SPLT, S_SPLT_ON, NULL, 0,
|
||||
|
@ -3305,13 +3313,10 @@ int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
|||
split_sc = S_SPLT_ON;
|
||||
|
||||
// Need to allow for SATMODE split in here
|
||||
if (!priv->split_on) // only need to do this if split is not on already
|
||||
/* ensure VFO A is Rx and VFO B is Tx as we assume that elsewhere */
|
||||
if (VFO_HAS_A_B)
|
||||
{
|
||||
/* ensure VFO A is Rx and VFO B is Tx as we assume that elsewhere */
|
||||
if (VFO_HAS_A_B)
|
||||
{
|
||||
if (RIG_OK != (rc = icom_set_vfo(rig, RIG_VFO_A))) { return rc; }
|
||||
}
|
||||
if (RIG_OK != (rc = icom_set_vfo(rig, RIG_VFO_A))) { return rc; }
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -3334,6 +3339,7 @@ int icom_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo)
|
|||
priv->rx_vfo = vfo;
|
||||
priv->tx_vfo = tx_vfo;
|
||||
priv->split_on = RIG_SPLIT_ON == split;
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s rx_vfo=%s tx_vfo=%s split=%d\n", __func__, rig_strvfo(vfo), rig_strvfo(priv->rx_vfo), rig_strvfo(priv->tx_vfo), split);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
@ -3348,6 +3354,7 @@ 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;
|
||||
struct icom_priv_data *priv = (struct icom_priv_data *)rig->state.priv;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
retval = icom_transaction(rig, C_CTL_SPLT, -1, NULL, 0,
|
||||
|
@ -3384,7 +3391,9 @@ int icom_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo)
|
|||
rig_debug(RIG_DEBUG_ERR, "%s: unsupported split %d", __func__, splitbuf[1]);
|
||||
return -RIG_EPROTO;
|
||||
}
|
||||
|
||||
*tx_vfo = priv->tx_vfo;
|
||||
priv->split_on = RIG_SPLIT_ON == *split;
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s rx_vfo=%s tx_vfo=%s split=%d\n", __func__, rig_strvfo(vfo), rig_strvfo(priv->rx_vfo), rig_strvfo(priv->tx_vfo), *split);
|
||||
return RIG_OK;
|
||||
}
|
||||
|
||||
|
@ -4006,14 +4015,14 @@ int icom_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone)
|
|||
const struct rig_caps *caps;
|
||||
unsigned char tonebuf[MAXFRAMELEN], ackbuf[MAXFRAMELEN];
|
||||
int tone_len, ack_len = sizeof(ackbuf), retval;
|
||||
int i;
|
||||
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
caps = rig->caps;
|
||||
|
||||
if (caps->ctcss_list)
|
||||
{
|
||||
for (i = 0; caps->ctcss_list[i] != 0 && i < FULL_CTCSS_LIST_COUNT; i++)
|
||||
int i;
|
||||
for (i = 0; caps->ctcss_list[i] != 0; i++)
|
||||
{
|
||||
if (caps->ctcss_list[i] == tone)
|
||||
{
|
||||
|
@ -4086,7 +4095,7 @@ int icom_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone)
|
|||
if (!caps->ctcss_list) { return RIG_OK; }
|
||||
|
||||
/* check this tone exists. That's better than nothing. */
|
||||
for (i = 0; caps->ctcss_list[i] != 0 && i < FULL_CTCSS_LIST_COUNT; i++)
|
||||
for (i = 0; caps->ctcss_list[i] != 0; i++)
|
||||
{
|
||||
if (caps->ctcss_list[i] == *tone)
|
||||
{
|
||||
|
@ -4112,7 +4121,7 @@ int icom_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone)
|
|||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
caps = rig->caps;
|
||||
|
||||
for (i = 0; caps->ctcss_list[i] != 0 && i < FULL_CTCSS_LIST_COUNT; i++)
|
||||
for (i = 0; caps->ctcss_list[i] != 0; i++)
|
||||
{
|
||||
if (caps->ctcss_list[i] == tone)
|
||||
{
|
||||
|
@ -4181,7 +4190,7 @@ int icom_get_ctcss_sql(RIG *rig, vfo_t vfo, tone_t *tone)
|
|||
*tone = from_bcd_be(tonebuf + 2, tone_len * 2);
|
||||
|
||||
/* check this tone exists. That's better than nothing. */
|
||||
for (i = 0; caps->ctcss_list[i] != 0 && i < FULL_CTCSS_LIST_COUNT; i++)
|
||||
for (i = 0; caps->ctcss_list[i] != 0; i++)
|
||||
{
|
||||
if (caps->ctcss_list[i] == *tone)
|
||||
{
|
||||
|
@ -4207,7 +4216,7 @@ int icom_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code)
|
|||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
caps = rig->caps;
|
||||
|
||||
for (i = 0; caps->dcs_list[i] != 0 && i < COMMON_DCS_LIST_COUNT; i++)
|
||||
for (i = 0; caps->dcs_list[i] != 0; i++)
|
||||
{
|
||||
if (caps->dcs_list[i] == code)
|
||||
{
|
||||
|
@ -4280,7 +4289,7 @@ int icom_get_dcs_code(RIG *rig, vfo_t vfo, tone_t *code)
|
|||
*code = from_bcd_be(codebuf + 3, code_len * 2);
|
||||
|
||||
/* check this code exists. That's better than nothing. */
|
||||
for (i = 0; caps->dcs_list[i] != 0 && i < COMMON_DCS_LIST_COUNT; i++)
|
||||
for (i = 0; caps->dcs_list[i] != 0; i++)
|
||||
{
|
||||
if (caps->dcs_list[i] == *code)
|
||||
{
|
||||
|
@ -4306,7 +4315,7 @@ int icom_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code)
|
|||
rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__);
|
||||
caps = rig->caps;
|
||||
|
||||
for (i = 0; caps->dcs_list[i] != 0 && i < COMMON_DCS_LIST_COUNT; i++)
|
||||
for (i = 0; caps->dcs_list[i] != 0; i++)
|
||||
{
|
||||
if (caps->dcs_list[i] == code)
|
||||
{
|
||||
|
@ -4379,7 +4388,7 @@ int icom_get_dcs_sql(RIG *rig, vfo_t vfo, tone_t *code)
|
|||
*code = from_bcd_be(codebuf + 3, code_len * 2);
|
||||
|
||||
/* check this code exists. That's better than nothing. */
|
||||
for (i = 0; caps->dcs_list[i] != 0 && i < COMMON_DCS_LIST_COUNT; i++)
|
||||
for (i = 0; caps->dcs_list[i] != 0; i++)
|
||||
{
|
||||
if (caps->dcs_list[i] == *code)
|
||||
{
|
||||
|
@ -5382,7 +5391,7 @@ DECLARE_PROBERIG_BACKEND(icom)
|
|||
/* read out the bytes we just sent
|
||||
* TODO: check this is what we expect
|
||||
*/
|
||||
frm_len = read_icom_frame(port, buf, sizeof(buf));
|
||||
read_icom_frame(port, buf, sizeof(buf));
|
||||
|
||||
/* this is the reply */
|
||||
frm_len = read_icom_frame(port, buf, sizeof(buf));
|
||||
|
@ -5456,7 +5465,7 @@ DECLARE_PROBERIG_BACKEND(icom)
|
|||
/* read out the bytes we just sent
|
||||
* TODO: check this is what we expect
|
||||
*/
|
||||
frm_len = read_icom_frame(port, buf, sizeof(buf));
|
||||
read_icom_frame(port, buf, sizeof(buf));
|
||||
|
||||
/* this is the reply */
|
||||
frm_len = read_icom_frame(port, buf, sizeof(buf));
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#define BACKEND_VER "0.17"
|
||||
#define BACKEND_VER "0.18"
|
||||
|
||||
/*
|
||||
* defines used by comp_cal_str in rig.c
|
||||
|
|
|
@ -283,7 +283,7 @@ const struct rig_caps icr7100_caps =
|
|||
.get_func = icom_get_func,
|
||||
.set_level = icom_set_level,
|
||||
.get_level = icom_get_level,
|
||||
#if 0
|
||||
#ifdef XXREMOVEDXX
|
||||
.set_parm = icom_set_parm,
|
||||
.get_parm = icom_get_parm,
|
||||
#endif
|
||||
|
|
|
@ -183,7 +183,7 @@ const struct rig_caps icr9000_caps =
|
|||
.get_func = icom_get_func,
|
||||
.set_level = icom_set_level,
|
||||
.get_level = icom_get_level,
|
||||
#if 0
|
||||
#ifdef XXREMOVEDXX
|
||||
.set_parm = icom_set_parm,
|
||||
.get_parm = icom_get_parm,
|
||||
#endif
|
||||
|
|
|
@ -245,7 +245,7 @@ int optoscan_get_dcs_code(RIG *rig, vfo_t vfo, tone_t *code)
|
|||
int optoscan_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length)
|
||||
{
|
||||
unsigned char dtmfbuf[MAXFRAMELEN], digit;
|
||||
int len, retval, digitpos;
|
||||
int len, digitpos;
|
||||
unsigned char xlate[] = {'0', '1', '2', '3', '4', '5', '6',
|
||||
'7', '8', '9', 'A', 'B', 'C', 'D',
|
||||
'*', '#'
|
||||
|
@ -254,7 +254,7 @@ int optoscan_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length)
|
|||
|
||||
do
|
||||
{
|
||||
retval = icom_transaction(rig, C_CTL_MISC, S_OPTO_RDDTMF,
|
||||
int retval = icom_transaction(rig, C_CTL_MISC, S_OPTO_RDDTMF,
|
||||
NULL, 0, dtmfbuf, &len);
|
||||
|
||||
if (retval != RIG_OK)
|
||||
|
@ -271,7 +271,7 @@ int optoscan_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length)
|
|||
|
||||
digit = dtmfbuf[2];
|
||||
|
||||
if (digit < 0x16)
|
||||
if (digit < 16)
|
||||
{
|
||||
digits[digitpos] = xlate[digit];
|
||||
digitpos++;
|
||||
|
@ -495,15 +495,13 @@ int optoscan_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val)
|
|||
int optoscan_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
||||
{
|
||||
struct optostat status_block;
|
||||
unsigned char lvlbuf[MAXFRAMELEN];
|
||||
int lvl_len = 0;
|
||||
int lvl_cn, lvl_sc; /* Command Number, Subcommand */
|
||||
int icom_val;
|
||||
int cmdhead;
|
||||
int retval;
|
||||
|
||||
if (level != RIG_LEVEL_AF)
|
||||
{
|
||||
int lvl_cn, lvl_sc; /* Command Number, Subcommand */
|
||||
switch (level)
|
||||
{
|
||||
case RIG_LEVEL_RAWSTR:
|
||||
|
@ -516,6 +514,7 @@ int optoscan_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
unsigned char lvlbuf[MAXFRAMELEN];
|
||||
retval = icom_transaction(rig, lvl_cn, lvl_sc, NULL, 0,
|
||||
lvlbuf, &lvl_len);
|
||||
|
||||
|
@ -527,7 +526,7 @@ int optoscan_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
/*
|
||||
* strbuf should contain Cn,Sc,Data area
|
||||
*/
|
||||
cmdhead = (lvl_sc == -1) ? 1 : 2;
|
||||
int cmdhead = (lvl_sc == -1) ? 1 : 2;
|
||||
lvl_len -= cmdhead;
|
||||
|
||||
if (lvlbuf[0] != ACK && lvlbuf[0] != lvl_cn)
|
||||
|
|
15
jrc/jrc.c
15
jrc/jrc.c
|
@ -897,7 +897,7 @@ int jrc_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
/*
|
||||
* 000..255
|
||||
*/
|
||||
sscanf(lvlbuf + 2, "%u", &lvl);
|
||||
sscanf(lvlbuf + 2, "%d", &lvl);
|
||||
val->f = (float)lvl / 255.0;
|
||||
break;
|
||||
|
||||
|
@ -919,7 +919,7 @@ int jrc_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
/*
|
||||
* 000..255
|
||||
*/
|
||||
sscanf(lvlbuf + 2, "%u", &lvl);
|
||||
sscanf(lvlbuf + 2, "%d", &lvl);
|
||||
val->f = (float)lvl / 255.0;
|
||||
break;
|
||||
|
||||
|
@ -941,7 +941,7 @@ int jrc_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
/*
|
||||
* 000..255
|
||||
*/
|
||||
sscanf(lvlbuf + 2, "%u", &lvl);
|
||||
sscanf(lvlbuf + 2, "%d", &lvl);
|
||||
val->f = (float)lvl / 255.0;
|
||||
break;
|
||||
|
||||
|
@ -963,7 +963,7 @@ int jrc_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
/*
|
||||
* 000..255
|
||||
*/
|
||||
sscanf(lvlbuf + 2, "%u", &lvl);
|
||||
sscanf(lvlbuf + 2, "%d", &lvl);
|
||||
val->f = (float)lvl / 255.0;
|
||||
break;
|
||||
|
||||
|
@ -1119,7 +1119,7 @@ int jrc_set_parm(RIG *rig, setting_t parm, value_t val)
|
|||
case RIG_PARM_BEEP:
|
||||
|
||||
cmd_len = sprintf(cmdbuf, "U%0*d" EOM, priv->beep_len,
|
||||
priv->beep + val.i ? 1 : 0);
|
||||
(priv->beep + val.i) ? 1 : 0);
|
||||
|
||||
return jrc_transaction(rig, cmdbuf, cmd_len, NULL, NULL);
|
||||
|
||||
|
@ -1353,7 +1353,7 @@ int jrc_set_mem(RIG *rig, vfo_t vfo, int ch)
|
|||
return -RIG_EINVAL;
|
||||
}
|
||||
|
||||
cmd_len = sprintf(cmdbuf, "C%03u" EOM, ch);
|
||||
cmd_len = sprintf(cmdbuf, "C%03d" EOM, ch);
|
||||
|
||||
/* don't care about the Automatic reponse from receiver */
|
||||
|
||||
|
@ -1464,7 +1464,7 @@ int jrc_set_chan(RIG *rig, const channel_t *chan)
|
|||
int jrc_get_chan(RIG *rig, channel_t *chan)
|
||||
{
|
||||
struct jrc_priv_caps *priv = (struct jrc_priv_caps *)rig->caps->priv;
|
||||
char membuf[BUFSZ], cmdbuf[BUFSZ], freqbuf[BUFSZ];
|
||||
char membuf[BUFSZ], cmdbuf[BUFSZ];
|
||||
int mem_len, cmd_len, retval;
|
||||
|
||||
chan->vfo = RIG_VFO_MEM;
|
||||
|
@ -1520,6 +1520,7 @@ int jrc_get_chan(RIG *rig, channel_t *chan)
|
|||
jrc2rig_mode(rig, membuf[6], membuf[5],
|
||||
&chan->mode, &chan->width);
|
||||
|
||||
char freqbuf[BUFSZ];
|
||||
strncpy(freqbuf, membuf + 7, priv->max_freq_len);
|
||||
freqbuf[priv->max_freq_len] = 0x00;
|
||||
chan->freq = strtol(freqbuf, NULL, 10);
|
||||
|
|
|
@ -2000,8 +2000,8 @@ int k3_set_nb_level(RIG *rig, float dsp_nb, float if_nb)
|
|||
char lvlbuf[16];
|
||||
int retval;
|
||||
|
||||
int dsp_nb_raw;
|
||||
int if_nb_raw;
|
||||
int dsp_nb_raw = 0;
|
||||
int if_nb_raw = 0;
|
||||
|
||||
if (dsp_nb >= 0)
|
||||
{
|
||||
|
|
|
@ -152,7 +152,7 @@ const struct rig_caps transfox_caps =
|
|||
.set_ptt = kenwood_set_ptt,
|
||||
.get_ptt = transfox_get_ptt,
|
||||
.get_info = transfox_get_info,
|
||||
#if 0
|
||||
#ifdef XXREMOVEDXX
|
||||
.set_trn = transfox_set_trn,
|
||||
.get_trn = transfox_get_trn,
|
||||
.scan = transfox_scan,
|
||||
|
|
|
@ -152,7 +152,7 @@ const struct rig_caps trc80_caps =
|
|||
.rig_init = kenwood_init,
|
||||
.rig_cleanup = kenwood_cleanup,
|
||||
|
||||
#if 0
|
||||
#ifdef XXREMOVEDXX
|
||||
.set_freq = kenwood_set_freq,
|
||||
#endif
|
||||
.get_freq = kenwood_get_freq_if,
|
||||
|
|
|
@ -57,7 +57,6 @@ microtune_eval_board::~microtune_eval_board ()
|
|||
{
|
||||
delete m_i2c;
|
||||
delete m_i2cio;
|
||||
delete m_i2c;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -292,7 +292,7 @@ int HAMLIB_API par_read_data(hamlib_port_t *port, unsigned char *data)
|
|||
status = ioctl(port->fd, PPIGDATA, &data);
|
||||
return status == 0 ? RIG_OK : -RIG_EIO;
|
||||
#elif defined(__WIN64__) || defined(__WIN32__)
|
||||
unsigned char ret;
|
||||
unsigned char ret = 0;
|
||||
unsigned int dummy;
|
||||
|
||||
intptr_t handle;
|
||||
|
@ -433,7 +433,7 @@ int HAMLIB_API par_read_control(hamlib_port_t *port, unsigned char *control)
|
|||
*control = ctrl ^ CP_ACTIVE_LOW_BITS;
|
||||
return status == 0 ? RIG_OK : -RIG_EIO;
|
||||
#elif defined(__WIN64__) || defined(__WIN32__)
|
||||
unsigned char ret;
|
||||
unsigned char ret = 0;
|
||||
unsigned int dummy;
|
||||
|
||||
intptr_t handle;
|
||||
|
@ -495,7 +495,7 @@ int HAMLIB_API par_read_status(hamlib_port_t *port, unsigned char *status)
|
|||
return ret == 0 ? RIG_OK : -RIG_EIO;
|
||||
|
||||
#elif defined(__WIN64__) || defined(__WIN32__)
|
||||
unsigned char ret;
|
||||
unsigned char ret = 0;
|
||||
unsigned int dummy;
|
||||
|
||||
intptr_t handle;
|
||||
|
|
|
@ -205,7 +205,7 @@ struct test_table *find_cmd_entry(int cmd)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAXNBOPT && test_list[i].cmd != 0x00; i++)
|
||||
for (i = 0; test_list[i].cmd != 0; i++)
|
||||
if (test_list[i].cmd == cmd)
|
||||
{
|
||||
break;
|
||||
|
@ -263,7 +263,7 @@ void hash_add_model(int id,
|
|||
/* Hash sorting functions */
|
||||
int hash_model_id_sort(struct mod_lst *a, struct mod_lst *b)
|
||||
{
|
||||
return (a->id - b->id);
|
||||
return (a->id > b->id);
|
||||
}
|
||||
|
||||
|
||||
|
@ -330,7 +330,7 @@ char parse_arg(const char *arg)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAXNBOPT && test_list[i].cmd != 0; i++)
|
||||
for (i = 0; test_list[i].cmd != 0; i++)
|
||||
{
|
||||
if (!strncmp(arg, test_list[i].name, MAXNAMSIZ))
|
||||
{
|
||||
|
|
|
@ -329,7 +329,7 @@ static struct test_table *find_cmd_entry(int cmd)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAXNBOPT && test_list[i].cmd != 0x00; i++)
|
||||
for (i = 0; test_list[i].cmd != 0x00; i++)
|
||||
{
|
||||
if (test_list[i].cmd == cmd)
|
||||
{
|
||||
|
@ -390,7 +390,7 @@ void hash_add_model(int id,
|
|||
/* Hash sorting functions */
|
||||
int hash_model_id_sort(struct mod_lst *a, struct mod_lst *b)
|
||||
{
|
||||
return (a->id - b->id);
|
||||
return (a->id > b->id);
|
||||
}
|
||||
|
||||
|
||||
|
@ -453,7 +453,7 @@ static char parse_arg(const char *arg)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAXNBOPT && test_list[i].cmd != 0; i++)
|
||||
for (i = 0; test_list[i].cmd != 0x00; i++)
|
||||
{
|
||||
if (!strncmp(arg, test_list[i].name, MAXNAMSIZ))
|
||||
{
|
||||
|
@ -4023,6 +4023,9 @@ declare_proto_rig(send_cmd)
|
|||
char bufcmd[BUFSZ];
|
||||
char buf[BUFSZ];
|
||||
char eom_buf[4] = { 0xa, 0xd, 0, 0 };
|
||||
int binary = 0;
|
||||
|
||||
rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__);
|
||||
|
||||
/*
|
||||
* binary protocols enter values as \0xZZ\0xYY..
|
||||
|
@ -4051,6 +4054,12 @@ declare_proto_rig(send_cmd)
|
|||
/* no End Of Message chars */
|
||||
eom_buf[0] = '\0';
|
||||
}
|
||||
else if (rig->caps->rig_model == RIG_MODEL_NETRIGCTL)
|
||||
{
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: we're using netrigctl\n", __func__);
|
||||
snprintf(bufcmd, sizeof(bufcmd), "w %s\n", arg1);
|
||||
cmd_len = strlen(bufcmd);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* text protocol */
|
||||
|
@ -4078,9 +4087,10 @@ declare_proto_rig(send_cmd)
|
|||
return retval;
|
||||
}
|
||||
|
||||
if (interactive && prompt)
|
||||
if ((interactive && prompt) || (interactive && !prompt && ext_resp))
|
||||
{
|
||||
fprintf(fout, "%s: ", cmd->arg2);
|
||||
fwrite(cmd->arg1, 1, strlen(cmd->arg1), fout); /* i.e. "Frequency" */
|
||||
fwrite(":", 1, 1, fout); /* i.e. "Frequency" */
|
||||
}
|
||||
|
||||
do
|
||||
|
@ -4102,13 +4112,53 @@ declare_proto_rig(send_cmd)
|
|||
buf[BUFSZ - 1] = '\0';
|
||||
}
|
||||
|
||||
// we use fwrite in case of any nulls in binary return
|
||||
fwrite(buf, 1, retval, fout);
|
||||
fwrite("\n", 1, 1, fout);
|
||||
if (rig->caps->rig_model != RIG_MODEL_NETRIGCTL)
|
||||
{
|
||||
// see if we have binary being returned
|
||||
int i;
|
||||
|
||||
for (i = 0; i < retval; ++i)
|
||||
{
|
||||
if (!isprint(buf[i]))
|
||||
{
|
||||
binary = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (binary) // convert our buf to a hex representaion
|
||||
{
|
||||
int i;
|
||||
char hex[64];
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s: sending binary\n", __func__);
|
||||
|
||||
for (i = 0; i < retval; ++i)
|
||||
{
|
||||
snprintf(hex, sizeof(hex), "\\0x%02X", (unsigned char)buf[i]);
|
||||
fprintf(fout, "%s", hex);
|
||||
}
|
||||
|
||||
fprintf(fout, " %d\n", retval);
|
||||
return RIG_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
// we should be in printable ASCII here
|
||||
fprintf(fout, "%s\n", buf);
|
||||
}
|
||||
}
|
||||
while (retval > 0);
|
||||
|
||||
// we use fwrite in case of any nulls in binary return
|
||||
if (binary) { fwrite(buf, 1, retval, fout); }
|
||||
|
||||
if (binary)
|
||||
{
|
||||
fwrite("\n", 1, 1, fout);
|
||||
}
|
||||
|
||||
|
||||
if (retval > 0 || retval == -RIG_ETIMEOUT)
|
||||
{
|
||||
retval = RIG_OK;
|
||||
|
|
|
@ -234,7 +234,7 @@ struct test_table *find_cmd_entry(int cmd)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAXNBOPT && test_list[i].cmd != 0x00; i++)
|
||||
for (i = 0; test_list[i].cmd != 0x00; i++)
|
||||
if (test_list[i].cmd == cmd)
|
||||
{
|
||||
break;
|
||||
|
@ -292,7 +292,7 @@ void hash_add_model(int id,
|
|||
/* Hash sorting functions */
|
||||
int hash_model_id_sort(struct mod_lst *a, struct mod_lst *b)
|
||||
{
|
||||
return (a->id - b->id);
|
||||
return (a->id > b->id);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -47,6 +47,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++)
|
||||
{
|
||||
|
@ -67,6 +68,8 @@ int read_calibration(int buf[NUM_CHANNELS][2])
|
|||
|
||||
empty_calibration:
|
||||
|
||||
fclose(f);
|
||||
|
||||
printf("/etc/ADC-calibration.dat not found or it's not readable\n");
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -45,6 +45,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++)
|
||||
{
|
||||
|
@ -67,6 +68,8 @@ empty_calibration:
|
|||
|
||||
printf("/etc/ADC-calibration.dat not found or it's not readable\n");
|
||||
|
||||
fclose(f);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -251,7 +251,7 @@ const struct rig_caps ft980_caps =
|
|||
.set_mem = ft980_set_mem,
|
||||
.get_mem = ft980_get_mem,
|
||||
|
||||
#if 0
|
||||
#ifdef XXREMOVEDXX
|
||||
.get_level = ft980_get_level,
|
||||
.set_level = ft980_set_level,
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue