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 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)
{ {
@ -834,37 +834,39 @@ static int flrig_open(RIG *rig)
} }
else else
{ {
priv->has_get_modeA = 1; priv->has_get_modeA = 1;
rig_debug(RIG_DEBUG_VERBOSE, "%s: getmodeA is available\n", __func__); rig_debug(RIG_DEBUG_VERBOSE, "%s: getmodeA is available\n", __func__);
} }
/* 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__);
RETURNFUNC(RIG_EPROTO); RETURNFUNC(RIG_EPROTO);
} }
value_t val; value_t val;
val.i = 1; // we'll try fast and if it fails turn it off val.i = 1; // we'll try fast and if it fails turn it off
priv->has_set_freq_fast = 1; priv->has_set_freq_fast = 1;
priv->has_set_ptt_fast = 1; // they both will be there priv->has_set_ptt_fast = 1; // they both will be there
rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, val); rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, val);
rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_PTT, val); rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_PTT, val);
retval = flrig_set_freq(rig, RIG_VFO_CURR, freq); retval = flrig_set_freq(rig, RIG_VFO_CURR, freq);
if (retval == RIG_ENAVAIL) // must not have it if (retval == RIG_ENAVAIL) // must not have it
{ {
val.i = 0; val.i = 0;
rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, val); rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, val);
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
{ {
@ -874,7 +876,7 @@ static int flrig_open(RIG *rig)
/* see if get_bwA is available */ /* see if get_bwA is available */
retval = flrig_transaction(rig, "rig.get_bwA", NULL, value, sizeof(value)); retval = flrig_transaction(rig, "rig.get_bwA", NULL, value, sizeof(value));
if (retval == RIG_ENAVAIL) // must not have it if (retval == RIG_ENAVAIL) // must not have it
{ {
priv->has_get_bwA = 0; priv->has_get_bwA = 0;
rig_debug(RIG_DEBUG_VERBOSE, "%s: get_bwA is available=%s\n", __func__, rig_debug(RIG_DEBUG_VERBOSE, "%s: get_bwA is available=%s\n", __func__,
@ -1036,7 +1038,7 @@ static int flrig_open(RIG *rig)
rig_debug(RIG_DEBUG_VERBOSE, "%s: hamlib modes=%s\n", __func__, value); rig_debug(RIG_DEBUG_VERBOSE, "%s: hamlib modes=%s\n", __func__, value);
RETURNFUNC(retval); RETURNFUNC(retval);
} }
@ -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__); {
RETURNFUNC(-RIG_EINVAL); 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; 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

@ -333,8 +333,8 @@ transaction_write:
// We may eventually want to verify PTT with rig_get_ptt instead // We may eventually want to verify PTT with rig_get_ptt instead
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, { }
}, },
@ -927,12 +928,13 @@ const struct confparams malachite_cfg_parms[] =
int malachite_init(RIG *rig) int malachite_init(RIG *rig)
{ {
struct kenwood_priv_data *priv = rig->state.priv; struct kenwood_priv_data *priv = rig->state.priv;
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

@ -64,7 +64,7 @@ int HAMLIB_API port_open(hamlib_port_t *p)
{ {
int status; int status;
int want_state_delay = 0; int want_state_delay = 0;
ENTERFUNC; ENTERFUNC;
p->fd = -1; p->fd = -1;
@ -275,7 +275,7 @@ static ssize_t port_read(hamlib_port_t *p, void *buf, size_t count)
} }
//RETURNFUNC(ret); // too verbose //RETURNFUNC(ret); // too verbose
return ret; return ret;
} }
else if (p->type.rig == RIG_PORT_NETWORK else if (p->type.rig == RIG_PORT_NETWORK
|| p->type.rig == RIG_PORT_UDP_NETWORK) || p->type.rig == RIG_PORT_UDP_NETWORK)

Wyświetl plik

@ -3605,11 +3605,11 @@ int HAMLIB_API rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq)
do 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) if (caps->set_split_freq)
{ {
retcode = caps->set_split_freq(rig, vfo, tx_freq); retcode = caps->set_split_freq(rig, vfo, tx_freq);
//rig_get_freq(rig, vfo, &tfreq); //rig_get_freq(rig, vfo, &tfreq);
} }
else else
{ {
@ -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);