pull/649/head
Mike Black W9MDB 2021-04-04 12:50:07 -05:00
rodzic d312945729
commit bbc8e00074
7 zmienionych plików z 52 dodań i 33 usunięć

Wyświetl plik

@ -588,8 +588,8 @@ static int flrig_transaction(RIG *rig, char *cmd, char *cmd_arg, char *value,
read_transaction(rig, xml, sizeof(xml)); // this might time out -- that's OK
// we get an uknown response if function does not exist
if (strstr(xml,"unknown")) RETURNFUNC(RIG_ENAVAIL);
// we get an uknown response if function does not exist
if (strstr(xml, "unknown")) { RETURNFUNC(RIG_ENAVAIL); }
if (value)
{
@ -834,17 +834,18 @@ static int flrig_open(RIG *rig)
}
else
{
priv->has_get_modeA = 1;
priv->has_get_modeA = 1;
rig_debug(RIG_DEBUG_VERBOSE, "%s: getmodeA is available\n", __func__);
}
/* see if set_vfoA_fast is available */
freq_t freq;
retval = flrig_get_freq(rig, RIG_VFO_CURR, &freq);
if (retval != RIG_OK)
{
rig_debug(RIG_DEBUG_ERR, "%s: flrig_get_freq not working!!\n", __func__);
RETURNFUNC(RIG_EPROTO);
RETURNFUNC(RIG_EPROTO);
}
@ -859,12 +860,13 @@ static int flrig_open(RIG *rig)
if (retval == RIG_ENAVAIL) // must not have it
{
val.i = 0;
rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, val);
rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_PTT, val);
val.i = 0;
rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, val);
rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_PTT, val);
priv->has_set_freq_fast = 0;
priv->has_set_ptt_fast = 0; // they both will not be there
rig_debug(RIG_DEBUG_VERBOSE, "%s: set_vfoA_fast/ptt is not available\n", __func__);
rig_debug(RIG_DEBUG_VERBOSE, "%s: set_vfoA_fast/ptt is not available\n",
__func__);
}
else
{
@ -1197,17 +1199,22 @@ static int flrig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
value_t val;
rig_get_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, &val);
rig_debug(RIG_DEBUG_VERBOSE, "%s: fast_set_freq=%d\n", __func__, val.i);
if (vfo == RIG_VFO_A)
{
cmd = "rig.set_vfoA";
if (val.i) cmd = "rig.set_vfoA_fast";
if (val.i) { cmd = "rig.set_vfoA_fast"; }
rig_debug(RIG_DEBUG_TRACE, "%s %.0f\n", cmd, freq);
priv->curr_freqA = freq;
}
else
{
cmd = "rig.set_vfoB";
if (val.i) cmd = "rig.set_vfoB_fast";
if (val.i) { cmd = "rig.set_vfoB_fast"; }
rig_debug(RIG_DEBUG_TRACE, "%s %.0f\n", cmd, freq);
priv->curr_freqB = freq;
}
@ -2200,10 +2207,14 @@ static int flrig_set_ext_parm(RIG *rig, token_t token, value_t val)
{
case TOK_FLRIG_FAST_SET_FREQ:
case TOK_FLRIG_FAST_SET_PTT:
if (val.i && !priv->has_set_freq_fast) {
rig_debug(RIG_DEBUG_ERR, "%s: FLRig version 1.3.54.14 or higher needed to support fast functions\n",__func__);
RETURNFUNC(-RIG_EINVAL);
}
if (val.i && !priv->has_set_freq_fast)
{
rig_debug(RIG_DEBUG_ERR,
"%s: FLRig version 1.3.54.14 or higher needed to support fast functions\n",
__func__);
RETURNFUNC(-RIG_EINVAL);
}
break;
default:

Wyświetl plik

@ -585,7 +585,8 @@ static int netrigctl_open(RIG *rig)
else if (strcmp(setting, "targetable_vfo") == 0)
{
rig->caps->targetable_vfo = strtol(value, NULL, 0);
rig_debug(RIG_DEBUG_ERR, "%s: targetable_vfo=0x%2x\n", __func__, rig->caps->targetable_vfo);
rig_debug(RIG_DEBUG_ERR, "%s: targetable_vfo=0x%2x\n", __func__,
rig->caps->targetable_vfo);
}
else if (strcmp(setting, "has_set_vfo") == 0)
{

Wyświetl plik

@ -334,7 +334,7 @@ transaction_write:
if (retval == RIG_OK && strncmp(cmdstr, "RX", 2) == 0) { goto transaction_quit; }
// Malachite SDR cannot send ID after FA
if (priv->no_id) RETURNFUNC(RIG_OK);
if (priv->no_id) { RETURNFUNC(RIG_OK); }
if (!datasize)
{
@ -2810,6 +2810,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
retval = kenwood_get_power_minmax(rig, &power_now, &power_min, &power_max, 1);
if (retval != RIG_OK) { RETURNFUNC(retval); }
power_min = 0; // our return scale is 0-max to match the input scale
val->f = (power_now - power_min) / (float)(power_max - power_min);
RETURNFUNC(RIG_OK);
@ -3764,7 +3765,7 @@ int kenwood_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
int retval = kenwood_transaction(rig, ptt_cmd, NULL, 0);
if (ptt == RIG_PTT_OFF) hl_usleep(100*1000); // a little time for PTT to turn off
if (ptt == RIG_PTT_OFF) { hl_usleep(100 * 1000); } // a little time for PTT to turn off
RETURNFUNC(retval);
}

Wyświetl plik

@ -918,7 +918,8 @@ const struct rig_caps ts890s_caps =
const struct confparams malachite_cfg_parms[] =
{
{ // the Malachite SDR cannot handle sending ID; after FA; commands
{
// the Malachite SDR cannot handle sending ID; after FA; commands
TOK_NO_ID, "no_id", "No ID", "If true do not send ID; with set commands",
NULL, RIG_CONF_CHECKBUTTON, { }
},
@ -932,7 +933,8 @@ int malachite_init(RIG *rig)
int retval;
retval = kenwood_init(rig);
if (retval != RIG_OK) RETURNFUNC(retval);
if (retval != RIG_OK) { RETURNFUNC(retval); }
priv->no_id = 1; // the Malchite doesn't like the ID; verify cmd

Wyświetl plik

@ -1016,7 +1016,8 @@ int ft857_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt)
}
n = ft857_send_cmd(rig, index);
if (ptt == RIG_PTT_OFF) hl_usleep(200*1000); // FT857 takes a bit to come out of PTT
if (ptt == RIG_PTT_OFF) { hl_usleep(200 * 1000); } // FT857 takes a bit to come out of PTT
rig_force_cache_timeout(&((struct ft857_priv_data *)
rig->state.priv)->tx_status_tv);

Wyświetl plik

@ -275,7 +275,7 @@ static ssize_t port_read(hamlib_port_t *p, void *buf, size_t count)
}
//RETURNFUNC(ret); // too verbose
return ret;
return ret;
}
else if (p->type.rig == RIG_PORT_NETWORK
|| p->type.rig == RIG_PORT_UDP_NETWORK)

