[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 3211e3aea18f0669344d5
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Michael B. <mdb...@us...> - 2020-12-22 05:50:49
|
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 3211e3aea18f0669344d51e74c5a72f1a273f794 (commit) via ee82cceb0c4e9264143bcebd744c9d902e217e1c (commit) via d0f2f172c50fbb67846ece577809d6841d897b09 (commit) via 61956faeb3bca79f68510e3bda45a95c556073a9 (commit) via 11a522ffc212e39c11c7a10ad21cc9ae234e4ffe (commit) via 9e62b2783ff5e60d4d8ab19a8a8beb2f091c6e8a (commit) from 1d15625757a8abea22794f2efb00be2ed13b9c8f (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 3211e3aea18f0669344d51e74c5a72f1a273f794 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Dec 21 23:50:29 2020 -0600 astyle files diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 870a1be4..5bfa1c8b 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1573,18 +1573,18 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, int ack_len = sizeof(ackbuf); rmode_t icom_mode; unsigned char dm_sub_cmd = - rig->caps->rig_model == RIG_MODEL_IC7200 ? 0x04 : S_MEM_DATA_MODE; + rig->caps->rig_model == RIG_MODEL_IC7200 ? 0x04 : S_MEM_DATA_MODE; int filter_byte = rig->caps->rig_model == RIG_MODEL_IC7100 - || rig->caps->rig_model == RIG_MODEL_IC7200 - || rig->caps->rig_model == RIG_MODEL_IC7300 - || rig->caps->rig_model == RIG_MODEL_IC7600 - || rig->caps->rig_model == RIG_MODEL_IC7610 - || rig->caps->rig_model == RIG_MODEL_IC7700 - || rig->caps->rig_model == RIG_MODEL_IC7800 - || rig->caps->rig_model == RIG_MODEL_IC785x - || rig->caps->rig_model == RIG_MODEL_IC9100 - || rig->caps->rig_model == RIG_MODEL_IC9700 - || rig->caps->rig_model == RIG_MODEL_IC705; + || rig->caps->rig_model == RIG_MODEL_IC7200 + || rig->caps->rig_model == RIG_MODEL_IC7300 + || rig->caps->rig_model == RIG_MODEL_IC7600 + || rig->caps->rig_model == RIG_MODEL_IC7610 + || rig->caps->rig_model == RIG_MODEL_IC7700 + || rig->caps->rig_model == RIG_MODEL_IC7800 + || rig->caps->rig_model == RIG_MODEL_IC785x + || rig->caps->rig_model == RIG_MODEL_IC9100 + || rig->caps->rig_model == RIG_MODEL_IC9700 + || rig->caps->rig_model == RIG_MODEL_IC705; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -1641,6 +1641,7 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, } rig2icom_mode(rig, vfo, mode, width, &mode_icom, &width_icom); + if (filter_byte && width_icom != -1) // then we need the width byte too { // since width_icom is 0-2 for rigs that need this here we have to make it 1-3 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 153ac092..7099384b 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -7438,7 +7438,8 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { // some rigs now require the bandwidth be turned "on" int on = is_ft891; - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SH%c%d%02d;", main_sub_vfo, on, w); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SH%c%d%02d;", main_sub_vfo, on, + w); } else { @@ -7627,7 +7628,8 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) char cmd[] = "SH"; char main_sub_vfo = '0'; - rig_debug(RIG_DEBUG_VERBOSE, "%s called, vfo=%s, mode=%s\n", __func__, rig_strvfo(vfo), rig_strrmode(mode)); + rig_debug(RIG_DEBUG_VERBOSE, "%s called, vfo=%s, mode=%s\n", __func__, + rig_strvfo(vfo), rig_strrmode(mode)); if (!newcat_valid_command(rig, cmd)) { @@ -7682,12 +7684,14 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) int on; // do we need to pay attention to the Main/Sub here? int n = sscanf(priv->ret_data, "SH%*1d%1d%3d", &on, &w); + if (n != 2) { err = -RIG_EPROTO; } #if 0 // this may apply to another Yaesu rig + if (n == 2) { if (!on) { w = 0; } @@ -7696,6 +7700,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { err = -RIG_EPROTO; } + #endif } else if (strlen(priv->ret_data) == 6) diff --git a/src/rig.c b/src/rig.c index b2397fe4..0a3a4cc5 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1941,12 +1941,15 @@ pbwidth_t HAMLIB_API rig_passband_normal(RIG *rig, rmode_t mode) { if (rs->filters[i].modes & mode) { - rig_debug(RIG_DEBUG_VERBOSE, "%s: return filter#%d, width=%d\n", __func__, i, (int)rs->filters[i].width); + rig_debug(RIG_DEBUG_VERBOSE, "%s: return filter#%d, width=%d\n", __func__, i, + (int)rs->filters[i].width); return rs->filters[i].width; } } - rig_debug(RIG_DEBUG_VERBOSE, "%s: filter not found...return RIG_PASSBAND_NORMAL=%d\n", __func__, (int)RIG_PASSBAND_NORMAL); + rig_debug(RIG_DEBUG_VERBOSE, + "%s: filter not found...return RIG_PASSBAND_NORMAL=%d\n", __func__, + (int)RIG_PASSBAND_NORMAL); return RIG_PASSBAND_NORMAL; } commit ee82cceb0c4e9264143bcebd744c9d902e217e1c Merge: 11a522ff d0f2f172 Author: Michael Black <mdb...@ya...> Date: Mon Dec 21 23:37:48 2020 -0600 Merge pull request #476 from wb4bxo/master IC-7100 Bank Select commit d0f2f172c50fbb67846ece577809d6841d897b09 Merge: 11a522ff 61956fae Author: Steve Mobley <wb...@mi...> Date: Tue Dec 22 00:32:29 2020 -0500 Merge remote-tracking branch 'origin/BXO-Dev' commit 61956faeb3bca79f68510e3bda45a95c556073a9 Author: Steve Mobley <wb...@mi...> Date: Tue Dec 22 00:13:05 2020 -0500 Add bank select to IC-7100 diff --git a/rigs/icom/ic7100.c b/rigs/icom/ic7100.c index 4cd27a21..50032220 100644 --- a/rigs/icom/ic7100.c +++ b/rigs/icom/ic7100.c @@ -243,7 +243,7 @@ const struct rig_caps ic7100_caps = .vfo_ops = IC7100_VFO_OPS, .scan_ops = IC7100_SCAN_OPS, .transceive = RIG_TRN_RIG, - .bank_qty = 0, + .bank_qty = 5, .chan_desc_sz = 9, /* TODO */ .chan_list = { /* TBC */ @@ -380,6 +380,7 @@ const struct rig_caps ic7100_caps = .set_ext_func = icom_set_ext_func, .get_ext_func = icom_get_ext_func, .set_mem = icom_set_mem, + .set_bank = icom_set_bank, .vfo_op = icom_vfo_op, .scan = icom_scan, .get_dcd = icom_get_dcd, commit 11a522ffc212e39c11c7a10ad21cc9ae234e4ffe Merge: 1d156257 9e62b278 Author: Michael Black <mdb...@ya...> Date: Mon Dec 21 10:22:54 2020 -0600 Merge pull request #474 from mikaelnousiainen/fix-icom-data-mode-and-filter-selection Fix Icom data mode and filter selection issues commit 9e62b2783ff5e60d4d8ab19a8a8beb2f091c6e8a Author: Mikael Nousiainen <mik...@ik...> Date: Mon Dec 21 18:15:15 2020 +0200 Fix RIG_PASSBAND_NOCHANGE use with Icom data modes. Allow selecting FIL2 as normal passband when in data mode. Add new Icom rigs to list that determines whether Icom data mode command supports setting filter too. diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 5d272eea..861347a0 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -414,6 +414,8 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, { case RIG_MODE_AM: icmode = S_AM; break; + case RIG_MODE_PKTAM: icmode = S_AM; break; + case RIG_MODE_AMN: icmode = S_AMN; break; case RIG_MODE_AMS: icmode = S_AMS; break; @@ -440,8 +442,12 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, case RIG_MODE_FM: icmode = S_FM; break; + case RIG_MODE_PKTFM: icmode = S_FM; break; + case RIG_MODE_FMN: icmode = S_FMN; break; + case RIG_MODE_PKTFMN: icmode = S_FMN; break; + case RIG_MODE_WFM: icmode = S_WFM; break; case RIG_MODE_P25: icmode = S_P25; break; @@ -468,15 +474,19 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, { pbwidth_t medium_width = rig_passband_normal(rig, mode); - if (width == medium_width || width == RIG_PASSBAND_NORMAL) + if (width == RIG_PASSBAND_NORMAL) { - icmode_ext = - -1; /* medium, no passband data-> rig default. Is medium always the default? */ + // Use rig default for "normal" passband + icmode_ext = -1; } else if (width < medium_width) { icmode_ext = PD_NARROW_3; } + else if (width == medium_width) + { + icmode_ext = PD_MEDIUM_3; + } else { icmode_ext = PD_WIDE_3; diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 22831206..870a1be4 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1572,10 +1572,19 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, unsigned char ackbuf[MAXFRAMELEN]; int ack_len = sizeof(ackbuf); rmode_t icom_mode; - unsigned char dm_sub_cmd = RIG_MODEL_IC7200 == rig->caps->rig_model ? 0x04 : - S_MEM_DATA_MODE; - int filter_byte = rig->caps->rig_model == RIG_MODEL_IC7300 - || rig->caps->rig_model == RIG_MODEL_IC7610; + unsigned char dm_sub_cmd = + rig->caps->rig_model == RIG_MODEL_IC7200 ? 0x04 : S_MEM_DATA_MODE; + int filter_byte = rig->caps->rig_model == RIG_MODEL_IC7100 + || rig->caps->rig_model == RIG_MODEL_IC7200 + || rig->caps->rig_model == RIG_MODEL_IC7300 + || rig->caps->rig_model == RIG_MODEL_IC7600 + || rig->caps->rig_model == RIG_MODEL_IC7610 + || rig->caps->rig_model == RIG_MODEL_IC7700 + || rig->caps->rig_model == RIG_MODEL_IC7800 + || rig->caps->rig_model == RIG_MODEL_IC785x + || rig->caps->rig_model == RIG_MODEL_IC9100 + || rig->caps->rig_model == RIG_MODEL_IC9700 + || rig->caps->rig_model == RIG_MODEL_IC705; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -1611,6 +1620,8 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, if (RIG_OK == retval) { unsigned char datamode[2]; + unsigned char mode_icom; // Not used, we only need the width + signed char width_icom; switch (mode) { @@ -1629,31 +1640,21 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, break; } - if (width != RIG_PASSBAND_NOCHANGE) + rig2icom_mode(rig, vfo, mode, width, &mode_icom, &width_icom); + if (filter_byte && width_icom != -1) // then we need the width byte too { - unsigned char mode_icom; // not usb as it will map to USB/LSB - signed char width_icom; - rig2icom_mode(rig, vfo, mode, width, &mode_icom, &width_icom); - if (filter_byte && width_icom != -1) // then we need the width byte too - { - // since width_icom is 0-2 for rigs that need this here we have to make it 1-3 - datamode[1] = datamode[0] ? width_icom : 0; - retval = - icom_transaction(rig, C_CTL_MEM, dm_sub_cmd, datamode, 2, - ackbuf, - &ack_len); - } - else - { - retval = - icom_transaction(rig, C_CTL_MEM, dm_sub_cmd, datamode, 1, ackbuf, - &ack_len); - } + // since width_icom is 0-2 for rigs that need this here we have to make it 1-3 + datamode[1] = datamode[0] ? width_icom : 0; + retval = + icom_transaction(rig, C_CTL_MEM, dm_sub_cmd, datamode, 2, + ackbuf, + &ack_len); } else { - rig_debug(RIG_DEBUG_TRACE, "%s RIG_PASSBAND_NOCHANGE\n", __func__); - return RIG_OK; + retval = + icom_transaction(rig, C_CTL_MEM, dm_sub_cmd, datamode, 1, ackbuf, + &ack_len); } if (retval != RIG_OK) ----------------------------------------------------------------------- Summary of changes: rigs/icom/frame.c | 16 +++++++++++++--- rigs/icom/ic7100.c | 3 ++- rigs/icom/icom.c | 52 +++++++++++++++++++++++++++------------------------- rigs/yaesu/newcat.c | 9 +++++++-- src/rig.c | 7 +++++-- 5 files changed, 54 insertions(+), 33 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |