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

@ -589,7 +589,7 @@ 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 read_transaction(rig, xml, sizeof(xml)); // this might time out -- that's OK
// we get an uknown response if function does not exist // we get an uknown response if function does not exist
if (strstr(xml,"unknown")) RETURNFUNC(RIG_ENAVAIL); if (strstr(xml, "unknown")) { RETURNFUNC(RIG_ENAVAIL); }
if (value) if (value)
{ {
@ -841,6 +841,7 @@ static int flrig_open(RIG *rig)
/* see if set_vfoA_fast is available */ /* see if set_vfoA_fast is available */
freq_t freq; freq_t freq;
retval = flrig_get_freq(rig, RIG_VFO_CURR, &freq); retval = flrig_get_freq(rig, RIG_VFO_CURR, &freq);
if (retval != RIG_OK) if (retval != RIG_OK)
{ {
rig_debug(RIG_DEBUG_ERR, "%s: flrig_get_freq not working!!\n", __func__); rig_debug(RIG_DEBUG_ERR, "%s: flrig_get_freq not working!!\n", __func__);
@ -864,7 +865,8 @@ static int flrig_open(RIG *rig)
rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_PTT, val); rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_PTT, val);
priv->has_set_freq_fast = 0; priv->has_set_freq_fast = 0;
priv->has_set_ptt_fast = 0; // they both will not be there 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 else
{ {
@ -1197,17 +1199,22 @@ static int flrig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
value_t val; value_t val;
rig_get_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, &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); rig_debug(RIG_DEBUG_VERBOSE, "%s: fast_set_freq=%d\n", __func__, val.i);
if (vfo == RIG_VFO_A) if (vfo == RIG_VFO_A)
{ {
cmd = "rig.set_vfoA"; 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); rig_debug(RIG_DEBUG_TRACE, "%s %.0f\n", cmd, freq);
priv->curr_freqA = freq; priv->curr_freqA = freq;
} }
else else
{ {
cmd = "rig.set_vfoB"; 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); rig_debug(RIG_DEBUG_TRACE, "%s %.0f\n", cmd, freq);
priv->curr_freqB = 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_FREQ:
case TOK_FLRIG_FAST_SET_PTT: case TOK_FLRIG_FAST_SET_PTT:
if (val.i && !priv->has_set_freq_fast) { 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__); {
rig_debug(RIG_DEBUG_ERR,
"%s: FLRig version 1.3.54.14 or higher needed to support fast functions\n",
__func__);
RETURNFUNC(-RIG_EINVAL); RETURNFUNC(-RIG_EINVAL);
} }
break; break;
default: default:

Wyświetl plik

@ -585,7 +585,8 @@ static int netrigctl_open(RIG *rig)
else if (strcmp(setting, "targetable_vfo") == 0) else if (strcmp(setting, "targetable_vfo") == 0)
{ {
rig->caps->targetable_vfo = strtol(value, NULL, 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) 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; } if (retval == RIG_OK && strncmp(cmdstr, "RX", 2) == 0) { goto transaction_quit; }
// Malachite SDR cannot send ID after FA // Malachite SDR cannot send ID after FA
if (priv->no_id) RETURNFUNC(RIG_OK); if (priv->no_id) { RETURNFUNC(RIG_OK); }
if (!datasize) 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); retval = kenwood_get_power_minmax(rig, &power_now, &power_min, &power_max, 1);
if (retval != RIG_OK) { RETURNFUNC(retval); } if (retval != RIG_OK) { RETURNFUNC(retval); }
power_min = 0; // our return scale is 0-max to match the input scale 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); val->f = (power_now - power_min) / (float)(power_max - power_min);
RETURNFUNC(RIG_OK); 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); 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); RETURNFUNC(retval);
} }

Wyświetl plik

@ -918,7 +918,8 @@ const struct rig_caps ts890s_caps =
const struct confparams malachite_cfg_parms[] = 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", TOK_NO_ID, "no_id", "No ID", "If true do not send ID; with set commands",
NULL, RIG_CONF_CHECKBUTTON, { } NULL, RIG_CONF_CHECKBUTTON, { }
}, },
@ -932,7 +933,8 @@ int malachite_init(RIG *rig)
int retval; int retval;
retval = kenwood_init(rig); 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 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); 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_force_cache_timeout(&((struct ft857_priv_data *)
rig->state.priv)->tx_status_tv); rig->state.priv)->tx_status_tv);

Wyświetl plik

@ -4039,7 +4039,9 @@ int HAMLIB_API rig_set_split_freq_mode(RIG *rig,
// in split mode we alwasy use VFOB // 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 // 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 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) 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 (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); retval = rig_get_mode(rig, vfo, mode, width);