kopia lustrzana https://github.com/Hamlib/Hamlib
astyle files
rodzic
1d74711a00
commit
ca8ed30f8f
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
|
36
src/rig.c
36
src/rig.c
|
@ -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))
|
||||
{
|
||||
|
|
Ładowanie…
Reference in New Issue