Wyświetl plik

@ -3605,7 +3605,7 @@ int HAMLIB_API rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
do
{
// doing get_freq seems to break on some rigs that can't read freq immediately after set
// doing get_freq seems to break on some rigs that can't read freq immediately after set
if (caps->set_split_freq)
{
retcode = caps->set_split_freq(rig, vfo, tx_freq);
@ -4039,7 +4039,9 @@ int HAMLIB_API rig_set_split_freq_mode(RIG *rig,
// in split mode we alwasy use VFOB
// in the future we may start using RIG_VFO_TX and let the backend figure out what VFO to use
vfo = RIG_VFO_B; // in split mode we always use VFOB
rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s, tx_freq=%.0f, tx_mode=%s, tx_width=%d\n", __func__, rig_strvfo(vfo), tx_freq, rig_strrmode(tx_mode), (int)tx_width);
rig_debug(RIG_DEBUG_VERBOSE,
"%s: vfo=%s, tx_freq=%.0f, tx_mode=%s, tx_width=%d\n", __func__,
rig_strvfo(vfo), tx_freq, rig_strrmode(tx_mode), (int)tx_width);
if (caps->set_split_freq_mode)
{
@ -6000,7 +6002,8 @@ int HAMLIB_API rig_get_vfo_info(RIG *rig, vfo_t vfo, freq_t *freq,
if (retval != RIG_OK) { RETURNFUNC(retval); }
if ((vfo == RIG_VFO_B || vfo == RIG_VFO_SUB) && (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE))
if ((vfo == RIG_VFO_B || vfo == RIG_VFO_SUB)
&& (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE))
{
retval = rig_get_mode(rig, vfo, mode, width);