[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. ca8ed30f8f39745941b1b
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Michael B. <mdb...@us...> - 2021-01-09 16:14:01
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via ca8ed30f8f39745941b1b7c1d4031e9bf246e144 (commit) from 1d74711a00dfa416a171cec87c841db315c5d9f7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit ca8ed30f8f39745941b1b7c1d4031e9bf246e144 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Jan 9 10:13:17 2021 -0600 astyle files diff --git a/rigs/barrett/barrett.c b/rigs/barrett/barrett.c index 739825c9..1494c80e 100644 --- a/rigs/barrett/barrett.c +++ b/rigs/barrett/barrett.c @@ -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); diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index aaba5d0b..4165884d 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -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)); diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 2b183e62..dacd414c 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -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); } diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index e9359d23..4b507415 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -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) diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index fe1131c2..553a0c63 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -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 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 97d9ebaf..a0896675 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -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); diff --git a/src/misc.c b/src/misc.c index a504376e..17a790ac 100644 --- a/src/misc.c +++ b/src/misc.c @@ -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"; } } diff --git a/src/register.c b/src/register.c index 85ee3f3f..c4f6127d 100644 --- a/src/register.c +++ b/src/register.c @@ -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++) { diff --git a/src/rig.c b/src/rig.c index 4c76a7d9..dfd9ac90 100644 --- a/src/rig.c +++ b/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)) { diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 962ed7a4..4e00f968 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -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"); } ----------------------------------------------------------------------- Summary of changes: rigs/barrett/barrett.c | 6 +++--- rigs/dummy/dummy.c | 2 +- rigs/dummy/flrig.c | 2 +- rigs/dummy/netrigctl.c | 21 +++++++++++++-------- rigs/icom/frame.c | 8 ++++++-- rigs/yaesu/newcat.c | 2 +- src/misc.c | 9 ++++++--- src/register.c | 6 +++--- src/rig.c | 36 +++++++++++++++++++++++++----------- tests/rigctl_parse.c | 8 ++++---- 10 files changed, 63 insertions(+), 37 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |