pull/506/head
Michael Black W9MDB 2021-01-09 10:13:17 -06:00
rodzic 1d74711a00
commit ca8ed30f8f
10 zmienionych plików z 63 dodań i 37 usunięć

Wyświetl plik

@ -54,14 +54,14 @@ int barrett_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt);
static int barrett_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt);
int barrett_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width);
int barrett_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode,
pbwidth_t *width);
pbwidth_t *width);
int barrett_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq);
int barrett_set_split_vfo(RIG *rig, vfo_t rxvfo, split_t split,
vfo_t txvfo);
vfo_t txvfo);
int barrett_get_split_vfo(RIG *rig, vfo_t rxvfo, split_t *split,
vfo_t *txvfo);
vfo_t *txvfo);
static int barrett_get_level(RIG *rig, vfo_t vfo, setting_t level,
value_t *val);

Wyświetl plik

@ -1123,7 +1123,7 @@ static int dummy_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
break;
}
memcpy (val, &curr->levels[idx], sizeof(value_t));
memcpy(val, &curr->levels[idx], sizeof(value_t));
rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__,
rig_strlevel(level));

Wyświetl plik

@ -909,7 +909,7 @@ static int flrig_open(RIG *rig)
else if (streq(p, "UCW")) { modeMapAdd(&modes, RIG_MODE_CW, p); }
else if (streq(p, "C4FM")) { modeMapAdd(&modes, RIG_MODE_C4FM, p); }
else if (streq(p, "SPEC")) { modeMapAdd(&modes, RIG_MODE_SPEC, p); }
else if (streq(p,"DRM")) // we don't support DRM yet (or maybe ever)
else if (streq(p, "DRM")) // we don't support DRM yet (or maybe ever)
{
rig_debug(RIG_DEBUG_VERBOSE, "%s: no mapping for mode %s\n", __func__, p);
}

Wyświetl plik

@ -579,27 +579,32 @@ static int netrigctl_open(RIG *rig)
else if (strcmp(setting, "targetable_vfo") == 0)
{
int has = strtol(value, NULL, 0);
if (!has) rig->caps->targetable_vfo = strtol(value, NULL, 0);
if (!has) { rig->caps->targetable_vfo = strtol(value, NULL, 0); }
}
else if (strcmp(setting, "has_set_vfo") == 0)
{
int has = strtol(value, NULL, 0);
if (!has) rig->caps->set_vfo = NULL;
if (!has) { rig->caps->set_vfo = NULL; }
}
else if (strcmp(setting, "has_get_vfo") == 0)
{
int has = strtol(value, NULL, 0);
if (!has) rig->caps->get_vfo = NULL;
if (!has) { rig->caps->get_vfo = NULL; }
}
else if (strcmp(setting, "has_set_freq") == 0)
{
int has = strtol(value, NULL, 0);
if (!has) rig->caps->set_freq = NULL;
if (!has) { rig->caps->set_freq = NULL; }
}
else if (strcmp(setting, "has_get_freq") == 0)
{
int has = strtol(value, NULL, 0);
if (!has) rig->caps->get_freq= NULL;
if (!has) { rig->caps->get_freq = NULL; }
}
else
{
@ -836,11 +841,11 @@ static int netrigctl_get_vfo(RIG *rig, vfo_t *vfo)
ret = netrigctl_transaction(rig, cmd, len, buf);
if (ret == -RIG_ENAVAIL || ret == -RIG_ENIMPL)
{
if (ret == -RIG_ENAVAIL || ret == -RIG_ENIMPL)
{
// for rigs without get_vfo we'll use our saved vfo
*vfo = priv->vfo_curr;
return RIG_OK;
return RIG_OK;
}
if (ret <= 0)

Wyświetl plik

@ -227,6 +227,7 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd,
frm_len = read_icom_frame(&rs->rigport, buf, sizeof(buf));
#if 0
// this was causing rigctld to fail on IC706 and WSJT-X
// This dynamic detection is therefore disabled for now
if (memcmp(buf, sendbuf, frm_len) == 0 && priv->serial_USB_echo_off)
@ -236,6 +237,7 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd,
// And try again
frm_len = read_icom_frame(&rs->rigport, buf, sizeof(buf));
}
#endif
Unhold_Decode(rig);
@ -273,7 +275,8 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd,
if (NAK == buf[frm_len - 2]) { return -RIG_ERJCTED; }
*data_len = frm_len - (ACKFRMLEN - 1);
rig_debug(RIG_DEBUG_TRACE, "%s: data_len=%d, frm_len=%d\n", __func__, *data_len, frm_len);
rig_debug(RIG_DEBUG_TRACE, "%s: data_len=%d, frm_len=%d\n", __func__, *data_len,
frm_len);
memcpy(data, buf + 4, *data_len);
/*
@ -400,7 +403,8 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width,
pbwidth_t width_tmp = width;
struct icom_priv_data *priv_data = (struct icom_priv_data *) rig->state.priv;
rig_debug(RIG_DEBUG_TRACE, "%s: mode=%d, width=%d\n", __func__, (int)mode, (int)width);
rig_debug(RIG_DEBUG_TRACE, "%s: mode=%d, width=%d\n", __func__, (int)mode,
(int)width);
icmode_ext = -1;
if (width == RIG_PASSBAND_NOCHANGE) // then we read width so we can reuse it

Wyświetl plik

@ -7701,7 +7701,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width)
else
{
snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c%c", cmd, main_sub_vfo,
cat_term);
cat_term);
}
err = newcat_get_cmd(rig);

Wyświetl plik

@ -1812,7 +1812,8 @@ const char *HAMLIB_API rot_strstatus(rot_status_t status)
* \param RIG* and rig_function_e
* \return the corresponding function pointer
*/
void *rig_get_function_ptr(rig_model_t rig_model, enum rig_function_e rig_function)
void *rig_get_function_ptr(rig_model_t rig_model,
enum rig_function_e rig_function)
{
const struct rig_caps *caps = rig_get_caps(rig_model);
@ -2105,7 +2106,8 @@ int rig_get_caps_int(rig_model_t rig_model, enum rig_caps_int_e rig_caps)
return RIG_OK;
}
const char *rig_get_caps_cptr(rig_model_t rig_model, enum rig_caps_cptr_e rig_caps)
const char *rig_get_caps_cptr(rig_model_t rig_model,
enum rig_caps_cptr_e rig_caps)
{
const struct rig_caps *caps = rig_get_caps(rig_model);
@ -2124,7 +2126,8 @@ const char *rig_get_caps_cptr(rig_model_t rig_model, enum rig_caps_cptr_e rig_ca
return rig_strstatus(caps->status);
default:
rig_debug(RIG_DEBUG_ERR, "%s: Unknown requested rig_caps value=%d\n", __func__, rig_caps);
rig_debug(RIG_DEBUG_ERR, "%s: Unknown requested rig_caps value=%d\n", __func__,
rig_caps);
return "Unknown caps value";
}
}

Wyświetl plik

@ -388,8 +388,8 @@ int HAMLIB_API rig_list_foreach(int (*cfunc)(const struct rig_caps *,
*/
//! @cond Doxygen_Suppress
int HAMLIB_API rig_list_foreach_model(int (*cfunc)(const rig_model_t rig_model,
rig_ptr_t),
rig_ptr_t data)
rig_ptr_t),
rig_ptr_t data)
{
struct rig_list *p;
int i;
@ -489,7 +489,7 @@ int rig_load_all_backends()
{
int i;
memset(rig_hash_table, 0 , sizeof(rig_hash_table));
memset(rig_hash_table, 0, sizeof(rig_hash_table));
for (i = 0; i < RIG_BACKEND_MAX && rig_backend_list[i].be_name; i++)
{

Wyświetl plik

@ -424,6 +424,7 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model)
sizeof(struct freq_range_list)*FRQRANGESIZ);
memcpy(rs->tx_range_list, caps->tx_range_list1,
sizeof(struct freq_range_list)*FRQRANGESIZ);
// if we don't have list1 we'll try list2
if (RIG_IS_FRNG_END(rs->rx_range_list[0]))
{
@ -432,6 +433,7 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model)
memcpy(rs->rx_range_list, caps->tx_range_list2,
sizeof(struct freq_range_list)*FRQRANGESIZ);
}
if (RIG_IS_FRNG_END(rs->rx_range_list[0]))
{
rig_debug(RIG_DEBUG_ERR, "%s: rig does not have rx_range!!\n", __func__);
@ -490,16 +492,26 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model)
rs->vfo_list |= caps->tx_range_list2[i].vfo;
rs->mode_list |= caps->tx_range_list2[i].modes;
}
if (rs->vfo_list & RIG_VFO_A) rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_A\n", __func__);
if (rs->vfo_list & RIG_VFO_B) rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_B\n", __func__);
if (rs->vfo_list & RIG_VFO_C) rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_C\n", __func__);
if (rs->vfo_list & RIG_VFO_SUB_A) rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_SUB_A\n", __func__);
if (rs->vfo_list & RIG_VFO_SUB_B) rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_SUB_B\n", __func__);
if (rs->vfo_list & RIG_VFO_MAIN_A) rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_MAIN_A\n", __func__);
if (rs->vfo_list & RIG_VFO_MAIN_B) rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_MAIN_B\n", __func__);
if (rs->vfo_list & RIG_VFO_SUB) rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_SUB\n", __func__);
if (rs->vfo_list & RIG_VFO_MAIN) rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_MAIN\n", __func__);
if (rs->vfo_list & RIG_VFO_MEM) rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_MEM\n", __func__);
if (rs->vfo_list & RIG_VFO_A) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_A\n", __func__); }
if (rs->vfo_list & RIG_VFO_B) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_B\n", __func__); }
if (rs->vfo_list & RIG_VFO_C) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_C\n", __func__); }
if (rs->vfo_list & RIG_VFO_SUB_A) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_SUB_A\n", __func__); }
if (rs->vfo_list & RIG_VFO_SUB_B) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_SUB_B\n", __func__); }
if (rs->vfo_list & RIG_VFO_MAIN_A) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_MAIN_A\n", __func__); }
if (rs->vfo_list & RIG_VFO_MAIN_B) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_MAIN_B\n", __func__); }
if (rs->vfo_list & RIG_VFO_SUB) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_SUB\n", __func__); }
if (rs->vfo_list & RIG_VFO_MAIN) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_MAIN\n", __func__); }
if (rs->vfo_list & RIG_VFO_MEM) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig has VFO_MEM\n", __func__); }
memcpy(rs->preamp, caps->preamp, sizeof(int)*MAXDBLSTSIZ);
memcpy(rs->attenuator, caps->attenuator, sizeof(int)*MAXDBLSTSIZ);
@ -1526,6 +1538,7 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq)
}
}
// update our current freq too
if (vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { rig->state.current_freq = freq_new; }
@ -1753,7 +1766,8 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width)
const struct rig_caps *caps;
int retcode;
rig_debug(RIG_DEBUG_VERBOSE, "%s called, vfo=%s, mode=%s, width=%d\n", __func__, rig_strvfo(vfo), rig_strrmode(mode), (int)width);
rig_debug(RIG_DEBUG_VERBOSE, "%s called, vfo=%s, mode=%s, width=%d\n", __func__,
rig_strvfo(vfo), rig_strrmode(mode), (int)width);
if (CHECK_RIG_ARG(rig))
{

Wyświetl plik

@ -4109,10 +4109,10 @@ declare_proto_rig(dump_state)
fprintf(fout, "vfo_ops=0x%x\n", rig->caps->vfo_ops);
fprintf(fout, "ptt_type=0x%x\n", rig->state.pttport.type.ptt);
fprintf(fout, "targetable_vfo=0x%x\n", rig->caps->targetable_vfo);
fprintf(fout, "has_set_vfo=%d\n", rig->caps->set_vfo!=NULL);
fprintf(fout, "has_get_vfo=%d\n", rig->caps->get_vfo!=NULL);
fprintf(fout, "has_set_freq=%d\n", rig->caps->set_freq!=NULL);
fprintf(fout, "has_get_freq=%d\n", rig->caps->get_freq!=NULL);
fprintf(fout, "has_set_vfo=%d\n", rig->caps->set_vfo != NULL);
fprintf(fout, "has_get_vfo=%d\n", rig->caps->get_vfo != NULL);
fprintf(fout, "has_set_freq=%d\n", rig->caps->set_freq != NULL);
fprintf(fout, "has_get_freq=%d\n", rig->caps->get_freq != NULL);
fprintf(fout, "done\n");
}