[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 6a523705319918a84fecc
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Michael B. <mdb...@us...> - 2021-01-08 22:35:52
|
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 6a523705319918a84feccfed151e408fbc43ee59 (commit) via 5805de6e1e71f7b2ada5e528b16460adf4ccff8b (commit) via cf858bfa3c8a36eda749c5078ef6f53a119fb285 (commit) via c426713a4b8ac441b8b41123a4fd26a0b0196b2a (commit) from 19e819948f9b7ce0c593dc6e934b68d4f5e8426e (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 6a523705319918a84feccfed151e408fbc43ee59 Merge: cf858bfa 5805de6e Author: Michael Black <mdb...@ya...> Date: Fri Jan 8 16:34:57 2021 -0600 Merge pull request #497 from df7cb/unaligned_access dummy/dummy.c: Fix unaligned access in dummy_get_level() commit 5805de6e1e71f7b2ada5e528b16460adf4ccff8b Author: John Paul Adrian Glaubitz <gla...@de...> Date: Sat Feb 8 10:21:08 2020 -0800 dummy/dummy.c: Fix unaligned access in dummy_get_level() This fixes an unaligned access in dummy/dummy.c in the function dummy_get_level() which resulted in crashes (Bus Error) on systems with stricter alignment requirements such as SPARC. On x86_64 (and any other architecture with less strict alignment requirements), the compiler automatically optimizes the memcpy() out if necessary such that there are no performance issues. diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index d3d7b51a..aaba5d0b 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; } - *val = curr->levels[idx]; + memcpy (val, &curr->levels[idx], sizeof(value_t)); rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rig_strlevel(level)); commit cf858bfa3c8a36eda749c5078ef6f53a119fb285 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 8 12:04:25 2021 -0600 Change rig.c to return RIG_ENAVAIL instead of RIG_ENTARGET when set_vfo==NULL Add IC706* to rigs that don't do dsp settings Remove dynamic detection of transceive status in icom/frame.c https://github.com/Hamlib/Hamlib/issues/490 diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 2f96d6db..fe1131c2 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -226,6 +226,9 @@ int icom_one_transaction(RIG *rig, int cmd, int subcmd, buf[0] = 0; 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) { // Hmmm -- got an echo back when not expected so let's change @@ -233,6 +236,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); @@ -269,6 +273,7 @@ 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); memcpy(data, buf + 4, *data_len); /* diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index d61b10a2..f50429b7 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1886,7 +1886,7 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) retval = icom_transaction(rig, C_RD_MODE, -1, NULL, 0, modebuf, &mode_len); - if (mode_len == 3) + if (--mode_len == 3) { priv_data->filter = modebuf[2]; rig_debug(RIG_DEBUG_TRACE, @@ -1933,8 +1933,12 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) * not ask for DSP filter settings */ /* Likewise, don't ask if we happen to be an Omni VI Plus */ /* Likewise, don't ask if we happen to be an IC-R30 */ + /* Likewise, don't ask if we happen to be an IC-706* */ if ((rig->caps->rig_model == RIG_MODEL_IC910) || (rig->caps->rig_model == RIG_MODEL_OMNIVIP) || + (rig->caps->rig_model == RIG_MODEL_IC706) || + (rig->caps->rig_model == RIG_MODEL_IC706MKII) || + (rig->caps->rig_model == RIG_MODEL_IC706MKIIG) || (rig->caps->rig_model == RIG_MODEL_ICR30)) { return RIG_OK; diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 3a680edc..413d2c98 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -30,7 +30,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20210106" +#define BACKEND_VER "20210107" /* * defines used by comp_cal_str in rig.c diff --git a/src/rig.c b/src/rig.c index bcd8377d..188d813a 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1448,7 +1448,7 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } if (twiddling(rig)) @@ -1767,7 +1767,7 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -1877,7 +1877,7 @@ int HAMLIB_API rig_get_mode(RIG *rig, if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -2300,7 +2300,7 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -2519,7 +2519,7 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -2729,7 +2729,7 @@ int HAMLIB_API rig_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -2831,7 +2831,7 @@ int HAMLIB_API rig_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -2899,7 +2899,7 @@ int HAMLIB_API rig_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -2967,7 +2967,7 @@ int HAMLIB_API rig_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -3035,7 +3035,7 @@ int HAMLIB_API rig_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -3694,7 +3694,7 @@ int HAMLIB_API rig_set_split_vfo(RIG *rig, if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -3804,7 +3804,7 @@ int HAMLIB_API rig_get_split_vfo(RIG *rig, if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } #if 0 // why were we doing this? Shouldn't need to set_vfo to figure out tx_vfo @@ -3885,7 +3885,7 @@ int HAMLIB_API rig_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -3953,7 +3953,7 @@ int HAMLIB_API rig_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -4021,7 +4021,7 @@ int HAMLIB_API rig_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -4089,7 +4089,7 @@ int HAMLIB_API rig_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -4157,7 +4157,7 @@ int HAMLIB_API rig_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -4225,7 +4225,7 @@ int HAMLIB_API rig_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -4298,7 +4298,7 @@ int HAMLIB_API rig_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -4373,7 +4373,7 @@ int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -4797,7 +4797,7 @@ int HAMLIB_API rig_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -4897,7 +4897,7 @@ int HAMLIB_API rig_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -4965,7 +4965,7 @@ int HAMLIB_API rig_send_dtmf(RIG *rig, vfo_t vfo, const char *digits) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -5034,7 +5034,7 @@ int HAMLIB_API rig_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -5102,7 +5102,7 @@ int HAMLIB_API rig_send_morse(RIG *rig, vfo_t vfo, const char *msg) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -5161,7 +5161,7 @@ int HAMLIB_API rig_stop_morse(RIG *rig, vfo_t vfo) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -5252,7 +5252,7 @@ int HAMLIB_API rig_wait_morse(RIG *rig, vfo_t vfo) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; @@ -5320,7 +5320,7 @@ int HAMLIB_API rig_send_voice_mem(RIG *rig, vfo_t vfo, int ch) if (!caps->set_vfo) { - return -RIG_ENTARGET; + return -RIG_ENAVAIL; } curr_vfo = rig->state.current_vfo; commit c426713a4b8ac441b8b41123a4fd26a0b0196b2a Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Jan 8 07:56:17 2021 -0600 Fix debug statement data types in icom/frame.c diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 1723fa8b..2f96d6db 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -395,7 +395,7 @@ 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=%ld, width=%ld\n", __func__, mode, 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 ----------------------------------------------------------------------- Summary of changes: rigs/dummy/dummy.c | 2 +- rigs/icom/frame.c | 7 ++++++- rigs/icom/icom.c | 6 +++++- rigs/icom/icom.h | 2 +- src/rig.c | 56 +++++++++++++++++++++++++++--------------------------- 5 files changed, 41 insertions(+), 32 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |