hamlib-cvs-digest Mailing List for Ham Radio Control Libraries (Page 24)
Library to control radio transceivers and receivers
Brought to you by:
n0nb
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(57) |
Nov
(27) |
Dec
(25) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(41) |
Feb
(101) |
Mar
(60) |
Apr
(32) |
May
(32) |
Jun
(198) |
Jul
(95) |
Aug
(60) |
Sep
(48) |
Oct
(96) |
Nov
(27) |
Dec
(222) |
2002 |
Jan
(180) |
Feb
(46) |
Mar
(68) |
Apr
(11) |
May
(36) |
Jun
(34) |
Jul
(113) |
Aug
(42) |
Sep
(71) |
Oct
(65) |
Nov
(116) |
Dec
(40) |
2003 |
Jan
(32) |
Feb
(92) |
Mar
(29) |
Apr
(102) |
May
(21) |
Jun
(34) |
Jul
(3) |
Aug
(60) |
Sep
(30) |
Oct
(62) |
Nov
(57) |
Dec
(33) |
2004 |
Jan
(28) |
Feb
(46) |
Mar
(16) |
Apr
(14) |
May
(31) |
Jun
(21) |
Jul
(10) |
Aug
(80) |
Sep
(42) |
Oct
(11) |
Nov
(28) |
Dec
(13) |
2005 |
Jan
(35) |
Feb
(26) |
Mar
(20) |
Apr
(118) |
May
(2) |
Jun
(5) |
Jul
|
Aug
|
Sep
(5) |
Oct
(1) |
Nov
(13) |
Dec
(1) |
2006 |
Jan
(9) |
Feb
(25) |
Mar
(22) |
Apr
(6) |
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
(3) |
Oct
(46) |
Nov
(13) |
Dec
(7) |
2007 |
Jan
(9) |
Feb
(14) |
Mar
(3) |
Apr
|
May
(6) |
Jun
(1) |
Jul
|
Aug
(11) |
Sep
(7) |
Oct
(8) |
Nov
(41) |
Dec
(3) |
2008 |
Jan
(27) |
Feb
(16) |
Mar
(13) |
Apr
(23) |
May
(39) |
Jun
(4) |
Jul
(7) |
Aug
(1) |
Sep
(13) |
Oct
(52) |
Nov
(44) |
Dec
(55) |
2009 |
Jan
(72) |
Feb
(69) |
Mar
|
Apr
|
May
|
Jun
(13) |
Jul
(1) |
Aug
(6) |
Sep
(15) |
Oct
(11) |
Nov
(31) |
Dec
(20) |
2010 |
Jan
(24) |
Feb
(21) |
Mar
(22) |
Apr
(40) |
May
(38) |
Jun
(4) |
Jul
(2) |
Aug
(22) |
Sep
(19) |
Oct
(14) |
Nov
(5) |
Dec
(8) |
2011 |
Jan
(14) |
Feb
(36) |
Mar
(6) |
Apr
|
May
|
Jun
(23) |
Jul
(13) |
Aug
(8) |
Sep
(7) |
Oct
|
Nov
(3) |
Dec
(9) |
2012 |
Jan
(17) |
Feb
(13) |
Mar
(10) |
Apr
|
May
(1) |
Jun
(14) |
Jul
(4) |
Aug
(12) |
Sep
(2) |
Oct
(24) |
Nov
(14) |
Dec
(2) |
2013 |
Jan
(4) |
Feb
(3) |
Mar
(3) |
Apr
(3) |
May
(10) |
Jun
(4) |
Jul
(7) |
Aug
|
Sep
(15) |
Oct
(5) |
Nov
(1) |
Dec
(2) |
2014 |
Jan
|
Feb
(8) |
Mar
(1) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
(3) |
Oct
(7) |
Nov
(6) |
Dec
(3) |
2015 |
Jan
(4) |
Feb
(5) |
Mar
(8) |
Apr
(8) |
May
(2) |
Jun
|
Jul
(4) |
Aug
(7) |
Sep
(8) |
Oct
|
Nov
(6) |
Dec
(4) |
2016 |
Jan
(6) |
Feb
(26) |
Mar
(3) |
Apr
(10) |
May
(6) |
Jun
(5) |
Jul
(1) |
Aug
(4) |
Sep
(3) |
Oct
(4) |
Nov
(3) |
Dec
(10) |
2017 |
Jan
(11) |
Feb
(11) |
Mar
(2) |
Apr
(1) |
May
(7) |
Jun
(2) |
Jul
(11) |
Aug
(9) |
Sep
(5) |
Oct
(5) |
Nov
(1) |
Dec
(2) |
2018 |
Jan
(5) |
Feb
(2) |
Mar
(19) |
Apr
(7) |
May
(11) |
Jun
(3) |
Jul
(4) |
Aug
(10) |
Sep
(2) |
Oct
(8) |
Nov
(6) |
Dec
(9) |
2019 |
Jan
(9) |
Feb
(6) |
Mar
(2) |
Apr
(4) |
May
(6) |
Jun
(9) |
Jul
(6) |
Aug
(3) |
Sep
(5) |
Oct
(2) |
Nov
(8) |
Dec
(9) |
2020 |
Jan
(15) |
Feb
(1) |
Mar
(18) |
Apr
(33) |
May
(43) |
Jun
(87) |
Jul
(45) |
Aug
(8) |
Sep
(43) |
Oct
(3) |
Nov
(5) |
Dec
(42) |
2021 |
Jan
(116) |
Feb
(40) |
Mar
(58) |
Apr
(48) |
May
(29) |
Jun
(2) |
Jul
|
Aug
(22) |
Sep
(18) |
Oct
(1) |
Nov
|
Dec
(3) |
2022 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(2) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
(6) |
Nov
(2) |
Dec
(9) |
2023 |
Jan
(10) |
Feb
|
Mar
|
Apr
(10) |
May
(3) |
Jun
(1) |
Jul
(2) |
Aug
(4) |
Sep
(1) |
Oct
|
Nov
(2) |
Dec
(3) |
2024 |
Jan
(4) |
Feb
(1) |
Mar
(2) |
Apr
(2) |
May
(5) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(9) |
2025 |
Jan
(5) |
Feb
(5) |
Mar
|
Apr
(10) |
May
(20) |
Jun
(43) |
Jul
(24) |
Aug
(21) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael B. <mdb...@us...> - 2020-12-22 14:34:23
|
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 5d2f5012c0623411be02308167a85cab64a7e328 (commit) from 3211e3aea18f0669344d51e74c5a72f1a273f794 (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 5d2f5012c0623411be02308167a85cab64a7e328 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Dec 22 08:34:04 2020 -0600 Fix newcat.c uninitialized var diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 7099384b..7c231116 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2857,7 +2857,7 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) struct rig_state *state = &rig->state; struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; int retval; - int i; + int i = 0; int retry_save; char ps; diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index f784d321..bf8b796a 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201219" +#define NEWCAT_VER "20201222" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 2 +- rigs/yaesu/newcat.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
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 |
From: Michael B. <mdb...@us...> - 2020-12-19 23:05:04
|
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 1d15625757a8abea22794f2efb00be2ed13b9c8f (commit) via 2b1bce89bf0834c35619442d5623be3c45cb0974 (commit) via 5a208a871d115b485b08b17ddcd3a2a23af09ebb (commit) from e5b7a5442d15fba365e6dc760b332c7e36dcabbf (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 1d15625757a8abea22794f2efb00be2ed13b9c8f Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 19 16:48:21 2020 -0600 Do not band select on FT891 as it does not remember bandwidth diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index 0740f055..adc5efa4 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -50,7 +50,7 @@ const struct rig_caps ft891_caps = RIG_MODEL(RIG_MODEL_FT891), .model_name = "FT-891", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".2", + .version = NEWCAT_VER ".3", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 1fc323fe..153ac092 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -786,7 +786,8 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // And only when not in split mode if (newcat_valid_command(rig, "BS") && newcat_band_index(freq) != newcat_band_index(rig->state.current_freq) - && !rig->state.cache.split) + && !rig->state.cache.split + && !is_ft891) // 891 does not remember bandwidth so don't do this { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BS%02d%c", newcat_band_index(freq), cat_term); @@ -7626,7 +7627,7 @@ 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\n", __func__); + 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)) { commit 2b1bce89bf0834c35619442d5623be3c45cb0974 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 19 14:30:31 2020 -0600 Fix icom default filter settings https://github.com/Hamlib/Hamlib/issues/471 diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index fbff3dda..5d272eea 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -297,6 +297,10 @@ int icom_transaction(RIG *rig, int cmd, int subcmd, { int retval, retry; + rig_debug(RIG_DEBUG_VERBOSE, + "%s: cmd=0x%02x, subcmd=0x%02x, payload_len=%d, data_len=%d\n", __func__, + cmd, subcmd, payload_len, *data_len); + retry = rig->state.rigport.retry; do diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index c83d5a7f..22831206 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1631,11 +1631,11 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, if (width != RIG_PASSBAND_NOCHANGE) { - if (filter_byte) // 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 { - unsigned char mode_icom; // not used as it will map to USB/LSB - signed char width_icom; - rig2icom_mode(rig, vfo, mode, width, &mode_icom, &width_icom); // 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 = diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 7004bbfd..6b7dadec 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -30,7 +30,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20201216" +#define BACKEND_VER "20201219" /* * defines used by comp_cal_str in rig.c diff --git a/src/rig.c b/src/rig.c index c7f48821..b2397fe4 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1941,10 +1941,12 @@ 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); 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); return RIG_PASSBAND_NORMAL; } commit 5a208a871d115b485b08b17ddcd3a2a23af09ebb Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 18 23:57:38 2020 -0600 Reorder newcat_band_index to return 15 for 2M band instead of 14 https://github.com/Hamlib/Hamlib/issues/470 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index fcc4654f..1fc323fe 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -399,10 +399,10 @@ static int newcat_band_index(freq_t freq) // does anybody work LSB or RTTYR at the upper band edge? // what about band 13 -- what is it? if (freq >= MHz(420) && freq < MHz(470)) { band = 16; } + else if (freq >= MHz(144) && freq < MHz(148)) { band = 15; } // band 14 is RX only + // override band 15 with 14 if needed else if (freq >= MHz(118) && freq < MHz(164)) { band = 14; } - // override band 14 with 15 if needed - else if (freq >= MHz(144) && freq < MHz(148)) { band = 15; } else if (freq >= MHz(70) && freq < MHz(70.5)) { band = 17; } else if (freq >= MHz(50) && freq < MHz(55)) { band = 10; } else if (freq >= MHz(28) && freq < MHz(29.7)) { band = 9; } @@ -9051,7 +9051,7 @@ int newcat_get_cmd(RIG *rig) __func__, priv->ret_data); // we were using BUSBUSY but microham devices need retries //rc = -RIG_BUSBUSY; /* don't write command again */ - rc = -RIG_EPROTO; + // rc = -RIG_EPROTO; /* we could decrement retry_count here but there is a danger of infinite looping so we just use up diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 63b80501..f784d321 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201218" +#define NEWCAT_VER "20201219" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 ----------------------------------------------------------------------- Summary of changes: rigs/icom/frame.c | 4 ++++ rigs/icom/icom.c | 8 ++++---- rigs/icom/icom.h | 2 +- rigs/yaesu/ft891.c | 2 +- rigs/yaesu/newcat.c | 11 ++++++----- rigs/yaesu/newcat.h | 2 +- src/rig.c | 2 ++ 7 files changed, 19 insertions(+), 12 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-12-18 18:46:08
|
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 e5b7a5442d15fba365e6dc760b332c7e36dcabbf (commit) from aa58442e18d6ad51dc3914f0ecef149c20c0a2bd (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 e5b7a5442d15fba365e6dc760b332c7e36dcabbf Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 18 12:41:25 2020 -0600 Fix gpredict behavior with cross band split Yaesu memory will be ignored for now when in split mode We may want to allow it when we allow for VFOA/B caching https://github.com/Hamlib/Hamlib/issues/470 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index e92bca3c..fcc4654f 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -783,8 +783,10 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // // Restore band memory if we can and band is changing -- we do it before we set the frequency + // And only when not in split mode if (newcat_valid_command(rig, "BS") - && newcat_band_index(freq) != newcat_band_index(rig->state.current_freq)) + && newcat_band_index(freq) != newcat_band_index(rig->state.current_freq) + && !rig->state.cache.split) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BS%02d%c", newcat_band_index(freq), cat_term); ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-12-18 15:42:21
|
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 aa58442e18d6ad51dc3914f0ecef149c20c0a2bd (commit) from f43e190e0739f142c70d700c00d2c80503b06ce7 (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 aa58442e18d6ad51dc3914f0ecef149c20c0a2bd Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 18 08:52:38 2020 -0600 Fix FT-891 bandwidth selection -- seems newer rigs now have an "on" value now https://github.com/Hamlib/Hamlib/issues/469 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 858b4039..e92bca3c 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -7433,7 +7433,9 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (is_ftdx101 || is_ft891) { - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SH%c0%02d;", main_sub_vfo, w); + // 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); } else { diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index faa00a1b..63b80501 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201217" +#define NEWCAT_VER "20201218" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 4 +++- rigs/yaesu/newcat.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-12-18 13:16:59
|
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 f43e190e0739f142c70d700c00d2c80503b06ce7 (commit) from b263ea1697ec6af19ffae763ec38797555ef72f3 (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 f43e190e0739f142c70d700c00d2c80503b06ce7 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Dec 17 23:57:25 2020 -0600 Fix SH command for FT-450 Comment out on/off flag for future possibilities CAT manual doesn't match what rig is returning...7 bytes vs 6 in the manual https://github.com/Hamlib/Hamlib/issues/469 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index c2515a76..858b4039 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -7675,8 +7675,14 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) if (strlen(priv->ret_data) == 7) { int on; - int n = sscanf(priv->ret_data, "SH0%1d%3d", &on, &w); + // 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; } @@ -7685,6 +7691,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/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index bf7b1dcd..faa00a1b 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201216" +#define NEWCAT_VER "20201217" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 9 ++++++++- rigs/yaesu/newcat.h | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-12-17 22:58:40
|
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 b263ea1697ec6af19ffae763ec38797555ef72f3 (commit) from 29c57bc5a7d8caa2a2c8d2a39f75e98accd34232 (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 b263ea1697ec6af19ffae763ec38797555ef72f3 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Dec 17 16:58:21 2020 -0600 Fix default powermeter_scale in flrig.c diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 668fd5ef..5dc4f823 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -742,7 +742,7 @@ static int flrig_open(RIG *rig) if (retval != RIG_OK) { return retval; } - priv->powermeter_scale = 100; // default + priv->powermeter_scale = 1; // default if (strlen(value) > 0) { ----------------------------------------------------------------------- Summary of changes: rigs/dummy/flrig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-12-17 22:51:40
|
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 29c57bc5a7d8caa2a2c8d2a39f75e98accd34232 (commit) via 0242df5098d3e3efc1c00cd4bbe7fa873c887ee2 (commit) via cb7f5ca120298328a82eff1ac6297a9e7e366258 (commit) from 263f1cde72081e4e6bdf1c02eca5253a9445fe99 (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 29c57bc5a7d8caa2a2c8d2a39f75e98accd34232 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Dec 17 16:51:19 2020 -0600 Add powermeter_scale to flrig diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index a6ce6d93..668fd5ef 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -1923,7 +1923,7 @@ static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) char value[MAXARGLEN]; char *cmd; int retval; - //struct flrig_priv_data *priv = (struct flrig_priv_data *) rig->state.priv; + struct flrig_priv_data *priv = (struct flrig_priv_data *) rig->state.priv; rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__, rig_strvfo(vfo)); @@ -1964,12 +1964,12 @@ static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) rig_debug(RIG_DEBUG_TRACE, "%s: val.i='%s'(%d)\n", __func__, value, val->i); case RIG_LEVEL_RFPOWER_METER: - val->f = atof(value) / 100.0; + val->f = atof(value) / 100.0 * priv->powermeter_scale; rig_debug(RIG_DEBUG_TRACE, "%s: val.f='%s'(%g)\n", __func__, value, val->f); break; case RIG_LEVEL_RFPOWER_METER_WATTS: - val->f = atof(value); + val->f = atof(value) * priv->powermeter_scale; rig_debug(RIG_DEBUG_TRACE, "%s: val.f='%s'(%g)\n", __func__, value, val->f); break; diff --git a/rigs/dummy/flrig.h b/rigs/dummy/flrig.h index 5eac365b..ad0e0f74 100644 --- a/rigs/dummy/flrig.h +++ b/rigs/dummy/flrig.h @@ -28,7 +28,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20201216" +#define BACKEND_VER "20201217" #define EOM "\r" #define TRUE 1 commit 0242df5098d3e3efc1c00cd4bbe7fa873c887ee2 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Dec 17 16:37:53 2020 -0600 Fix RIG_LEVEL_RFPOWER_METER_WATTS for flrig #2 diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 2934b9c2..a6ce6d93 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -1939,6 +1939,7 @@ static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_STRENGTH: cmd = "rig.get_power"; break; + case RIG_LEVEL_RFPOWER_METER_WATTS: case RIG_LEVEL_RFPOWER_METER: cmd = "rig.get_pwrmeter"; break; default: commit cb7f5ca120298328a82eff1ac6297a9e7e366258 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Dec 17 16:16:45 2020 -0600 Fix RIG_LEVEL_RFPOWER_METER_WATTS for flrig diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 3b38a0b2..2934b9c2 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -57,7 +57,7 @@ RIG_MODE_SSB | RIG_MODE_LSB | RIG_MODE_USB |\ RIG_MODE_FM | RIG_MODE_WFM | RIG_MODE_FMN |RIG_MODE_PKTFM ) -#define FLRIG_LEVELS (RIG_LEVEL_AF | RIG_LEVEL_RF | RIG_LEVEL_MICGAIN | RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER_METER) +#define FLRIG_LEVELS (RIG_LEVEL_AF | RIG_LEVEL_RF | RIG_LEVEL_MICGAIN | RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER_METER | RIG_LEVEL_RFPOWER_METER_WATTS) #define streq(s1,s2) (strcmp(s1,s2)==0) ----------------------------------------------------------------------- Summary of changes: rigs/dummy/flrig.c | 9 +++++---- rigs/dummy/flrig.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-12-17 21:07:31
|
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 263f1cde72081e4e6bdf1c02eca5253a9445fe99 (commit) via 8ed0dcdbb78e118ef6be94836749d8ac0da81835 (commit) via 31b42de067ecee1a084aad36d28dd2739b347f7f (commit) via c11e592a7a747f93046c760ea988694f73011167 (commit) via 6f4c2de0b63f267c32497d86103a7629c55bfb30 (commit) via 603f39097db1f476d31f0f6962f6c0845a3c9611 (commit) via 2a0deb34158bea57cab351819adeea2a8fc02a1e (commit) from 21e691153854c7029b4d0c152f964c7dd7acba3d (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 263f1cde72081e4e6bdf1c02eca5253a9445fe99 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Dec 17 15:07:04 2020 -0600 astyle files diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index a34da5ad..3b38a0b2 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -1963,7 +1963,7 @@ static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) rig_debug(RIG_DEBUG_TRACE, "%s: val.i='%s'(%d)\n", __func__, value, val->i); case RIG_LEVEL_RFPOWER_METER: - val->f = atof(value)/100.0; + val->f = atof(value) / 100.0; rig_debug(RIG_DEBUG_TRACE, "%s: val.f='%s'(%g)\n", __func__, value, val->f); break; diff --git a/rigs/dummy/rot_dummy.c b/rigs/dummy/rot_dummy.c index d5b8b994..974f9caf 100644 --- a/rigs/dummy/rot_dummy.c +++ b/rigs/dummy/rot_dummy.c @@ -165,7 +165,7 @@ static int dummy_rot_init(ROT *rot) static int dummy_rot_cleanup(ROT *rot) { struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *) - rot->state.priv; + rot->state.priv; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -261,7 +261,7 @@ static int dummy_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) static void dummy_rot_simulate_rotation(ROT *rot) { - struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *) + struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *) rot->state.priv; struct timeval tv; unsigned elapsed; /* ms */ @@ -280,7 +280,8 @@ static void dummy_rot_simulate_rotation(ROT *rot) { /* target reached */ priv->az = priv->target_az; - priv->status &= ~(ROT_STATUS_MOVING_AZ | ROT_STATUS_MOVING_LEFT | ROT_STATUS_MOVING_RIGHT); + priv->status &= ~(ROT_STATUS_MOVING_AZ | ROT_STATUS_MOVING_LEFT | + ROT_STATUS_MOVING_RIGHT); } else { @@ -300,7 +301,8 @@ static void dummy_rot_simulate_rotation(ROT *rot) { /* target reached */ priv->el = priv->target_el; - priv->status &= ~(ROT_STATUS_MOVING_EL | ROT_STATUS_MOVING_UP | ROT_STATUS_MOVING_DOWN); + priv->status &= ~(ROT_STATUS_MOVING_EL | ROT_STATUS_MOVING_UP | + ROT_STATUS_MOVING_DOWN); } else { @@ -316,9 +318,12 @@ static void dummy_rot_simulate_rotation(ROT *rot) } } - if (priv->status & (ROT_STATUS_MOVING_AZ | ROT_STATUS_MOVING_EL)) { + if (priv->status & (ROT_STATUS_MOVING_AZ | ROT_STATUS_MOVING_EL)) + { priv->status |= ROT_STATUS_MOVING; - } else { + } + else + { priv->status &= ~(ROT_STATUS_MOVING); } @@ -427,7 +432,8 @@ static const char *dummy_rot_get_info(ROT *rot) static int dummy_set_func(ROT *rot, setting_t func, int status) { - struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)rot->state.priv; + struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *) + rot->state.priv; rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s %d\n", __func__, rot_strfunc(func), status); @@ -447,7 +453,8 @@ static int dummy_set_func(ROT *rot, setting_t func, int status) static int dummy_get_func(ROT *rot, setting_t func, int *status) { - struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)rot->state.priv; + struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *) + rot->state.priv; *status = (priv->funcs & func) ? 1 : 0; @@ -460,7 +467,8 @@ static int dummy_get_func(ROT *rot, setting_t func, int *status) static int dummy_set_level(ROT *rot, setting_t level, value_t val) { - struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)rot->state.priv; + struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *) + rot->state.priv; int idx; char lstr[32]; @@ -491,7 +499,8 @@ static int dummy_set_level(ROT *rot, setting_t level, value_t val) static int dummy_get_level(ROT *rot, setting_t level, value_t *val) { - struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)rot->state.priv; + struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *) + rot->state.priv; int idx; idx = rig_setting2idx(level); @@ -511,7 +520,8 @@ static int dummy_get_level(ROT *rot, setting_t level, value_t *val) static int dummy_set_ext_level(ROT *rot, token_t token, value_t val) { - struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)rot->state.priv; + struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *) + rot->state.priv; char lstr[64]; const struct confparams *cfp; struct ext_list *elp; @@ -579,7 +589,8 @@ static int dummy_set_ext_level(ROT *rot, token_t token, value_t val) static int dummy_get_ext_level(ROT *rot, token_t token, value_t *val) { - struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)rot->state.priv; + struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *) + rot->state.priv; const struct confparams *cfp; struct ext_list *elp; @@ -621,7 +632,8 @@ static int dummy_get_ext_level(ROT *rot, token_t token, value_t *val) static int dummy_set_ext_func(ROT *rot, token_t token, int status) { - struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)rot->state.priv; + struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *) + rot->state.priv; const struct confparams *cfp; struct ext_list *elp; @@ -672,7 +684,8 @@ static int dummy_set_ext_func(ROT *rot, token_t token, int status) static int dummy_get_ext_func(ROT *rot, token_t token, int *status) { - struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)rot->state.priv; + struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *) + rot->state.priv; const struct confparams *cfp; struct ext_list *elp; @@ -711,7 +724,8 @@ static int dummy_get_ext_func(ROT *rot, token_t token, int *status) static int dummy_set_parm(ROT *rot, setting_t parm, value_t val) { - struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)rot->state.priv; + struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *) + rot->state.priv; int idx; char pstr[32]; @@ -742,7 +756,8 @@ static int dummy_set_parm(ROT *rot, setting_t parm, value_t val) static int dummy_get_parm(ROT *rot, setting_t parm, value_t *val) { - struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)rot->state.priv; + struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *) + rot->state.priv; int idx; idx = rig_setting2idx(parm); @@ -762,7 +777,8 @@ static int dummy_get_parm(ROT *rot, setting_t parm, value_t *val) static int dummy_set_ext_parm(ROT *rot, token_t token, value_t val) { - struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)rot->state.priv; + struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *) + rot->state.priv; char lstr[64]; const struct confparams *cfp; struct ext_list *epp; @@ -827,7 +843,8 @@ static int dummy_set_ext_parm(ROT *rot, token_t token, value_t val) static int dummy_get_ext_parm(ROT *rot, token_t token, value_t *val) { - struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)rot->state.priv; + struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *) + rot->state.priv; const struct confparams *cfp; struct ext_list *epp; @@ -866,7 +883,8 @@ static int dummy_get_ext_parm(ROT *rot, token_t token, value_t *val) static int dummy_rot_get_status(ROT *rot, rot_status_t *status) { - struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)rot->state.priv; + struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *) + rot->state.priv; dummy_rot_simulate_rotation(rot); diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index e52950ad..fbff3dda 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -490,6 +490,7 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, icmode_ext = PD_WIDE_3; /* default to Wide */ } } + *pd = icmode_ext; } else diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 738738df..c83d5a7f 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1604,7 +1604,8 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, break; } - rig_debug(RIG_DEBUG_VERBOSE, "%s mode=%d, width=%d\n", __func__, (int)icom_mode, (int)width); + rig_debug(RIG_DEBUG_VERBOSE, "%s mode=%d, width=%d\n", __func__, (int)icom_mode, + (int)width); retval = icom_set_mode(rig, vfo, icom_mode, width); if (RIG_OK == retval) @@ -1627,6 +1628,7 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, datamode[0] = 0x00; break; } + if (width != RIG_PASSBAND_NOCHANGE) { if (filter_byte) // then we need the width byte too @@ -1704,7 +1706,8 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = rig2icom_mode(rig, vfo, mode, width, &icmode, &icmode_ext); } - if (width == RIG_PASSBAND_NOCHANGE) icmode_ext = priv_data->filter; + + if (width == RIG_PASSBAND_NOCHANGE) { icmode_ext = priv_data->filter; } if (err < 0) { @@ -1712,7 +1715,9 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) return err; } - rig_debug(RIG_DEBUG_VERBOSE, "%s: icmode=%d, icmode_ext=%d\n", __func__, icmode, icmode_ext); + rig_debug(RIG_DEBUG_VERBOSE, "%s: icmode=%d, icmode_ext=%d\n", __func__, icmode, + icmode_ext); + /* IC-731, IC-735, IC-7000 don't support passband data */ /* IC-726 & IC-475A/E also limited support - only on CW */ /* TODO: G4WJS CW wide/narrow are possible with above two radios */ @@ -1724,7 +1729,8 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) icmode_ext = -1; } - rig_debug(RIG_DEBUG_VERBOSE, "%s: #2 icmode=%d, icmode_ext=%d\n", __func__, icmode, icmode_ext); + rig_debug(RIG_DEBUG_VERBOSE, "%s: #2 icmode=%d, icmode_ext=%d\n", __func__, + icmode, icmode_ext); retval = icom_transaction(rig, C_SET_MODE, icmode, (unsigned char *) &icmode_ext, (icmode_ext == -1 ? 0 : 1), ackbuf, &ack_len); @@ -1775,6 +1781,7 @@ int icom_get_mode_with_data(RIG *rig, vfo_t vfo, rmode_t *mode, retval = icom_get_mode(rig, vfo, mode, width); rig_debug(RIG_DEBUG_VERBOSE, "%s mode=%d\n", __func__, (int)*mode); + if (retval != RIG_OK) { return retval; @@ -1820,7 +1827,9 @@ int icom_get_mode_with_data(RIG *rig, vfo_t vfo, rmode_t *mode, return -RIG_ERJCTED; } - rig_debug(RIG_DEBUG_VERBOSE, "%s databuf[2]=%d, mode=%d\n", __func__, (int)databuf[2], (int)*mode); + rig_debug(RIG_DEBUG_VERBOSE, "%s databuf[2]=%d, mode=%d\n", __func__, + (int)databuf[2], (int)*mode); + if (databuf[2]) /* 0x01/0x02/0x03 -> data mode, 0x00 -> not data mode */ { switch (*mode) @@ -3084,16 +3093,17 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_RFPOWER_METER_WATTS: + // eventually we should change all the Icom tables to watts if (rig->caps->rfpower_meter_cal.size == 0) { val->f = - rig_raw2val_float(icom_val, &icom_default_rfpower_meter_cal)*100; + rig_raw2val_float(icom_val, &icom_default_rfpower_meter_cal) * 100; } else { val->f = - rig_raw2val_float(icom_val, &rig->caps->rfpower_meter_cal)*100; + rig_raw2val_float(icom_val, &rig->caps->rfpower_meter_cal) * 100; } break; diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index 1da17bad..492d5205 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -774,10 +774,13 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_RFPOWER_METER: case RIG_LEVEL_RFPOWER_METER_WATTS: flex6k_get_ptt(rig, vfo, &ptt); - if (!ptt) { + + if (!ptt) + { val->f = 0; return RIG_OK; } + cmd = "ZZRM5"; len = 5; ans = 3; @@ -844,6 +847,7 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_RFPOWER_METER: case RIG_LEVEL_RFPOWER_METER_WATTS: n = sscanf(lvlbuf, "ZZRM%f", &val->f); + if (n != 1) { rig_debug(RIG_DEBUG_ERR, "%s: Error parsing value from lvlbuf='%s'\n", @@ -851,10 +855,12 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->f = 0; return -RIG_EPROTO; } + if (level != RIG_LEVEL_RFPOWER_METER_WATTS) { val->f /= 100; } + break; case RIG_LEVEL_RF: diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index e371c1a8..abe1f491 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -1864,10 +1864,12 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } val->f = pwr; + if (level == RIG_LEVEL_RFPOWER_METER_WATTS) { val->f *= 100; } + break; } diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 685aeb3b..c366f3b1 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2398,8 +2398,11 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) // https://github.com/Hamlib/Hamlib/issues/465 kenwood_val = val.f * power_max; - if (kenwood_val < power_min) kenwood_val = power_min; - if (kenwood_val > power_max) kenwood_val = power_max; + + if (kenwood_val < power_min) { kenwood_val = power_min; } + + if (kenwood_val > power_max) { kenwood_val = power_max; } + snprintf(levelbuf, sizeof(levelbuf), "PC%03d", kenwood_val); break; } @@ -3888,8 +3891,8 @@ int kenwood_set_powerstat(RIG *rig, powerstat_t status) sleep(1); retval = rig_get_freq(rig, RIG_VFO_A, &freq); - if (retval == RIG_OK) - { + if (retval == RIG_OK) + { rig->state.rigport.retry = retry_save; return retval; } diff --git a/rigs/yaesu/ft2000.c b/rigs/yaesu/ft2000.c index 03888f71..aeaa6af1 100644 --- a/rigs/yaesu/ft2000.c +++ b/rigs/yaesu/ft2000.c @@ -185,12 +185,12 @@ const struct rig_caps ft2000_caps = /* mode/filter list, .remember = order matters! */ .filters = { - {RIG_MODE_CW|RIG_MODE_CWR, Hz(500)}, /* Normal CW, RTTY, PKT/USER */ - {RIG_MODE_CW|RIG_MODE_CWR, Hz(200)}, /* Narrow CW, RTTY, PKT/USER */ - {RIG_MODE_CW|RIG_MODE_CWR, Hz(2400)}, /* Wide CW, RTTY, PKT/USER */ - {RIG_MODE_RTTY|RIG_MODE_RTTYR, Hz(500)}, /* Normal RTTY */ - {RIG_MODE_RTTY|RIG_MODE_RTTYR, Hz(300)}, /* Narrow RTTY */ - {RIG_MODE_RTTY|RIG_MODE_RTTYR, Hz(2400)}, /* Wide RTTY */ + {RIG_MODE_CW | RIG_MODE_CWR, Hz(500)}, /* Normal CW, RTTY, PKT/USER */ + {RIG_MODE_CW | RIG_MODE_CWR, Hz(200)}, /* Narrow CW, RTTY, PKT/USER */ + {RIG_MODE_CW | RIG_MODE_CWR, Hz(2400)}, /* Wide CW, RTTY, PKT/USER */ + {RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(500)}, /* Normal RTTY */ + {RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(300)}, /* Narrow RTTY */ + {RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(2400)}, /* Wide RTTY */ {RIG_MODE_SSB, Hz(2400)}, /* Normal SSB */ {RIG_MODE_SSB, Hz(1800)}, /* Narrow SSB */ {RIG_MODE_SSB, Hz(3000)}, /* Wide SSB */ diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 1943adde..c2515a76 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -534,11 +534,14 @@ int newcat_open(RIG *rig) (void)newcat_get_rigid(rig); if (priv->rig_id == NC_RIGID_FT2000) - { // then we need to readjust rfpowermeter cal table in half + { + // then we need to readjust rfpowermeter cal table in half int i; - for(i=0;i<rig->caps->rfpower_meter_cal.size; ++i) - { // we may need a table for the FT2000 instead of this - rig->caps->rfpower_meter_cal.table[i].raw/=2; + + for (i = 0; i < rig->caps->rfpower_meter_cal.size; ++i) + { + // we may need a table for the FT2000 instead of this + rig->caps->rfpower_meter_cal.table[i].raw /= 2; } } @@ -2884,7 +2887,7 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PS%c%c", ps, cat_term); retval = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)); - + retry_save = rig->state.rigport.retry; rig->state.rigport.retry = 0; @@ -2896,10 +2899,11 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) hl_usleep(1000000); retval = rig_get_freq(rig, RIG_VFO_A, &freq); - if (retval == RIG_OK) { + if (retval == RIG_OK) + { rig->state.rigport.retry = retry_save; - return retval; - } + return retval; + } rig_debug(RIG_DEBUG_TRACE, "%s: Wait #%d for power up\n", __func__, i + 1); } @@ -4182,6 +4186,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RM5%c", cat_term); } + break; case RIG_LEVEL_COMP_METER: @@ -4383,26 +4388,36 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_RFPOWER_METER: case RIG_LEVEL_RFPOWER_METER_WATTS: rig_debug(RIG_DEBUG_VERBOSE, "%s: RFPOWER_METER retlvl=%s\n", __func__, retlvl); + if (retlvl_len > 3) { // Some rigs like FTDX101 have 6-byte return so we just truncate - rig_debug(RIG_DEBUG_VERBOSE, "%s: retlvl of %s getting truncated\n", __func__, retlvl); + rig_debug(RIG_DEBUG_VERBOSE, "%s: retlvl of %s getting truncated\n", __func__, + retlvl); retlvl[3] = 0; rig_debug(RIG_DEBUG_VERBOSE, "%s: retlvl truncated to %s\n", __func__, retlvl); } if (rig->caps->rfpower_meter_cal.size == 0) { - val->f = rig_raw2val_float(atoi(retlvl), &yaesu_default_rfpower_meter_cal)/(level == RIG_LEVEL_RFPOWER_METER_WATTS?1.0:100.0); + val->f = rig_raw2val_float(atoi(retlvl), + &yaesu_default_rfpower_meter_cal) / (level == RIG_LEVEL_RFPOWER_METER_WATTS ? + 1.0 : 100.0); } else { - val->f = rig_raw2val_float(atoi(retlvl), &rig->caps->rfpower_meter_cal)/(level == RIG_LEVEL_RFPOWER_METER_WATTS?1.0:100.0); + val->f = rig_raw2val_float(atoi(retlvl), + &rig->caps->rfpower_meter_cal) / (level == RIG_LEVEL_RFPOWER_METER_WATTS ? 1.0 : + 100.0); } - rig_debug(RIG_DEBUG_VERBOSE, "%s: RFPOWER_METER=%s, converted to %f\n", __func__, retlvl, val->f); - if (level == RIG_LEVEL_RFPOWER_METER && val->f > 1.0) + + rig_debug(RIG_DEBUG_VERBOSE, "%s: RFPOWER_METER=%s, converted to %f\n", + __func__, retlvl, val->f); + + if (level == RIG_LEVEL_RFPOWER_METER && val->f > 1.0) { - rig_debug(RIG_DEBUG_VERBOSE, "%s: val->f(%f) clipped at 1.0\n", __func__, val->f); + rig_debug(RIG_DEBUG_VERBOSE, "%s: val->f(%f) clipped at 1.0\n", __func__, + val->f); val->f = 1.0; } @@ -4417,11 +4432,11 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (rig->caps->comp_meter_cal.size == 0) { - val->f = rig_raw2val_float(atoi(retlvl), &yaesu_default_comp_meter_cal)/100; + val->f = rig_raw2val_float(atoi(retlvl), &yaesu_default_comp_meter_cal) / 100; } else { - val->f = rig_raw2val_float(atoi(retlvl), &rig->caps->comp_meter_cal)/100; + val->f = rig_raw2val_float(atoi(retlvl), &rig->caps->comp_meter_cal) / 100; } break; @@ -7656,11 +7671,14 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) w = 0; // use default in case of error + if (strlen(priv->ret_data) == 7) { int on; int n = sscanf(priv->ret_data, "SH0%1d%3d", &on, &w); - if (n == 2) { + + if (n == 2) + { if (!on) { w = 0; } } else @@ -7671,14 +7689,15 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) else if (strlen(priv->ret_data) == 6) { int n = sscanf(priv->ret_data, "SH%3d", &w); - if (n != 1) err = -RIG_EPROTO; + + if (n != 1) { err = -RIG_EPROTO; } } else { err = -RIG_EPROTO; } - rig_debug(RIG_DEBUG_TRACE, "%s: w=%d\n", __func__, w); + rig_debug(RIG_DEBUG_TRACE, "%s: w=%d\n", __func__, w); if (err != RIG_OK) { @@ -7878,7 +7897,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) case 17: *width = 3000; break; - default: + default: rig_debug(RIG_DEBUG_ERR, "%s: unknown w=%d\n", __func__, w); return -RIG_EINVAL; } @@ -7933,7 +7952,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) case 21: *width = 3200; break; - default: + default: rig_debug(RIG_DEBUG_ERR, "%s: unknown mode=%s\n", __func__, rig_strrmode(mode)); return -RIG_EINVAL; } @@ -8565,6 +8584,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { *width = 3000; } + break; case RIG_MODE_PKTUSB: @@ -8581,6 +8601,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { *width = 2400; } + break; case RIG_MODE_RTTY: @@ -8597,6 +8618,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { *width = 2400; } + break; case RIG_MODE_LSB: @@ -8617,6 +8639,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { *width = 4000; } + break; case RIG_MODE_AM: @@ -8665,6 +8688,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { *width = rig_passband_normal(rig, mode); } + break; case RIG_MODE_AM: @@ -9074,7 +9098,7 @@ int newcat_get_cmd(RIG *rig) */ rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig: '%s'\n", __func__, priv->cmd_str); - // return -RIG_ERJCTED; + // return -RIG_ERJCTED; } continue; diff --git a/rotators/easycomm/easycomm.c b/rotators/easycomm/easycomm.c index e2955c11..a75c2763 100644 --- a/rotators/easycomm/easycomm.c +++ b/rotators/easycomm/easycomm.c @@ -259,13 +259,16 @@ static int easycomm_rot_move_velocity(ROT *rot, int direction, int speed) rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); - if (speed == ROT_SPEED_NOCHANGE) { + if (speed == ROT_SPEED_NOCHANGE) + { easycomm_speed = rs->current_speed; - } else { + } + else + { if (speed < 1 || speed > 100) { rig_debug(RIG_DEBUG_ERR, "%s: Invalid speed value (1-100)! (%d)\n", __func__, - speed); + speed); return -RIG_EINVAL; } @@ -314,12 +317,14 @@ static int easycomm_rot_get_level(ROT *rot, setting_t level, value_t *val) rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); - switch (level) { - case ROT_LEVEL_SPEED: - val->i = rs->current_speed; - break; - default: - return -RIG_ENAVAIL; + switch (level) + { + case ROT_LEVEL_SPEED: + val->i = rs->current_speed; + break; + + default: + return -RIG_ENAVAIL; } return RIG_OK; @@ -332,20 +337,27 @@ static int easycomm_rot_set_level(ROT *rot, setting_t level, value_t val) rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); - switch (level) { - case ROT_LEVEL_SPEED: { - int speed = val.i; - if (speed < 0) { - speed = 0; - } else if (speed > 9999) { - speed = 9999; - } - - rs->current_speed = speed; - break; + switch (level) + { + case ROT_LEVEL_SPEED: + { + int speed = val.i; + + if (speed < 0) + { + speed = 0; } - default: - return -RIG_ENAVAIL; + else if (speed > 9999) + { + speed = 9999; + } + + rs->current_speed = speed; + break; + } + + default: + return -RIG_ENAVAIL; } return RIG_OK; diff --git a/rotators/ether6/ether6.c b/rotators/ether6/ether6.c index 2a5c121a..10e65196 100644 --- a/rotators/ether6/ether6.c +++ b/rotators/ether6/ether6.c @@ -274,12 +274,16 @@ static int ether_rot_move(ROT *rot, int direction, int speed) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - if (speed == ROT_SPEED_NOCHANGE) { + if (speed == ROT_SPEED_NOCHANGE) + { ether_speed = rs->current_speed; - } else { + } + else + { if (speed < 1 || speed > 100) { - rig_debug(RIG_DEBUG_ERR, "%s: Invalid speed value (1-100)! (%d)\n", __func__, speed); + rig_debug(RIG_DEBUG_ERR, "%s: Invalid speed value (1-100)! (%d)\n", __func__, + speed); return -RIG_EINVAL; } @@ -315,12 +319,14 @@ static int ether_rot_get_level(ROT *rot, setting_t level, value_t *val) rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); - switch (level) { - case ROT_LEVEL_SPEED: - val->i = rs->current_speed; - break; - default: - return -RIG_ENAVAIL; + switch (level) + { + case ROT_LEVEL_SPEED: + val->i = rs->current_speed; + break; + + default: + return -RIG_ENAVAIL; } return RIG_OK; @@ -333,20 +339,27 @@ static int ether_rot_set_level(ROT *rot, setting_t level, value_t val) rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); - switch (level) { - case ROT_LEVEL_SPEED: { - int speed = val.i; - if (speed < 1) { - speed = 1; - } else if (speed > 100) { - speed = 100; - } - - rs->current_speed = speed; - break; + switch (level) + { + case ROT_LEVEL_SPEED: + { + int speed = val.i; + + if (speed < 1) + { + speed = 1; + } + else if (speed > 100) + { + speed = 100; } - default: - return -RIG_ENAVAIL; + + rs->current_speed = speed; + break; + } + + default: + return -RIG_ENAVAIL; } return RIG_OK; diff --git a/rotators/gs232a/gs232a.c b/rotators/gs232a/gs232a.c index 9647e0f0..335b6c3d 100644 --- a/rotators/gs232a/gs232a.c +++ b/rotators/gs232a/gs232a.c @@ -245,12 +245,14 @@ static int gs232a_rot_get_level(ROT *rot, setting_t level, value_t *val) rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); - switch (level) { - case ROT_LEVEL_SPEED: - val->i = rs->current_speed; - break; - default: - return -RIG_ENAVAIL; + switch (level) + { + case ROT_LEVEL_SPEED: + val->i = rs->current_speed; + break; + + default: + return -RIG_ENAVAIL; } return RIG_OK; @@ -265,28 +267,36 @@ static int gs232a_rot_set_level(ROT *rot, setting_t level, value_t val) rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); - switch (level) { - case ROT_LEVEL_SPEED: { - int speed = val.i; - if (speed < 1) { - speed = 1; - } else if (speed > 4) { - speed = 4; - } + switch (level) + { + case ROT_LEVEL_SPEED: + { + int speed = val.i; - /* between 1 (slowest) and 4 (fastest) */ - sprintf(cmdstr, "X%u" EOM, speed); - retval = gs232a_transaction(rot, cmdstr, NULL, 0, 1); + if (speed < 1) + { + speed = 1; + } + else if (speed > 4) + { + speed = 4; + } - if (retval != RIG_OK) { - return retval; - } + /* between 1 (slowest) and 4 (fastest) */ + sprintf(cmdstr, "X%u" EOM, speed); + retval = gs232a_transaction(rot, cmdstr, NULL, 0, 1); - rs->current_speed = speed; - break; + if (retval != RIG_OK) + { + return retval; } - default: - return -RIG_ENAVAIL; + + rs->current_speed = speed; + break; + } + + default: + return -RIG_ENAVAIL; } return RIG_OK; @@ -301,12 +311,14 @@ static int gs232a_rot_move(ROT *rot, int direction, int speed) rig_debug(RIG_DEBUG_TRACE, "%s called %d %d\n", __func__, direction, speed); - if (speed != ROT_SPEED_NOCHANGE) { + if (speed != ROT_SPEED_NOCHANGE) + { value_t gs232a_speed; if (speed < 1 || speed > 100) { - rig_debug(RIG_DEBUG_ERR, "%s: Invalid speed value (1-100)! (%d)\n", __func__, speed); + rig_debug(RIG_DEBUG_ERR, "%s: Invalid speed value (1-100)! (%d)\n", __func__, + speed); return -RIG_EINVAL; } diff --git a/rotators/gs232a/gs232b.c b/rotators/gs232a/gs232b.c index b085a29a..ef86fdba 100644 --- a/rotators/gs232a/gs232b.c +++ b/rotators/gs232a/gs232b.c @@ -109,7 +109,7 @@ transaction_write: if (strncmp(data, "\r\n", 2) == 0 || strchr(data, '>')) { rig_debug(RIG_DEBUG_ERR, "%s: Invalid response for '%s': '%s' (length=%d)\n", - __func__, cmdstr, data, (int) strlen(data)); + __func__, cmdstr, data, (int) strlen(data)); dump_hex((unsigned char *)data, strlen(data)); retval = -RIG_EPROTO; // force retry } @@ -274,12 +274,14 @@ static int gs232b_rot_get_level(ROT *rot, setting_t level, value_t *val) rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); - switch (level) { - case ROT_LEVEL_SPEED: - val->i = rs->current_speed; - break; - default: - return -RIG_ENAVAIL; + switch (level) + { + case ROT_LEVEL_SPEED: + val->i = rs->current_speed; + break; + + default: + return -RIG_ENAVAIL; } return RIG_OK; @@ -294,28 +296,36 @@ static int gs232b_rot_set_level(ROT *rot, setting_t level, value_t val) rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); - switch (level) { - case ROT_LEVEL_SPEED: { - int speed = val.i; - if (speed < 1) { - speed = 1; - } else if (speed > 4) { - speed = 4; - } - - /* between 1 (slowest) and 4 (fastest) */ - sprintf(cmdstr, "X%u" EOM, speed); - retval = gs232b_transaction(rot, cmdstr, NULL, 0, 1); - - if (retval != RIG_OK) { - return retval; - } - - rs->current_speed = speed; - break; + switch (level) + { + case ROT_LEVEL_SPEED: + { + int speed = val.i; + + if (speed < 1) + { + speed = 1; + } + else if (speed > 4) + { + speed = 4; + } + + /* between 1 (slowest) and 4 (fastest) */ + sprintf(cmdstr, "X%u" EOM, speed); + retval = gs232b_transaction(rot, cmdstr, NULL, 0, 1); + + if (retval != RIG_OK) + { + return retval; } - default: - return -RIG_ENAVAIL; + + rs->current_speed = speed; + break; + } + + default: + return -RIG_ENAVAIL; } return RIG_OK; @@ -330,12 +340,14 @@ static int gs232b_rot_move(ROT *rot, int direction, int speed) rig_debug(RIG_DEBUG_TRACE, "%s called %d %d\n", __func__, direction, speed); - if (speed != ROT_SPEED_NOCHANGE) { + if (speed != ROT_SPEED_NOCHANGE) + { value_t gs232b_speed; if (speed < 1 || speed > 100) { - rig_debug(RIG_DEBUG_ERR, "%s: Invalid speed value (1-100)! (%d)\n", __func__, speed); + rig_debug(RIG_DEBUG_ERR, "%s: Invalid speed value (1-100)! (%d)\n", __func__, + speed); return -RIG_EINVAL; } diff --git a/rotators/prosistel/prosistel.c b/rotators/prosistel/prosistel.c index 96d4c478..25fd64cc 100644 --- a/rotators/prosistel/prosistel.c +++ b/rotators/prosistel/prosistel.c @@ -133,7 +133,7 @@ transaction_quit: static int prosistel_rot_open(ROT *rot) { struct prosistel_rot_priv_caps *priv_caps = - (struct prosistel_rot_priv_caps *) rot->caps->priv; + (struct prosistel_rot_priv_caps *) rot->caps->priv; char cmdstr[64]; int retval; @@ -144,10 +144,12 @@ static int prosistel_rot_open(ROT *rot) // The rotator controller sends position data continuously when CPM is enabled // Disable CPM for azimuth if the rotator has an azimuth rotator - if (rot->caps->rot_type == ROT_TYPE_AZIMUTH || rot->caps->rot_type == ROT_TYPE_AZEL) + if (rot->caps->rot_type == ROT_TYPE_AZIMUTH + || rot->caps->rot_type == ROT_TYPE_AZEL) { num_sprintf(cmdstr, STX"%cS"CR, priv_caps->azimuth_id); retval = prosistel_transaction(rot, cmdstr, NULL, 0); + if (retval != RIG_OK) { return retval; @@ -155,10 +157,12 @@ static int prosistel_rot_open(ROT *rot) } // Disable CPM for elevation if the rotator has an elevation rotator - if (rot->caps->rot_type == ROT_TYPE_ELEVATION || rot->caps->rot_type == ROT_TYPE_AZEL) + if (rot->caps->rot_type == ROT_TYPE_ELEVATION + || rot->caps->rot_type == ROT_TYPE_AZEL) { num_sprintf(cmdstr, STX"%cS"CR, priv_caps->elevation_id); retval = prosistel_transaction(rot, cmdstr, NULL, 0); + if (retval != RIG_OK) { return retval; @@ -172,7 +176,7 @@ static int prosistel_rot_open(ROT *rot) static int prosistel_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) { struct prosistel_rot_priv_caps *priv_caps = - (struct prosistel_rot_priv_caps *) rot->caps->priv; + (struct prosistel_rot_priv_caps *) rot->caps->priv; char cmdstr[64]; int retval; @@ -182,9 +186,11 @@ static int prosistel_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) // Set azimuth only if the rotator has the capability to do so // It is an error to set azimuth if it's not supported by the rotator controller - if (rot->caps->rot_type == ROT_TYPE_AZIMUTH || rot->caps->rot_type == ROT_TYPE_AZEL) + if (rot->caps->rot_type == ROT_TYPE_AZIMUTH + || rot->caps->rot_type == ROT_TYPE_AZEL) { - num_sprintf(cmdstr, STX"%cG%.0f"CR, priv_caps->azimuth_id, az * priv_caps->angle_multiplier); + num_sprintf(cmdstr, STX"%cG%.0f"CR, priv_caps->azimuth_id, + az * priv_caps->angle_multiplier); retval = prosistel_transaction(rot, cmdstr, NULL, 0); if (retval != RIG_OK) @@ -195,9 +201,11 @@ static int prosistel_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) // Set elevation only if the rotator has the capability to do so // It is an error to set elevation if it's not supported by the rotator controller - if (rot->caps->rot_type == ROT_TYPE_ELEVATION || rot->caps->rot_type == ROT_TYPE_AZEL) + if (rot->caps->rot_type == ROT_TYPE_ELEVATION + || rot->caps->rot_type == ROT_TYPE_AZEL) { - num_sprintf(cmdstr, STX"%cG%.0f"CR, priv_caps->elevation_id, el * priv_caps->angle_multiplier); + num_sprintf(cmdstr, STX"%cG%.0f"CR, priv_caps->elevation_id, + el * priv_caps->angle_multiplier); retval = prosistel_transaction(rot, cmdstr, NULL, 0); if (retval != RIG_OK) @@ -213,7 +221,7 @@ static int prosistel_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) static int prosistel_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) { struct prosistel_rot_priv_caps *priv_caps = - (struct prosistel_rot_priv_caps *) rot->caps->priv; + (struct prosistel_rot_priv_caps *) rot->caps->priv; char cmdstr[64]; char data[20]; float posval; @@ -222,12 +230,14 @@ static int prosistel_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) // Query azimuth only if the rotator has the capability to do so // It is an error to query for azimuth if it's not supported by the rotator controller - if (rot->caps->rot_type == ROT_TYPE_AZIMUTH || rot->caps->rot_type == ROT_TYPE_AZEL) + if (rot->caps->rot_type == ROT_TYPE_AZIMUTH + || rot->caps->rot_type == ROT_TYPE_AZEL) { char rot_id; num_sprintf(cmdstr, STX"%c?"CR, priv_caps->azimuth_id); retval = prosistel_transaction(rot, cmdstr, data, sizeof(data)); + if (retval != RIG_OK) { return retval; @@ -248,7 +258,7 @@ static int prosistel_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) posval /= priv_caps->angle_multiplier; rig_debug(RIG_DEBUG_VERBOSE, "%s got position from '%s' converted to %f\n", - __func__, data, posval); + __func__, data, posval); *az = (azimuth_t) posval; } @@ -259,12 +269,14 @@ static int prosistel_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) // Query elevation only if the rotator has the capability to do so // It is an error to query for elevation if it's not supported by the rotator controller - if (rot->caps->rot_type == ROT_TYPE_ELEVATION || rot->caps->rot_type == ROT_TYPE_AZEL) + if (rot->caps->rot_type == ROT_TYPE_ELEVATION + || rot->caps->rot_type == ROT_TYPE_AZEL) { char rot_id; num_sprintf(cmdstr, STX"%c?"CR, priv_caps->elevation_id); retval = prosistel_transaction(rot, cmdstr, data, sizeof(data)); + if (retval != RIG_OK) { return retval; @@ -285,7 +297,7 @@ static int prosistel_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) posval /= priv_caps->angle_multiplier; rig_debug(RIG_DEBUG_VERBOSE, "%s got position from '%s' converted to %f\n", - __func__, data, posval); + __func__, data, posval); *el = (elevation_t) posval; } @@ -301,14 +313,15 @@ static int prosistel_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) static int prosistel_rot_stop(ROT *rot) { struct prosistel_rot_priv_caps *priv_caps = - (struct prosistel_rot_priv_caps *) rot->caps->priv; + (struct prosistel_rot_priv_caps *) rot->caps->priv; char cmdstr[64]; int retval; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); // Stop azimuth only if the rotator has the capability to do so - if (rot->caps->rot_type == ROT_TYPE_AZIMUTH || rot->caps->rot_type == ROT_TYPE_AZEL) + if (rot->caps->rot_type == ROT_TYPE_AZIMUTH + || rot->caps->rot_type == ROT_TYPE_AZEL) { num_sprintf(cmdstr, STX"%cG%d"CR, priv_caps->azimuth_id, priv_caps->stop_angle); retval = prosistel_transaction(rot, cmdstr, NULL, 0); @@ -320,9 +333,11 @@ static int prosistel_rot_stop(ROT *rot) } // Stop elevation only if the rotator has the capability to do so - if (rot->caps->rot_type == ROT_TYPE_ELEVATION || rot->caps->rot_type == ROT_TYPE_AZEL) + if (rot->caps->rot_type == ROT_TYPE_ELEVATION + || rot->caps->rot_type == ROT_TYPE_AZEL) { - num_sprintf(cmdstr, STX"%cG%d"CR, priv_caps->elevation_id, priv_caps->stop_angle); + num_sprintf(cmdstr, STX"%cG%d"CR, priv_caps->elevation_id, + priv_caps->stop_angle); retval = prosistel_transaction(rot, cmdstr, NULL, 0); if (retval != RIG_OK) commit 8ed0dcdbb78e118ef6be94836749d8ac0da81835 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Dec 17 12:01:08 2020 -0600 Fix flex6xxx RFPOWER_METER_WATTS for sure this time diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index 11bb1dc1..1da17bad 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -736,6 +736,7 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) int len, ans; rmode_t mode; pbwidth_t width; + ptt_t ptt; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -772,6 +773,11 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_RFPOWER_METER: case RIG_LEVEL_RFPOWER_METER_WATTS: + flex6k_get_ptt(rig, vfo, &ptt); + if (!ptt) { + val->f = 0; + return RIG_OK; + } cmd = "ZZRM5"; len = 5; ans = 3; @@ -837,12 +843,12 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_AF: case RIG_LEVEL_RFPOWER_METER: case RIG_LEVEL_RFPOWER_METER_WATTS: - n = sscanf(lvlbuf + len, "%f", &val->f); - + n = sscanf(lvlbuf, "ZZRM%f", &val->f); if (n != 1) { rig_debug(RIG_DEBUG_ERR, "%s: Error parsing value from lvlbuf='%s'\n", __func__, lvlbuf); + val->f = 0; return -RIG_EPROTO; } if (level != RIG_LEVEL_RFPOWER_METER_WATTS) commit 31b42de067ecee1a084aad36d28dd2739b347f7f Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Dec 17 11:36:21 2020 -0600 Fix flex6xxx RFPOWER_METER_WATTS diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index 7dc8c89b..11bb1dc1 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -771,6 +771,7 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_RFPOWER_METER: + case RIG_LEVEL_RFPOWER_METER_WATTS: cmd = "ZZRM5"; len = 5; ans = 3; commit c11e592a7a747f93046c760ea988694f73011167 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Dec 17 07:53:16 2020 -0600 Add RFLEVEL_POWER_METER_WATTS to flex6xxx and k3 diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index 65411fbf..7dc8c89b 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -51,7 +51,7 @@ /* PowerSDR differences */ #define POWERSDR_FUNC_ALL (RIG_FUNC_VOX|RIG_FUNC_SQL|RIG_FUNC_NB|RIG_FUNC_ANF|RIG_FUNC_MUTE|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER) -#define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_MICGAIN|RIG_LEVEL_VOXGAIN|RIG_LEVEL_SQL|RIG_LEVEL_AF|RIG_LEVEL_AGC|RIG_LEVEL_RF|RIG_LEVEL_IF) +#define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_MICGAIN|RIG_LEVEL_VOXGAIN|RIG_LEVEL_SQL|RIG_LEVEL_AF|RIG_LEVEL_AGC|RIG_LEVEL_RF|RIG_LEVEL_IF) static rmode_t flex_mode_table[KENWOOD_MODE_TABLE_MAX] = @@ -835,6 +835,7 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_AF: case RIG_LEVEL_RFPOWER_METER: + case RIG_LEVEL_RFPOWER_METER_WATTS: n = sscanf(lvlbuf + len, "%f", &val->f); if (n != 1) @@ -843,8 +844,10 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) __func__, lvlbuf); return -RIG_EPROTO; } - - val->f /= 100; + if (level != RIG_LEVEL_RFPOWER_METER_WATTS) + { + val->f /= 100; + } break; case RIG_LEVEL_RF: @@ -1020,7 +1023,7 @@ const struct rig_caps f6k_caps = RIG_MODEL(RIG_MODEL_F6K), .model_name = "6xxx", .mfg_name = "FlexRadio", - .version = "20130717.0", + .version = "20201217.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1144,7 +1147,7 @@ const struct rig_caps powersdr_caps = RIG_MODEL(RIG_MODEL_POWERSDR), .model_name = "PowerSDR/Thetis", .mfg_name = "FlexRadio/ANAN", - .version = "20201108.0", + .version = "2020161217", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 8cdfe628..e371c1a8 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -47,7 +47,7 @@ #define K3_LEVEL_ALL (RIG_LEVEL_ATT|RIG_LEVEL_PREAMP|RIG_LEVEL_AGC|RIG_LEVEL_SQL|\ RIG_LEVEL_STRENGTH|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER|RIG_LEVEL_KEYSPD|\ RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_MICGAIN|RIG_LEVEL_COMP|\ - RIG_LEVEL_NR|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_RAWSTR|RIG_LEVEL_RFPOWER_METER) + RIG_LEVEL_NR|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_RAWSTR|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS) #define K3_VFO (RIG_VFO_A|RIG_VFO_B) #define K3_VFO_OP (RIG_OP_UP|RIG_OP_DOWN) @@ -61,7 +61,7 @@ #define KX3_LEVEL_ALL (RIG_LEVEL_ATT|RIG_LEVEL_PREAMP|RIG_LEVEL_AGC|RIG_LEVEL_SQL|\ RIG_LEVEL_STRENGTH|RIG_LEVEL_RFPOWER|RIG_LEVEL_KEYSPD|\ RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_MICGAIN|RIG_LEVEL_COMP|\ - RIG_LEVEL_NR|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_RAWSTR|RIG_LEVEL_RFPOWER_METER) + RIG_LEVEL_NR|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_RAWSTR|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS) /* * Elecraft K3/K3S extra level definitions @@ -181,7 +181,7 @@ const struct rig_caps k3_caps = RIG_MODEL(RIG_MODEL_K3), .model_name = "K3", .mfg_name = "Elecraft", - .version = BACKEND_VER ".1", + .version = BACKEND_VER ".2", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -332,7 +332,7 @@ const struct rig_caps k3s_caps = RIG_MODEL(RIG_MODEL_K3S), .model_name = "K3S", .mfg_name = "Elecraft", - .version = BACKEND_VER ".1", + .version = BACKEND_VER ".2", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -482,7 +482,7 @@ const struct rig_caps k4_caps = RIG_MODEL(RIG_MODEL_K4), .model_name = "K4", .mfg_name = "Elecraft", - .version = BACKEND_VER ".1", + .version = BACKEND_VER ".2", .copyright = "LGPL", .status = RIG_STATUS_ALPHA, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -631,7 +631,7 @@ const struct rig_caps kx3_caps = RIG_MODEL(RIG_MODEL_KX3), .model_name = "KX3", .mfg_name = "Elecraft", - .version = BACKEND_VER ".1", + .version = BACKEND_VER ".2", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -780,7 +780,7 @@ const struct rig_caps kx2_caps = RIG_MODEL(RIG_MODEL_KX2), .model_name = "KX2", .mfg_name = "Elecraft", - .version = BACKEND_VER ".1", + .version = BACKEND_VER ".2", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1840,6 +1840,7 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } case RIG_LEVEL_RFPOWER_METER: + case RIG_LEVEL_RFPOWER_METER_WATTS: { int tx_mode; float pwr; @@ -1863,6 +1864,10 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } val->f = pwr; + if (level == RIG_LEVEL_RFPOWER_METER_WATTS) + { + val->f *= 100; + } break; } commit 6f4c2de0b63f267c32497d86103a7629c55bfb30 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 16 22:33:00 2020 -0600 Change RFPOWER_METER table to reflect that it's for the FT2000D diff --git a/rigs/yaesu/ft2000.c b/rigs/yaesu/ft2000.c index 59b9d1c5..03888f71 100644 --- a/rigs/yaesu/ft2000.c +++ b/rigs/yaesu/ft2000.c @@ -133,7 +133,7 @@ const struct rig_caps ft2000_caps = .transceive = RIG_TRN_OFF, /* May enable later as the 2000 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, - .rfpower_meter_cal = FT2000_RFPOWER_METER_CAL, + .rfpower_meter_cal = FT2000D_RFPOWER_METER_CAL, .str_cal = FT2000_STR_CAL, .chan_list = { { 1, 99, RIG_MTYPE_MEM, NEWCAT_MEM_CAP }, diff --git a/rigs/yaesu/ft2000.h b/rigs/yaesu/ft2000.h index e9e10459..b09da65e 100644 --- a/rigs/yaesu/ft2000.h +++ b/rigs/yaesu/ft2000.h @@ -72,7 +72,7 @@ // From measurements on FT2000D by Stan UA3SAQ // We'll reuse this for now and divide by 2 for FT2000 -#define FT2000_RFPOWER_METER_CAL { 12, \ +#define FT2000D_RFPOWER_METER_CAL { 12, \ { \ {0, 0.0f}, \ {51, 10.0f}, \ commit 603f39097db1f476d31f0f6962f6c0845a3c9611 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 16 22:20:39 2020 -0600 Update ft2000 RFPOWER_METER diff --git a/rigs/yaesu/ft2000.c b/rigs/yaesu/ft2000.c index 03888f71..59b9d1c5 100644 --- a/rigs/yaesu/ft2000.c +++ b/rigs/yaesu/ft2000.c @@ -133,7 +133,7 @@ const struct rig_caps ft2000_caps = .transceive = RIG_TRN_OFF, /* May enable later as the 2000 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, - .rfpower_meter_cal = FT2000D_RFPOWER_METER_CAL, + .rfpower_meter_cal = FT2000_RFPOWER_METER_CAL, .str_cal = FT2000_STR_CAL, .chan_list = { { 1, 99, RIG_MTYPE_MEM, NEWCAT_MEM_CAP }, diff --git a/rigs/yaesu/ft2000.h b/rigs/yaesu/ft2000.h index f81c5a9b..e9e10459 100644 --- a/rigs/yaesu/ft2000.h +++ b/rigs/yaesu/ft2000.h @@ -72,8 +72,9 @@ // From measurements on FT2000D by Stan UA3SAQ // We'll reuse this for now and divide by 2 for FT2000 -#define FT2000D_RFPOWER_METER_CAL { 11, \ +#define FT2000_RFPOWER_METER_CAL { 12, \ { \ + {0, 0.0f}, \ {51, 10.0f}, \ {67, 20.0f}, \ {97, 40.0f}, \ commit 2a0deb34158bea57cab351819adeea2a8fc02a1e Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 16 17:47:49 2020 -0600 Add RIG_LEVEL_RFPOWER_METER_WATTS Old level of 0-1 just doesn't work well with the varying power levels in rigs now diff --git a/NEWS b/NEWS index 438541d0..e1407ba7 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,7 @@ Version 4.0 * API/ABI changes, advance ABI to 4 0 0. * Add GPIO and GPION options for DCD. Jeroen Vreeken * New backend: ELAD FDM DUO. Giovanni, HB9EIK. + * New RIG_LEVEL_RFPOWER_METER_WATTS level * All channel functions now take a vfo argument * New rotator backend: iOptron. Bob, KD8CGH * New model: Icom IC-R8600. Ekki, DF4OR diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index b2fde9ce..e695ce3f 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -841,7 +841,7 @@ and .IP Level is a token: \(oqPREAMP\(cq, \(oqATT\(cq, \(oqVOX\(cq, \(oqAF\(cq, \(oqRF\(cq, \(oqSQL\(cq, \(oqIF\(cq, \(oqAPF\(cq, \(oqNR\(cq, \(oqPBT_IN\(cq, -\(oqPBT_OUT\(cq, \(oqCWPITCH\(cq, \(oqRFPOWER\(cq, \(oqMICGAIN\(cq, +\(oqPBT_OUT\(cq, \(oqCWPITCH\(cq, \(oqRFPOWER\(cq, \(oqRFPOWER_METER\(cq, \(oqRFPOWER_METER_WATTS\(cq, \(oqMICGAIN\(cq, \(oqKEYSPD\(cq, \(oqNOTCHF\(cq, \(oqCOMP\(cq, \(oqAGC\(cq, \(oqBKINDL\(cq, \(oqBAL\(cq, \(oqMETER\(cq, \(oqVOXGAIN\(cq, \(oqANTIVOX\(cq, \(oqSLOPE_LOW\(cq, \(oqSLOPE_HIGH\(cq, \(oqRAWSTR\(cq, \(oqSWR\(cq, diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index 74229e18..8024b6c1 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -822,7 +822,7 @@ and .IP Level is a token: \(oqPREAMP\(cq, \(oqATT\(cq, \(oqVOX\(cq, \(oqAF\(cq, \(oqRF\(cq, \(oqSQL\(cq, \(oqIF\(cq, \(oqAPF\(cq, \(oqNR\(cq, \(oqPBT_IN\(cq, -\(oqPBT_OUT\(cq, \(oqCWPITCH\(cq, \(oqRFPOWER\(cq, \(oqMICGAIN\(cq, +\(oqPBT_OUT\(cq, \(oqCWPITCH\(cq, \(oqRFPOWER\(cq, \(oqRFPOWER_METER\(cq, \(oqRFPOWER_METER_WATTS\(cq, \(oqMICGAIN\(cq, \(oqKEYSPD\(cq, \(oqNOTCHF\(cq, \(oqCOMP\(cq, \(oqAGC\(cq, \(oqBKINDL\(cq, \(oqBAL\(cq, \(oqMETER\(cq, \(oqVOXGAIN\(cq, \(oqANTIVOX\(cq, \(oqSLOPE_LOW\(cq, \(oqSLOPE_HIGH\(cq, \(oqRAWSTR\(cq, \(oqSWR\(cq, diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index b8c4832f..8825c8d6 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -888,7 +888,7 @@ enum rig_level_e { RIG_LEVEL_NOTCHF_RAW = CONSTANT_64BIT_FLAG(36), /*!< \c NOTCHF_RAW -- Notch Freq., arg float [0.0 ... 1.0] */ RIG_LEVEL_MONITOR_GAIN = CONSTANT_64BIT_FLAG(37), /*!< \c MONITOR_GAIN -- Monitor gain (level for monitoring of transmitted audio), arg float [0.0 ... 1.0] */ RIG_LEVEL_NB = CONSTANT_64BIT_FLAG(38), /*!< \c NB -- Noise Blanker level, arg float [0.0 ... 1.0] */ - RIG_LEVEL_39 = CONSTANT_64BIT_FLAG(39), /*!< \c Future use */ + RIG_LEVEL_RFPOWER_METER_WATTS = CONSTANT_64BIT_FLAG(39), /*!< \c RFPOWER_METER_WATTS -- RF power output meter, arg float [0.0 ... MAX] (output power in watts) */ RIG_LEVEL_40 = CONSTANT_64BIT_FLAG(40), /*!< \c Future use */ RIG_LEVEL_41 = CONSTANT_64BIT_FLAG(41), /*!< \c Future use */ RIG_LEVEL_42 = CONSTANT_64BIT_FLAG(42), /*!< \c Future use */ @@ -916,7 +916,7 @@ enum rig_level_e { }; //! @cond Doxygen_Suppress -#define RIG_LEVEL_FLOAT_LIST (RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_APF|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_COMP|RIG_LEVEL_BALANCE|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB) +#define RIG_LEVEL_FLOAT_LIST (RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_APF|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_COMP|RIG_LEVEL_BALANCE|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB) #define RIG_LEVEL_READONLY_LIST (RIG_LEVEL_SQLSTAT|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_STRENGTH|RIG_LEVEL_RAWSTR|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER) diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index 37f4ad2f..d3d7b51a 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -1069,6 +1069,20 @@ static int dummy_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; + case RIG_LEVEL_RFPOWER_METER_WATTS: + if (priv->static_data) + { + curr->levels[idx].f = 50.0f; + } + else + { + curr->levels[idx].f = (float)(time(NULL) % 32) / 64.0f + (float)( + rand() % 4) / 8.0f; + curr->levels[idx].f *= 100.0f; + } + + break; + case RIG_LEVEL_COMP_METER: if (priv->static_data) { diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 214174df..a34da5ad 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -107,6 +107,7 @@ struct flrig_priv_data pbwidth_t curr_widthB; int has_get_modeA; /* True if this function is available */ int has_get_bwA; /* True if this function is available */ + float powermeter_scale; /* So we can scale power meter to 0-1 */ }; const struct rig_caps flrig_caps = @@ -735,6 +736,19 @@ static int flrig_open(RIG *rig) strncpy(priv->info, value, sizeof(priv->info)); rig_debug(RIG_DEBUG_VERBOSE, "Transceiver=%s\n", value); + /* see if get_pwrmeter_scale is available */ + retval = flrig_transaction(rig, "rig.get_pwrmeter_scale", NULL, value, + sizeof(value)); + + if (retval != RIG_OK) { return retval; } + + priv->powermeter_scale = 100; // default + + if (strlen(value) > 0) + { + priv->powermeter_scale = atof(value); + } + /* see if get_modeA is available */ retval = flrig_transaction(rig, "rig.get_modeA", NULL, value, sizeof(value)); @@ -1909,6 +1923,7 @@ static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) char value[MAXARGLEN]; char *cmd; int retval; + //struct flrig_priv_data *priv = (struct flrig_priv_data *) rig->state.priv; rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__, rig_strvfo(vfo)); @@ -1944,9 +1959,17 @@ static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) switch (level) { case RIG_LEVEL_STRENGTH: - case RIG_LEVEL_RFPOWER_METER: val->i = atoi(value); rig_debug(RIG_DEBUG_TRACE, "%s: val.i='%s'(%d)\n", __func__, value, val->i); + + case RIG_LEVEL_RFPOWER_METER: + val->f = atof(value)/100.0; + rig_debug(RIG_DEBUG_TRACE, "%s: val.f='%s'(%g)\n", __func__, value, val->f); + break; + + case RIG_LEVEL_RFPOWER_METER_WATTS: + val->f = atof(value); + rig_debug(RIG_DEBUG_TRACE, "%s: val.f='%s'(%g)\n", __func__, value, val->f); break; d... [truncated message content] |
From: Michael B. <mdb...@us...> - 2020-12-16 13:55:27
|
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 21e691153854c7029b4d0c152f964c7dd7acba3d (commit) from 14ea0305b6ef4d96f6d5dc05d33131c1d96f03a3 (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 21e691153854c7029b4d0c152f964c7dd7acba3d Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 16 07:46:39 2020 -0600 Add rfpower_meter_str for FT2000D and reuse by dividing in half for FT2000 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 137b0508..d40c24f9 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -532,6 +532,15 @@ int newcat_open(RIG *rig) /* Initialize rig_id in case any subsequent commands need it */ (void)newcat_get_rigid(rig); + if (priv->rig_id == NC_RIGID_FT2000) + { // then we need to readjust rfpowermeter cal table in half + int i; + for(i=0;i<rig->caps->rfpower_meter_cal.size; ++i) + { // we may need a table for the FT2000 instead of this + rig->caps->rfpower_meter_cal.table[i].raw/=2; + } + } + return RIG_OK; } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 654e2295..bf7b1dcd 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201215" +#define NEWCAT_VER "20201216" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 9 +++++++++ rigs/yaesu/newcat.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-12-15 21:27:55
|
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 14ea0305b6ef4d96f6d5dc05d33131c1d96f03a3 (commit) via f05307dae8cf7a2b0f1041fcd24d81471d624a61 (commit) via 82c389a75b6669790de01a09781a6a072151cca7 (commit) via 429fd1ab89fb51847db78e5b75e773d58712bc22 (commit) via 0b52d2a6c334975a69dd03ea4fff0fc980b9056f (commit) via 219b1635a149e6868c06a095862887ed1949f32a (commit) via 9e604437b1ad95b3413e845a853421300513eb2c (commit) via 1cd872e8cd05db3d2549a32dfa01870d3e82b628 (commit) via 349516911ad4e123f6939b79135b28d3e4188de4 (commit) via 20764a548345b18ed9b161a3dbe5f2769426e7a3 (commit) via 41969433eda9db965a28348330448d2c2b5644e1 (commit) via da04467584e5d24541d90083e833e0e43cca2cbb (commit) via 1e1f7529fab7302f7698a32607b97397cb8ed0e7 (commit) via 8c265a85f20b4318ba1b2cec9f3b6e1dac00baec (commit) from 4eef84ef47874e47f567d0d5c88fd093977b70dc (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 14ea0305b6ef4d96f6d5dc05d33131c1d96f03a3 Merge: f05307da 82c389a7 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Dec 15 15:27:23 2020 -0600 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit f05307dae8cf7a2b0f1041fcd24d81471d624a61 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Dec 15 15:25:28 2020 -0600 Fix newcat_get_rx_bandwith SH return values https://github.com/Hamlib/Hamlib/issues/467 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index b15f6f68..137b0508 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1034,6 +1034,7 @@ int newcat_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) if (*mode == '0') { + rig_debug(RIG_DEBUG_ERR, "%s: *mode = '0'??\n", __func__); return -RIG_EPROTO; } @@ -7641,14 +7642,31 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) return err; } - if (sscanf(priv->ret_data, "SH0%3d;", &w) != 1) + + w = 0; // use default in case of error + if (strlen(priv->ret_data) == 7) { - if (sscanf(priv->ret_data, "SH%3d;", &w) != 1) + int on; + int n = sscanf(priv->ret_data, "SH0%1d%3d", &on, &w); + if (n == 2) { + if (!on) { w = 0; } + } + else { err = -RIG_EPROTO; - } + } + } + else if (strlen(priv->ret_data) == 6) + { + int n = sscanf(priv->ret_data, "SH%3d", &w); + if (n != 1) err = -RIG_EPROTO; + } + else + { + err = -RIG_EPROTO; } - rig_debug(RIG_DEBUG_TRACE, "%s: w=%d\n", __func__, w); + + rig_debug(RIG_DEBUG_TRACE, "%s: w=%d\n", __func__, w); if (err != RIG_OK) { @@ -7779,6 +7797,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) break; default: + rig_debug(RIG_DEBUG_ERR, "%s: unknown mode=%s\n", __func__, rig_strrmode(mode)); return -RIG_EINVAL; } /* end switch(mode) */ @@ -7787,6 +7806,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { if ((narrow = get_narrow(rig, vfo)) < 0) { + rig_debug(RIG_DEBUG_ERR, "%s: error narrow < 0, narrow=%d\n", __func__, narrow); return -RIG_EPROTO; } @@ -7846,7 +7866,9 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) case 17: *width = 3000; break; - default: return -RIG_EINVAL; + default: + rig_debug(RIG_DEBUG_ERR, "%s: unknown w=%d\n", __func__, w); + return -RIG_EINVAL; } break; @@ -7899,7 +7921,9 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) case 21: *width = 3200; break; - default: return -RIG_EINVAL; + default: + rig_debug(RIG_DEBUG_ERR, "%s: unknown mode=%s\n", __func__, rig_strrmode(mode)); + return -RIG_EINVAL; } break; @@ -7919,6 +7943,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) break; default: + rig_debug(RIG_DEBUG_ERR, "%s: unknown mode=%s\n", __func__, rig_strrmode(mode)); return -RIG_EINVAL; } /* end switch(mode) */ diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 6b69bf15..654e2295 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201213" +#define NEWCAT_VER "20201215" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 82c389a75b6669790de01a09781a6a072151cca7 Merge: 1cd872e8 429fd1ab Author: Michael Black <mdb...@ya...> Date: Tue Dec 15 14:44:20 2020 -0600 Merge pull request #468 from mikaelnousiainen/prosistel-d-fixes Fix Prosistel rotator control backend commit 429fd1ab89fb51847db78e5b75e773d58712bc22 Author: Mikael Nousiainen <mik...@ik...> Date: Tue Dec 15 22:18:08 2020 +0200 Set az/el return values to zero when not supported diff --git a/rotators/prosistel/prosistel.c b/rotators/prosistel/prosistel.c index 77dc19ad..96d4c478 100644 --- a/rotators/prosistel/prosistel.c +++ b/rotators/prosistel/prosistel.c @@ -252,6 +252,10 @@ static int prosistel_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) *az = (azimuth_t) posval; } + else + { + *az = 0; + } // Query elevation only if the rotator has the capability to do so // It is an error to query for elevation if it's not supported by the rotator controller @@ -285,6 +289,10 @@ static int prosistel_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) *el = (elevation_t) posval; } + else + { + *el = 0; + } return retval; } commit 0b52d2a6c334975a69dd03ea4fff0fc980b9056f Author: Mikael Nousiainen <mik...@ik...> Date: Tue Dec 15 21:46:02 2020 +0200 Update Prosistel backend model variable names diff --git a/include/hamlib/rotlist.h b/include/hamlib/rotlist.h index 796a5723..bab32d20 100644 --- a/include/hamlib/rotlist.h +++ b/include/hamlib/rotlist.h @@ -424,31 +424,31 @@ /** - * \def ROT_MODEL_PROSISTEL_AZ - * \brief A macro that returns the model number of the PROSISTEL azimuth backend. + * \def ROT_MODEL_PROSISTEL_D_AZ + * \brief A macro that returns the model number of the PROSISTEL D azimuth backend. * */ //! @cond Doxygen_Suppress #define ROT_PROSISTEL 17 #define ROT_BACKEND_PROSISTEL "prosistel" //! @endcond -#define ROT_MODEL_PROSISTEL_AZ ROT_MAKE_MODEL(ROT_PROSISTEL, 1) +#define ROT_MODEL_PROSISTEL_D_AZ ROT_MAKE_MODEL(ROT_PROSISTEL, 1) /** - * \def ROT_MODEL_PROSISTEL_EL - * \brief A macro that returns the model number of the PROSISTEL elevation backend. + * \def ROT_MODEL_PROSISTEL_D_EL + * \brief A macro that returns the model number of the PROSISTEL D elevation backend. * */ -#define ROT_MODEL_PROSISTEL_EL ROT_MAKE_MODEL(ROT_PROSISTEL, 2) +#define ROT_MODEL_PROSISTEL_D_EL ROT_MAKE_MODEL(ROT_PROSISTEL, 2) /** * \def ROT_MODEL_PROSISTEL_AZEL_COMBO - * \brief A macro that returns the model number of the PROSISTEL azimuth + elevation combo backend. + * \brief A macro that returns the model number of the PROSISTEL Combi-Track azimuth + elevation combo backend. * */ -#define ROT_MODEL_PROSISTEL_AZEL_COMBO ROT_MAKE_MODEL(ROT_PROSISTEL, 3) +#define ROT_MODEL_PROSISTEL_COMBI_TRACK_AZEL ROT_MAKE_MODEL(ROT_PROSISTEL, 3) /** diff --git a/rotators/prosistel/prosistel.c b/rotators/prosistel/prosistel.c index 8f6bcd67..77dc19ad 100644 --- a/rotators/prosistel/prosistel.c +++ b/rotators/prosistel/prosistel.c @@ -360,9 +360,9 @@ static const struct prosistel_rot_priv_caps prosistel_rot_combitrack_priv_caps = /* * Prosistel rotator capabilities */ -const struct rot_caps prosistel_az_rot_caps = +const struct rot_caps prosistel_d_az_rot_caps = { - ROT_MODEL(ROT_MODEL_PROSISTEL_AZ), + ROT_MODEL(ROT_MODEL_PROSISTEL_D_AZ), .model_name = "D azimuth", .mfg_name = "Prosistel", .version = "20201215.0", @@ -395,9 +395,9 @@ const struct rot_caps prosistel_az_rot_caps = }; -const struct rot_caps prosistel_el_rot_caps = +const struct rot_caps prosistel_d_el_rot_caps = { - ROT_MODEL(ROT_MODEL_PROSISTEL_EL), + ROT_MODEL(ROT_MODEL_PROSISTEL_D_EL), .model_name = "D elevation", .mfg_name = "Prosistel", .version = "20201215.0", @@ -430,9 +430,9 @@ const struct rot_caps prosistel_el_rot_caps = }; -const struct rot_caps prosistel_azel_combo_rot_caps = +const struct rot_caps prosistel_combi_track_azel_rot_caps = { - ROT_MODEL(ROT_MODEL_PROSISTEL_AZEL_COMBO), + ROT_MODEL(ROT_MODEL_PROSISTEL_COMBI_TRACK_AZEL), .model_name = "Combi-Track az+el", .mfg_name = "Prosistel", .version = "20201215.0", @@ -468,9 +468,9 @@ DECLARE_INITROT_BACKEND(prosistel) { rig_debug(RIG_DEBUG_VERBOSE, "%s: _init called\n", __func__); - rot_register(&prosistel_az_rot_caps); - rot_register(&prosistel_el_rot_caps); - rot_register(&prosistel_azel_combo_rot_caps); + rot_register(&prosistel_d_az_rot_caps); + rot_register(&prosistel_d_el_rot_caps); + rot_register(&prosistel_combi_track_azel_rot_caps); return RIG_OK; } diff --git a/rotators/prosistel/prosistel.h b/rotators/prosistel/prosistel.h index 3c6bba59..ee7b3594 100644 --- a/rotators/prosistel/prosistel.h +++ b/rotators/prosistel/prosistel.h @@ -22,9 +22,8 @@ #ifndef _ROT_PROSISTEL_H #define _ROT_PROSISTEL_H 1 - -extern const struct rot_caps prosistel_az_rot_caps; -extern const struct rot_caps prosistel_el_rot_caps; -extern const struct rot_caps prosistel_azel_combo_rot_caps; +extern const struct rot_caps prosistel_d_az_rot_caps; +extern const struct rot_caps prosistel_d_el_rot_caps; +extern const struct rot_caps prosistel_combi_track_azel_rot_caps; #endif /* _ROT_PROSISTEL_H */ commit 219b1635a149e6868c06a095862887ed1949f32a Author: Mikael Nousiainen <mik...@ik...> Date: Tue Dec 15 21:42:29 2020 +0200 Make Prosistel model names shorter diff --git a/rotators/prosistel/prosistel.c b/rotators/prosistel/prosistel.c index d114df1d..8f6bcd67 100644 --- a/rotators/prosistel/prosistel.c +++ b/rotators/prosistel/prosistel.c @@ -363,7 +363,7 @@ static const struct prosistel_rot_priv_caps prosistel_rot_combitrack_priv_caps = const struct rot_caps prosistel_az_rot_caps = { ROT_MODEL(ROT_MODEL_PROSISTEL_AZ), - .model_name = "Prosistel D azimuth", + .model_name = "D azimuth", .mfg_name = "Prosistel", .version = "20201215.0", .copyright = "LGPL", @@ -398,7 +398,7 @@ const struct rot_caps prosistel_az_rot_caps = const struct rot_caps prosistel_el_rot_caps = { ROT_MODEL(ROT_MODEL_PROSISTEL_EL), - .model_name = "Prosistel D elevation", + .model_name = "D elevation", .mfg_name = "Prosistel", .version = "20201215.0", .copyright = "LGPL", @@ -433,7 +433,7 @@ const struct rot_caps prosistel_el_rot_caps = const struct rot_caps prosistel_azel_combo_rot_caps = { ROT_MODEL(ROT_MODEL_PROSISTEL_AZEL_COMBO), - .model_name = "Prosistel Combi-Track az+el", + .model_name = "Combi-Track az+el", .mfg_name = "Prosistel", .version = "20201215.0", .copyright = "LGPL", commit 9e604437b1ad95b3413e845a853421300513eb2c Author: Mikael Nousiainen <mik...@ik...> Date: Tue Dec 15 21:40:35 2020 +0200 Fix Prosistel rotator backend: the 'D' model and Combi-Track for az+el have slightly different protocols. Add stop command. diff --git a/include/hamlib/rotlist.h b/include/hamlib/rotlist.h index 5151013c..796a5723 100644 --- a/include/hamlib/rotlist.h +++ b/include/hamlib/rotlist.h @@ -424,15 +424,31 @@ /** - * \def ROT_MODEL_PROSISTEL - * \brief A macro that returns the model number of the PROSISTEL backend. + * \def ROT_MODEL_PROSISTEL_AZ + * \brief A macro that returns the model number of the PROSISTEL azimuth backend. * */ //! @cond Doxygen_Suppress #define ROT_PROSISTEL 17 #define ROT_BACKEND_PROSISTEL "prosistel" //! @endcond -#define ROT_MODEL_PROSISTEL ROT_MAKE_MODEL(ROT_PROSISTEL, 1) +#define ROT_MODEL_PROSISTEL_AZ ROT_MAKE_MODEL(ROT_PROSISTEL, 1) + + +/** + * \def ROT_MODEL_PROSISTEL_EL + * \brief A macro that returns the model number of the PROSISTEL elevation backend. + * + */ +#define ROT_MODEL_PROSISTEL_EL ROT_MAKE_MODEL(ROT_PROSISTEL, 2) + + +/** + * \def ROT_MODEL_PROSISTEL_AZEL_COMBO + * \brief A macro that returns the model number of the PROSISTEL azimuth + elevation combo backend. + * + */ +#define ROT_MODEL_PROSISTEL_AZEL_COMBO ROT_MAKE_MODEL(ROT_PROSISTEL, 3) /** diff --git a/rotators/prosistel/prosistel.c b/rotators/prosistel/prosistel.c index 415d1d97..d114df1d 100644 --- a/rotators/prosistel/prosistel.c +++ b/rotators/prosistel/prosistel.c @@ -1,6 +1,7 @@ /* * Hamlib Prosistel backend * Copyright (c) 2015 by Dario Ventura IZ7CRX + * Copyright (c) 2020 by Mikael Nousiainen OH3BHX * * * This library is free software; you can redistribute it and/or @@ -24,16 +25,10 @@ #endif #include <stdio.h> -#include <stdlib.h> -#include <string.h> /* String function definitions */ -#include <unistd.h> /* UNIX standard function definitions */ -#include <math.h> -#include <sys/time.h> -#include <time.h> +#include <string.h> #include "hamlib/rotator.h" #include "serial.h" -#include "misc.h" #include "register.h" #include "num_stdio.h" @@ -43,19 +38,14 @@ #define CR "\r" #define STX "\x02" - -#if 0 -struct prosistel_rot_priv_data +struct prosistel_rot_priv_caps { - azimuth_t az; - elevation_t el; + float angle_multiplier; + char azimuth_id; + char elevation_id; - azimuth_t target_az; - elevation_t target_el; + int stop_angle; }; -#endif - - /** * prosistel_transaction @@ -69,6 +59,7 @@ struct prosistel_rot_priv_data * returns: * RIG_OK - if no error occurred. * RIG_EIO - if an I/O error occurred while sending/receiving data. + * RIG_EPROTO - if a the response does not follow Prosistel protocol * RIG_ETIMEOUT - if timeout expires without any characters received. */ static int prosistel_transaction(ROT *rot, const char *cmdstr, @@ -106,7 +97,7 @@ transaction_write: data_len = BUFSZ; } - //remember check for STXA,G,R or STXA,?,XXX,R 10 bytes + // Remember to check for STXA,G,R or STXA,?,XXX,R 10 bytes retval = read_string(&rs->rotport, data, 20, CR, strlen(CR)); if (retval < 0) @@ -119,7 +110,7 @@ transaction_write: goto transaction_quit; } - //check if reply match issued command + // Check if reply matches issued command if (cmdstr && data[0] == 0x02 && data[3] == cmdstr[2]) { rig_debug(RIG_DEBUG_VERBOSE, "%s Command %c reply received\n", __func__, @@ -131,7 +122,7 @@ transaction_write: rig_debug(RIG_DEBUG_VERBOSE, "%s Error Command issued: %c doesn't match reply %c\n", __func__, cmdstr[2], data[3]); - retval = RIG_EIO; + retval = -RIG_EPROTO; } transaction_quit: @@ -139,132 +130,242 @@ transaction_quit: } - - - - static int prosistel_rot_open(ROT *rot) { + struct prosistel_rot_priv_caps *priv_caps = + (struct prosistel_rot_priv_caps *) rot->caps->priv; char cmdstr[64]; int retval; + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - rot_open(rot); - //disable CPM mode - CPM stands for Continuous Position Monitor operating mode - //MCU continuously sends position data when CPM enabled - num_sprintf(cmdstr, STX"AS"CR); - retval = prosistel_transaction(rot, cmdstr, NULL, 0); - return retval; -} + // Disable CPM mode - CPM stands for Continuous Position Monitor operating mode + // The rotator controller sends position data continuously when CPM is enabled + + // Disable CPM for azimuth if the rotator has an azimuth rotator + if (rot->caps->rot_type == ROT_TYPE_AZIMUTH || rot->caps->rot_type == ROT_TYPE_AZEL) + { + num_sprintf(cmdstr, STX"%cS"CR, priv_caps->azimuth_id); + retval = prosistel_transaction(rot, cmdstr, NULL, 0); + if (retval != RIG_OK) + { + return retval; + } + } + + // Disable CPM for elevation if the rotator has an elevation rotator + if (rot->caps->rot_type == ROT_TYPE_ELEVATION || rot->caps->rot_type == ROT_TYPE_AZEL) + { + num_sprintf(cmdstr, STX"%cS"CR, priv_caps->elevation_id); + retval = prosistel_transaction(rot, cmdstr, NULL, 0); + if (retval != RIG_OK) + { + return retval; + } + } + + return RIG_OK; +} + static int prosistel_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) { - + struct prosistel_rot_priv_caps *priv_caps = + (struct prosistel_rot_priv_caps *) rot->caps->priv; char cmdstr[64]; int retval; - rig_debug(RIG_DEBUG_VERBOSE, "%s called: %.1f %.1f\n", __func__, - az, el); + rig_debug(RIG_DEBUG_VERBOSE, "%s called: %.1f %.1f\n", __func__, az, el); - num_sprintf(cmdstr, STX"AG%04.0f"CR, az * 10); - retval = prosistel_transaction(rot, cmdstr, NULL, 0); + // Leading zeros in angle values are optional according to Prosistel protocol documentation - if (retval != RIG_OK) + // Set azimuth only if the rotator has the capability to do so + // It is an error to set azimuth if it's not supported by the rotator controller + if (rot->caps->rot_type == ROT_TYPE_AZIMUTH || rot->caps->rot_type == ROT_TYPE_AZEL) { - return retval; - } + num_sprintf(cmdstr, STX"%cG%.0f"CR, priv_caps->azimuth_id, az * priv_caps->angle_multiplier); + retval = prosistel_transaction(rot, cmdstr, NULL, 0); - /* - * Elevation section - */ - num_sprintf(cmdstr, STX"EG%04.0f"CR, el * 10); - retval = prosistel_transaction(rot, cmdstr, NULL, 0); + if (retval != RIG_OK) + { + return retval; + } + } - if (retval != RIG_OK) + // Set elevation only if the rotator has the capability to do so + // It is an error to set elevation if it's not supported by the rotator controller + if (rot->caps->rot_type == ROT_TYPE_ELEVATION || rot->caps->rot_type == ROT_TYPE_AZEL) { - return retval; + num_sprintf(cmdstr, STX"%cG%.0f"CR, priv_caps->elevation_id, el * priv_caps->angle_multiplier); + retval = prosistel_transaction(rot, cmdstr, NULL, 0); + + if (retval != RIG_OK) + { + return retval; + } } return retval; } -/* - * Get position of rotor - */ static int prosistel_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) { + struct prosistel_rot_priv_caps *priv_caps = + (struct prosistel_rot_priv_caps *) rot->caps->priv; char cmdstr[64]; char data[20]; float posval; int retval; int n; - num_sprintf(cmdstr, STX"A?"CR); - retval = prosistel_transaction(rot, cmdstr, data, sizeof(data)); - - if (retval != RIG_OK) + // Query azimuth only if the rotator has the capability to do so + // It is an error to query for azimuth if it's not supported by the rotator controller + if (rot->caps->rot_type == ROT_TYPE_AZIMUTH || rot->caps->rot_type == ROT_TYPE_AZEL) { - return retval; - } + char rot_id; + + num_sprintf(cmdstr, STX"%c?"CR, priv_caps->azimuth_id); + retval = prosistel_transaction(rot, cmdstr, data, sizeof(data)); + if (retval != RIG_OK) + { + return retval; + } + + // Example response of 290 degree azimuth with 3 digits + // 02 41 2c 3f 2c 32 39 30 2c 52 0d .A,?,290,R. + // Example response of 100 degree azimuth with 4 digits + // 02 41 2c 3f 2c 31 30 30 30 2c 52 0d .A,?,1000,R. + n = sscanf(data, "%*c%c,?,%f,%*c.", &rot_id, &posval); + + if (n != 2 || rot_id != priv_caps->azimuth_id) + { + rig_debug(RIG_DEBUG_ERR, "%s failed to parse azimuth '%s'\n", __func__, data); + return -RIG_EPROTO; + } + + posval /= priv_caps->angle_multiplier; + + rig_debug(RIG_DEBUG_VERBOSE, "%s got position from '%s' converted to %f\n", + __func__, data, posval); - // Example response of 100 azimuth - // 02 41 2c 3f 2c 31 30 30 30 2c 52 0d .A,?,1000,R. - n = sscanf(data, "%*cA,?,%f,%*c.", &posval); + *az = (azimuth_t) posval; + } - if (n != 1) + // Query elevation only if the rotator has the capability to do so + // It is an error to query for elevation if it's not supported by the rotator controller + if (rot->caps->rot_type == ROT_TYPE_ELEVATION || rot->caps->rot_type == ROT_TYPE_AZEL) { - rig_debug(RIG_DEBUG_ERR, "%s failed to parse azimuth '%s'\n", __func__, data); - return RIG_EPROTO; + char rot_id; + + num_sprintf(cmdstr, STX"%c?"CR, priv_caps->elevation_id); + retval = prosistel_transaction(rot, cmdstr, data, sizeof(data)); + if (retval != RIG_OK) + { + return retval; + } + + // Example response of 90 degree elevation with 4 digits + // 02 42 2c 3f 2c 30 39 30 30 2c 52 0d .B,?,0900,R. + // The response will be an error if no elevation is available + // 02 42 2c 3f 2c 45 2c 30 30 30 30 33 0d .B,?,E,00003. + n = sscanf(data, "%*c%c,?,%f,%*c.", &rot_id, &posval); + + if (n != 2 || rot_id != priv_caps->elevation_id) + { + rig_debug(RIG_DEBUG_ERR, "%s failed to parse elevation '%s'\n", __func__, data); + return -RIG_EPROTO; + } + + posval /= priv_caps->angle_multiplier; + + rig_debug(RIG_DEBUG_VERBOSE, "%s got position from '%s' converted to %f\n", + __func__, data, posval); + + *el = (elevation_t) posval; } - posval /= 10.0; - rig_debug(RIG_DEBUG_VERBOSE, "%s got position from '%s' converted to %f\n", - __func__, data, posval); - *az = (azimuth_t) posval; + return retval; +} - /* - * Elevation section - */ +static int prosistel_rot_stop(ROT *rot) +{ + struct prosistel_rot_priv_caps *priv_caps = + (struct prosistel_rot_priv_caps *) rot->caps->priv; + char cmdstr[64]; + int retval; - num_sprintf(cmdstr, STX"B?"CR); - retval = prosistel_transaction(rot, cmdstr, data, sizeof(data)); - // Example response of 90 elevation - // 02 42 2c 3f 2c 30 39 30 30 2c 52 0d .B,?,0900,R. - // Could be error if no el available e.g. .B,?,E,00003. - if (data[5] == 'E') return RIG_OK; - n = sscanf(data, "%*cB,?,%f,%*c.", &posval); - posval /= 10.0; + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - if (n != 1) + // Stop azimuth only if the rotator has the capability to do so + if (rot->caps->rot_type == ROT_TYPE_AZIMUTH || rot->caps->rot_type == ROT_TYPE_AZEL) { - rig_debug(RIG_DEBUG_ERR, "%s failed to parse elevation '%s'\n", __func__, data); - return RIG_EPROTO; + num_sprintf(cmdstr, STX"%cG%d"CR, priv_caps->azimuth_id, priv_caps->stop_angle); + retval = prosistel_transaction(rot, cmdstr, NULL, 0); + + if (retval != RIG_OK) + { + return retval; + } } - rig_debug(RIG_DEBUG_VERBOSE, "%s got position from '%s' converted to %f\n", - __func__, data, posval); - *el = (elevation_t) posval; + // Stop elevation only if the rotator has the capability to do so + if (rot->caps->rot_type == ROT_TYPE_ELEVATION || rot->caps->rot_type == ROT_TYPE_AZEL) + { + num_sprintf(cmdstr, STX"%cG%d"CR, priv_caps->elevation_id, priv_caps->stop_angle); + retval = prosistel_transaction(rot, cmdstr, NULL, 0); + + if (retval != RIG_OK) + { + return retval; + } + } return retval; } - +static const struct prosistel_rot_priv_caps prosistel_rot_az_or_el_priv_caps = +{ + .angle_multiplier = 1.0f, + /** + * Angle 977 = soft stop, stops the rotator using using PWM if PWM mode is enabled, otherwise results in a fast stop + * Angle 999 = fast stop, stops the rotator immediately + */ + .stop_angle = 997, + .azimuth_id = 'A', + .elevation_id = 'E', +}; /* - * Prosistel rotator capabilities. + * The Prosistel Combi-Track azimuth + elevation controllers use angle values multiplied by 10 and have + * two "units" with identifier A and B (instead of A and E). */ +static const struct prosistel_rot_priv_caps prosistel_rot_combitrack_priv_caps = +{ + .angle_multiplier = 10.0f, + /** + * Angle 9777 = soft stop, stops the rotator using using PWM if PWM mode is enabled, otherwise results in a fast stop + * Angle 9999 = fast stop, stops the rotator immediately + */ + .stop_angle = 9777, + .azimuth_id = 'A', + .elevation_id = 'B', +}; + -const struct rot_caps prosistel_rot_caps = +/* + * Prosistel rotator capabilities + */ +const struct rot_caps prosistel_az_rot_caps = { - ROT_MODEL(ROT_MODEL_PROSISTEL), - .model_name = "Prosistel D", + ROT_MODEL(ROT_MODEL_PROSISTEL_AZ), + .model_name = "Prosistel D azimuth", .mfg_name = "Prosistel", - .version = "20201214.0", + .version = "20201215.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZIMUTH, @@ -280,24 +381,96 @@ const struct rot_caps prosistel_rot_caps = .timeout = 3000, .retry = 3, + .min_az = 0.0, + .max_az = 360.0, + .min_el = 0.0, + .max_el = 0.0, + + .priv = &prosistel_rot_az_or_el_priv_caps, + + .rot_open = prosistel_rot_open, + .stop = prosistel_rot_stop, + .set_position = prosistel_rot_set_position, + .get_position = prosistel_rot_get_position, +}; + + +const struct rot_caps prosistel_el_rot_caps = +{ + ROT_MODEL(ROT_MODEL_PROSISTEL_EL), + .model_name = "Prosistel D elevation", + .mfg_name = "Prosistel", + .version = "20201215.0", + .copyright = "LGPL", + .status = RIG_STATUS_STABLE, + .rot_type = ROT_TYPE_ELEVATION, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 9600, + .serial_rate_max = 9600, + .serial_data_bits = 8, + .serial_stop_bits = 1, + .serial_parity = RIG_PARITY_NONE, + .serial_handshake = RIG_HANDSHAKE_NONE, + .write_delay = 0, + .post_write_delay = 0, + .timeout = 3000, + .retry = 3, + + .min_az = 0.0, + .max_az = 0.0, + .min_el = 0.0, + .max_el = 90.0, + + .priv = &prosistel_rot_az_or_el_priv_caps, + + .rot_open = prosistel_rot_open, + .stop = prosistel_rot_stop, + .set_position = prosistel_rot_set_position, + .get_position = prosistel_rot_get_position, +}; + + +const struct rot_caps prosistel_azel_combo_rot_caps = +{ + ROT_MODEL(ROT_MODEL_PROSISTEL_AZEL_COMBO), + .model_name = "Prosistel Combi-Track az+el", + .mfg_name = "Prosistel", + .version = "20201215.0", + .copyright = "LGPL", + .status = RIG_STATUS_STABLE, + .rot_type = ROT_TYPE_AZEL, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 9600, + .serial_rate_max = 9600, + .serial_data_bits = 8, + .serial_stop_bits = 1, + .serial_parity = RIG_PARITY_NONE, + .serial_handshake = RIG_HANDSHAKE_NONE, + .write_delay = 0, + .post_write_delay = 0, + .timeout = 3000, + .retry = 3, .min_az = 0.0, .max_az = 360.0, .min_el = 0.0, .max_el = 90.0, - .rot_open = prosistel_rot_open, - .set_position = prosistel_rot_set_position, - .get_position = prosistel_rot_get_position, + .priv = &prosistel_rot_combitrack_priv_caps, + .rot_open = prosistel_rot_open, + .stop = prosistel_rot_stop, + .set_position = prosistel_rot_set_position, + .get_position = prosistel_rot_get_position, }; DECLARE_INITROT_BACKEND(prosistel) { rig_debug(RIG_DEBUG_VERBOSE, "%s: _init called\n", __func__); - rot_register(&prosistel_rot_caps); - + rot_register(&prosistel_az_rot_caps); + rot_register(&prosistel_el_rot_caps); + rot_register(&prosistel_azel_combo_rot_caps); return RIG_OK; } diff --git a/rotators/prosistel/prosistel.h b/rotators/prosistel/prosistel.h index 28cf6a33..3c6bba59 100644 --- a/rotators/prosistel/prosistel.h +++ b/rotators/prosistel/prosistel.h @@ -23,6 +23,8 @@ #define _ROT_PROSISTEL_H 1 -extern const struct rot_caps prosistel_rot_caps; +extern const struct rot_caps prosistel_az_rot_caps; +extern const struct rot_caps prosistel_el_rot_caps; +extern const struct rot_caps prosistel_azel_combo_rot_caps; #endif /* _ROT_PROSISTEL_H */ commit 1cd872e8cd05db3d2549a32dfa01870d3e82b628 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Dec 15 12:26:36 2020 -0600 Change ft857 get_freq to recognize RIG_VFO_A https://github.com/Hamlib/Hamlib/issues/467 diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index 836ddb2c..a3d6ccaa 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -155,7 +155,7 @@ const struct rig_caps ft857_caps = RIG_MODEL(RIG_MODEL_FT857), .model_name = "FT-857", .mfg_name = "Yaesu", - .version = "20200907.0", + .version = "20201215.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -564,7 +564,7 @@ int ft857_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); - if (vfo != RIG_VFO_CURR) + if (vfo != RIG_VFO_CURR && vfo != RIG_VFO_A) { return -RIG_ENTARGET; } commit 349516911ad4e123f6939b79135b28d3e4188de4 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Dec 15 12:21:09 2020 -0600 Fix ft897 get_freq to allow RIG_VFO_A too https://github.com/Hamlib/Hamlib/issues/467 diff --git a/rigs/yaesu/ft897.c b/rigs/yaesu/ft897.c index 0574f392..b3dbafc6 100644 --- a/rigs/yaesu/ft897.c +++ b/rigs/yaesu/ft897.c @@ -191,7 +191,7 @@ const struct rig_caps ft897_caps = RIG_MODEL(RIG_MODEL_FT897), .model_name = "FT-897", .mfg_name = "Yaesu", - .version = "20201130.0", + .version = "20201215.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -518,7 +518,8 @@ int ft897_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - if (vfo != RIG_VFO_CURR) + // can only deal with VFO_CURR and VFO_A + if (vfo != RIG_VFO_CURR && vfo != RIG_VFO_A) { return -RIG_ENTARGET; } commit 20764a548345b18ed9b161a3dbe5f2769426e7a3 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Dec 14 16:49:58 2020 -0600 If error return on prosistel elevation just return RIG_OK Assuming no elevation available in this case https://github.com/Hamlib/Hamlib/issues/466 diff --git a/rotators/prosistel/prosistel.c b/rotators/prosistel/prosistel.c index 7b892969..415d1d97 100644 --- a/rotators/prosistel/prosistel.c +++ b/rotators/prosistel/prosistel.c @@ -228,10 +228,13 @@ static int prosistel_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) /* * Elevation section */ + num_sprintf(cmdstr, STX"B?"CR); retval = prosistel_transaction(rot, cmdstr, data, sizeof(data)); // Example response of 90 elevation // 02 42 2c 3f 2c 30 39 30 30 2c 52 0d .B,?,0900,R. + // Could be error if no el available e.g. .B,?,E,00003. + if (data[5] == 'E') return RIG_OK; n = sscanf(data, "%*cB,?,%f,%*c.", &posval); posval /= 10.0; @@ -261,7 +264,7 @@ const struct rot_caps prosistel_rot_caps = ROT_MODEL(ROT_MODEL_PROSISTEL), .model_name = "Prosistel D", .mfg_name = "Prosistel", - .version = "20191219.0", + .version = "20201214.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZIMUTH, commit 41969433eda9db965a28348330448d2c2b5644e1 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Dec 14 12:59:38 2020 -0600 Change kenwood power setting to 0-max instead of min-max https://github.com/Hamlib/Hamlib/issues/465 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 13adb590..685aeb3b 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2396,7 +2396,10 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) if (retval != RIG_OK) { return retval; } - kenwood_val = val.f * (power_max - power_min) + power_min; + // https://github.com/Hamlib/Hamlib/issues/465 + kenwood_val = val.f * power_max; + if (kenwood_val < power_min) kenwood_val = power_min; + if (kenwood_val > power_max) kenwood_val = power_max; snprintf(levelbuf, sizeof(levelbuf), "PC%03d", kenwood_val); break; } diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 7766ebd7..7816efff 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -27,7 +27,7 @@ #include <string.h> #include "token.h" -#define BACKEND_VER "20201126" +#define BACKEND_VER "20201214" #define EOM_KEN ';' #define EOM_TH '\r' commit da04467584e5d24541d90083e833e0e43cca2cbb Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 13 15:28:55 2020 -0600 Increase FT950 post write delay to 50ms https://github.com/Hamlib/Hamlib/issues/461 diff --git a/rigs/yaesu/ft950.c b/rigs/yaesu/ft950.c index f71ebea3..2d59ac14 100644 --- a/rigs/yaesu/ft950.c +++ b/rigs/yaesu/ft950.c @@ -89,7 +89,7 @@ const struct rig_caps ft950_caps = RIG_MODEL(RIG_MODEL_FT950), .model_name = "FT-950", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".0", + .version = NEWCAT_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, diff --git a/rigs/yaesu/ft950.h b/rigs/yaesu/ft950.h index e7bccd4a..cc5eebbe 100644 --- a/rigs/yaesu/ft950.h +++ b/rigs/yaesu/ft950.h @@ -137,6 +137,6 @@ /* Delay sequential fast writes */ //#define FT950_POST_WRITE_DELAY 5 -#define FT950_POST_WRITE_DELAY 25 +#define FT950_POST_WRITE_DELAY 50 #endif /* _FT950_H */ commit 1e1f7529fab7302f7698a32607b97397cb8ed0e7 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 13 10:20:02 2020 -0600 Fix debug statements in rig.c diff --git a/src/rig.c b/src/rig.c index c705ecfc..c7f48821 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1891,14 +1891,14 @@ int HAMLIB_API rig_get_mode(RIG *rig, if (retcode == RIG_OK && (vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo)) { - rig_debug(RIG_DEBUG_TRACE, "%s(%d): debug", __func__, __LINE__); + rig_debug(RIG_DEBUG_TRACE, "%s(%d): debug\n", __func__, __LINE__); rig->state.current_mode = *mode; rig->state.current_width = *width; } if (*width == RIG_PASSBAND_NORMAL && *mode != RIG_MODE_NONE) { - rig_debug(RIG_DEBUG_TRACE, "%s(%d): debug", __func__, __LINE__); + rig_debug(RIG_DEBUG_TRACE, "%s(%d): debug\n", __func__, __LINE__); *width = rig_passband_normal(rig, *mode); } commit 8c265a85f20b4318ba1b2cec9f3b6e1dac00baec Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 13 10:00:37 2020 -0600 Fix debug statement in rig.c diff --git a/src/rig.c b/src/rig.c index 69a990dd..c705ecfc 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1862,7 +1862,7 @@ int HAMLIB_API rig_get_mode(RIG *rig, { int rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_TRACE, "%s(%d): debug", __func__, __LINE__); + rig_debug(RIG_DEBUG_TRACE, "%s(%d): debug\n", __func__, __LINE__); if (!caps->set_vfo) { ----------------------------------------------------------------------- Summary of changes: include/hamlib/rotlist.h | 22 ++- rigs/kenwood/kenwood.c | 5 +- rigs/kenwood/kenwood.h | 2 +- rigs/yaesu/ft857.c | 4 +- rigs/yaesu/ft897.c | 5 +- rigs/yaesu/ft950.c | 2 +- rigs/yaesu/ft950.h | 2 +- rigs/yaesu/newcat.c | 37 ++++- rigs/yaesu/newcat.h | 2 +- rotators/prosistel/prosistel.c | 362 +++++++++++++++++++++++++++++++---------- rotators/prosistel/prosistel.h | 5 +- src/rig.c | 6 +- 12 files changed, 342 insertions(+), 112 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Nate B. <n0...@us...> - 2020-12-13 18:39:40
|
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, Hamlib-4.0 has been updated via af1a0828c327cff27ddd281e6a050ca5d21939d7 (commit) via 6caeb35b55eb8c6acaf5b73c80b051a259bfe25f (commit) via 4ccc6cb72309481997cc70d51364ddf3f5ee12f1 (commit) via d0572c5ae650bfba5e382f62d0c1076bba509c89 (commit) via 66e154ffaf0609a69fc005c8d559f6160068823a (commit) via e2ce6027b5efc5f3d453498e0f829d7aa4b0edb4 (commit) via 62aa6eb4eafadf4d3b53a18d8878a5c3a832ebf4 (commit) via 99b862d0caf41fae6e0f33d36d54eff9207c5761 (commit) via 123e0e7d986bd1204b156e8d1597df91312f2552 (commit) via 6c5a7c205939b7932156a4ae6efc8a4220c39d3b (commit) via c202d9cdac47b4983dd8deef32a03fdf2a549864 (commit) via 1c389b97838dfb6862589631536699ed390ca6a8 (commit) via 178208714f13ea28786ddd9bfd32625bd09e12e4 (commit) via ada663f55e00f9a475412481a7669616116a89b5 (commit) via 5a3e50535d198f5c965eb4ebe2fd5f2b1bfd509c (commit) via 8217714ed31dcd3181abc2f00129aef3c9f7d4f7 (commit) via e88a8a863e5207babd4b6ed011a8c13d235d4997 (commit) from e0cbeb72df873076f10862ca88ae189505b3ae59 (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 af1a0828c327cff27ddd281e6a050ca5d21939d7 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 13 10:20:02 2020 -0600 Fix debug statements in rig.c (cherry picked from commit 1e1f7529fab7302f7698a32607b97397cb8ed0e7) diff --git a/src/rig.c b/src/rig.c index c705ecfc..c7f48821 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1891,14 +1891,14 @@ int HAMLIB_API rig_get_mode(RIG *rig, if (retcode == RIG_OK && (vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo)) { - rig_debug(RIG_DEBUG_TRACE, "%s(%d): debug", __func__, __LINE__); + rig_debug(RIG_DEBUG_TRACE, "%s(%d): debug\n", __func__, __LINE__); rig->state.current_mode = *mode; rig->state.current_width = *width; } if (*width == RIG_PASSBAND_NORMAL && *mode != RIG_MODE_NONE) { - rig_debug(RIG_DEBUG_TRACE, "%s(%d): debug", __func__, __LINE__); + rig_debug(RIG_DEBUG_TRACE, "%s(%d): debug\n", __func__, __LINE__); *width = rig_passband_normal(rig, *mode); } commit 6caeb35b55eb8c6acaf5b73c80b051a259bfe25f Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 13 10:00:37 2020 -0600 Fix debug statement in rig.c (cherry picked from commit 8c265a85f20b4318ba1b2cec9f3b6e1dac00baec) diff --git a/src/rig.c b/src/rig.c index 69a990dd..c705ecfc 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1862,7 +1862,7 @@ int HAMLIB_API rig_get_mode(RIG *rig, { int rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_TRACE, "%s(%d): debug", __func__, __LINE__); + rig_debug(RIG_DEBUG_TRACE, "%s(%d): debug\n", __func__, __LINE__); if (!caps->set_vfo) { commit 4ccc6cb72309481997cc70d51364ddf3f5ee12f1 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 13 09:40:52 2020 -0600 Change newcat.c to not abort when ?; is received FTDX3000 was giving ?; to FB; command!!! https://github.com/Hamlib/Hamlib/issues/464 (cherry picked from commit 4eef84ef47874e47f567d0d5c88fd093977b70dc) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 08d98313..b15f6f68 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -9032,10 +9032,12 @@ int newcat_get_cmd(RIG *rig) * There are many more cases like these and they vary by rig model. * * So far, "rig busy" type situations with the ? response have not been observed for get commands. + * Followup 20201213 FTDX3000 FB; command returning ?; so do NOT abort + * see https://github.com/Hamlib/Hamlib/issues/464 */ rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig: '%s'\n", __func__, priv->cmd_str); - return -RIG_ERJCTED; + // return -RIG_ERJCTED; } continue; diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 6b8e76e6..6b69bf15 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201212" +#define NEWCAT_VER "20201213" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit d0572c5ae650bfba5e382f62d0c1076bba509c89 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 13 08:55:50 2020 -0600 Added flrig LEVEL values STRENGTH, RF, AF, RFPOWER_METER, MICGAIN https://github.com/Hamlib/Hamlib/issues/460 (cherry picked from commit f54d0508fd1230c3bcd85143ba7b9349eda5a2aa) diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index caec2721..214174df 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -57,7 +57,7 @@ RIG_MODE_SSB | RIG_MODE_LSB | RIG_MODE_USB |\ RIG_MODE_FM | RIG_MODE_WFM | RIG_MODE_FMN |RIG_MODE_PKTFM ) -#define FLRIG_LEVELS (RIG_LEVEL_AF | RIG_LEVEL_RF | RIG_LEVEL_MICGAIN | RIG_LEVEL_STRENGTH) +#define FLRIG_LEVELS (RIG_LEVEL_AF | RIG_LEVEL_RF | RIG_LEVEL_MICGAIN | RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER_METER) #define streq(s1,s2) (strcmp(s1,s2)==0) @@ -1874,7 +1874,8 @@ static int flrig_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } sprintf(cmd_arg, - "<params><param><value><double>%d</double></value></param></params>", (int)val.f); + "<params><param><value><double>%d</double></value></param></params>", + (int)val.f); switch (level) { @@ -1923,6 +1924,8 @@ static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_STRENGTH: cmd = "rig.get_power"; break; + case RIG_LEVEL_RFPOWER_METER: cmd = "rig.get_pwrmeter"; break; + default: rig_debug(RIG_DEBUG_ERR, "%s: unknown level=%d\n", __func__, (int)level); return -RIG_EINVAL; @@ -1937,9 +1940,20 @@ static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return retval; } - val->f = atof(value); + // most levels are 0-100 -- may have to allow for different ranges + switch (level) + { + case RIG_LEVEL_STRENGTH: + case RIG_LEVEL_RFPOWER_METER: + val->i = atoi(value); + rig_debug(RIG_DEBUG_TRACE, "%s: val.i='%s'(%d)\n", __func__, value, val->i); + break; + + default: + val->f = atof(value) / 100; + rig_debug(RIG_DEBUG_TRACE, "%s: val.f='%s'(%f)\n", __func__, value, val->f); + } - rig_debug(RIG_DEBUG_TRACE, "%s: val='%s'(%f)\n", __func__, value, val->f); return RIG_OK; } diff --git a/rigs/dummy/flrig.h b/rigs/dummy/flrig.h index f49a1934..b231e02d 100644 --- a/rigs/dummy/flrig.h +++ b/rigs/dummy/flrig.h @@ -28,7 +28,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20201209" +#define BACKEND_VER "20201213" #define EOM "\r" #define TRUE 1 commit 66e154ffaf0609a69fc005c8d559f6160068823a Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 13 00:01:09 2020 -0600 Fix datamode set in icom.c to use 0x00 0x00 per the manual for 7300 and 9700 https://github.com/Hamlib/Hamlib/issues/448 (cherry picked from commit 9b98a264abf06b7e847ba45511494031f851a4f2) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 1248b87b..1c13b4a2 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1627,7 +1627,6 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, datamode[0] = 0x00; break; } - if (width != RIG_PASSBAND_NOCHANGE) { if (filter_byte) // then we need the width byte too @@ -1638,7 +1637,7 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, // 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, width_icom == -1 ? 1 : 2, + icom_transaction(rig, C_CTL_MEM, dm_sub_cmd, datamode, 2, ackbuf, &ack_len); } commit e2ce6027b5efc5f3d453498e0f829d7aa4b0edb4 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 23:05:59 2020 -0600 icom.c passband nochange seems to be working https://github.com/Hamlib/Hamlib/issues/448 (cherry picked from commit 5883897656f7c8937d81af112ea7d9f7792e89f2) diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index ec5e20e3..e52950ad 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -404,7 +404,6 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, "%s: Failed to get width for passband nochange err=%s\n", __func__, rigerror(ret)); } - return RIG_OK; } switch (mode) @@ -491,15 +490,15 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, icmode_ext = PD_WIDE_3; /* default to Wide */ } } + *pd = icmode_ext; } else { // filter should already be set elsewhere - icmode_ext = priv_data->filter; + *pd = priv_data->filter; } *md = icmode; - *pd = icmode_ext; return RIG_OK; } diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index d4b66816..1248b87b 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1604,6 +1604,7 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, break; } + rig_debug(RIG_DEBUG_VERBOSE, "%s mode=%d, width=%d\n", __func__, (int)icom_mode, (int)width); retval = icom_set_mode(rig, vfo, icom_mode, width); if (RIG_OK == retval) @@ -1704,16 +1705,18 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = rig2icom_mode(rig, vfo, mode, width, &icmode, &icmode_ext); } + if (width == RIG_PASSBAND_NOCHANGE) icmode_ext = priv_data->filter; if (err < 0) { + rig_debug(RIG_DEBUG_ERR, "%s: Error on rig2icom err=%d\n", __func__, err); return err; } + rig_debug(RIG_DEBUG_VERBOSE, "%s: icmode=%d, icmode_ext=%d\n", __func__, icmode, icmode_ext); /* IC-731, IC-735, IC-7000 don't support passband data */ /* IC-726 & IC-475A/E also limited support - only on CW */ /* TODO: G4WJS CW wide/narrow are possible with above two radios */ - if (icmode_ext == -1) icmode_ext = priv_data->filter; if (priv->civ_731_mode || rig->caps->rig_model == RIG_MODEL_OS456 || rig->caps->rig_model == RIG_MODEL_IC726 || rig->caps->rig_model == RIG_MODEL_IC475 @@ -1722,6 +1725,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) icmode_ext = -1; } + rig_debug(RIG_DEBUG_VERBOSE, "%s: #2 icmode=%d, icmode_ext=%d\n", __func__, icmode, icmode_ext); retval = icom_transaction(rig, C_SET_MODE, icmode, (unsigned char *) &icmode_ext, (icmode_ext == -1 ? 0 : 1), ackbuf, &ack_len); @@ -1771,6 +1775,7 @@ int icom_get_mode_with_data(RIG *rig, vfo_t vfo, rmode_t *mode, rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); retval = icom_get_mode(rig, vfo, mode, width); + rig_debug(RIG_DEBUG_VERBOSE, "%s mode=%d\n", __func__, (int)*mode); if (retval != RIG_OK) { return retval; @@ -1816,6 +1821,7 @@ int icom_get_mode_with_data(RIG *rig, vfo_t vfo, rmode_t *mode, return -RIG_ERJCTED; } + rig_debug(RIG_DEBUG_VERBOSE, "%s databuf[2]=%d, mode=%d\n", __func__, (int)databuf[2], (int)*mode); if (databuf[2]) /* 0x01/0x02/0x03 -> data mode, 0x00 -> not data mode */ { switch (*mode) @@ -2045,8 +2051,6 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) return -RIG_EINVAL; } - rig_debug(RIG_DEBUG_TRACE, "%s: debug#1\n", __func__); - if (vfo != rig->state.current_vfo) { rig_debug(RIG_DEBUG_TRACE, "%s: VFO changing from %s to %s\n", __func__, commit 62aa6eb4eafadf4d3b53a18d8878a5c3a832ebf4 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 15:38:42 2020 -0600 move icom.c icmode_ext setting a bit earlier in the code https://github.com/Hamlib/Hamlib/issues/448 (cherry picked from commit cdeacfb7d1015850444d329a0ee9304e265a75f5) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 9555338d..d4b66816 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1713,6 +1713,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) /* IC-731, IC-735, IC-7000 don't support passband data */ /* IC-726 & IC-475A/E also limited support - only on CW */ /* TODO: G4WJS CW wide/narrow are possible with above two radios */ + if (icmode_ext == -1) icmode_ext = priv_data->filter; if (priv->civ_731_mode || rig->caps->rig_model == RIG_MODEL_OS456 || rig->caps->rig_model == RIG_MODEL_IC726 || rig->caps->rig_model == RIG_MODEL_IC475 @@ -1721,7 +1722,6 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) icmode_ext = -1; } - if (icmode_ext == -1) icmode_ext = priv_data->filter; retval = icom_transaction(rig, C_SET_MODE, icmode, (unsigned char *) &icmode_ext, (icmode_ext == -1 ? 0 : 1), ackbuf, &ack_len); commit 99b862d0caf41fae6e0f33d36d54eff9207c5761 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 15:33:38 2020 -0600 Set icom_set_mode to use existing filter for passband nochange https://github.com/Hamlib/Hamlib/issues/448 (cherry picked from commit ddb38db106519d801ff8f6a0d3bf25fedbd50b78) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 74ddda8e..9555338d 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1681,6 +1681,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { struct icom_priv_data *priv; const struct icom_priv_caps *priv_caps; + const struct icom_priv_data *priv_data; struct rig_state *rs; unsigned char ackbuf[MAXFRAMELEN]; unsigned char icmode; @@ -1693,6 +1694,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) priv = (struct icom_priv_data *) rs->priv; priv_caps = (const struct icom_priv_caps *) rig->caps->priv; + priv_data = (const struct icom_priv_data *) rig->state.priv; if (priv_caps->r2i_mode != NULL) /* call priv code if defined */ { @@ -1719,6 +1721,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) icmode_ext = -1; } + if (icmode_ext == -1) icmode_ext = priv_data->filter; retval = icom_transaction(rig, C_SET_MODE, icmode, (unsigned char *) &icmode_ext, (icmode_ext == -1 ? 0 : 1), ackbuf, &ack_len); commit 123e0e7d986bd1204b156e8d1597df91312f2552 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 13:22:49 2020 -0600 Add filter memory to frame.c for no passband change https://github.com/Hamlib/Hamlib/issues/448 (cherry picked from commit 9bc98c9a2e45dbe2c47db488be5703dc2b0fc00d) diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 5348dbca..ec5e20e3 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -389,6 +389,7 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, unsigned char icmode; signed char icmode_ext; pbwidth_t width_tmp = width; + struct icom_priv_data *priv_data = (struct icom_priv_data *) rig->state.priv; icmode_ext = -1; @@ -491,6 +492,11 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, } } } + else + { + // filter should already be set elsewhere + icmode_ext = priv_data->filter; + } *md = icmode; *pd = icmode_ext; commit 6c5a7c205939b7932156a4ae6efc8a4220c39d3b Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 13:00:26 2020 -0600 Fix passband nochange in icom frame.c https://github.com/Hamlib/Hamlib/issues/448 (cherry picked from commit 7cd09fdd84f70598fffb684e74ab4e24408da13b) diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index ca718a8d..5348dbca 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -388,6 +388,7 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, { unsigned char icmode; signed char icmode_ext; + pbwidth_t width_tmp = width; icmode_ext = -1; @@ -402,6 +403,7 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, "%s: Failed to get width for passband nochange err=%s\n", __func__, rigerror(ret)); } + return RIG_OK; } switch (mode) @@ -458,7 +460,7 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, return -RIG_EINVAL; } - if (width != RIG_PASSBAND_NOCHANGE) + if (width_tmp != RIG_PASSBAND_NOCHANGE) { pbwidth_t medium_width = rig_passband_normal(rig, mode); commit c202d9cdac47b4983dd8deef32a03fdf2a549864 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 12:40:04 2020 -0600 Fix icom filter value, not ASCII!!! https://github.com/Hamlib/Hamlib/issues/448 (cherry picked from commit 3061a5f8b2354b14e226fc1cddcbaffce3bde159) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 0e32beca..74ddda8e 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1868,7 +1868,7 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) if (mode_len == 3) { - priv_data->filter = modebuf[2] - '0'; + priv_data->filter = modebuf[2]; rig_debug(RIG_DEBUG_TRACE, "%s: modebuf[0]=0x%02x, modebuf[1]=0x%02x, modebuf[2]=0x%02x, mode_len=%d, filter=%d\n", __func__, modebuf[0], diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 9120c364..b93aab6c 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -203,7 +203,7 @@ struct icom_priv_data int x25cmdfails; // This will get set if the 0x25 command fails so we try just once int x1cx03cmdfails; // This will get set if the 0x1c 0x03 command fails so we try just once int poweron; // to prevent powering on more than once - int filter; // Current filter selected + unsigned char filter; // Current filter selected }; extern const struct ts_sc_list r8500_ts_sc_list[]; commit 1c389b97838dfb6862589631536699ed390ca6a8 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 12:31:32 2020 -0600 Missed icom.h commit https://github.com/Hamlib/Hamlib/issues/448 (cherry picked from commit 0fa00cb14f12600c9863ab9369e5eb510108a252) diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index cb564ee5..9120c364 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -203,6 +203,7 @@ struct icom_priv_data int x25cmdfails; // This will get set if the 0x25 command fails so we try just once int x1cx03cmdfails; // This will get set if the 0x1c 0x03 command fails so we try just once int poweron; // to prevent powering on more than once + int filter; // Current filter selected }; extern const struct ts_sc_list r8500_ts_sc_list[]; commit 178208714f13ea28786ddd9bfd32625bd09e12e4 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 12:21:54 2020 -0600 Remember filter setting from icom_get_mode so we can refer to it later on set_mode https://github.com/Hamlib/Hamlib/issues/448 (cherry picked from commit 915666add2c857c2c74cf4623992c419c27812ad) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 19ad7460..0e32beca 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1857,16 +1857,29 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) { unsigned char modebuf[MAXFRAMELEN]; const struct icom_priv_caps *priv_caps; + struct icom_priv_data *priv_data; int mode_len, retval; rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s\n", __func__, rig_strvfo(vfo)); priv_caps = (const struct icom_priv_caps *) rig->caps->priv; + priv_data = (struct icom_priv_data *) rig->state.priv; retval = icom_transaction(rig, C_RD_MODE, -1, NULL, 0, modebuf, &mode_len); - rig_debug(RIG_DEBUG_TRACE, - "%s: modebuf[0]=0x%02x, modebuf[1]=0x%02x, mode_len=%d\n", __func__, modebuf[0], - modebuf[1], mode_len); + if (mode_len == 3) + { + priv_data->filter = modebuf[2] - '0'; + rig_debug(RIG_DEBUG_TRACE, + "%s: modebuf[0]=0x%02x, modebuf[1]=0x%02x, modebuf[2]=0x%02x, mode_len=%d, filter=%d\n", + __func__, modebuf[0], + modebuf[1], modebuf[2], mode_len, priv_data->filter); + } + else + { + rig_debug(RIG_DEBUG_TRACE, + "%s: modebuf[0]=0x%02x, modebuf[1]=0x%02x, mode_len=%d\n", __func__, modebuf[0], + modebuf[1], mode_len); + } if (retval != RIG_OK) { commit ada663f55e00f9a475412481a7669616116a89b5 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 11:24:07 2020 -0600 Eliminate warning in icom.c for passband nochange https://github.com/Hamlib/Hamlib/issues/448 (cherry picked from commit e4e88b833d1877797e56726a749e3bf6cdb35a05) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index e3a7f133..19ad7460 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1651,6 +1651,7 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, else { rig_debug(RIG_DEBUG_TRACE, "%s RIG_PASSBAND_NOCHANGE\n", __func__); + return RIG_OK; } if (retval != RIG_OK) commit 5a3e50535d198f5c965eb4ebe2fd5f2b1bfd509c Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 10:07:03 2020 -0600 Update icom.h version (cherry picked from commit f22d4a6dbe7305b3a84546faa6e462e388a0d3ee) diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 8a404cc6..cb564ee5 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -30,7 +30,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20201103" +#define BACKEND_VER "20201212" /* * defines used by comp_cal_str in rig.c commit 8217714ed31dcd3181abc2f00129aef3c9f7d4f7 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 10:06:44 2020 -0600 astyle icom.c (cherry picked from commit c0743dfe6e6633151b87cdbc5c7321bd11ce9d1a) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 033801e5..e3a7f133 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1627,25 +1627,26 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, break; } - if (width != RIG_PASSBAND_NOCHANGE) { - if (filter_byte) // then we need the width byte too - { - unsigned char mode_icom; // not used as it will map to USB/LSB - signed char width_icom; - rig2icom_mode(rig, vfo, mode, width, &mode_icom, &width_icom); - // 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, width_icom == -1 ? 1 : 2, - ackbuf, - &ack_len); - } - else + if (width != RIG_PASSBAND_NOCHANGE) { - retval = - icom_transaction(rig, C_CTL_MEM, dm_sub_cmd, datamode, 1, ackbuf, - &ack_len); - } + if (filter_byte) // then we need the width byte too + { + unsigned char mode_icom; // not used as it will map to USB/LSB + signed char width_icom; + rig2icom_mode(rig, vfo, mode, width, &mode_icom, &width_icom); + // 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, width_icom == -1 ? 1 : 2, + ackbuf, + &ack_len); + } + else + { + retval = + icom_transaction(rig, C_CTL_MEM, dm_sub_cmd, datamode, 1, ackbuf, + &ack_len); + } } else { commit e88a8a863e5207babd4b6ed011a8c13d235d4997 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 10:06:00 2020 -0600 icom now recognizes RIG_PASSBAND_NOCHANGE https://github.com/Hamlib/Hamlib/issues/448 (cherry picked from commit 2ff3fa0782377eed7b9b766caaf41d99c434cc22) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index acbc309f..033801e5 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1627,6 +1627,7 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, break; } + if (width != RIG_PASSBAND_NOCHANGE) { if (filter_byte) // then we need the width byte too { unsigned char mode_icom; // not used as it will map to USB/LSB @@ -1645,6 +1646,11 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, icom_transaction(rig, C_CTL_MEM, dm_sub_cmd, datamode, 1, ackbuf, &ack_len); } + } + else + { + rig_debug(RIG_DEBUG_TRACE, "%s RIG_PASSBAND_NOCHANGE\n", __func__); + } if (retval != RIG_OK) { ----------------------------------------------------------------------- Summary of changes: rigs/dummy/flrig.c | 22 ++++++++++++++---- rigs/dummy/flrig.h | 2 +- rigs/icom/frame.c | 11 +++++++-- rigs/icom/icom.c | 65 +++++++++++++++++++++++++++++++++++++---------------- rigs/icom/icom.h | 3 ++- rigs/yaesu/newcat.c | 4 +++- rigs/yaesu/newcat.h | 2 +- src/rig.c | 6 ++--- 8 files changed, 83 insertions(+), 32 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Nate B. <n0...@us...> - 2020-12-13 17:16:04
|
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, Hamlib-4.0 has been updated via e0cbeb72df873076f10862ca88ae189505b3ae59 (commit) from 0c10e7efc2b894a5cadda7a18820df6bcfdb2946 (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 e0cbeb72df873076f10862ca88ae189505b3ae59 Author: Nate Bargmann <n0...@n0...> Date: Sun Dec 13 11:12:55 2020 -0600 Advance to 4.0~rc4 Per request of Mike, W9MDB, release RC4 up to commit e1aa80599f419025e1894a449ab18924817ebe9f on the master branch. diff --git a/configure.ac b/configure.ac index fab6da24..83902f4c 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ dnl however, the use of '~' should be fine as apt (others?) will treat dnl it as an earlier version than the actual release. TNX KA6MAL dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars! AC_INIT([Hamlib], - [4.0~rc3], + [4.0~rc4], [ham...@li...], [hamlib], [http://www.hamlib.org]) ----------------------------------------------------------------------- Summary of changes: configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Nate B. <n0...@us...> - 2020-12-13 17:02:45
|
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, Hamlib-4.0 has been updated via 0c10e7efc2b894a5cadda7a18820df6bcfdb2946 (commit) via 6557238e0088de2100e816755ed9fee506b5f10e (commit) via cb2cca57d4c08572fcf0504532c6eab4b69954f4 (commit) via 7b3f8715b6c5b69f8e4bb49f82847b897d303ed9 (commit) via f27ab6f734b0e0aa5ea55962ab632de71a614004 (commit) via 51fefa3b7b31f57bf09250b3a09266dad799d343 (commit) via 08d59aac7488a6d5d8515c333dca4feed241a4be (commit) via 8c810c962c4ad90a3b09cb28df64bb77bfc98a54 (commit) via 7f9311569964477e70a17373539ba11d642ae58e (commit) via d63e951c10f3c475376c06522a927a46faee3b67 (commit) via f70712d990e9b59d64ff0e43179c1e34e4a3b466 (commit) via 90e0b036b9abfd894f96531741d538216e6a8a52 (commit) via 57d45dfca1ab125a7a646e5362472e20450a388f (commit) from d2fa649026d461830447fccbd3c3566aac2c9ed9 (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 0c10e7efc2b894a5cadda7a18820df6bcfdb2946 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 18:13:58 2020 -0600 Fix retry_save for Kenwood rigs (cherry picked from commit b6d6c5d9663d9625efe6de4663751437740448ff) diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 57e0d739..13adb590 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -3885,7 +3885,11 @@ int kenwood_set_powerstat(RIG *rig, powerstat_t status) sleep(1); retval = rig_get_freq(rig, RIG_VFO_A, &freq); - if (retval == RIG_OK) { return retval; } + if (retval == RIG_OK) + { + rig->state.rigport.retry = retry_save; + return retval; + } rig_debug(RIG_DEBUG_TRACE, "%s: Wait #%d for power up\n", __func__, i + 1); } commit 6557238e0088de2100e816755ed9fee506b5f10e Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 08:34:32 2020 -0600 Add some more debug for Yaesu RFPOWER_METER levels https://github.com/Hamlib/Hamlib/issues/462 (cherry picked from commit e1aa80599f419025e1894a449ab18924817ebe9f) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 2252ed4a..08d98313 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -4369,6 +4369,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_RFPOWER_METER: + rig_debug(RIG_DEBUG_VERBOSE, "%s: RFPOWER_METER retlvl=%s\n", __func__, retlvl); if (retlvl_len > 3) { // Some rigs like FTDX101 have 6-byte return so we just truncate commit cb2cca57d4c08572fcf0504532c6eab4b69954f4 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 08:24:33 2020 -0600 Normalize Yaesu RFPOWER_METER_LEVELS to 100W This is a quick fix for most Yaesu rigs We need a new RIG_LEVEL_RFPOWER_METER_WATTS to return watts instead of 0-1.0 https://github.com/Hamlib/Hamlib/issues/462 (cherry picked from commit ffe7184970ccfde09e85db02d7d7bad743ee54a1) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index a088f0ca..2252ed4a 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -163,7 +163,7 @@ const cal_table_float_t yaesu_default_comp_meter_cal = 2, { {0, 0.0f}, - {255, 1.0f}, + {255, 100.0f}, } }; @@ -4372,7 +4372,9 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (retlvl_len > 3) { // Some rigs like FTDX101 have 6-byte return so we just truncate + rig_debug(RIG_DEBUG_VERBOSE, "%s: retlvl of %s getting truncated\n", __func__, retlvl); retlvl[3] = 0; + rig_debug(RIG_DEBUG_VERBOSE, "%s: retlvl truncated to %s\n", __func__, retlvl); } if (rig->caps->rfpower_meter_cal.size == 0) @@ -4383,6 +4385,12 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { val->f = rig_raw2val_float(atoi(retlvl), &rig->caps->rfpower_meter_cal); } + rig_debug(RIG_DEBUG_VERBOSE, "%s: RFPOWER_METER=%s, converted to %f\n", __func__, retlvl, val->f); + if (val->f > 1.0) + { + rig_debug(RIG_DEBUG_VERBOSE, "%s: val->f(%f) clipped at 1.0\n", __func__, val->f); + val->f = 1.0; + } break; @@ -4395,11 +4403,11 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (rig->caps->comp_meter_cal.size == 0) { - val->f = rig_raw2val_float(atoi(retlvl), &yaesu_default_comp_meter_cal); + val->f = rig_raw2val_float(atoi(retlvl), &yaesu_default_comp_meter_cal)/100; } else { - val->f = rig_raw2val_float(atoi(retlvl), &rig->caps->comp_meter_cal); + val->f = rig_raw2val_float(atoi(retlvl), &rig->caps->comp_meter_cal)/100; } break; diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 0a88e03f..6b8e76e6 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201211" +#define NEWCAT_VER "20201212" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 7b3f8715b6c5b69f8e4bb49f82847b897d303ed9 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 11 17:20:34 2020 -0600 Update rigctl.1 man page (cherry picked from commit 44baf44dccd86467f7aa6b529fcfefeb3501595c) diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index 1913b7e9..b2fde9ce 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -88,6 +88,8 @@ etc. on Linux, etc. on MS Windows. The BSD flavors and Mac OS/X have their own designations. See your system's documentation. .IP +Can be a network address:port, e.g. 127.0.0.1:12345 +.IP The special string \(lquh\-rig\(rq may be given to enable micro-ham device support. . commit f27ab6f734b0e0aa5ea55962ab632de71a614004 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 11 17:00:21 2020 -0600 Change post_write_delay on FT950 to 25ms https://github.com/Hamlib/Hamlib/issues/461 (cherry picked from commit 5a86a1657fe50d96b2fed22cffeb8ba61c887c64) diff --git a/rigs/yaesu/ft950.h b/rigs/yaesu/ft950.h index cdea56a6..e7bccd4a 100644 --- a/rigs/yaesu/ft950.h +++ b/rigs/yaesu/ft950.h @@ -137,6 +137,6 @@ /* Delay sequential fast writes */ //#define FT950_POST_WRITE_DELAY 5 -#define FT950_POST_WRITE_DELAY 0 +#define FT950_POST_WRITE_DELAY 25 #endif /* _FT950_H */ commit 51fefa3b7b31f57bf09250b3a09266dad799d343 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 11 16:38:02 2020 -0600 Add power level to ft991 and fix ft1200 table https://github.com/Hamlib/Hamlib/issues/462 (cherry picked from commit 7911fd1d4bd04df0a1d9d737b4817653feca75b2) diff --git a/rigs/yaesu/ft1200.h b/rigs/yaesu/ft1200.h index 3b1a9389..535bee43 100644 --- a/rigs/yaesu/ft1200.h +++ b/rigs/yaesu/ft1200.h @@ -76,13 +76,14 @@ // Borrowed from FLRig -- Thanks to Dave W1HKJ #define FTDX1200_RFPOWER_METER_CAL \ { \ - 5, \ + 6, \ { \ - {35, 5.0f}, \ - {94, 25.0f}, \ - {147, 50.0f}, \ - {176, 75.0f}, \ - {205, 100.0f}, \ + {10, 0.8f}, \ + {50, 8.0f}, \ + {100, 26.0f}, \ + {150, 54.0f}, \ + {200, 92.0f}, \ + {250, 140.0f}, \ } \ } diff --git a/rigs/yaesu/ft991.c b/rigs/yaesu/ft991.c index 60568197..ecf67299 100644 --- a/rigs/yaesu/ft991.c +++ b/rigs/yaesu/ft991.c @@ -91,6 +91,7 @@ const struct rig_caps ft991_caps = .transceive = RIG_TRN_OFF, /* May enable later as the 950 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, + .rfpower_meter_cal = FT991_RFPOWER_METER_CAL, .str_cal = FT991_STR_CAL, .chan_list = { { 1, 99, RIG_MTYPE_MEM, NEWCAT_MEM_CAP }, diff --git a/rigs/yaesu/ft991.h b/rigs/yaesu/ft991.h index 159aeeac..97ee43be 100644 --- a/rigs/yaesu/ft991.h +++ b/rigs/yaesu/ft991.h @@ -71,6 +71,20 @@ RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\ RIG_OP_TO_VFO|RIG_OP_FROM_VFO) +// Borrowed from FLRig -- Thanks to Dave W1HKJ +#define FT991_RFPOWER_METER_CAL \ + { \ + 6, \ + { \ + {10, 0.8f}, \ + {50, 8.0f}, \ + {100, 26.0f}, \ + {150, 54.0f}, \ + {200, 92.0f}, \ + {250, 140.0f}, \ + } \ + } + /* TBC */ #define FT991_STR_CAL { 16, \ { \ commit 08d59aac7488a6d5d8515c333dca4feed241a4be Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 11 16:31:24 2020 -0600 Add power level to ft1200 https://github.com/Hamlib/Hamlib/issues/462 (cherry picked from commit ff17dd0199f6613549f74cb8cb3351b708338a4a) diff --git a/rigs/yaesu/ft1200.c b/rigs/yaesu/ft1200.c index 9aa8928a..3e295e95 100644 --- a/rigs/yaesu/ft1200.c +++ b/rigs/yaesu/ft1200.c @@ -131,6 +131,7 @@ const struct rig_caps ftdx1200_caps = .transceive = RIG_TRN_OFF, /* May enable later as the 1200 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, + .rfpower_meter_cal = FTDX1200_RFPOWER_METER_CAL, .str_cal = FTDX1200_STR_CAL, .chan_list = { { 1, 99, RIG_MTYPE_MEM, NEWCAT_MEM_CAP }, diff --git a/rigs/yaesu/ft1200.h b/rigs/yaesu/ft1200.h index 88afd85d..3b1a9389 100644 --- a/rigs/yaesu/ft1200.h +++ b/rigs/yaesu/ft1200.h @@ -73,6 +73,19 @@ RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\ RIG_OP_TO_VFO|RIG_OP_FROM_VFO|RIG_OP_TOGGLE) +// Borrowed from FLRig -- Thanks to Dave W1HKJ +#define FTDX1200_RFPOWER_METER_CAL \ + { \ + 5, \ + { \ + {35, 5.0f}, \ + {94, 25.0f}, \ + {147, 50.0f}, \ + {176, 75.0f}, \ + {205, 100.0f}, \ + } \ + } + /* TBC */ #define FTDX1200_STR_CAL { 16, \ { \ commit 8c810c962c4ad90a3b09cb28df64bb77bfc98a54 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 11 16:28:56 2020 -0600 https://github.com/Hamlib/Hamlib/issues/462 (cherry picked from commit d1ea35c93e0d4c7313b31415d456befdf90ad7bb) diff --git a/rigs/yaesu/ft950.c b/rigs/yaesu/ft950.c index 1141eba2..f71ebea3 100644 --- a/rigs/yaesu/ft950.c +++ b/rigs/yaesu/ft950.c @@ -131,6 +131,7 @@ const struct rig_caps ft950_caps = .transceive = RIG_TRN_OFF, /* May enable later as the 950 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, + .rfpower_meter_cal = FT950_RFPOWER_METER_CAL, .str_cal = FT950_STR_CAL, .chan_list = { { 1, 99, RIG_MTYPE_MEM, NEWCAT_MEM_CAP }, diff --git a/rigs/yaesu/ft950.h b/rigs/yaesu/ft950.h index 09de523e..cdea56a6 100644 --- a/rigs/yaesu/ft950.h +++ b/rigs/yaesu/ft950.h @@ -72,6 +72,21 @@ RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\ RIG_OP_TO_VFO|RIG_OP_FROM_VFO|RIG_OP_TOGGLE) +// Borrowed from FLRig -- Thanks to Dave W1HKJ +#define FT950_RFPOWER_METER_CAL \ + { \ + 6, \ + { \ + {10, 0.8f}, \ + {50, 8.0f}, \ + {100, 26.0f}, \ + {150, 54.0f}, \ + {200, 92.0f}, \ + {250, 140.0f}, \ + } \ + } + + /* TBC */ #define FT950_STR_CAL { 16, \ { \ commit 7f9311569964477e70a17373539ba11d642ae58e Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 11 16:25:21 2020 -0600 Add power level to ft891 https://github.com/Hamlib/Hamlib/issues/462 (cherry picked from commit 354cb925ccf1df37d2bde19d4d81dea25e6953e5) diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index 1c4b3c7d..0740f055 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -92,6 +92,7 @@ const struct rig_caps ft891_caps = .transceive = RIG_TRN_OFF, /* May enable later as the 950 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, + .rfpower_meter_cal = FT891_RFPOWER_METER_CAL, .str_cal = FT891_STR_CAL, .chan_list = { { 1, 99, RIG_MTYPE_MEM, NEWCAT_MEM_CAP }, diff --git a/rigs/yaesu/ft891.h b/rigs/yaesu/ft891.h index 6a3b541f..daea8917 100644 --- a/rigs/yaesu/ft891.h +++ b/rigs/yaesu/ft891.h @@ -68,6 +68,16 @@ RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\ RIG_OP_TO_VFO|RIG_OP_FROM_VFO) +// Borrowed from FLRig -- Thanks to Dave W1HKJ +#define FT891_RFPOWER_METER_CAL \ + { \ + 2, \ + { \ + {0, 0.0f}, \ + {100, 100.0f}, \ + } \ + } + /* TBC */ #define FT891_STR_CAL { 16, \ { \ commit d63e951c10f3c475376c06522a927a46faee3b67 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 11 16:21:36 2020 -0600 Fix FT450 power levels https://github.com/Hamlib/Hamlib/issues/462 (cherry picked from commit 97a28ea75f04fb504394565d033d6b895bc10235) diff --git a/rigs/yaesu/ft450.c b/rigs/yaesu/ft450.c index d0be5671..7bd00548 100644 --- a/rigs/yaesu/ft450.c +++ b/rigs/yaesu/ft450.c @@ -86,6 +86,7 @@ const struct rig_caps ft450_caps = .transceive = RIG_TRN_OFF, /* May enable later as the 450 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, + .rfpower_meter_cal = FT450_RFPOWER_METER_CAL, .str_cal = FT450_STR_CAL, .chan_list = { { 1, 500, RIG_MTYPE_MEM, NEWCAT_MEM_CAP }, diff --git a/rigs/yaesu/ft450.h b/rigs/yaesu/ft450.h index e39cb291..20da880c 100644 --- a/rigs/yaesu/ft450.h +++ b/rigs/yaesu/ft450.h @@ -76,6 +76,20 @@ RIG_OP_TOGGLE) +// Borrowed from FLRig -- Thanks to Dave W1HKJ +#define FT450_RFPOWER_METER_CAL \ + { \ + 6, \ + { \ + {10, 0.8f}, \ + {50, 8.0f}, \ + {100, 26.0f}, \ + {150, 54.0f}, \ + {200, 92.0f}, \ + {250, 140.0f}, \ + } \ + } + /* TBC */ #define FT450_STR_CAL { 3, \ { \ commit f70712d990e9b59d64ff0e43179c1e34e4a3b466 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 11 16:12:11 2020 -0600 Add ftdx9000 power levels https://github.com/Hamlib/Hamlib/issues/462Z (cherry picked from commit 09da908bb393b7d45e9e7d4654289a40eee4ecf5) diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index e1b166e7..caec2721 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -57,6 +57,8 @@ RIG_MODE_SSB | RIG_MODE_LSB | RIG_MODE_USB |\ RIG_MODE_FM | RIG_MODE_WFM | RIG_MODE_FMN |RIG_MODE_PKTFM ) +#define FLRIG_LEVELS (RIG_LEVEL_AF | RIG_LEVEL_RF | RIG_LEVEL_MICGAIN | RIG_LEVEL_STRENGTH) + #define streq(s1,s2) (strcmp(s1,s2)==0) static int flrig_init(RIG *rig); @@ -84,6 +86,8 @@ static int flrig_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t freq, rmode_t mode, pbwidth_t width); static int flrig_get_split_freq_mode(RIG *rig, vfo_t vfo, freq_t *freq, rmode_t *mode, pbwidth_t *width); +static int flrig_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); +static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); static const char *flrig_get_info(RIG *rig); @@ -124,8 +128,8 @@ const struct rig_caps flrig_caps = .has_get_func = RIG_FUNC_NONE, .has_set_func = RIG_FUNC_NONE, - .has_get_level = RIG_LEVEL_NONE, - .has_set_level = RIG_LEVEL_NONE, + .has_get_level = FLRIG_LEVELS, + .has_set_level = RIG_LEVEL_SET(FLRIG_LEVELS), .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .filters = { @@ -169,7 +173,9 @@ const struct rig_caps flrig_caps = .set_split_vfo = flrig_set_split_vfo, .get_split_vfo = flrig_get_split_vfo, .set_split_freq_mode = flrig_set_split_freq_mode, - .get_split_freq_mode = flrig_get_split_freq_mode + .get_split_freq_mode = flrig_get_split_freq_mode, + .set_level = flrig_set_level, + .get_level = flrig_get_level }; // Structure for mapping flrig dynmamic modes to hamlib modes @@ -1851,6 +1857,93 @@ static int flrig_get_split_freq_mode(RIG *rig, vfo_t vfo, freq_t *freq, return retval; } +static int flrig_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) +{ + int retval; + char cmd_arg[MAXARGLEN]; + char *cmd; + + rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s level=%d, val=%f\n", __func__, + rig_strvfo(vfo), (int)level, val.f); + + if (check_vfo(vfo) == FALSE) + { + rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %s\n", + __func__, rig_strvfo(vfo)); + return -RIG_EINVAL; + } + + sprintf(cmd_arg, + "<params><param><value><double>%d</double></value></param></params>", (int)val.f); + + switch (level) + { + case RIG_LEVEL_RF: cmd = "rig.set_rfgain"; break; + + case RIG_LEVEL_AF: cmd = "rig.set_volume"; break; + + case RIG_LEVEL_MICGAIN: cmd = "rig.set_micgain"; break; + + default: + rig_debug(RIG_DEBUG_ERR, "%s: invalid level=%d\n", __func__, (int)level); + return -RIG_EINVAL; + } + + retval = flrig_transaction(rig, cmd, cmd_arg, NULL, 0); + + if (retval < 0) + { + return retval; + } + + return RIG_OK; +} + +/* + * flrig_get_level + * Assumes rig!=NULL, rig->state.priv!=NULL, val!=NULL + */ +static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) +{ + char value[MAXARGLEN]; + char *cmd; + int retval; + + rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__, + rig_strvfo(vfo)); + + + switch (level) + { + case RIG_LEVEL_AF: cmd = "rig.get_volume"; break; + + case RIG_LEVEL_RF: cmd = "rig.get_rfgain"; break; + + case RIG_LEVEL_MICGAIN: cmd = "rig.get_micgain"; break; + + case RIG_LEVEL_STRENGTH: cmd = "rig.get_power"; break; + + default: + rig_debug(RIG_DEBUG_ERR, "%s: unknown level=%d\n", __func__, (int)level); + return -RIG_EINVAL; + } + + retval = flrig_transaction(rig, cmd, NULL, value, sizeof(value)); + + if (retval != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: flrig_transaction failed retval=%s\n", __func__, + rigerror(retval)); + return retval; + } + + val->f = atof(value); + + rig_debug(RIG_DEBUG_TRACE, "%s: val='%s'(%f)\n", __func__, value, val->f); + + return RIG_OK; +} + /* * flrig_get_info * assumes rig!=NULL diff --git a/rigs/dummy/flrig.h b/rigs/dummy/flrig.h index 8459eb8e..f49a1934 100644 --- a/rigs/dummy/flrig.h +++ b/rigs/dummy/flrig.h @@ -28,7 +28,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20200617" +#define BACKEND_VER "20201209" #define EOM "\r" #define TRUE 1 diff --git a/rigs/yaesu/ft9000.c b/rigs/yaesu/ft9000.c index 149a43df..cd573c37 100644 --- a/rigs/yaesu/ft9000.c +++ b/rigs/yaesu/ft9000.c @@ -93,6 +93,7 @@ const struct rig_caps ft9000_caps = .transceive = RIG_TRN_OFF, /* May enable later as the 9000 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, + .rfpower_meter_cal = FT9000_RFPOWER_METER_CAL, .str_cal = FT9000_STR_CAL, .chan_list = { /* TBC */ diff --git a/rigs/yaesu/ft9000.h b/rigs/yaesu/ft9000.h index 03525832..5d8f13ee 100644 --- a/rigs/yaesu/ft9000.h +++ b/rigs/yaesu/ft9000.h @@ -81,6 +81,25 @@ RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\ RIG_OP_TO_VFO|RIG_OP_FROM_VFO|RIG_OP_TOGGLE) +// Borrowed from FLRig -- Thanks to Dave W1HKJ +#define FT9000_RFPOWER_METER_CAL \ + { \ + 11, \ + { \ + {35, 10.0f}, \ + {53, 20.0f}, \ + {80, 40.0f}, \ + {97, 60.0f}, \ + {119, 80.0f}, \ + {137, 100.0f}, \ + {154, 120.0f}, \ + {167, 140.0f}, \ + {177, 160.0f}, \ + {188, 180.0f}, \ + {197, 200.0f}, \ + } \ + } + /* TBC */ #define FT9000_STR_CAL { 16, \ { \ diff --git a/rigs/yaesu/ftdx101.h b/rigs/yaesu/ftdx101.h index fe271b9e..b9c3230a 100644 --- a/rigs/yaesu/ftdx101.h +++ b/rigs/yaesu/ftdx101.h @@ -71,7 +71,7 @@ RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\ RIG_OP_TO_VFO|RIG_OP_FROM_VFO|RIG_OP_TOGGLE) -// Borrowed from FLRig -- Thanks to Dave W +// Borrowed from FLRig -- Thanks to Dave W1HKJ #define FTDX101D_RFPOWER_METER_CAL \ { \ 5, \ diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 0467857e..a088f0ca 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -4162,7 +4162,14 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return -RIG_ENAVAIL; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RM5%c", cat_term); + if (is_ftdx9000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RM08%c", cat_term); + } + else + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RM5%c", cat_term); + } break; case RIG_LEVEL_COMP_METER: commit 90e0b036b9abfd894f96531741d538216e6a8a52 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 11 14:55:33 2020 -0600 Fix retries in newcat.c https://github.com/Hamlib/Hamlib/issues/463 (cherry picked from commit 0a7c229f068daaf1d1be93f7410f06f8c7f71bd2) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 4e00d6ea..0467857e 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -8963,6 +8963,7 @@ int newcat_get_cmd(RIG *rig) __func__, priv->ret_data); // we were using BUSBUSY but microham devices need retries //rc = -RIG_BUSBUSY; /* don't write command again */ + rc = -RIG_EPROTO; /* we could decrement retry_count here but there is a danger of infinite looping so we just use up @@ -9038,6 +9039,7 @@ int newcat_get_cmd(RIG *rig) // we were using BUSBUSY but microham devices need retries // this should be OK under all other circumstances too //rc = -RIG_BUSBUSY; /* retry read only */ + rc = -RIG_EPROTO; } } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 9ce0859e..0a88e03f 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201209" +#define NEWCAT_VER "20201211" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 57d45dfca1ab125a7a646e5362472e20450a388f Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 11 12:25:01 2020 -0600 Fix RFPOWER levels for ftdx101 https://github.com/Hamlib/Hamlib/issues/462 (cherry picked from commit f60f9e0181b4926729c7fbb88571152843440120) diff --git a/rigs/yaesu/ftdx101.c b/rigs/yaesu/ftdx101.c index c7f517fb..5152e05c 100644 --- a/rigs/yaesu/ftdx101.c +++ b/rigs/yaesu/ftdx101.c @@ -37,8 +37,6 @@ #include "newcat.h" #include "ftdx101.h" -cal_table_float_t yaesu_ftdx101d_swr_cal = FTDX101D_SWR_CAL; - const struct newcat_priv_caps ftdx101d_priv_caps = { .roofing_filter_count = 6, @@ -78,7 +76,7 @@ const struct rig_caps ftdx101d_caps = RIG_MODEL(RIG_MODEL_FTDX101D), .model_name = "FTDX101D", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".6", + .version = NEWCAT_VER ".7", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -119,6 +117,7 @@ const struct rig_caps ftdx101d_caps = .transceive = RIG_TRN_OFF, /* May enable later as the FTDX101 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, + .rfpower_meter_cal = FTDX101D_RFPOWER_METER_CAL, .swr_cal = FTDX101D_SWR_CAL, .chan_list = { { 1, 99, RIG_MTYPE_MEM, NEWCAT_MEM_CAP }, diff --git a/rigs/yaesu/ftdx101.h b/rigs/yaesu/ftdx101.h index 5e0309f4..fe271b9e 100644 --- a/rigs/yaesu/ftdx101.h +++ b/rigs/yaesu/ftdx101.h @@ -71,6 +71,19 @@ RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\ RIG_OP_TO_VFO|RIG_OP_FROM_VFO|RIG_OP_TOGGLE) +// Borrowed from FLRig -- Thanks to Dave W +#define FTDX101D_RFPOWER_METER_CAL \ + { \ + 5, \ + { \ + {35, 5.0f}, \ + {94, 25.0f}, \ + {147, 50.0f}, \ + {176, 75.0f}, \ + {205, 100.0f}, \ + } \ + } + // Based on testing with G3VPX Ian Sumner #define FTDX101D_SWR_CAL \ { \ ----------------------------------------------------------------------- Summary of changes: doc/man1/rigctl.1 | 2 + rigs/dummy/flrig.c | 99 ++++++++++++++++++++++++++++++++++++++++++++++++-- rigs/dummy/flrig.h | 2 +- rigs/kenwood/kenwood.c | 6 ++- rigs/yaesu/ft1200.c | 1 + rigs/yaesu/ft1200.h | 14 +++++++ rigs/yaesu/ft450.c | 1 + rigs/yaesu/ft450.h | 14 +++++++ rigs/yaesu/ft891.c | 1 + rigs/yaesu/ft891.h | 10 +++++ rigs/yaesu/ft9000.c | 1 + rigs/yaesu/ft9000.h | 19 ++++++++++ rigs/yaesu/ft950.c | 1 + rigs/yaesu/ft950.h | 17 ++++++++- rigs/yaesu/ft991.c | 1 + rigs/yaesu/ft991.h | 14 +++++++ rigs/yaesu/ftdx101.c | 5 +-- rigs/yaesu/ftdx101.h | 13 +++++++ rigs/yaesu/newcat.c | 26 +++++++++++-- rigs/yaesu/newcat.h | 2 +- 20 files changed, 235 insertions(+), 14 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-12-13 15:55:10
|
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 4eef84ef47874e47f567d0d5c88fd093977b70dc (commit) via f54d0508fd1230c3bcd85143ba7b9349eda5a2aa (commit) via 9b98a264abf06b7e847ba45511494031f851a4f2 (commit) via 5883897656f7c8937d81af112ea7d9f7792e89f2 (commit) via cdeacfb7d1015850444d329a0ee9304e265a75f5 (commit) via ddb38db106519d801ff8f6a0d3bf25fedbd50b78 (commit) via 9bc98c9a2e45dbe2c47db488be5703dc2b0fc00d (commit) via 7cd09fdd84f70598fffb684e74ab4e24408da13b (commit) via 3061a5f8b2354b14e226fc1cddcbaffce3bde159 (commit) via 0fa00cb14f12600c9863ab9369e5eb510108a252 (commit) via 915666add2c857c2c74cf4623992c419c27812ad (commit) via e4e88b833d1877797e56726a749e3bf6cdb35a05 (commit) via f22d4a6dbe7305b3a84546faa6e462e388a0d3ee (commit) via c0743dfe6e6633151b87cdbc5c7321bd11ce9d1a (commit) via 2ff3fa0782377eed7b9b766caaf41d99c434cc22 (commit) via e1aa80599f419025e1894a449ab18924817ebe9f (commit) via ffe7184970ccfde09e85db02d7d7bad743ee54a1 (commit) via 44baf44dccd86467f7aa6b529fcfefeb3501595c (commit) via 5a86a1657fe50d96b2fed22cffeb8ba61c887c64 (commit) via 7911fd1d4bd04df0a1d9d737b4817653feca75b2 (commit) via ff17dd0199f6613549f74cb8cb3351b708338a4a (commit) via d1ea35c93e0d4c7313b31415d456befdf90ad7bb (commit) via 354cb925ccf1df37d2bde19d4d81dea25e6953e5 (commit) via 97a28ea75f04fb504394565d033d6b895bc10235 (commit) via 09da908bb393b7d45e9e7d4654289a40eee4ecf5 (commit) via 0a7c229f068daaf1d1be93f7410f06f8c7f71bd2 (commit) via f60f9e0181b4926729c7fbb88571152843440120 (commit) from 9fa31392b059e4eaadad9e9d62aaa70c32869f28 (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 4eef84ef47874e47f567d0d5c88fd093977b70dc Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 13 09:40:52 2020 -0600 Change newcat.c to not abort when ?; is received FTDX3000 was giving ?; to FB; command!!! https://github.com/Hamlib/Hamlib/issues/464 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 08d98313..b15f6f68 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -9032,10 +9032,12 @@ int newcat_get_cmd(RIG *rig) * There are many more cases like these and they vary by rig model. * * So far, "rig busy" type situations with the ? response have not been observed for get commands. + * Followup 20201213 FTDX3000 FB; command returning ?; so do NOT abort + * see https://github.com/Hamlib/Hamlib/issues/464 */ rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig: '%s'\n", __func__, priv->cmd_str); - return -RIG_ERJCTED; + // return -RIG_ERJCTED; } continue; diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 6b8e76e6..6b69bf15 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201212" +#define NEWCAT_VER "20201213" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit f54d0508fd1230c3bcd85143ba7b9349eda5a2aa Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 13 08:55:50 2020 -0600 Added flrig LEVEL values STRENGTH, RF, AF, RFPOWER_METER, MICGAIN https://github.com/Hamlib/Hamlib/issues/460 diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index caec2721..214174df 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -57,7 +57,7 @@ RIG_MODE_SSB | RIG_MODE_LSB | RIG_MODE_USB |\ RIG_MODE_FM | RIG_MODE_WFM | RIG_MODE_FMN |RIG_MODE_PKTFM ) -#define FLRIG_LEVELS (RIG_LEVEL_AF | RIG_LEVEL_RF | RIG_LEVEL_MICGAIN | RIG_LEVEL_STRENGTH) +#define FLRIG_LEVELS (RIG_LEVEL_AF | RIG_LEVEL_RF | RIG_LEVEL_MICGAIN | RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER_METER) #define streq(s1,s2) (strcmp(s1,s2)==0) @@ -1874,7 +1874,8 @@ static int flrig_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } sprintf(cmd_arg, - "<params><param><value><double>%d</double></value></param></params>", (int)val.f); + "<params><param><value><double>%d</double></value></param></params>", + (int)val.f); switch (level) { @@ -1923,6 +1924,8 @@ static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_STRENGTH: cmd = "rig.get_power"; break; + case RIG_LEVEL_RFPOWER_METER: cmd = "rig.get_pwrmeter"; break; + default: rig_debug(RIG_DEBUG_ERR, "%s: unknown level=%d\n", __func__, (int)level); return -RIG_EINVAL; @@ -1937,9 +1940,20 @@ static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return retval; } - val->f = atof(value); + // most levels are 0-100 -- may have to allow for different ranges + switch (level) + { + case RIG_LEVEL_STRENGTH: + case RIG_LEVEL_RFPOWER_METER: + val->i = atoi(value); + rig_debug(RIG_DEBUG_TRACE, "%s: val.i='%s'(%d)\n", __func__, value, val->i); + break; + + default: + val->f = atof(value) / 100; + rig_debug(RIG_DEBUG_TRACE, "%s: val.f='%s'(%f)\n", __func__, value, val->f); + } - rig_debug(RIG_DEBUG_TRACE, "%s: val='%s'(%f)\n", __func__, value, val->f); return RIG_OK; } diff --git a/rigs/dummy/flrig.h b/rigs/dummy/flrig.h index f49a1934..b231e02d 100644 --- a/rigs/dummy/flrig.h +++ b/rigs/dummy/flrig.h @@ -28,7 +28,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20201209" +#define BACKEND_VER "20201213" #define EOM "\r" #define TRUE 1 commit 9b98a264abf06b7e847ba45511494031f851a4f2 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 13 00:01:09 2020 -0600 Fix datamode set in icom.c to use 0x00 0x00 per the manual for 7300 and 9700 https://github.com/Hamlib/Hamlib/issues/448 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 1248b87b..1c13b4a2 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1627,7 +1627,6 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, datamode[0] = 0x00; break; } - if (width != RIG_PASSBAND_NOCHANGE) { if (filter_byte) // then we need the width byte too @@ -1638,7 +1637,7 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, // 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, width_icom == -1 ? 1 : 2, + icom_transaction(rig, C_CTL_MEM, dm_sub_cmd, datamode, 2, ackbuf, &ack_len); } commit 5883897656f7c8937d81af112ea7d9f7792e89f2 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 23:05:59 2020 -0600 icom.c passband nochange seems to be working https://github.com/Hamlib/Hamlib/issues/448 diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index ec5e20e3..e52950ad 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -404,7 +404,6 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, "%s: Failed to get width for passband nochange err=%s\n", __func__, rigerror(ret)); } - return RIG_OK; } switch (mode) @@ -491,15 +490,15 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, icmode_ext = PD_WIDE_3; /* default to Wide */ } } + *pd = icmode_ext; } else { // filter should already be set elsewhere - icmode_ext = priv_data->filter; + *pd = priv_data->filter; } *md = icmode; - *pd = icmode_ext; return RIG_OK; } diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index d4b66816..1248b87b 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1604,6 +1604,7 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, break; } + rig_debug(RIG_DEBUG_VERBOSE, "%s mode=%d, width=%d\n", __func__, (int)icom_mode, (int)width); retval = icom_set_mode(rig, vfo, icom_mode, width); if (RIG_OK == retval) @@ -1704,16 +1705,18 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = rig2icom_mode(rig, vfo, mode, width, &icmode, &icmode_ext); } + if (width == RIG_PASSBAND_NOCHANGE) icmode_ext = priv_data->filter; if (err < 0) { + rig_debug(RIG_DEBUG_ERR, "%s: Error on rig2icom err=%d\n", __func__, err); return err; } + rig_debug(RIG_DEBUG_VERBOSE, "%s: icmode=%d, icmode_ext=%d\n", __func__, icmode, icmode_ext); /* IC-731, IC-735, IC-7000 don't support passband data */ /* IC-726 & IC-475A/E also limited support - only on CW */ /* TODO: G4WJS CW wide/narrow are possible with above two radios */ - if (icmode_ext == -1) icmode_ext = priv_data->filter; if (priv->civ_731_mode || rig->caps->rig_model == RIG_MODEL_OS456 || rig->caps->rig_model == RIG_MODEL_IC726 || rig->caps->rig_model == RIG_MODEL_IC475 @@ -1722,6 +1725,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) icmode_ext = -1; } + rig_debug(RIG_DEBUG_VERBOSE, "%s: #2 icmode=%d, icmode_ext=%d\n", __func__, icmode, icmode_ext); retval = icom_transaction(rig, C_SET_MODE, icmode, (unsigned char *) &icmode_ext, (icmode_ext == -1 ? 0 : 1), ackbuf, &ack_len); @@ -1771,6 +1775,7 @@ int icom_get_mode_with_data(RIG *rig, vfo_t vfo, rmode_t *mode, rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); retval = icom_get_mode(rig, vfo, mode, width); + rig_debug(RIG_DEBUG_VERBOSE, "%s mode=%d\n", __func__, (int)*mode); if (retval != RIG_OK) { return retval; @@ -1816,6 +1821,7 @@ int icom_get_mode_with_data(RIG *rig, vfo_t vfo, rmode_t *mode, return -RIG_ERJCTED; } + rig_debug(RIG_DEBUG_VERBOSE, "%s databuf[2]=%d, mode=%d\n", __func__, (int)databuf[2], (int)*mode); if (databuf[2]) /* 0x01/0x02/0x03 -> data mode, 0x00 -> not data mode */ { switch (*mode) @@ -2045,8 +2051,6 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) return -RIG_EINVAL; } - rig_debug(RIG_DEBUG_TRACE, "%s: debug#1\n", __func__); - if (vfo != rig->state.current_vfo) { rig_debug(RIG_DEBUG_TRACE, "%s: VFO changing from %s to %s\n", __func__, commit cdeacfb7d1015850444d329a0ee9304e265a75f5 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 15:38:42 2020 -0600 move icom.c icmode_ext setting a bit earlier in the code https://github.com/Hamlib/Hamlib/issues/448 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 9555338d..d4b66816 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1713,6 +1713,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) /* IC-731, IC-735, IC-7000 don't support passband data */ /* IC-726 & IC-475A/E also limited support - only on CW */ /* TODO: G4WJS CW wide/narrow are possible with above two radios */ + if (icmode_ext == -1) icmode_ext = priv_data->filter; if (priv->civ_731_mode || rig->caps->rig_model == RIG_MODEL_OS456 || rig->caps->rig_model == RIG_MODEL_IC726 || rig->caps->rig_model == RIG_MODEL_IC475 @@ -1721,7 +1722,6 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) icmode_ext = -1; } - if (icmode_ext == -1) icmode_ext = priv_data->filter; retval = icom_transaction(rig, C_SET_MODE, icmode, (unsigned char *) &icmode_ext, (icmode_ext == -1 ? 0 : 1), ackbuf, &ack_len); commit ddb38db106519d801ff8f6a0d3bf25fedbd50b78 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 15:33:38 2020 -0600 Set icom_set_mode to use existing filter for passband nochange https://github.com/Hamlib/Hamlib/issues/448 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 74ddda8e..9555338d 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1681,6 +1681,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { struct icom_priv_data *priv; const struct icom_priv_caps *priv_caps; + const struct icom_priv_data *priv_data; struct rig_state *rs; unsigned char ackbuf[MAXFRAMELEN]; unsigned char icmode; @@ -1693,6 +1694,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) priv = (struct icom_priv_data *) rs->priv; priv_caps = (const struct icom_priv_caps *) rig->caps->priv; + priv_data = (const struct icom_priv_data *) rig->state.priv; if (priv_caps->r2i_mode != NULL) /* call priv code if defined */ { @@ -1719,6 +1721,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) icmode_ext = -1; } + if (icmode_ext == -1) icmode_ext = priv_data->filter; retval = icom_transaction(rig, C_SET_MODE, icmode, (unsigned char *) &icmode_ext, (icmode_ext == -1 ? 0 : 1), ackbuf, &ack_len); commit 9bc98c9a2e45dbe2c47db488be5703dc2b0fc00d Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 13:22:49 2020 -0600 Add filter memory to frame.c for no passband change https://github.com/Hamlib/Hamlib/issues/448 diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 5348dbca..ec5e20e3 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -389,6 +389,7 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, unsigned char icmode; signed char icmode_ext; pbwidth_t width_tmp = width; + struct icom_priv_data *priv_data = (struct icom_priv_data *) rig->state.priv; icmode_ext = -1; @@ -491,6 +492,11 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, } } } + else + { + // filter should already be set elsewhere + icmode_ext = priv_data->filter; + } *md = icmode; *pd = icmode_ext; commit 7cd09fdd84f70598fffb684e74ab4e24408da13b Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 13:00:26 2020 -0600 Fix passband nochange in icom frame.c https://github.com/Hamlib/Hamlib/issues/448 diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index ca718a8d..5348dbca 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -388,6 +388,7 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, { unsigned char icmode; signed char icmode_ext; + pbwidth_t width_tmp = width; icmode_ext = -1; @@ -402,6 +403,7 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, "%s: Failed to get width for passband nochange err=%s\n", __func__, rigerror(ret)); } + return RIG_OK; } switch (mode) @@ -458,7 +460,7 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, return -RIG_EINVAL; } - if (width != RIG_PASSBAND_NOCHANGE) + if (width_tmp != RIG_PASSBAND_NOCHANGE) { pbwidth_t medium_width = rig_passband_normal(rig, mode); commit 3061a5f8b2354b14e226fc1cddcbaffce3bde159 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 12:40:04 2020 -0600 Fix icom filter value, not ASCII!!! https://github.com/Hamlib/Hamlib/issues/448 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 0e32beca..74ddda8e 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1868,7 +1868,7 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) if (mode_len == 3) { - priv_data->filter = modebuf[2] - '0'; + priv_data->filter = modebuf[2]; rig_debug(RIG_DEBUG_TRACE, "%s: modebuf[0]=0x%02x, modebuf[1]=0x%02x, modebuf[2]=0x%02x, mode_len=%d, filter=%d\n", __func__, modebuf[0], diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 9120c364..b93aab6c 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -203,7 +203,7 @@ struct icom_priv_data int x25cmdfails; // This will get set if the 0x25 command fails so we try just once int x1cx03cmdfails; // This will get set if the 0x1c 0x03 command fails so we try just once int poweron; // to prevent powering on more than once - int filter; // Current filter selected + unsigned char filter; // Current filter selected }; extern const struct ts_sc_list r8500_ts_sc_list[]; commit 0fa00cb14f12600c9863ab9369e5eb510108a252 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 12:31:32 2020 -0600 Missed icom.h commit https://github.com/Hamlib/Hamlib/issues/448 diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index cb564ee5..9120c364 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -203,6 +203,7 @@ struct icom_priv_data int x25cmdfails; // This will get set if the 0x25 command fails so we try just once int x1cx03cmdfails; // This will get set if the 0x1c 0x03 command fails so we try just once int poweron; // to prevent powering on more than once + int filter; // Current filter selected }; extern const struct ts_sc_list r8500_ts_sc_list[]; commit 915666add2c857c2c74cf4623992c419c27812ad Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 12:21:54 2020 -0600 Remember filter setting from icom_get_mode so we can refer to it later on set_mode https://github.com/Hamlib/Hamlib/issues/448 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 19ad7460..0e32beca 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1857,16 +1857,29 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) { unsigned char modebuf[MAXFRAMELEN]; const struct icom_priv_caps *priv_caps; + struct icom_priv_data *priv_data; int mode_len, retval; rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s\n", __func__, rig_strvfo(vfo)); priv_caps = (const struct icom_priv_caps *) rig->caps->priv; + priv_data = (struct icom_priv_data *) rig->state.priv; retval = icom_transaction(rig, C_RD_MODE, -1, NULL, 0, modebuf, &mode_len); - rig_debug(RIG_DEBUG_TRACE, - "%s: modebuf[0]=0x%02x, modebuf[1]=0x%02x, mode_len=%d\n", __func__, modebuf[0], - modebuf[1], mode_len); + if (mode_len == 3) + { + priv_data->filter = modebuf[2] - '0'; + rig_debug(RIG_DEBUG_TRACE, + "%s: modebuf[0]=0x%02x, modebuf[1]=0x%02x, modebuf[2]=0x%02x, mode_len=%d, filter=%d\n", + __func__, modebuf[0], + modebuf[1], modebuf[2], mode_len, priv_data->filter); + } + else + { + rig_debug(RIG_DEBUG_TRACE, + "%s: modebuf[0]=0x%02x, modebuf[1]=0x%02x, mode_len=%d\n", __func__, modebuf[0], + modebuf[1], mode_len); + } if (retval != RIG_OK) { commit e4e88b833d1877797e56726a749e3bf6cdb35a05 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 11:24:07 2020 -0600 Eliminate warning in icom.c for passband nochange https://github.com/Hamlib/Hamlib/issues/448 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index e3a7f133..19ad7460 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1651,6 +1651,7 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, else { rig_debug(RIG_DEBUG_TRACE, "%s RIG_PASSBAND_NOCHANGE\n", __func__); + return RIG_OK; } if (retval != RIG_OK) commit f22d4a6dbe7305b3a84546faa6e462e388a0d3ee Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 10:07:03 2020 -0600 Update icom.h version diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 8a404cc6..cb564ee5 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -30,7 +30,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20201103" +#define BACKEND_VER "20201212" /* * defines used by comp_cal_str in rig.c commit c0743dfe6e6633151b87cdbc5c7321bd11ce9d1a Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 10:06:44 2020 -0600 astyle icom.c diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 033801e5..e3a7f133 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1627,25 +1627,26 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, break; } - if (width != RIG_PASSBAND_NOCHANGE) { - if (filter_byte) // then we need the width byte too - { - unsigned char mode_icom; // not used as it will map to USB/LSB - signed char width_icom; - rig2icom_mode(rig, vfo, mode, width, &mode_icom, &width_icom); - // 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, width_icom == -1 ? 1 : 2, - ackbuf, - &ack_len); - } - else + if (width != RIG_PASSBAND_NOCHANGE) { - retval = - icom_transaction(rig, C_CTL_MEM, dm_sub_cmd, datamode, 1, ackbuf, - &ack_len); - } + if (filter_byte) // then we need the width byte too + { + unsigned char mode_icom; // not used as it will map to USB/LSB + signed char width_icom; + rig2icom_mode(rig, vfo, mode, width, &mode_icom, &width_icom); + // 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, width_icom == -1 ? 1 : 2, + ackbuf, + &ack_len); + } + else + { + retval = + icom_transaction(rig, C_CTL_MEM, dm_sub_cmd, datamode, 1, ackbuf, + &ack_len); + } } else { commit 2ff3fa0782377eed7b9b766caaf41d99c434cc22 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 10:06:00 2020 -0600 icom now recognizes RIG_PASSBAND_NOCHANGE https://github.com/Hamlib/Hamlib/issues/448 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index acbc309f..033801e5 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1627,6 +1627,7 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, break; } + if (width != RIG_PASSBAND_NOCHANGE) { if (filter_byte) // then we need the width byte too { unsigned char mode_icom; // not used as it will map to USB/LSB @@ -1645,6 +1646,11 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, icom_transaction(rig, C_CTL_MEM, dm_sub_cmd, datamode, 1, ackbuf, &ack_len); } + } + else + { + rig_debug(RIG_DEBUG_TRACE, "%s RIG_PASSBAND_NOCHANGE\n", __func__); + } if (retval != RIG_OK) { commit e1aa80599f419025e1894a449ab18924817ebe9f Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 08:34:32 2020 -0600 Add some more debug for Yaesu RFPOWER_METER levels https://github.com/Hamlib/Hamlib/issues/462 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 2252ed4a..08d98313 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -4369,6 +4369,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_RFPOWER_METER: + rig_debug(RIG_DEBUG_VERBOSE, "%s: RFPOWER_METER retlvl=%s\n", __func__, retlvl); if (retlvl_len > 3) { // Some rigs like FTDX101 have 6-byte return so we just truncate commit ffe7184970ccfde09e85db02d7d7bad743ee54a1 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 08:24:33 2020 -0600 Normalize Yaesu RFPOWER_METER_LEVELS to 100W This is a quick fix for most Yaesu rigs We need a new RIG_LEVEL_RFPOWER_METER_WATTS to return watts instead of 0-1.0 https://github.com/Hamlib/Hamlib/issues/462 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index a088f0ca..2252ed4a 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -163,7 +163,7 @@ const cal_table_float_t yaesu_default_comp_meter_cal = 2, { {0, 0.0f}, - {255, 1.0f}, + {255, 100.0f}, } }; @@ -4372,7 +4372,9 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (retlvl_len > 3) { // Some rigs like FTDX101 have 6-byte return so we just truncate + rig_debug(RIG_DEBUG_VERBOSE, "%s: retlvl of %s getting truncated\n", __func__, retlvl); retlvl[3] = 0; + rig_debug(RIG_DEBUG_VERBOSE, "%s: retlvl truncated to %s\n", __func__, retlvl); } if (rig->caps->rfpower_meter_cal.size == 0) @@ -4383,6 +4385,12 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { val->f = rig_raw2val_float(atoi(retlvl), &rig->caps->rfpower_meter_cal); } + rig_debug(RIG_DEBUG_VERBOSE, "%s: RFPOWER_METER=%s, converted to %f\n", __func__, retlvl, val->f); + if (val->f > 1.0) + { + rig_debug(RIG_DEBUG_VERBOSE, "%s: val->f(%f) clipped at 1.0\n", __func__, val->f); + val->f = 1.0; + } break; @@ -4395,11 +4403,11 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (rig->caps->comp_meter_cal.size == 0) { - val->f = rig_raw2val_float(atoi(retlvl), &yaesu_default_comp_meter_cal); + val->f = rig_raw2val_float(atoi(retlvl), &yaesu_default_comp_meter_cal)/100; } else { - val->f = rig_raw2val_float(atoi(retlvl), &rig->caps->comp_meter_cal); + val->f = rig_raw2val_float(atoi(retlvl), &rig->caps->comp_meter_cal)/100; } break; diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 0a88e03f..6b8e76e6 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201211" +#define NEWCAT_VER "20201212" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 44baf44dccd86467f7aa6b529fcfefeb3501595c Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 11 17:20:34 2020 -0600 Update rigctl.1 man page diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index 1913b7e9..b2fde9ce 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -88,6 +88,8 @@ etc. on Linux, etc. on MS Windows. The BSD flavors and Mac OS/X have their own designations. See your system's documentation. .IP +Can be a network address:port, e.g. 127.0.0.1:12345 +.IP The special string \(lquh\-rig\(rq may be given to enable micro-ham device support. . commit 5a86a1657fe50d96b2fed22cffeb8ba61c887c64 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 11 17:00:21 2020 -0600 Change post_write_delay on FT950 to 25ms https://github.com/Hamlib/Hamlib/issues/461 diff --git a/rigs/yaesu/ft950.h b/rigs/yaesu/ft950.h index cdea56a6..e7bccd4a 100644 --- a/rigs/yaesu/ft950.h +++ b/rigs/yaesu/ft950.h @@ -137,6 +137,6 @@ /* Delay sequential fast writes */ //#define FT950_POST_WRITE_DELAY 5 -#define FT950_POST_WRITE_DELAY 0 +#define FT950_POST_WRITE_DELAY 25 #endif /* _FT950_H */ commit 7911fd1d4bd04df0a1d9d737b4817653feca75b2 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 11 16:38:02 2020 -0600 Add power level to ft991 and fix ft1200 table https://github.com/Hamlib/Hamlib/issues/462 diff --git a/rigs/yaesu/ft1200.h b/rigs/yaesu/ft1200.h index 3b1a9389..535bee43 100644 --- a/rigs/yaesu/ft1200.h +++ b/rigs/yaesu/ft1200.h @@ -76,13 +76,14 @@ // Borrowed from FLRig -- Thanks to Dave W1HKJ #define FTDX1200_RFPOWER_METER_CAL \ { \ - 5, \ + 6, \ { \ - {35, 5.0f}, \ - {94, 25.0f}, \ - {147, 50.0f}, \ - {176, 75.0f}, \ - {205, 100.0f}, \ + {10, 0.8f}, \ + {50, 8.0f}, \ + {100, 26.0f}, \ + {150, 54.0f}, \ + {200, 92.0f}, \ + {250, 140.0f}, \ } \ } diff --git a/rigs/yaesu/ft991.c b/rigs/yaesu/ft991.c index 60568197..ecf67299 100644 --- a/rigs/yaesu/ft991.c +++ b/rigs/yaesu/ft991.c @@ -91,6 +91,7 @@ const struct rig_caps ft991_caps = .transceive = RIG_TRN_OFF, /* May enable later as the 950 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, + .rfpower_meter_cal = FT991_RFPOWER_METER_CAL, .str_cal = FT991_STR_CAL, .chan_list = { { 1, 99, RIG_MTYPE_MEM, NEWCAT_MEM_CAP }, diff --git a/rigs/yaesu/ft991.h b/rigs/yaesu/ft991.h index 159aeeac..97ee43be 100644 --- a/rigs/yaesu/ft991.h +++ b/rigs/yaesu/ft991.h @@ -71,6 +71,20 @@ RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\ RIG_OP_TO_VFO|RIG_OP_FROM_VFO) +// Borrowed from FLRig -- Thanks to Dave W1HKJ +#define FT991_RFPOWER_METER_CAL \ + { \ + 6, \ + { \ + {10, 0.8f}, \ + {50, 8.0f}, \ + {100, 26.0f}, \ + {150, 54.0f}, \ + {200, 92.0f}, \ + {250, 140.0f}, \ + } \ + } + /* TBC */ #define FT991_STR_CAL { 16, \ { \ commit ff17dd0199f6613549f74cb8cb3351b708338a4a Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 11 16:31:24 2020 -0600 Add power level to ft1200 https://github.com/Hamlib/Hamlib/issues/462 diff --git a/rigs/yaesu/ft1200.c b/rigs/yaesu/ft1200.c index 9aa8928a..3e295e95 100644 --- a/rigs/yaesu/ft1200.c +++ b/rigs/yaesu/ft1200.c @@ -131,6 +131,7 @@ const struct rig_caps ftdx1200_caps = .transceive = RIG_TRN_OFF, /* May enable later as the 1200 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, + .rfpower_meter_cal = FTDX1200_RFPOWER_METER_CAL, .str_cal = FTDX1200_STR_CAL, .chan_list = { { 1, 99, RIG_MTYPE_MEM, NEWCAT_MEM_CAP }, diff --git a/rigs/yaesu/ft1200.h b/rigs/yaesu/ft1200.h index 88afd85d..3b1a9389 100644 --- a/rigs/yaesu/ft1200.h +++ b/rigs/yaesu/ft1200.h @@ -73,6 +73,19 @@ RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\ RIG_OP_TO_VFO|RIG_OP_FROM_VFO|RIG_OP_TOGGLE) +// Borrowed from FLRig -- Thanks to Dave W1HKJ +#define FTDX1200_RFPOWER_METER_CAL \ + { \ + 5, \ + { \ + {35, 5.0f}, \ + {94, 25.0f}, \ + {147, 50.0f}, \ + {176, 75.0f}, \ + {205, 100.0f}, \ + } \ + } + /* TBC */ #define FTDX1200_STR_CAL { 16, \ { \ commit d1ea35c93e0d4c7313b31415d456befdf90ad7bb Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 11 16:28:56 2020 -0600 https://github.com/Hamlib/Hamlib/issues/462 diff --git a/rigs/yaesu/ft950.c b/rigs/yaesu/ft950.c index 1141eba2..f71ebea3 100644 --- a/rigs/yaesu/ft950.c +++ b/rigs/yaesu/ft950.c @@ -131,6 +131,7 @@ const struct rig_caps ft950_caps = .transceive = RIG_TRN_OFF, /* May enable later as the 950 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, + .rfpower_meter_cal = FT950_RFPOWER_METER_CAL, .str_cal = FT950_STR_CAL, .chan_list = { { 1, 99, RIG_MTYPE_MEM, NEWCAT_MEM_CAP }, diff --git a/rigs/yaesu/ft950.h b/rigs/yaesu/ft950.h index 09de523e..cdea56a6 100644 --- a/rigs/yaesu/ft950.h +++ b/rigs/yaesu/ft950.h @@ -72,6 +72,21 @@ RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\ RIG_OP_TO_VFO|RIG_OP_FROM_VFO|RIG_OP_TOGGLE) +// Borrowed from FLRig -- Thanks to Dave W1HKJ +#define FT950_RFPOWER_METER_CAL \ + { \ + 6, \ + { \ + {10, 0.8f}, \ + {50, 8.0f}, \ + {100, 26.0f}, \ + {150, 54.0f}, \ + {200, 92.0f}, \ + {250, 140.0f}, \ + } \ + } + + /* TBC */ #define FT950_STR_CAL { 16, \ { \ commit 354cb925ccf1df37d2bde19d4d81dea25e6953e5 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 11 16:25:21 2020 -0600 Add power level to ft891 https://github.com/Hamlib/Hamlib/issues/462 diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index 1c4b3c7d..0740f055 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -92,6 +92,7 @@ const struct rig_caps ft891_caps = .transceive = RIG_TRN_OFF, /* May enable later as the 950 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, + .rfpower_meter_cal = FT891_RFPOWER_METER_CAL, .str_cal = FT891_STR_CAL, .chan_list = { { 1, 99, RIG_MTYPE_MEM, NEWCAT_MEM_CAP }, diff --git a/rigs/yaesu/ft891.h b/rigs/yaesu/ft891.h index 6a3b541f..daea8917 100644 --- a/rigs/yaesu/ft891.h +++ b/rigs/yaesu/ft891.h @@ -68,6 +68,16 @@ RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\ RIG_OP_TO_VFO|RIG_OP_FROM_VFO) +// Borrowed from FLRig -- Thanks to Dave W1HKJ +#define FT891_RFPOWER_METER_CAL \ + { \ + 2, \ + { \ + {0, 0.0f}, \ + {100, 100.0f}, \ + } \ + } + /* TBC */ #define FT891_STR_CAL { 16, \ { \ commit 97a28ea75f04fb504394565d033d6b895bc10235 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 11 16:21:36 2020 -0600 Fix FT450 power levels https://github.com/Hamlib/Hamlib/issues/462 diff --git a/rigs/yaesu/ft450.c b/rigs/yaesu/ft450.c index d0be5671..7bd00548 100644 --- a/rigs/yaesu/ft450.c +++ b/rigs/yaesu/ft450.c @@ -86,6 +86,7 @@ const struct rig_caps ft450_caps = .transceive = RIG_TRN_OFF, /* May enable later as the 450 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, + .rfpower_meter_cal = FT450_RFPOWER_METER_CAL, .str_cal = FT450_STR_CAL, .chan_list = { { 1, 500, RIG_MTYPE_MEM, NEWCAT_MEM_CAP }, diff --git a/rigs/yaesu/ft450.h b/rigs/yaesu/ft450.h index e39cb291..20da880c 100644 --- a/rigs/yaesu/ft450.h +++ b/rigs/yaesu/ft450.h @@ -76,6 +76,20 @@ RIG_OP_TOGGLE) +// Borrowed from FLRig -- Thanks to Dave W1HKJ +#define FT450_RFPOWER_METER_CAL \ + { \ + 6, \ + { \ + {10, 0.8f}, \ + {50, 8.0f}, \ + {100, 26.0f}, \ + {150, 54.0f}, \ + {200, 92.0f}, \ + {250, 140.0f}, \ + } \ + } + /* TBC */ #define FT450_STR_CAL { 3, \ { \ commit 09da908bb393b7d45e9e7d4654289a40eee4ecf5 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 11 16:12:11 2020 -0600 Add ftdx9000 power levels https://github.com/Hamlib/Hamlib/issues/462Z diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index e1b166e7..caec2721 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -57,6 +57,8 @@ RIG_MODE_SSB | RIG_MODE_LSB | RIG_MODE_USB |\ RIG_MODE_FM | RIG_MODE_WFM | RIG_MODE_FMN |RIG_MODE_PKTFM ) +#define FLRIG_LEVELS (RIG_LEVEL_AF | RIG_LEVEL_RF | RIG_LEVEL_MICGAIN | RIG_LEVEL_STRENGTH) + #define streq(s1,s2) (strcmp(s1,s2)==0) static int flrig_init(RIG *rig); @@ -84,6 +86,8 @@ static int flrig_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t freq, rmode_t mode, pbwidth_t width); static int flrig_get_split_freq_mode(RIG *rig, vfo_t vfo, freq_t *freq, rmode_t *mode, pbwidth_t *width); +static int flrig_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); +static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); static const char *flrig_get_info(RIG *rig); @@ -124,8 +128,8 @@ const struct rig_caps flrig_caps = .has_get_func = RIG_FUNC_NONE, .has_set_func = RIG_FUNC_NONE, - .has_get_level = RIG_LEVEL_NONE, - .has_set_level = RIG_LEVEL_NONE, + .has_get_level = FLRIG_LEVELS, + .has_set_level = RIG_LEVEL_SET(FLRIG_LEVELS), .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .filters = { @@ -169,7 +173,9 @@ const struct rig_caps flrig_caps = .set_split_vfo = flrig_set_split_vfo, .get_split_vfo = flrig_get_split_vfo, .set_split_freq_mode = flrig_set_split_freq_mode, - .get_split_freq_mode = flrig_get_split_freq_mode + .get_split_freq_mode = flrig_get_split_freq_mode, + .set_level = flrig_set_level, + .get_level = flrig_get_level }; // Structure for mapping flrig dynmamic modes to hamlib modes @@ -1851,6 +1857,93 @@ static int flrig_get_split_freq_mode(RIG *rig, vfo_t vfo, freq_t *freq, return retval; } +static int flrig_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) +{ + int retval; + char cmd_arg[MAXARGLEN]; + char *cmd; + + rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s level=%d, val=%f\n", __func__, + rig_strvfo(vfo), (int)level, val.f); + + if (check_vfo(vfo) == FALSE) + { + rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %s\n", + __func__, rig_strvfo(vfo)); + return -RIG_EINVAL; + } + + sprintf(cmd_arg, + "<params><param><value><double>%d</double></value></param></params>", (int)val.f); + + switch (level) + { + case RIG_LEVEL_RF: cmd = "rig.set_rfgain"; break; + + case RIG_LEVEL_AF: cmd = "rig.set_volume"; break; + + case RIG_LEVEL_MICGAIN: cmd = "rig.set_micgain"; break; + + default: + rig_debug(RIG_DEBUG_ERR, "%s: invalid level=%d\n", __func__, (int)level); + return -RIG_EINVAL; + } + + retval = flrig_transaction(rig, cmd, cmd_arg, NULL, 0); + + if (retval < 0) + { + return retval; + } + + return RIG_OK; +} + +/* + * flrig_get_level + * Assumes rig!=NULL, rig->state.priv!=NULL, val!=NULL + */ +static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) +{ + char value[MAXARGLEN]; + char *cmd; + int retval; + + rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__, + rig_strvfo(vfo)); + + + switch (level) + { + case RIG_LEVEL_AF: cmd = "rig.get_volume"; break; + + case RIG_LEVEL_RF: cmd = "rig.get_rfgain"; break; + + case RIG_LEVEL_MICGAIN: cmd = "rig.get_micgain"; break; + + case RIG_LEVEL_STRENGTH: cmd = "rig.get_power"; break; + + default: + rig_debug(RIG_DEBUG_ERR, "%s: unknown level=%d\n", __func__, (int)level); + return -RIG_EINVAL; + } + + retval = flrig_transaction(rig, cmd, NULL, value, sizeof(value)); + + if (retval != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: flrig_transaction failed retval=%s\n", __func__, + rigerror(retval)); + return retval; + } + + val->f = atof(value); + + rig_debug(RIG_DEBUG_TRACE, "%s: val='%s'(%f)\n", __func__, value, val->f); + + return RIG_OK; +} + /* * flrig_get_info * assumes rig!=NULL diff --git a/rigs/dummy/flrig.h b/rigs/dummy/flrig.h index 8459eb8e..f49a1934 100644 --- a/rigs/dummy/flrig.h +++ b/rigs/dummy/flrig.h @@ -28,7 +28,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20200617" +#define BACKEND_VER "20201209" #define EOM "\r" #define TRUE 1 diff --git a/rigs/yaesu/ft9000.c b/rigs/yaesu/ft9000.c index 149a43df..cd573c37 100644 --- a/rigs/yaesu/ft9000.c +++ b/rigs/yaesu/ft9000.c @@ -93,6 +93,7 @@ const struct rig_caps ft9000_caps = .transceive = RIG_TRN_OFF, /* May enable later as the 9000 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, + .rfpower_meter_cal = FT9000_RFPOWER_METER_CAL, .str_cal = FT9000_STR_CAL, .chan_list = { /* TBC */ diff --git a/rigs/yaesu/ft9000.h b/rigs/yaesu/ft9000.h index 03525832..5d8f13ee 100644 --- a/rigs/yaesu/ft9000.h +++ b/rigs/yaesu/ft9000.h @@ -81,6 +81,25 @@ RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\ RIG_OP_TO_VFO|RIG_OP_FROM_VFO|RIG_OP_TOGGLE) +// Borrowed from FLRig -- Thanks to Dave W1HKJ +#define FT9000_RFPOWER_METER_CAL \ + { \ + 11, \ + { \ + {35, 10.0f}, \ + {53, 20.0f}, \ + {80, 40.0f}, \ + {97, 60.0f}, \ + {119, 80.0f}, \ + {137, 100.0f}, \ + {154, 120.0f}, \ + {167, 140.0f}, \ + {177, 160.0f}, \ + {188, 180.0f}, \ + {197, 200.0f}, \ + } \ + } + /* TBC */ #define FT9000_STR_CAL { 16, \ { \ diff --git a/rigs/yaesu/ftdx101.h b/rigs/yaesu/ftdx101.h index fe271b9e..b9c3230a 100644 --- a/rigs/yaesu/ftdx101.h +++ b/rigs/yaesu/ftdx101.h @@ -71,7 +71,7 @@ RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\ RIG_OP_TO_VFO|RIG_OP_FROM_VFO|RIG_OP_TOGGLE) -// Borrowed from FLRig -- Thanks to Dave W +// Borrowed from FLRig -- Thanks to Dave W1HKJ #define FTDX101D_RFPOWER_METER_CAL \ { \ 5, \ diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 0467857e..a088f0ca 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -4162,7 +4162,14 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return -RIG_ENAVAIL; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RM5%c", cat_term); + if (is_ftdx9000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RM08%c", cat_term); + } + else + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RM5%c", cat_term); + } break; case RIG_LEVEL_COMP_METER: commit 0a7c229f068daaf1d1be93f7410f06f8c7f71bd2 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 11 14:55:33 2020 -0600 Fix retries in newcat.c https://github.com/Hamlib/Hamlib/issues/463 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 4e00d6ea..0467857e 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -8963,6 +8963,7 @@ int newcat_get_cmd(RIG *rig) __func__, priv->ret_data); // we were using BUSBUSY but microham devices need retries //rc = -RIG_BUSBUSY; /* don't write command again */ + rc = -RIG_EPROTO; /* we could decrement retry_count here but there is a danger of infinite looping so we just use up @@ -9038,6 +9039,7 @@ int newcat_get_cmd(RIG *rig) // we were using BUSBUSY but microham devices need retries // this should be OK under all other circumstances too //rc = -RIG_BUSBUSY; /* retry read only */ + rc = -RIG_EPROTO; } } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 9ce0859e..0a88e03f 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201209" +#define NEWCAT_VER "20201211" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit f60f9e0181b4926729c7fbb88571152843440120 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 11 12:25:01 2020 -0600 Fix RFPOWER levels for ftdx101 https://github.com/Hamlib/Hamlib/issues/462 diff --git a/rigs/yaesu/ftdx101.c b/rigs/yaesu/ftdx101.c index c7f517fb..5152e05c 100644 --- a/rigs/yaesu/ftdx101.c +++ b/rigs/yaesu/ftdx101.c @@ -37,8 +37,6 @@ #include "newcat.h" #include "ftdx101.h" -cal_table_float_t yaesu_ftdx101d_swr_cal = FTDX101D_SWR_CAL; - const struct newcat_priv_caps ftdx101d_priv_caps = { .roofing_filter_count = 6, @@ -78,7 +76,7 @@ const struct rig_caps ftdx101d_caps = RIG_MODEL(RIG_MODEL_FTDX101D), .model_name = "FTDX101D", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".6", + .version = NEWCAT_VER ".7", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -119,6 +117,7 @@ const struct rig_caps ftdx101d_caps = .transceive = RIG_TRN_OFF, /* May enable later as the FTDX101 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, + .rfpower_meter_cal = FTDX101D_RFPOWER_METER_CAL, .swr_cal = FTDX101D_SWR_CAL, .chan_list = { { 1, 99, RIG_MTYPE_MEM, NEWCAT_MEM_CAP }, diff --git a/rigs/yaesu/ftdx101.h b/rigs/yaesu/ftdx101.h index 5e0309f4..fe271b9e 100644 --- a/rigs/yaesu/ftdx101.h +++ b/rigs/yaesu/ftdx101.h @@ -71,6 +71,19 @@ RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\ RIG_OP_TO_VFO|RIG_OP_FROM_VFO|RIG_OP_TOGGLE) +// Borrowed from FLRig -- Thanks to Dave W +#define FTDX101D_RFPOWER_METER_CAL \ + { \ + 5, \ + { \ + {35, 5.0f}, \ + {94, 25.0f}, \ + {147, 50.0f}, \ + {176, 75.0f}, \ + {205, 100.0f}, \ + } \ + } + // Based on testing with G3VPX Ian Sumner #define FTDX101D_SWR_CAL \ { \ ----------------------------------------------------------------------- Summary of changes: doc/man1/rigctl.1 | 2 + rigs/dummy/flrig.c | 113 +++++++++++++++++++++++++++++++++++++++++++++++++-- rigs/dummy/flrig.h | 2 +- rigs/icom/frame.c | 11 ++++- rigs/icom/icom.c | 65 ++++++++++++++++++++--------- rigs/icom/icom.h | 3 +- rigs/yaesu/ft1200.c | 1 + rigs/yaesu/ft1200.h | 14 +++++++ rigs/yaesu/ft450.c | 1 + rigs/yaesu/ft450.h | 14 +++++++ rigs/yaesu/ft891.c | 1 + rigs/yaesu/ft891.h | 10 +++++ rigs/yaesu/ft9000.c | 1 + rigs/yaesu/ft9000.h | 19 +++++++++ rigs/yaesu/ft950.c | 1 + rigs/yaesu/ft950.h | 17 +++++++- rigs/yaesu/ft991.c | 1 + rigs/yaesu/ft991.h | 14 +++++++ rigs/yaesu/ftdx101.c | 5 +-- rigs/yaesu/ftdx101.h | 13 ++++++ rigs/yaesu/newcat.c | 30 +++++++++++--- rigs/yaesu/newcat.h | 2 +- 22 files changed, 304 insertions(+), 36 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Nate B. <n0...@us...> - 2020-12-11 02:47:17
|
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, Hamlib-4.0 has been updated via d2fa649026d461830447fccbd3c3566aac2c9ed9 (commit) via 2d2475f56c5e59226b21375b5a16c0a2572fbea4 (commit) via dc5d3058eaf3ecc8820328600dca320cb9b006ee (commit) via d3a632f6b4265516783ddcc7ad47c138f0e9cc46 (commit) via e7c0239791fc88c2c9b05177d27041373a48dbc4 (commit) via 6f397021d462dfd50e0e79ef530a6a58b7ebb19e (commit) via 2b88342f8f11577b2f678174f154d667b3f948aa (commit) from 058cf38b87e1130eb7d6768fb25434047d0dcc36 (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 d2fa649026d461830447fccbd3c3566aac2c9ed9 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 18:09:49 2020 -0600 Fix retry_save during Yaesu poweron (cherry picked from commit 7a93ce3fb23b5a2ecdb69cc32f5de3b2e4395446) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index dba7042c..4e00d6ea 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2885,7 +2885,10 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) hl_usleep(1000000); retval = rig_get_freq(rig, RIG_VFO_A, &freq); - if (retval == RIG_OK) { return retval; } + if (retval == RIG_OK) { + rig->state.rigport.retry = retry_save; + return retval; + } rig_debug(RIG_DEBUG_TRACE, "%s: Wait #%d for power up\n", __func__, i + 1); } commit 2d2475f56c5e59226b21375b5a16c0a2572fbea4 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 17:48:09 2020 -0600 Fix newcat SH parsing (cherry picked from commit 504a01913fcb07f7b3ad67c63d9717339286d349) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 09cd2b4c..dba7042c 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -7622,11 +7622,14 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) return err; } - if (sscanf(priv->ret_data, "SH%3d;", &w) != 1 && - sscanf(priv->ret_data, "SH0%3d;", &w) != 1) + if (sscanf(priv->ret_data, "SH0%3d;", &w) != 1) { - err = -RIG_EPROTO; + if (sscanf(priv->ret_data, "SH%3d;", &w) != 1) + { + err = -RIG_EPROTO; + } } + rig_debug(RIG_DEBUG_TRACE, "%s: w=%d\n", __func__, w); if (err != RIG_OK) { @@ -7634,8 +7637,6 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) priv->ret_data); return -RIG_EPROTO; } - - rig_debug(RIG_DEBUG_TRACE, "%s: w=%d\n", __func__, w); } else { @@ -8929,6 +8930,7 @@ int newcat_get_cmd(RIG *rig) { if (rc != -RIG_BUSBUSY) { + rig_flush(&state->rigport); /* discard any unsolicited data */ /* send the command */ rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s\n", priv->cmd_str); commit dc5d3058eaf3ecc8820328600dca320cb9b006ee Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 16:58:16 2020 -0600 Change newcat.c set_powerstat=1 to loop logic same as kenwood https://github.com/Hamlib/Hamlib/issues/459 (cherry picked from commit 132991179968553b88bff31944fb5499fc295e85) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index fb2ed951..09cd2b4c 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2839,7 +2839,9 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) { struct rig_state *state = &rig->state; struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; - int err; + int retval; + int i; + int retry_save; char ps; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -2870,11 +2872,36 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PS%c%c", ps, cat_term); - err = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)); + retval = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)); - if (ps) hl_usleep(1000000); // give it a second to turn on + retry_save = rig->state.rigport.retry; + rig->state.rigport.retry = 0; - return err; + if (status == RIG_POWER_ON) // wait for wakeup only + { + for (i = 0; i < 8; ++i) // up to ~10 seconds including the timeouts + { + freq_t freq; + hl_usleep(1000000); + retval = rig_get_freq(rig, RIG_VFO_A, &freq); + + if (retval == RIG_OK) { return retval; } + + rig_debug(RIG_DEBUG_TRACE, "%s: Wait #%d for power up\n", __func__, i + 1); + } + } + + rig->state.rigport.retry = retry_save; + + if (i == 9) + { + rig_debug(RIG_DEBUG_TRACE, "%s: timeout waiting for powerup, try %d\n", + __func__, + i + 1); + retval = -RIG_ETIMEOUT; + } + + return retval; } commit d3a632f6b4265516783ddcc7ad47c138f0e9cc46 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 16:17:03 2020 -0600 Only sleep on power on for Yaesu rigs (cherry picked from commit 679c84f3eef8c387a013bd98b68af8d430373b74) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 5e6a7de0..fb2ed951 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2872,7 +2872,7 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) err = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)); - hl_usleep(1000000); // give it a second to turn on + if (ps) hl_usleep(1000000); // give it a second to turn on return err; } commit e7c0239791fc88c2c9b05177d27041373a48dbc4 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 16:15:13 2020 -0600 Add 1 second sleep after power on for Yaesu rigs https://github.com/Hamlib/Hamlib/issues/459 (cherry picked from commit 79e2263dfb4ca12e9b63bde380e549718b1a0556) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 3ebcd754..5e6a7de0 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2871,6 +2871,8 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PS%c%c", ps, cat_term); err = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)); + + hl_usleep(1000000); // give it a second to turn on return err; } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 39cf2b88..9ce0859e 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201207" +#define NEWCAT_VER "20201209" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 6f397021d462dfd50e0e79ef530a6a58b7ebb19e Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 16:12:31 2020 -0600 Fix a few cppcheck warnings (cherry picked from commit ac1cb518b0dba4d676168448010c93813bee8c40) diff --git a/rotators/indi/indi_wrapper.cpp b/rotators/indi/indi_wrapper.cpp index df616999..50baae42 100644 --- a/rotators/indi/indi_wrapper.cpp +++ b/rotators/indi/indi_wrapper.cpp @@ -58,7 +58,7 @@ int RotINDIClient::setSpeed(int speedPercent) int speed = DIV_ROUND_UP(speedPercent, 10); - for (int i = 1; i <= 10; i++) + for (unsigned int i = 1; i <= 10; i++) { char switchName[4]; snprintf(switchName, sizeof(switchName), "%ux", i); @@ -519,10 +519,9 @@ void RotINDIClient::serverDisconnected(int exit_code) const char *RotINDIClient::getInfo(void) { - static char info[128]; - if (mTelescope && mTelescope->isConnected()) { + static char info[128]; snprintf(info, sizeof(info), "using INDI device %s", mTelescope->getDeviceName()); return info; commit 2b88342f8f11577b2f678174f154d667b3f948aa Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 10:31:28 2020 -0600 Remove get_vfo permanently from ft891.c https://github.com/Hamlib/Hamlib/issues/455 (cherry picked from commit f4c12adb850c8717812aeeb749d26762677923e6) diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index 74120e4a..1c4b3c7d 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -192,7 +192,6 @@ const struct rig_caps ft891_caps = .get_freq = newcat_get_freq, .set_mode = ft891_set_mode, .get_mode = newcat_get_mode, -// .get_vfo = newcat_get_vfo, .set_ptt = newcat_set_ptt, .get_ptt = newcat_get_ptt, .set_split_vfo = ft891_set_split_vfo, ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/ft891.c | 1 - rigs/yaesu/newcat.c | 50 +++++++++++++++++++++++++++++++++++------- rigs/yaesu/newcat.h | 2 +- rotators/indi/indi_wrapper.cpp | 5 ++--- 4 files changed, 45 insertions(+), 13 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-12-10 23:38:29
|
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 9fa31392b059e4eaadad9e9d62aaa70c32869f28 (commit) via b6d6c5d9663d9625efe6de4663751437740448ff (commit) via 7a93ce3fb23b5a2ecdb69cc32f5de3b2e4395446 (commit) via 504a01913fcb07f7b3ad67c63d9717339286d349 (commit) via 132991179968553b88bff31944fb5499fc295e85 (commit) via 679c84f3eef8c387a013bd98b68af8d430373b74 (commit) via 79e2263dfb4ca12e9b63bde380e549718b1a0556 (commit) via ac1cb518b0dba4d676168448010c93813bee8c40 (commit) via f4c12adb850c8717812aeeb749d26762677923e6 (commit) from 15958c8aab8dfcadecb2cc27c13d948b2a6d8764 (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 9fa31392b059e4eaadad9e9d62aaa70c32869f28 Merge: b6d6c5d9 7a93ce3f Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 22:20:14 2020 -0600 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit b6d6c5d9663d9625efe6de4663751437740448ff Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 18:13:58 2020 -0600 Fix retry_save for Kenwood rigs diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 57e0d739..13adb590 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -3885,7 +3885,11 @@ int kenwood_set_powerstat(RIG *rig, powerstat_t status) sleep(1); retval = rig_get_freq(rig, RIG_VFO_A, &freq); - if (retval == RIG_OK) { return retval; } + if (retval == RIG_OK) + { + rig->state.rigport.retry = retry_save; + return retval; + } rig_debug(RIG_DEBUG_TRACE, "%s: Wait #%d for power up\n", __func__, i + 1); } commit 7a93ce3fb23b5a2ecdb69cc32f5de3b2e4395446 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 18:09:49 2020 -0600 Fix retry_save during Yaesu poweron diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index dba7042c..4e00d6ea 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2885,7 +2885,10 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) hl_usleep(1000000); retval = rig_get_freq(rig, RIG_VFO_A, &freq); - if (retval == RIG_OK) { return retval; } + if (retval == RIG_OK) { + rig->state.rigport.retry = retry_save; + return retval; + } rig_debug(RIG_DEBUG_TRACE, "%s: Wait #%d for power up\n", __func__, i + 1); } commit 504a01913fcb07f7b3ad67c63d9717339286d349 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 17:48:09 2020 -0600 Fix newcat SH parsing diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 09cd2b4c..dba7042c 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -7622,11 +7622,14 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) return err; } - if (sscanf(priv->ret_data, "SH%3d;", &w) != 1 && - sscanf(priv->ret_data, "SH0%3d;", &w) != 1) + if (sscanf(priv->ret_data, "SH0%3d;", &w) != 1) { - err = -RIG_EPROTO; + if (sscanf(priv->ret_data, "SH%3d;", &w) != 1) + { + err = -RIG_EPROTO; + } } + rig_debug(RIG_DEBUG_TRACE, "%s: w=%d\n", __func__, w); if (err != RIG_OK) { @@ -7634,8 +7637,6 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) priv->ret_data); return -RIG_EPROTO; } - - rig_debug(RIG_DEBUG_TRACE, "%s: w=%d\n", __func__, w); } else { @@ -8929,6 +8930,7 @@ int newcat_get_cmd(RIG *rig) { if (rc != -RIG_BUSBUSY) { + rig_flush(&state->rigport); /* discard any unsolicited data */ /* send the command */ rig_debug(RIG_DEBUG_TRACE, "cmd_str = %s\n", priv->cmd_str); commit 132991179968553b88bff31944fb5499fc295e85 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 16:58:16 2020 -0600 Change newcat.c set_powerstat=1 to loop logic same as kenwood https://github.com/Hamlib/Hamlib/issues/459 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index fb2ed951..09cd2b4c 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2839,7 +2839,9 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) { struct rig_state *state = &rig->state; struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; - int err; + int retval; + int i; + int retry_save; char ps; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -2870,11 +2872,36 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PS%c%c", ps, cat_term); - err = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)); + retval = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)); - if (ps) hl_usleep(1000000); // give it a second to turn on + retry_save = rig->state.rigport.retry; + rig->state.rigport.retry = 0; - return err; + if (status == RIG_POWER_ON) // wait for wakeup only + { + for (i = 0; i < 8; ++i) // up to ~10 seconds including the timeouts + { + freq_t freq; + hl_usleep(1000000); + retval = rig_get_freq(rig, RIG_VFO_A, &freq); + + if (retval == RIG_OK) { return retval; } + + rig_debug(RIG_DEBUG_TRACE, "%s: Wait #%d for power up\n", __func__, i + 1); + } + } + + rig->state.rigport.retry = retry_save; + + if (i == 9) + { + rig_debug(RIG_DEBUG_TRACE, "%s: timeout waiting for powerup, try %d\n", + __func__, + i + 1); + retval = -RIG_ETIMEOUT; + } + + return retval; } commit 679c84f3eef8c387a013bd98b68af8d430373b74 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 16:17:03 2020 -0600 Only sleep on power on for Yaesu rigs diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 5e6a7de0..fb2ed951 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2872,7 +2872,7 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) err = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)); - hl_usleep(1000000); // give it a second to turn on + if (ps) hl_usleep(1000000); // give it a second to turn on return err; } commit 79e2263dfb4ca12e9b63bde380e549718b1a0556 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 16:15:13 2020 -0600 Add 1 second sleep after power on for Yaesu rigs https://github.com/Hamlib/Hamlib/issues/459 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 3ebcd754..5e6a7de0 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2871,6 +2871,8 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PS%c%c", ps, cat_term); err = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)); + + hl_usleep(1000000); // give it a second to turn on return err; } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 39cf2b88..9ce0859e 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201207" +#define NEWCAT_VER "20201209" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit ac1cb518b0dba4d676168448010c93813bee8c40 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 16:12:31 2020 -0600 Fix a few cppcheck warnings diff --git a/rotators/indi/indi_wrapper.cpp b/rotators/indi/indi_wrapper.cpp index df616999..50baae42 100644 --- a/rotators/indi/indi_wrapper.cpp +++ b/rotators/indi/indi_wrapper.cpp @@ -58,7 +58,7 @@ int RotINDIClient::setSpeed(int speedPercent) int speed = DIV_ROUND_UP(speedPercent, 10); - for (int i = 1; i <= 10; i++) + for (unsigned int i = 1; i <= 10; i++) { char switchName[4]; snprintf(switchName, sizeof(switchName), "%ux", i); @@ -519,10 +519,9 @@ void RotINDIClient::serverDisconnected(int exit_code) const char *RotINDIClient::getInfo(void) { - static char info[128]; - if (mTelescope && mTelescope->isConnected()) { + static char info[128]; snprintf(info, sizeof(info), "using INDI device %s", mTelescope->getDeviceName()); return info; commit f4c12adb850c8717812aeeb749d26762677923e6 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 9 10:31:28 2020 -0600 Remove get_vfo permanently from ft891.c https://github.com/Hamlib/Hamlib/issues/455 diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index 74120e4a..1c4b3c7d 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -192,7 +192,6 @@ const struct rig_caps ft891_caps = .get_freq = newcat_get_freq, .set_mode = ft891_set_mode, .get_mode = newcat_get_mode, -// .get_vfo = newcat_get_vfo, .set_ptt = newcat_set_ptt, .get_ptt = newcat_get_ptt, .set_split_vfo = ft891_set_split_vfo, ----------------------------------------------------------------------- Summary of changes: rigs/kenwood/kenwood.c | 6 ++++- rigs/yaesu/ft891.c | 1 - rigs/yaesu/newcat.c | 50 +++++++++++++++++++++++++++++++++++------- rigs/yaesu/newcat.h | 2 +- rotators/indi/indi_wrapper.cpp | 5 ++--- 5 files changed, 50 insertions(+), 14 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Nate B. <n0...@us...> - 2020-12-07 13:21:37
|
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, Hamlib-4.0 has been updated via 058cf38b87e1130eb7d6768fb25434047d0dcc36 (commit) via 4b34316dc685ab4dd0659009f277c180ad487e3e (commit) from da275881623af0ec34ffce32d3e95c3b7fdc1d25 (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 058cf38b87e1130eb7d6768fb25434047d0dcc36 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 6 22:54:47 2020 -0600 Fix parsing of SH command in newcat.c Remove get_vfo from FT-891 https://github.com/Hamlib/Hamlib/issues/455 (cherry picked from commit 15958c8aab8dfcadecb2cc27c13d948b2a6d8764) diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index d2131d84..74120e4a 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -50,7 +50,7 @@ const struct rig_caps ft891_caps = RIG_MODEL(RIG_MODEL_FT891), .model_name = "FT-891", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".1", + .version = NEWCAT_VER ".2", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -192,7 +192,7 @@ const struct rig_caps ft891_caps = .get_freq = newcat_get_freq, .set_mode = ft891_set_mode, .get_mode = newcat_get_mode, - .get_vfo = newcat_get_vfo, +// .get_vfo = newcat_get_vfo, .set_ptt = newcat_set_ptt, .get_ptt = newcat_get_ptt, .set_split_vfo = ft891_set_split_vfo, diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 57226e4f..3ebcd754 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -7593,25 +7593,10 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) return err; } - if (strlen(priv->ret_data) == 7) + if (sscanf(priv->ret_data, "SH%3d;", &w) != 1 && + sscanf(priv->ret_data, "SH0%3d;", &w) != 1) { - if (sscanf(priv->ret_data, "SH%*1d0%3d", &w) != 1) - { - err = -RIG_EPROTO; - } - } - else if (strlen(priv->ret_data) == 6) - { - if (sscanf(priv->ret_data, "SH%*1d%3d", &w) != 1) - { - err = -RIG_EPROTO; - } - } - else - { - rig_debug(RIG_DEBUG_ERR, "%s: unknown SH response='%s'\n", __func__, - priv->ret_data); - return -RIG_EPROTO; + err = -RIG_EPROTO; } if (err != RIG_OK) diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 02d121af..39cf2b88 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201206" +#define NEWCAT_VER "20201207" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 diff --git a/tests/example.c b/tests/example.c index 4d895d09..86b8bc67 100644 --- a/tests/example.c +++ b/tests/example.c @@ -12,8 +12,8 @@ #include <string.h> #include <hamlib/rig.h> #include <hamlib/riglist.h> -#include <hamlib/rotator.h> #include "sprintflst.h" +#include <hamlib/rotator.h> #if 0 #define MODEL RIG_MODEL_DUMMY @@ -131,7 +131,7 @@ int main() if (range) { char vfolist[256]; - sprintf_vfo(vfolist, my_rig->state.vfo_list); + rig_sprintf_vfo(vfolist, my_rig->state.vfo_list); printf("Range start=%"PRIfreq", end=%"PRIfreq", low_power=%d, high_power=%d, vfos=%s\n", range->startf, range->endf, range->low_power, range->high_power, vfolist); } commit 4b34316dc685ab4dd0659009f277c180ad487e3e Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 6 15:04:51 2020 -0600 Add version check for lutest to only to 64-bit when 5.4 or greater (cherry picked from commit 30389216555cb3dce8f1897ee97ae48b11e14b48) diff --git a/bindings/luatest.lua b/bindings/luatest.lua index dd768745..3d097920 100755 --- a/bindings/luatest.lua +++ b/bindings/luatest.lua @@ -5,6 +5,16 @@ Hamlib = require("Hamliblua") -- you can see the Hamlib properties: -- for key,value in pairs(Hamlib) do print(key,value) end +function version() + ver = string.sub(_VERSION,4) + -- should only get one match to this + for ver2 in string.gmatch(ver,"%d.%d") do + ver = tonumber(ver2) + end + return ver +end + + function doStartup() print(string.format("%s test, %s\n", _VERSION, Hamlib.hamlib_version)) @@ -107,9 +117,13 @@ function doStartup() if sw2 > 0 then D = 'S' else D = 'N' end print(string.format("Latitude:\t%4.4f, %4.0f° %.0f' %2.0f\" %1s\trecoded: %9.4f", lat1, deg2, mins2, sec2, D, lat3)) - print(string.format("The next two lines should show 0x8000000000000000")); - print(string.format("RIG_MODE_TESTS_MAX: 0x%08x", Hamlib.RIG_MODE_TESTS_MAX)); - print(string.format("RIG_FUNC_BIT63: 0x%08x", Hamlib.RIG_FUNC_BIT63)); + if (version() >= 5.4) then + -- older version may not handle 64-bit values + -- not sure when this was fixed...might have been 5.3 somehwere + print(string.format("The next two lines should show 0x8000000000000000")); + print(string.format("RIG_MODE_TESTS_MAX: 0x%08x", Hamlib.RIG_MODE_TESTS_MAX)); + print(string.format("RIG_FUNC_BIT63: 0x%08x", Hamlib.RIG_FUNC_BIT63)); + end end ----------------------------------------------------------------------- Summary of changes: bindings/luatest.lua | 20 +++++++++++++++++--- rigs/yaesu/ft891.c | 4 ++-- rigs/yaesu/newcat.c | 21 +++------------------ rigs/yaesu/newcat.h | 2 +- tests/example.c | 4 ++-- 5 files changed, 25 insertions(+), 26 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-12-07 04:59:29
|
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 15958c8aab8dfcadecb2cc27c13d948b2a6d8764 (commit) via 30389216555cb3dce8f1897ee97ae48b11e14b48 (commit) from 1b2236bb2e031ec4ff4d3242b31e38c8e19f46b9 (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 15958c8aab8dfcadecb2cc27c13d948b2a6d8764 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 6 22:54:47 2020 -0600 Fix parsing of SH command in newcat.c Remove get_vfo from FT-891 https://github.com/Hamlib/Hamlib/issues/455 diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index d2131d84..74120e4a 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -50,7 +50,7 @@ const struct rig_caps ft891_caps = RIG_MODEL(RIG_MODEL_FT891), .model_name = "FT-891", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".1", + .version = NEWCAT_VER ".2", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -192,7 +192,7 @@ const struct rig_caps ft891_caps = .get_freq = newcat_get_freq, .set_mode = ft891_set_mode, .get_mode = newcat_get_mode, - .get_vfo = newcat_get_vfo, +// .get_vfo = newcat_get_vfo, .set_ptt = newcat_set_ptt, .get_ptt = newcat_get_ptt, .set_split_vfo = ft891_set_split_vfo, diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 57226e4f..3ebcd754 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -7593,25 +7593,10 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) return err; } - if (strlen(priv->ret_data) == 7) + if (sscanf(priv->ret_data, "SH%3d;", &w) != 1 && + sscanf(priv->ret_data, "SH0%3d;", &w) != 1) { - if (sscanf(priv->ret_data, "SH%*1d0%3d", &w) != 1) - { - err = -RIG_EPROTO; - } - } - else if (strlen(priv->ret_data) == 6) - { - if (sscanf(priv->ret_data, "SH%*1d%3d", &w) != 1) - { - err = -RIG_EPROTO; - } - } - else - { - rig_debug(RIG_DEBUG_ERR, "%s: unknown SH response='%s'\n", __func__, - priv->ret_data); - return -RIG_EPROTO; + err = -RIG_EPROTO; } if (err != RIG_OK) diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 02d121af..39cf2b88 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201206" +#define NEWCAT_VER "20201207" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 diff --git a/tests/example.c b/tests/example.c index 4d895d09..86b8bc67 100644 --- a/tests/example.c +++ b/tests/example.c @@ -12,8 +12,8 @@ #include <string.h> #include <hamlib/rig.h> #include <hamlib/riglist.h> -#include <hamlib/rotator.h> #include "sprintflst.h" +#include <hamlib/rotator.h> #if 0 #define MODEL RIG_MODEL_DUMMY @@ -131,7 +131,7 @@ int main() if (range) { char vfolist[256]; - sprintf_vfo(vfolist, my_rig->state.vfo_list); + rig_sprintf_vfo(vfolist, my_rig->state.vfo_list); printf("Range start=%"PRIfreq", end=%"PRIfreq", low_power=%d, high_power=%d, vfos=%s\n", range->startf, range->endf, range->low_power, range->high_power, vfolist); } commit 30389216555cb3dce8f1897ee97ae48b11e14b48 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 6 15:04:51 2020 -0600 Add version check for lutest to only to 64-bit when 5.4 or greater diff --git a/bindings/luatest.lua b/bindings/luatest.lua index dd768745..3d097920 100755 --- a/bindings/luatest.lua +++ b/bindings/luatest.lua @@ -5,6 +5,16 @@ Hamlib = require("Hamliblua") -- you can see the Hamlib properties: -- for key,value in pairs(Hamlib) do print(key,value) end +function version() + ver = string.sub(_VERSION,4) + -- should only get one match to this + for ver2 in string.gmatch(ver,"%d.%d") do + ver = tonumber(ver2) + end + return ver +end + + function doStartup() print(string.format("%s test, %s\n", _VERSION, Hamlib.hamlib_version)) @@ -107,9 +117,13 @@ function doStartup() if sw2 > 0 then D = 'S' else D = 'N' end print(string.format("Latitude:\t%4.4f, %4.0f° %.0f' %2.0f\" %1s\trecoded: %9.4f", lat1, deg2, mins2, sec2, D, lat3)) - print(string.format("The next two lines should show 0x8000000000000000")); - print(string.format("RIG_MODE_TESTS_MAX: 0x%08x", Hamlib.RIG_MODE_TESTS_MAX)); - print(string.format("RIG_FUNC_BIT63: 0x%08x", Hamlib.RIG_FUNC_BIT63)); + if (version() >= 5.4) then + -- older version may not handle 64-bit values + -- not sure when this was fixed...might have been 5.3 somehwere + print(string.format("The next two lines should show 0x8000000000000000")); + print(string.format("RIG_MODE_TESTS_MAX: 0x%08x", Hamlib.RIG_MODE_TESTS_MAX)); + print(string.format("RIG_FUNC_BIT63: 0x%08x", Hamlib.RIG_FUNC_BIT63)); + end end ----------------------------------------------------------------------- Summary of changes: bindings/luatest.lua | 20 +++++++++++++++++--- rigs/yaesu/ft891.c | 4 ++-- rigs/yaesu/newcat.c | 21 +++------------------ rigs/yaesu/newcat.h | 2 +- tests/example.c | 4 ++-- 5 files changed, 25 insertions(+), 26 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Nate B. <n0...@us...> - 2020-12-06 15:27:17
|
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, Hamlib-4.0 has been updated via da275881623af0ec34ffce32d3e95c3b7fdc1d25 (commit) via afa8561ac89330ec84cda128dd2637a3e632321b (commit) via bb655924f5e69566273dd131873b8c9f6b2d9e63 (commit) via cbc1e03c7cd8a012d10692d67b04d8527e6cf9d8 (commit) via 8eb44409527c8e7df3a3d47fcea4e2d64d544e41 (commit) via 1fb9a32877e7debe2d8526656368615ac4e4be3b (commit) via 6659acd53f029e996437ea08a08f39dbbf3bd8cf (commit) via f55efa984b5afa3ab20b49e9eb1ba8a93d851b65 (commit) via deeb7beb362e890c6764d0dc900222e00d31aaf7 (commit) via 196a97eab8cc1eb79eacff3198fd7fd0d04a2019 (commit) from 763bb9ae556ba7dc5ee571cab2ebaa9bf65fa1e9 (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 da275881623af0ec34ffce32d3e95c3b7fdc1d25 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 6 08:49:13 2020 -0600 Fix example.c to include rotator.h (cherry picked from commit 1b2236bb2e031ec4ff4d3242b31e38c8e19f46b9) diff --git a/tests/example.c b/tests/example.c index f021b980..4d895d09 100644 --- a/tests/example.c +++ b/tests/example.c @@ -12,6 +12,7 @@ #include <string.h> #include <hamlib/rig.h> #include <hamlib/riglist.h> +#include <hamlib/rotator.h> #include "sprintflst.h" #if 0 commit afa8561ac89330ec84cda128dd2637a3e632321b Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 6 08:41:37 2020 -0600 Fix ft891 set_mode https://github.com/Hamlib/Hamlib/issues/455 (cherry picked from commit a0829063d8cd4f638ee726b7ce81d2db5100322d) diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index f33e2652..d2131d84 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -50,7 +50,7 @@ const struct rig_caps ft891_caps = RIG_MODEL(RIG_MODEL_FT891), .model_name = "FT-891", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".0", + .version = NEWCAT_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -507,7 +507,7 @@ int ft891_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) // Copy A to B snprintf(priv->cmd_str, sizeof(priv->cmd_str), "AB;"); - if (RIG_OK != (err = newcat_get_cmd(rig))) + if (RIG_OK != (err = newcat_set_cmd(rig))) { return err; } commit bb655924f5e69566273dd131873b8c9f6b2d9e63 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 6 08:20:11 2020 -0600 Update newcat.h version (cherry picked from commit 1c86ef28cfac1fcead103cf0090f39b58dddc94e) diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 4443fd03..02d121af 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201204" +#define NEWCAT_VER "20201206" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit cbc1e03c7cd8a012d10692d67b04d8527e6cf9d8 Author: Mikael Nousiainen <mik...@ik...> Date: Sun Dec 6 14:25:29 2020 +0200 Remove TODOs (cherry picked from commit 2526fa2ae306fe102f3d4c6750b7a661403b9583) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 61664dc6..57226e4f 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2868,9 +2868,6 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) return -RIG_ENAVAIL; } - // TODO: According to FTDX3000 CAT manual: "This command requires dummy data be initially sent. Then after one second and before two seconds the command is sent." - // TODO: According to FTDX5000 CAT manual: "Send the PS1; command twice every one second." - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PS%c%c", ps, cat_term); err = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)); @@ -7563,7 +7560,6 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) return err; } - // TODO: check if ft-2000 needs this fix too? if (is_ft950 || is_ftdx5000) { // Some Yaesu rigs cannot query SH in modes such as AM/FM commit 8eb44409527c8e7df3a3d47fcea4e2d64d544e41 Author: Mikael Nousiainen <mik...@ik...> Date: Sun Dec 6 14:21:39 2020 +0200 Do not expect a reply from GS-232B stop command. Fix GS-232B retry error code. (cherry picked from commit b062ddce22056cf2f7f3060cbcee132784ff621d) diff --git a/rotators/gs232a/gs232b.c b/rotators/gs232a/gs232b.c index 8a5bf593..b085a29a 100644 --- a/rotators/gs232a/gs232b.c +++ b/rotators/gs232a/gs232b.c @@ -106,13 +106,12 @@ transaction_write: retval = read_string(&rs->rotport, data, data_len, REPLY_EOM, strlen(REPLY_EOM)); - if (strncmp(data, "\r\n", 2) == 0 - || strchr(data, '>')) + if (strncmp(data, "\r\n", 2) == 0 || strchr(data, '>')) { - rig_debug(RIG_DEBUG_ERR, "%s: wrong response nbytes=%d\n", __func__, - (int)strlen(data)); + rig_debug(RIG_DEBUG_ERR, "%s: Invalid response for '%s': '%s' (length=%d)\n", + __func__, cmdstr, data, (int) strlen(data)); dump_hex((unsigned char *)data, strlen(data)); - retval = -1; // force retry + retval = -RIG_EPROTO; // force retry } @@ -253,13 +252,12 @@ gs232b_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) static int gs232b_rot_stop(ROT *rot) { - char buf[32]; int retval; rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); /* All Stop */ - retval = gs232b_transaction(rot, "S" EOM, buf, sizeof(buf), 0); + retval = gs232b_transaction(rot, "S" EOM, NULL, 0, 0); if (retval != RIG_OK) { commit 1fb9a32877e7debe2d8526656368615ac4e4be3b Author: Mikael Nousiainen <mik...@ik...> Date: Sun Dec 6 00:11:44 2020 +0200 Tuning FT-2000 filter code (cherry picked from commit 5be6a06e9a107109b4f2d188f0fe1fe4870a4387) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index ead6e0c8..61664dc6 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -7545,7 +7545,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) int err; int w; int sh_command_valid = 1; - char narrow = '!'; + int narrow = 0; char cmd[] = "SH"; char main_sub_vfo = '0'; @@ -8473,6 +8473,11 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) } /* end if is_ftdx101 */ else if (is_ft2000) { + if ((narrow = get_narrow(rig, RIG_VFO_MAIN)) < 0) + { + return -RIG_EPROTO; + } + switch (mode) { case RIG_MODE_CW: @@ -8497,17 +8502,13 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) case RIG_MODE_PKTUSB: case RIG_MODE_PKTLSB: - if (w <= 4) + if (w <= 8) { *width = 200; } - else if (w <= 6) - { - *width = 500; - } else if (w <= 16) { - *width = 2400; + *width = 500; } else { commit 6659acd53f029e996437ea08a08f39dbbf3bd8cf Author: Mikael Nousiainen <mik...@ik...> Date: Sun Dec 6 00:00:15 2020 +0200 Tuning FT-2000 filter code (cherry picked from commit 72cc9b773cf3f7471621526e166c5e0ad5be3849) diff --git a/rigs/yaesu/ft2000.c b/rigs/yaesu/ft2000.c index 67d7944a..e246da3e 100644 --- a/rigs/yaesu/ft2000.c +++ b/rigs/yaesu/ft2000.c @@ -194,10 +194,9 @@ const struct rig_caps ft2000_caps = {RIG_MODE_SSB, Hz(1800)}, /* Narrow SSB */ {RIG_MODE_SSB, Hz(3000)}, /* Wide SSB */ {RIG_MODE_SSB, Hz(4000)}, /* Wide SSB */ - {FT2000_PKTSSB_RX_MODES, Hz(2400)}, /* Normal PKTSSB */ - {FT2000_PKTSSB_RX_MODES, Hz(1800)}, /* Narrow PKTSSB */ - {FT2000_PKTSSB_RX_MODES, Hz(3000)}, /* Wide PKTSSB */ - {FT2000_PKTSSB_RX_MODES, Hz(4000)}, /* Wide PKTSSB */ + {FT2000_PKTSSB_RX_MODES, Hz(500)}, /* Normal PKTSSB */ + {FT2000_PKTSSB_RX_MODES, Hz(200)}, /* Narrow PKTSSB */ + {FT2000_PKTSSB_RX_MODES, Hz(2400)}, /* Wide PKTSSB */ {FT2000_AM_RX_MODES, Hz(9000)}, /* Normal AM */ {FT2000_AM_RX_MODES, Hz(6000)}, /* Narrow AM */ {FT2000_FM_RX_MODES, Hz(16000)}, /* Normal FM */ diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 9a0b7eef..ead6e0c8 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -6642,7 +6642,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_AM: case RIG_MODE_FM: case RIG_MODE_PKTFM: - if (width < rig_passband_normal(rig, mode)) + if (width > 0 && width < rig_passband_normal(rig, mode)) { err = newcat_set_narrow(rig, vfo, TRUE); } @@ -6734,7 +6734,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_AM: case RIG_MODE_FM: case RIG_MODE_PKTFM: - if (width < rig_passband_normal(rig, mode)) + if (width > 0 && width < rig_passband_normal(rig, mode)) { err = newcat_set_narrow(rig, vfo, TRUE); } @@ -6875,7 +6875,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) return err; case RIG_MODE_PKTFM: - if (width < rig_passband_normal(rig, mode)) + if (width > 0 && width < rig_passband_normal(rig, mode)) { err = newcat_set_narrow(rig, vfo, TRUE); } @@ -6992,7 +6992,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_FM: case RIG_MODE_PKTFM: case RIG_MODE_FMN: - if (width < rig_passband_normal(rig, mode)) + if (width > 0 && width < rig_passband_normal(rig, mode)) { err = newcat_set_narrow(rig, vfo, TRUE); } @@ -7104,7 +7104,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_FM: case RIG_MODE_PKTFM: case RIG_MODE_FMN: - if (width < rig_passband_normal(rig, mode)) + if (width > 0 && width < rig_passband_normal(rig, mode)) { err = newcat_set_narrow(rig, vfo, TRUE); } @@ -7199,7 +7199,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_AM: case RIG_MODE_FM: case RIG_MODE_PKTFM: - if (width < rig_passband_normal(rig, mode)) + if (width > 0 && width < rig_passband_normal(rig, mode)) { err = newcat_set_narrow(rig, vfo, TRUE); } @@ -7234,6 +7234,19 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) break; + case RIG_MODE_PKTUSB: + case RIG_MODE_PKTLSB: + // Narrow mode overrides DSP filter width on FT-2000 + newcat_set_narrow(rig, vfo, FALSE); + + // Packet SSB bandwidth is 2400 Hz at value 31 + if (width == RIG_PASSBAND_NORMAL) { w = 31; } + else if (width <= 200) { w = 8; } + else if (width <= 500) { w = 16; } + else { w = 31; } // 2400 + + break; + case RIG_MODE_RTTY: case RIG_MODE_RTTYR: // Narrow mode overrides DSP filter width on FT-2000 @@ -7246,8 +7259,6 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) break; - case RIG_MODE_PKTUSB: - case RIG_MODE_PKTLSB: case RIG_MODE_LSB: case RIG_MODE_USB: // Narrow mode overrides DSP filter width on FT-2000 @@ -7264,17 +7275,6 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_AM: case RIG_MODE_FM: case RIG_MODE_PKTFM: - if (width < rig_passband_normal(rig, mode)) - { - err = newcat_set_narrow(rig, vfo, TRUE); - } - else - { - err = newcat_set_narrow(rig, vfo, FALSE); - } - - return err; - case RIG_MODE_AMN: case RIG_MODE_FMN: return RIG_OK; @@ -7295,7 +7295,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_FM: case RIG_MODE_PKTFM: case RIG_MODE_FMN: - if (width < rig_passband_normal(rig, mode)) + if (width > 0 && width < rig_passband_normal(rig, mode)) { err = newcat_set_narrow(rig, vfo, TRUE); } @@ -7338,7 +7338,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_AM: case RIG_MODE_FM: case RIG_MODE_PKTFM: - if (width < rig_passband_normal(rig, mode)) + if (width > 0 && width < rig_passband_normal(rig, mode)) { err = newcat_set_narrow(rig, vfo, TRUE); } @@ -8477,6 +8477,26 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { case RIG_MODE_CW: case RIG_MODE_CWR: + if (w <= 4) + { + *width = 200; + } + else if (w <= 6) + { + *width = 500; + } + else if (w <= 16) + { + *width = 2400; + } + else + { + *width = 3000; + } + break; + + case RIG_MODE_PKTUSB: + case RIG_MODE_PKTLSB: if (w <= 4) { *width = 200; @@ -8511,8 +8531,6 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) } break; - case RIG_MODE_PKTUSB: - case RIG_MODE_PKTLSB: case RIG_MODE_LSB: case RIG_MODE_USB: if (w <= 8) commit f55efa984b5afa3ab20b49e9eb1ba8a93d851b65 Author: Mikael Nousiainen <mik...@ik...> Date: Sat Dec 5 23:43:07 2020 +0200 Tuning FT-2000 filter code (cherry picked from commit 27eaa1b1f79407bd9029a3360dea1b362468cdf5) diff --git a/rigs/yaesu/ft2000.c b/rigs/yaesu/ft2000.c index ec5800da..67d7944a 100644 --- a/rigs/yaesu/ft2000.c +++ b/rigs/yaesu/ft2000.c @@ -184,15 +184,22 @@ const struct rig_caps ft2000_caps = /* mode/filter list, .remember = order matters! */ .filters = { - {FT2000_CW_RTTY_PKT_RX_MODES, Hz(500)}, /* Normal CW, RTTY, PKT/USER */ - {FT2000_CW_RTTY_PKT_RX_MODES, Hz(100)}, /* Narrow CW, RTTY, PKT/USER */ - {FT2000_CW_RTTY_PKT_RX_MODES, Hz(2400)}, /* Wide CW, RTTY, PKT/USER */ + {RIG_MODE_CW|RIG_MODE_CWR, Hz(500)}, /* Normal CW, RTTY, PKT/USER */ + {RIG_MODE_CW|RIG_MODE_CWR, Hz(200)}, /* Narrow CW, RTTY, PKT/USER */ + {RIG_MODE_CW|RIG_MODE_CWR, Hz(2400)}, /* Wide CW, RTTY, PKT/USER */ + {RIG_MODE_RTTY|RIG_MODE_RTTYR, Hz(500)}, /* Normal RTTY */ + {RIG_MODE_RTTY|RIG_MODE_RTTYR, Hz(300)}, /* Narrow RTTY */ + {RIG_MODE_RTTY|RIG_MODE_RTTYR, Hz(2400)}, /* Wide RTTY */ {RIG_MODE_SSB, Hz(2400)}, /* Normal SSB */ {RIG_MODE_SSB, Hz(1800)}, /* Narrow SSB */ {RIG_MODE_SSB, Hz(3000)}, /* Wide SSB */ {RIG_MODE_SSB, Hz(4000)}, /* Wide SSB */ - {RIG_MODE_AM, Hz(9000)}, /* Normal AM */ - {RIG_MODE_AM, Hz(6000)}, /* Narrow AM */ + {FT2000_PKTSSB_RX_MODES, Hz(2400)}, /* Normal PKTSSB */ + {FT2000_PKTSSB_RX_MODES, Hz(1800)}, /* Narrow PKTSSB */ + {FT2000_PKTSSB_RX_MODES, Hz(3000)}, /* Wide PKTSSB */ + {FT2000_PKTSSB_RX_MODES, Hz(4000)}, /* Wide PKTSSB */ + {FT2000_AM_RX_MODES, Hz(9000)}, /* Normal AM */ + {FT2000_AM_RX_MODES, Hz(6000)}, /* Narrow AM */ {FT2000_FM_RX_MODES, Hz(16000)}, /* Normal FM */ {FT2000_FM_RX_MODES, Hz(9000)}, /* Narrow FM */ diff --git a/rigs/yaesu/ft2000.h b/rigs/yaesu/ft2000.h index 4517b82e..37ee5c12 100644 --- a/rigs/yaesu/ft2000.h +++ b/rigs/yaesu/ft2000.h @@ -39,13 +39,12 @@ #define FT2000_SSB_CW_RX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|\ RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB) #define FT2000_AM_RX_MODES (RIG_MODE_AM|RIG_MODE_AMN) -#define FT2000_FM_RX_MODES (RIG_MODE_FM|RIG_MODE_PKTFM) -#define FT2000_CW_RTTY_PKT_RX_MODES (RIG_MODE_RTTY|RIG_MODE_RTTYR|\ - RIG_MODE_PKTUSB|RIG_MODE_PKTLSB|RIG_MODE_CW|RIG_MODE_CWR) +#define FT2000_FM_RX_MODES (RIG_MODE_FM|RIG_MODE_FMN|RIG_MODE_PKTFM) +#define FT2000_PKTSSB_RX_MODES (RIG_MODE_PKTLSB|RIG_MODE_PKTUSB) /* TRX caps */ -#define FT2000_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY| \ +#define FT2000_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY| \ RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|\ RIG_MODE_FM|RIG_MODE_FMN) /* 100 W class */ #define FT2000_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_AMN) /* set 25W max */ diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index d9ad4fe3..9a0b7eef 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -7220,15 +7220,27 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) // We need details on the widths here, manuals lack information. switch (mode) { - case RIG_MODE_RTTY: - case RIG_MODE_RTTYR: case RIG_MODE_CW: case RIG_MODE_CWR: // Narrow mode overrides DSP filter width on FT-2000 newcat_set_narrow(rig, vfo, FALSE); + // CW bandwidth is 2400 Hz at value 16 if (width == RIG_PASSBAND_NORMAL) { w = 16; } - else if (width <= 100) { w = 4; } + else if (width <= 200) { w = 4; } + else if (width <= 500) { w = 6; } + else if (width <= 2400) { w = 16; } + else { w = 31; } // No effect? + + break; + + case RIG_MODE_RTTY: + case RIG_MODE_RTTYR: + // Narrow mode overrides DSP filter width on FT-2000 + newcat_set_narrow(rig, vfo, FALSE); + + if (width == RIG_PASSBAND_NORMAL) { w = 16; } + else if (width <= 300) { w = 8; } else if (width <= 500) { w = 16; } else { w = 31; } // 2400 @@ -8463,13 +8475,31 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { switch (mode) { - case RIG_MODE_RTTY: - case RIG_MODE_RTTYR: case RIG_MODE_CW: case RIG_MODE_CWR: if (w <= 4) { - *width = 100; + *width = 200; + } + else if (w <= 6) + { + *width = 500; + } + else if (w <= 16) + { + *width = 2400; + } + else + { + *width = 2400; + } + break; + + case RIG_MODE_RTTY: + case RIG_MODE_RTTYR: + if (w <= 8) + { + *width = 300; } else if (w <= 16) { commit deeb7beb362e890c6764d0dc900222e00d31aaf7 Author: Mikael Nousiainen <mik...@ik...> Date: Sat Dec 5 23:11:12 2020 +0200 Add missing levels and fix filters for Yaesu FT-2000 (cherry picked from commit e2ca90841cc4f24a8e60490f84776ffb5db72c5b) diff --git a/rigs/yaesu/ft2000.c b/rigs/yaesu/ft2000.c index d486ab02..ec5800da 100644 --- a/rigs/yaesu/ft2000.c +++ b/rigs/yaesu/ft2000.c @@ -25,7 +25,6 @@ * */ - #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -185,16 +184,17 @@ const struct rig_caps ft2000_caps = /* mode/filter list, .remember = order matters! */ .filters = { - {FT2000_CW_RTTY_PKT_RX_MODES, Hz(1800)}, /* Normal CW, RTTY, PKT/USER */ - {FT2000_CW_RTTY_PKT_RX_MODES, Hz(500)}, /* Narrow CW, RTTY, PKT/USER */ + {FT2000_CW_RTTY_PKT_RX_MODES, Hz(500)}, /* Normal CW, RTTY, PKT/USER */ + {FT2000_CW_RTTY_PKT_RX_MODES, Hz(100)}, /* Narrow CW, RTTY, PKT/USER */ {FT2000_CW_RTTY_PKT_RX_MODES, Hz(2400)}, /* Wide CW, RTTY, PKT/USER */ {RIG_MODE_SSB, Hz(2400)}, /* Normal SSB */ {RIG_MODE_SSB, Hz(1800)}, /* Narrow SSB */ {RIG_MODE_SSB, Hz(3000)}, /* Wide SSB */ + {RIG_MODE_SSB, Hz(4000)}, /* Wide SSB */ {RIG_MODE_AM, Hz(9000)}, /* Normal AM */ {RIG_MODE_AM, Hz(6000)}, /* Narrow AM */ - {FT2000_FM_RX_MODES, Hz(12000)}, /* Normal FM */ - {FT2000_FM_RX_MODES, Hz(8000)}, /* Narrow FM */ + {FT2000_FM_RX_MODES, Hz(16000)}, /* Normal FM */ + {FT2000_FM_RX_MODES, Hz(9000)}, /* Narrow FM */ RIG_FLT_END, }, diff --git a/rigs/yaesu/ft2000.h b/rigs/yaesu/ft2000.h index 09d1d1b1..4517b82e 100644 --- a/rigs/yaesu/ft2000.h +++ b/rigs/yaesu/ft2000.h @@ -28,60 +28,49 @@ #ifndef _FT2000_H #define _FT2000_H 1 -#if 0 -#define TRUE 1 -#define FALSE 0 -#define ON TRUE -#define OFF FALSE -#endif - -#define FT2000_VFO_ALL (RIG_VFO_A|RIG_VFO_B) +#define FT2000_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM) /* Receiver caps */ -#define FT2000_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|\ - RIG_MODE_RTTY|RIG_MODE_RTTYR|\ - RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM) +#define FT2000_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_AMN|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|\ + RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|\ + RIG_MODE_FM|RIG_MODE_FMN) #define FT2000_SSB_CW_RX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|\ RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB) -#define FT2000_AM_RX_MODES (RIG_MODE_AM) +#define FT2000_AM_RX_MODES (RIG_MODE_AM|RIG_MODE_AMN) #define FT2000_FM_RX_MODES (RIG_MODE_FM|RIG_MODE_PKTFM) #define FT2000_CW_RTTY_PKT_RX_MODES (RIG_MODE_RTTY|RIG_MODE_RTTYR|\ RIG_MODE_PKTUSB|RIG_MODE_PKTLSB|RIG_MODE_CW|RIG_MODE_CWR) - - - /* TRX caps */ #define FT2000_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY| \ - RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM) /* 100 W class */ -#define FT2000_AM_TX_MODES (RIG_MODE_AM) /* set 25W max */ + RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|\ + RIG_MODE_FM|RIG_MODE_FMN) /* 100 W class */ +#define FT2000_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_AMN) /* set 25W max */ -/* TBC */ #define FT2000_LEVELS (RIG_LEVEL_ATT|RIG_LEVEL_PREAMP|\ - RIG_LEVEL_ALC|RIG_LEVEL_RAWSTR|RIG_LEVEL_SWR|\ + RIG_LEVEL_ALC|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_SWR|\ RIG_LEVEL_RFPOWER|RIG_LEVEL_RF|RIG_LEVEL_SQL|\ RIG_LEVEL_MICGAIN|RIG_LEVEL_IF|RIG_LEVEL_CWPITCH|\ RIG_LEVEL_KEYSPD|RIG_LEVEL_AF|RIG_LEVEL_AGC|\ RIG_LEVEL_METER|RIG_LEVEL_BKINDL|RIG_LEVEL_SQL|\ RIG_LEVEL_VOXGAIN|RIG_LEVEL_VOXDELAY|RIG_LEVEL_COMP|\ - RIG_LEVEL_ANTIVOX|RIG_LEVEL_NR|RIG_LEVEL_NOTCHF) + RIG_LEVEL_ANTIVOX|RIG_LEVEL_NR|RIG_LEVEL_NOTCHF|\ + RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_RFPOWER_METER|\ + RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER) -/* TBC */ #define FT2000_FUNCS (RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_LOCK|\ RIG_FUNC_MON|RIG_FUNC_NB|RIG_FUNC_NR|RIG_FUNC_VOX|\ RIG_FUNC_FBKIN|RIG_FUNC_COMP|RIG_FUNC_ANF|RIG_FUNC_MN|\ RIG_FUNC_RIT|RIG_FUNC_XIT|\ RIG_FUNC_TUNER) -/* TBC */ #define FT2000_VFO_OPS (RIG_OP_TUNE|RIG_OP_CPY|RIG_OP_XCHG|\ RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\ RIG_OP_TO_VFO|RIG_OP_FROM_VFO|RIG_OP_TOGGLE) -/* TBC */ #define FT2000_STR_CAL { 16, \ { \ { 0, -54 }, /* S0 */ \ diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index e112876f..d9ad4fe3 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2868,6 +2868,9 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) return -RIG_ENAVAIL; } + // TODO: According to FTDX3000 CAT manual: "This command requires dummy data be initially sent. Then after one second and before two seconds the command is sent." + // TODO: According to FTDX5000 CAT manual: "Send the PS1; command twice every one second." + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PS%c%c", ps, cat_term); err = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)); @@ -5404,7 +5407,7 @@ int newcat_set_mem(RIG *rig, vfo_t vfo, int ch) /* Out of Range, or empty */ if (!mem_caps) { - return -RIG_ENAVAIL; + return -RIG_EINVAL; } /* set to usable vfo if needed */ @@ -7212,9 +7215,89 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) return RIG_OK; } } // end is_ftdx101 + else if (is_ft2000) + { + // We need details on the widths here, manuals lack information. + switch (mode) + { + case RIG_MODE_RTTY: + case RIG_MODE_RTTYR: + case RIG_MODE_CW: + case RIG_MODE_CWR: + // Narrow mode overrides DSP filter width on FT-2000 + newcat_set_narrow(rig, vfo, FALSE); + + if (width == RIG_PASSBAND_NORMAL) { w = 16; } + else if (width <= 100) { w = 4; } + else if (width <= 500) { w = 16; } + else { w = 31; } // 2400 + + break; + + case RIG_MODE_PKTUSB: + case RIG_MODE_PKTLSB: + case RIG_MODE_LSB: + case RIG_MODE_USB: + // Narrow mode overrides DSP filter width on FT-2000 + newcat_set_narrow(rig, vfo, FALSE); + + if (width == RIG_PASSBAND_NORMAL) { w = 16; } + else if (width <= 1800) { w = 8; } + else if (width <= 2400) { w = 16; } + else if (width <= 3000) { w = 25; } + else { w = 31; } // 4000 + + break; + + case RIG_MODE_AM: + case RIG_MODE_FM: + case RIG_MODE_PKTFM: + if (width < rig_passband_normal(rig, mode)) + { + err = newcat_set_narrow(rig, vfo, TRUE); + } + else + { + err = newcat_set_narrow(rig, vfo, FALSE); + } + + return err; + + case RIG_MODE_AMN: + case RIG_MODE_FMN: + return RIG_OK; + + default: + return -RIG_EINVAL; + } + + if ((err = set_roofing_filter_for_width(rig, vfo, width)) != RIG_OK) + { + return err; + } + + switch (mode) + { + case RIG_MODE_AM: + case RIG_MODE_AMN: + case RIG_MODE_FM: + case RIG_MODE_PKTFM: + case RIG_MODE_FMN: + if (width < rig_passband_normal(rig, mode)) + { + err = newcat_set_narrow(rig, vfo, TRUE); + } + else + { + err = newcat_set_narrow(rig, vfo, FALSE); + } + + return err; + } + } else { - // FT-450, FT-2000, FTDX 9000 + // FT-450, FTDX 9000 // We need details on the widths here, manuals lack information. switch (mode) { @@ -7224,7 +7307,8 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_RTTYR: case RIG_MODE_CW: case RIG_MODE_CWR: - if (width <= 500) { w = 6; } + if (width == RIG_PASSBAND_NORMAL) { w = 16; } + else if (width <= 500) { w = 6; } else if (width <= 1800) { w = 16; } else { w = 24; } @@ -7232,7 +7316,8 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_LSB: case RIG_MODE_USB: - if (width <= 1800) { w = 8; } + if (width == RIG_PASSBAND_NORMAL) { w = 16; } + else if (width <= 1800) { w = 8; } else if (width <= 2400) { w = 16; } else { w = 25; } // 3000 @@ -7466,6 +7551,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) return err; } + // TODO: check if ft-2000 needs this fix too? if (is_ft950 || is_ftdx5000) { // Some Yaesu rigs cannot query SH in modes such as AM/FM @@ -8373,9 +8459,74 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) rig_debug(RIG_DEBUG_TRACE, "%s: end if FTDX101D\n", __func__); } /* end if is_ftdx101 */ + else if (is_ft2000) + { + switch (mode) + { + case RIG_MODE_RTTY: + case RIG_MODE_RTTYR: + case RIG_MODE_CW: + case RIG_MODE_CWR: + if (w <= 4) + { + *width = 100; + } + else if (w <= 16) + { + *width = 500; + } + else + { + *width = 2400; + } + break; + + case RIG_MODE_PKTUSB: + case RIG_MODE_PKTLSB: + case RIG_MODE_LSB: + case RIG_MODE_USB: + if (w <= 8) + { + *width = 1800; + } + else if (w <= 16) + { + *width = 2400; + } + else if (w <= 25) + { + *width = 3000; + } + else + { + *width = 4000; + } + break; + + case RIG_MODE_AM: + *width = narrow ? 6000 : 9000; + break; + + case RIG_MODE_PKTFM: + case RIG_MODE_FM: + *width = narrow ? 9000 : 16000; + break; + + case RIG_MODE_FMN: + *width = 9000; + break; + + case RIG_MODE_AMN: + *width = 6000; + break; + + default: + return -RIG_EINVAL; + } /* end switch (mode) */ + } /* end if is_ft2000 */ else { - /* FT450, FT2000, FT9000 */ + /* FT450, FT9000 */ switch (mode) { case RIG_MODE_PKTUSB: @@ -8398,13 +8549,24 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { *width = rig_passband_normal(rig, mode); } - break; case RIG_MODE_AM: + *width = narrow ? 6000 : 9000; + break; + case RIG_MODE_PKTFM: case RIG_MODE_FM: - return RIG_OK; + *width = narrow ? 9000 : 16000; + break; + + case RIG_MODE_FMN: + *width = 9000; + break; + + case RIG_MODE_AMN: + *width = 6000; + break; default: return -RIG_EINVAL; commit 196a97eab8cc1eb79eacff3198fd7fd0d04a2019 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 5 10:01:55 2020 -0600 Fix compilation with libxml2 https://github.com/Hamlib/Hamlib/issues/456 (cherry picked from commit 99d568df7248099d6cefdf7d2ac615767e462a49) diff --git a/tests/memload.c b/tests/memload.c index e1a7a1ee..ceeb5f31 100644 --- a/tests/memload.c +++ b/tests/memload.c @@ -99,7 +99,7 @@ int xml_load(RIG *my_rig, const char *infilename) set_chan(my_rig, &chan, node); - status = rig_set_channel(my_rig, &chan); + status = rig_set_channel(my_rig, RIG_VFO_NONE, &chan); if (status != RIG_OK) { diff --git a/tests/memsave.c b/tests/memsave.c index 6ac39523..81a56cc6 100644 --- a/tests/memsave.c +++ b/tests/memsave.c @@ -36,6 +36,7 @@ # include <libxml/tree.h> static int dump_xml_chan(RIG *rig, + vfo_t vfo, channel_t **chan, int channel_num, const chan_t *chan_list, @@ -61,7 +62,7 @@ int xml_save(RIG *rig, const char *outfilename) printf("About to save data, enter cloning mode: %s\n", rig->caps->clone_combo_get); - retval = rig_get_chan_all_cb(rig, dump_xml_chan, root); + retval = rig_get_chan_all_cb(rig, RIG_VFO_NONE, dump_xml_chan, root); if (retval != RIG_OK) { @@ -90,6 +91,7 @@ int xml_parm_save(RIG *rig, const char *outfilename) #ifdef HAVE_XML2 int dump_xml_chan(RIG *rig, + vfo_t vfo, channel_t **chan_pp, int chan_num, const chan_t *chan_list, ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/ft2000.c | 22 +++-- rigs/yaesu/ft2000.h | 42 +++------ rigs/yaesu/ft891.c | 4 +- rigs/yaesu/newcat.c | 237 ++++++++++++++++++++++++++++++++++++++++++++--- rigs/yaesu/newcat.h | 2 +- rotators/gs232a/gs232b.c | 12 +-- tests/example.c | 1 + tests/memload.c | 2 +- tests/memsave.c | 4 +- 9 files changed, 264 insertions(+), 62 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-12-06 14:52:42
|
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 1b2236bb2e031ec4ff4d3242b31e38c8e19f46b9 (commit) via a0829063d8cd4f638ee726b7ce81d2db5100322d (commit) via 1c86ef28cfac1fcead103cf0090f39b58dddc94e (commit) via 2eb3a557d023f0fff90cbf5e1dd723b08e6584d2 (commit) via 2526fa2ae306fe102f3d4c6750b7a661403b9583 (commit) via b062ddce22056cf2f7f3060cbcee132784ff621d (commit) via 5be6a06e9a107109b4f2d188f0fe1fe4870a4387 (commit) via 72cc9b773cf3f7471621526e166c5e0ad5be3849 (commit) via 27eaa1b1f79407bd9029a3360dea1b362468cdf5 (commit) via e2ca90841cc4f24a8e60490f84776ffb5db72c5b (commit) via 99d568df7248099d6cefdf7d2ac615767e462a49 (commit) from 12335d5c254af24950d678a797aef2661ebc4f9d (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 1b2236bb2e031ec4ff4d3242b31e38c8e19f46b9 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 6 08:49:13 2020 -0600 Fix example.c to include rotator.h diff --git a/tests/example.c b/tests/example.c index f021b980..4d895d09 100644 --- a/tests/example.c +++ b/tests/example.c @@ -12,6 +12,7 @@ #include <string.h> #include <hamlib/rig.h> #include <hamlib/riglist.h> +#include <hamlib/rotator.h> #include "sprintflst.h" #if 0 commit a0829063d8cd4f638ee726b7ce81d2db5100322d Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 6 08:41:37 2020 -0600 Fix ft891 set_mode https://github.com/Hamlib/Hamlib/issues/455 diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index f33e2652..d2131d84 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -50,7 +50,7 @@ const struct rig_caps ft891_caps = RIG_MODEL(RIG_MODEL_FT891), .model_name = "FT-891", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".0", + .version = NEWCAT_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -507,7 +507,7 @@ int ft891_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) // Copy A to B snprintf(priv->cmd_str, sizeof(priv->cmd_str), "AB;"); - if (RIG_OK != (err = newcat_get_cmd(rig))) + if (RIG_OK != (err = newcat_set_cmd(rig))) { return err; } commit 1c86ef28cfac1fcead103cf0090f39b58dddc94e Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 6 08:20:11 2020 -0600 Update newcat.h version diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 4443fd03..02d121af 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201204" +#define NEWCAT_VER "20201206" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 2eb3a557d023f0fff90cbf5e1dd723b08e6584d2 Merge: 99d568df 2526fa2a Author: Michael Black <mdb...@ya...> Date: Sun Dec 6 08:18:54 2020 -0600 Merge pull request #457 from mikaelnousiainen/yaesu-ft2000-fixes Yaesu FT-2000 + GS-232B fixes commit 2526fa2ae306fe102f3d4c6750b7a661403b9583 Author: Mikael Nousiainen <mik...@ik...> Date: Sun Dec 6 14:25:29 2020 +0200 Remove TODOs diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index c1d5d4cb..af6d0db7 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2868,9 +2868,6 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) return -RIG_ENAVAIL; } - // TODO: According to FTDX3000 CAT manual: "This command requires dummy data be initially sent. Then after one second and before two seconds the command is sent." - // TODO: According to FTDX5000 CAT manual: "Send the PS1; command twice every one second." - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PS%c%c", ps, cat_term); err = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)); @@ -7563,7 +7560,6 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) return err; } - // TODO: check if ft-2000 needs this fix too? if (is_ft950 || is_ftdx5000) { // Some Yaesu rigs cannot query SH in modes such as AM/FM commit b062ddce22056cf2f7f3060cbcee132784ff621d Author: Mikael Nousiainen <mik...@ik...> Date: Sun Dec 6 14:21:39 2020 +0200 Do not expect a reply from GS-232B stop command. Fix GS-232B retry error code. diff --git a/rotators/gs232a/gs232b.c b/rotators/gs232a/gs232b.c index 8a5bf593..b085a29a 100644 --- a/rotators/gs232a/gs232b.c +++ b/rotators/gs232a/gs232b.c @@ -106,13 +106,12 @@ transaction_write: retval = read_string(&rs->rotport, data, data_len, REPLY_EOM, strlen(REPLY_EOM)); - if (strncmp(data, "\r\n", 2) == 0 - || strchr(data, '>')) + if (strncmp(data, "\r\n", 2) == 0 || strchr(data, '>')) { - rig_debug(RIG_DEBUG_ERR, "%s: wrong response nbytes=%d\n", __func__, - (int)strlen(data)); + rig_debug(RIG_DEBUG_ERR, "%s: Invalid response for '%s': '%s' (length=%d)\n", + __func__, cmdstr, data, (int) strlen(data)); dump_hex((unsigned char *)data, strlen(data)); - retval = -1; // force retry + retval = -RIG_EPROTO; // force retry } @@ -253,13 +252,12 @@ gs232b_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) static int gs232b_rot_stop(ROT *rot) { - char buf[32]; int retval; rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); /* All Stop */ - retval = gs232b_transaction(rot, "S" EOM, buf, sizeof(buf), 0); + retval = gs232b_transaction(rot, "S" EOM, NULL, 0, 0); if (retval != RIG_OK) { commit 5be6a06e9a107109b4f2d188f0fe1fe4870a4387 Author: Mikael Nousiainen <mik...@ik...> Date: Sun Dec 6 00:11:44 2020 +0200 Tuning FT-2000 filter code diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 04dcbea0..c1d5d4cb 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -7545,7 +7545,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) int err; int w; int sh_command_valid = 1; - char narrow = '!'; + int narrow = 0; char cmd[] = "SH"; char main_sub_vfo = '0'; @@ -8473,6 +8473,11 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) } /* end if is_ftdx101 */ else if (is_ft2000) { + if ((narrow = get_narrow(rig, RIG_VFO_MAIN)) < 0) + { + return -RIG_EPROTO; + } + switch (mode) { case RIG_MODE_CW: @@ -8497,17 +8502,13 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) case RIG_MODE_PKTUSB: case RIG_MODE_PKTLSB: - if (w <= 4) + if (w <= 8) { *width = 200; } - else if (w <= 6) - { - *width = 500; - } else if (w <= 16) { - *width = 2400; + *width = 500; } else { commit 72cc9b773cf3f7471621526e166c5e0ad5be3849 Author: Mikael Nousiainen <mik...@ik...> Date: Sun Dec 6 00:00:15 2020 +0200 Tuning FT-2000 filter code diff --git a/rigs/yaesu/ft2000.c b/rigs/yaesu/ft2000.c index 67d7944a..e246da3e 100644 --- a/rigs/yaesu/ft2000.c +++ b/rigs/yaesu/ft2000.c @@ -194,10 +194,9 @@ const struct rig_caps ft2000_caps = {RIG_MODE_SSB, Hz(1800)}, /* Narrow SSB */ {RIG_MODE_SSB, Hz(3000)}, /* Wide SSB */ {RIG_MODE_SSB, Hz(4000)}, /* Wide SSB */ - {FT2000_PKTSSB_RX_MODES, Hz(2400)}, /* Normal PKTSSB */ - {FT2000_PKTSSB_RX_MODES, Hz(1800)}, /* Narrow PKTSSB */ - {FT2000_PKTSSB_RX_MODES, Hz(3000)}, /* Wide PKTSSB */ - {FT2000_PKTSSB_RX_MODES, Hz(4000)}, /* Wide PKTSSB */ + {FT2000_PKTSSB_RX_MODES, Hz(500)}, /* Normal PKTSSB */ + {FT2000_PKTSSB_RX_MODES, Hz(200)}, /* Narrow PKTSSB */ + {FT2000_PKTSSB_RX_MODES, Hz(2400)}, /* Wide PKTSSB */ {FT2000_AM_RX_MODES, Hz(9000)}, /* Normal AM */ {FT2000_AM_RX_MODES, Hz(6000)}, /* Narrow AM */ {FT2000_FM_RX_MODES, Hz(16000)}, /* Normal FM */ diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 06073153..04dcbea0 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -6642,7 +6642,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_AM: case RIG_MODE_FM: case RIG_MODE_PKTFM: - if (width < rig_passband_normal(rig, mode)) + if (width > 0 && width < rig_passband_normal(rig, mode)) { err = newcat_set_narrow(rig, vfo, TRUE); } @@ -6734,7 +6734,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_AM: case RIG_MODE_FM: case RIG_MODE_PKTFM: - if (width < rig_passband_normal(rig, mode)) + if (width > 0 && width < rig_passband_normal(rig, mode)) { err = newcat_set_narrow(rig, vfo, TRUE); } @@ -6875,7 +6875,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) return err; case RIG_MODE_PKTFM: - if (width < rig_passband_normal(rig, mode)) + if (width > 0 && width < rig_passband_normal(rig, mode)) { err = newcat_set_narrow(rig, vfo, TRUE); } @@ -6992,7 +6992,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_FM: case RIG_MODE_PKTFM: case RIG_MODE_FMN: - if (width < rig_passband_normal(rig, mode)) + if (width > 0 && width < rig_passband_normal(rig, mode)) { err = newcat_set_narrow(rig, vfo, TRUE); } @@ -7104,7 +7104,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_FM: case RIG_MODE_PKTFM: case RIG_MODE_FMN: - if (width < rig_passband_normal(rig, mode)) + if (width > 0 && width < rig_passband_normal(rig, mode)) { err = newcat_set_narrow(rig, vfo, TRUE); } @@ -7199,7 +7199,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_AM: case RIG_MODE_FM: case RIG_MODE_PKTFM: - if (width < rig_passband_normal(rig, mode)) + if (width > 0 && width < rig_passband_normal(rig, mode)) { err = newcat_set_narrow(rig, vfo, TRUE); } @@ -7234,6 +7234,19 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) break; + case RIG_MODE_PKTUSB: + case RIG_MODE_PKTLSB: + // Narrow mode overrides DSP filter width on FT-2000 + newcat_set_narrow(rig, vfo, FALSE); + + // Packet SSB bandwidth is 2400 Hz at value 31 + if (width == RIG_PASSBAND_NORMAL) { w = 31; } + else if (width <= 200) { w = 8; } + else if (width <= 500) { w = 16; } + else { w = 31; } // 2400 + + break; + case RIG_MODE_RTTY: case RIG_MODE_RTTYR: // Narrow mode overrides DSP filter width on FT-2000 @@ -7246,8 +7259,6 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) break; - case RIG_MODE_PKTUSB: - case RIG_MODE_PKTLSB: case RIG_MODE_LSB: case RIG_MODE_USB: // Narrow mode overrides DSP filter width on FT-2000 @@ -7264,17 +7275,6 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_AM: case RIG_MODE_FM: case RIG_MODE_PKTFM: - if (width < rig_passband_normal(rig, mode)) - { - err = newcat_set_narrow(rig, vfo, TRUE); - } - else - { - err = newcat_set_narrow(rig, vfo, FALSE); - } - - return err; - case RIG_MODE_AMN: case RIG_MODE_FMN: return RIG_OK; @@ -7295,7 +7295,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_FM: case RIG_MODE_PKTFM: case RIG_MODE_FMN: - if (width < rig_passband_normal(rig, mode)) + if (width > 0 && width < rig_passband_normal(rig, mode)) { err = newcat_set_narrow(rig, vfo, TRUE); } @@ -7338,7 +7338,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_AM: case RIG_MODE_FM: case RIG_MODE_PKTFM: - if (width < rig_passband_normal(rig, mode)) + if (width > 0 && width < rig_passband_normal(rig, mode)) { err = newcat_set_narrow(rig, vfo, TRUE); } @@ -8477,6 +8477,26 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { case RIG_MODE_CW: case RIG_MODE_CWR: + if (w <= 4) + { + *width = 200; + } + else if (w <= 6) + { + *width = 500; + } + else if (w <= 16) + { + *width = 2400; + } + else + { + *width = 3000; + } + break; + + case RIG_MODE_PKTUSB: + case RIG_MODE_PKTLSB: if (w <= 4) { *width = 200; @@ -8511,8 +8531,6 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) } break; - case RIG_MODE_PKTUSB: - case RIG_MODE_PKTLSB: case RIG_MODE_LSB: case RIG_MODE_USB: if (w <= 8) commit 27eaa1b1f79407bd9029a3360dea1b362468cdf5 Author: Mikael Nousiainen <mik...@ik...> Date: Sat Dec 5 23:43:07 2020 +0200 Tuning FT-2000 filter code diff --git a/rigs/yaesu/ft2000.c b/rigs/yaesu/ft2000.c index ec5800da..67d7944a 100644 --- a/rigs/yaesu/ft2000.c +++ b/rigs/yaesu/ft2000.c @@ -184,15 +184,22 @@ const struct rig_caps ft2000_caps = /* mode/filter list, .remember = order matters! */ .filters = { - {FT2000_CW_RTTY_PKT_RX_MODES, Hz(500)}, /* Normal CW, RTTY, PKT/USER */ - {FT2000_CW_RTTY_PKT_RX_MODES, Hz(100)}, /* Narrow CW, RTTY, PKT/USER */ - {FT2000_CW_RTTY_PKT_RX_MODES, Hz(2400)}, /* Wide CW, RTTY, PKT/USER */ + {RIG_MODE_CW|RIG_MODE_CWR, Hz(500)}, /* Normal CW, RTTY, PKT/USER */ + {RIG_MODE_CW|RIG_MODE_CWR, Hz(200)}, /* Narrow CW, RTTY, PKT/USER */ + {RIG_MODE_CW|RIG_MODE_CWR, Hz(2400)}, /* Wide CW, RTTY, PKT/USER */ + {RIG_MODE_RTTY|RIG_MODE_RTTYR, Hz(500)}, /* Normal RTTY */ + {RIG_MODE_RTTY|RIG_MODE_RTTYR, Hz(300)}, /* Narrow RTTY */ + {RIG_MODE_RTTY|RIG_MODE_RTTYR, Hz(2400)}, /* Wide RTTY */ {RIG_MODE_SSB, Hz(2400)}, /* Normal SSB */ {RIG_MODE_SSB, Hz(1800)}, /* Narrow SSB */ {RIG_MODE_SSB, Hz(3000)}, /* Wide SSB */ {RIG_MODE_SSB, Hz(4000)}, /* Wide SSB */ - {RIG_MODE_AM, Hz(9000)}, /* Normal AM */ - {RIG_MODE_AM, Hz(6000)}, /* Narrow AM */ + {FT2000_PKTSSB_RX_MODES, Hz(2400)}, /* Normal PKTSSB */ + {FT2000_PKTSSB_RX_MODES, Hz(1800)}, /* Narrow PKTSSB */ + {FT2000_PKTSSB_RX_MODES, Hz(3000)}, /* Wide PKTSSB */ + {FT2000_PKTSSB_RX_MODES, Hz(4000)}, /* Wide PKTSSB */ + {FT2000_AM_RX_MODES, Hz(9000)}, /* Normal AM */ + {FT2000_AM_RX_MODES, Hz(6000)}, /* Narrow AM */ {FT2000_FM_RX_MODES, Hz(16000)}, /* Normal FM */ {FT2000_FM_RX_MODES, Hz(9000)}, /* Narrow FM */ diff --git a/rigs/yaesu/ft2000.h b/rigs/yaesu/ft2000.h index 4517b82e..37ee5c12 100644 --- a/rigs/yaesu/ft2000.h +++ b/rigs/yaesu/ft2000.h @@ -39,13 +39,12 @@ #define FT2000_SSB_CW_RX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|\ RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB) #define FT2000_AM_RX_MODES (RIG_MODE_AM|RIG_MODE_AMN) -#define FT2000_FM_RX_MODES (RIG_MODE_FM|RIG_MODE_PKTFM) -#define FT2000_CW_RTTY_PKT_RX_MODES (RIG_MODE_RTTY|RIG_MODE_RTTYR|\ - RIG_MODE_PKTUSB|RIG_MODE_PKTLSB|RIG_MODE_CW|RIG_MODE_CWR) +#define FT2000_FM_RX_MODES (RIG_MODE_FM|RIG_MODE_FMN|RIG_MODE_PKTFM) +#define FT2000_PKTSSB_RX_MODES (RIG_MODE_PKTLSB|RIG_MODE_PKTUSB) /* TRX caps */ -#define FT2000_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY| \ +#define FT2000_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY| \ RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|\ RIG_MODE_FM|RIG_MODE_FMN) /* 100 W class */ #define FT2000_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_AMN) /* set 25W max */ diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index d2c64440..06073153 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -7220,15 +7220,27 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) // We need details on the widths here, manuals lack information. switch (mode) { - case RIG_MODE_RTTY: - case RIG_MODE_RTTYR: case RIG_MODE_CW: case RIG_MODE_CWR: // Narrow mode overrides DSP filter width on FT-2000 newcat_set_narrow(rig, vfo, FALSE); + // CW bandwidth is 2400 Hz at value 16 if (width == RIG_PASSBAND_NORMAL) { w = 16; } - else if (width <= 100) { w = 4; } + else if (width <= 200) { w = 4; } + else if (width <= 500) { w = 6; } + else if (width <= 2400) { w = 16; } + else { w = 31; } // No effect? + + break; + + case RIG_MODE_RTTY: + case RIG_MODE_RTTYR: + // Narrow mode overrides DSP filter width on FT-2000 + newcat_set_narrow(rig, vfo, FALSE); + + if (width == RIG_PASSBAND_NORMAL) { w = 16; } + else if (width <= 300) { w = 8; } else if (width <= 500) { w = 16; } else { w = 31; } // 2400 @@ -8463,13 +8475,31 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { switch (mode) { - case RIG_MODE_RTTY: - case RIG_MODE_RTTYR: case RIG_MODE_CW: case RIG_MODE_CWR: if (w <= 4) { - *width = 100; + *width = 200; + } + else if (w <= 6) + { + *width = 500; + } + else if (w <= 16) + { + *width = 2400; + } + else + { + *width = 2400; + } + break; + + case RIG_MODE_RTTY: + case RIG_MODE_RTTYR: + if (w <= 8) + { + *width = 300; } else if (w <= 16) { commit e2ca90841cc4f24a8e60490f84776ffb5db72c5b Author: Mikael Nousiainen <mik...@ik...> Date: Sat Dec 5 23:11:12 2020 +0200 Add missing levels and fix filters for Yaesu FT-2000 diff --git a/rigs/yaesu/ft2000.c b/rigs/yaesu/ft2000.c index d486ab02..ec5800da 100644 --- a/rigs/yaesu/ft2000.c +++ b/rigs/yaesu/ft2000.c @@ -25,7 +25,6 @@ * */ - #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -185,16 +184,17 @@ const struct rig_caps ft2000_caps = /* mode/filter list, .remember = order matters! */ .filters = { - {FT2000_CW_RTTY_PKT_RX_MODES, Hz(1800)}, /* Normal CW, RTTY, PKT/USER */ - {FT2000_CW_RTTY_PKT_RX_MODES, Hz(500)}, /* Narrow CW, RTTY, PKT/USER */ + {FT2000_CW_RTTY_PKT_RX_MODES, Hz(500)}, /* Normal CW, RTTY, PKT/USER */ + {FT2000_CW_RTTY_PKT_RX_MODES, Hz(100)}, /* Narrow CW, RTTY, PKT/USER */ {FT2000_CW_RTTY_PKT_RX_MODES, Hz(2400)}, /* Wide CW, RTTY, PKT/USER */ {RIG_MODE_SSB, Hz(2400)}, /* Normal SSB */ {RIG_MODE_SSB, Hz(1800)}, /* Narrow SSB */ {RIG_MODE_SSB, Hz(3000)}, /* Wide SSB */ + {RIG_MODE_SSB, Hz(4000)}, /* Wide SSB */ {RIG_MODE_AM, Hz(9000)}, /* Normal AM */ {RIG_MODE_AM, Hz(6000)}, /* Narrow AM */ - {FT2000_FM_RX_MODES, Hz(12000)}, /* Normal FM */ - {FT2000_FM_RX_MODES, Hz(8000)}, /* Narrow FM */ + {FT2000_FM_RX_MODES, Hz(16000)}, /* Normal FM */ + {FT2000_FM_RX_MODES, Hz(9000)}, /* Narrow FM */ RIG_FLT_END, }, diff --git a/rigs/yaesu/ft2000.h b/rigs/yaesu/ft2000.h index 09d1d1b1..4517b82e 100644 --- a/rigs/yaesu/ft2000.h +++ b/rigs/yaesu/ft2000.h @@ -28,60 +28,49 @@ #ifndef _FT2000_H #define _FT2000_H 1 -#if 0 -#define TRUE 1 -#define FALSE 0 -#define ON TRUE -#define OFF FALSE -#endif - -#define FT2000_VFO_ALL (RIG_VFO_A|RIG_VFO_B) +#define FT2000_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM) /* Receiver caps */ -#define FT2000_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|\ - RIG_MODE_RTTY|RIG_MODE_RTTYR|\ - RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM) +#define FT2000_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_AMN|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|\ + RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|\ + RIG_MODE_FM|RIG_MODE_FMN) #define FT2000_SSB_CW_RX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|\ RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB) -#define FT2000_AM_RX_MODES (RIG_MODE_AM) +#define FT2000_AM_RX_MODES (RIG_MODE_AM|RIG_MODE_AMN) #define FT2000_FM_RX_MODES (RIG_MODE_FM|RIG_MODE_PKTFM) #define FT2000_CW_RTTY_PKT_RX_MODES (RIG_MODE_RTTY|RIG_MODE_RTTYR|\ RIG_MODE_PKTUSB|RIG_MODE_PKTLSB|RIG_MODE_CW|RIG_MODE_CWR) - - - /* TRX caps */ #define FT2000_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY| \ - RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM) /* 100 W class */ -#define FT2000_AM_TX_MODES (RIG_MODE_AM) /* set 25W max */ + RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|\ + RIG_MODE_FM|RIG_MODE_FMN) /* 100 W class */ +#define FT2000_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_AMN) /* set 25W max */ -/* TBC */ #define FT2000_LEVELS (RIG_LEVEL_ATT|RIG_LEVEL_PREAMP|\ - RIG_LEVEL_ALC|RIG_LEVEL_RAWSTR|RIG_LEVEL_SWR|\ + RIG_LEVEL_ALC|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_SWR|\ RIG_LEVEL_RFPOWER|RIG_LEVEL_RF|RIG_LEVEL_SQL|\ RIG_LEVEL_MICGAIN|RIG_LEVEL_IF|RIG_LEVEL_CWPITCH|\ RIG_LEVEL_KEYSPD|RIG_LEVEL_AF|RIG_LEVEL_AGC|\ RIG_LEVEL_METER|RIG_LEVEL_BKINDL|RIG_LEVEL_SQL|\ RIG_LEVEL_VOXGAIN|RIG_LEVEL_VOXDELAY|RIG_LEVEL_COMP|\ - RIG_LEVEL_ANTIVOX|RIG_LEVEL_NR|RIG_LEVEL_NOTCHF) + RIG_LEVEL_ANTIVOX|RIG_LEVEL_NR|RIG_LEVEL_NOTCHF|\ + RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_RFPOWER_METER|\ + RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER) -/* TBC */ #define FT2000_FUNCS (RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_LOCK|\ RIG_FUNC_MON|RIG_FUNC_NB|RIG_FUNC_NR|RIG_FUNC_VOX|\ RIG_FUNC_FBKIN|RIG_FUNC_COMP|RIG_FUNC_ANF|RIG_FUNC_MN|\ RIG_FUNC_RIT|RIG_FUNC_XIT|\ RIG_FUNC_TUNER) -/* TBC */ #define FT2000_VFO_OPS (RIG_OP_TUNE|RIG_OP_CPY|RIG_OP_XCHG|\ RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\ RIG_OP_TO_VFO|RIG_OP_FROM_VFO|RIG_OP_TOGGLE) -/* TBC */ #define FT2000_STR_CAL { 16, \ { \ { 0, -54 }, /* S0 */ \ diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 27ac0fea..d2c64440 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2868,6 +2868,9 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) return -RIG_ENAVAIL; } + // TODO: According to FTDX3000 CAT manual: "This command requires dummy data be initially sent. Then after one second and before two seconds the command is sent." + // TODO: According to FTDX5000 CAT manual: "Send the PS1; command twice every one second." + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PS%c%c", ps, cat_term); err = write_block(&state->rigport, priv->cmd_str, strlen(priv->cmd_str)); @@ -5404,7 +5407,7 @@ int newcat_set_mem(RIG *rig, vfo_t vfo, int ch) /* Out of Range, or empty */ if (!mem_caps) { - return -RIG_ENAVAIL; + return -RIG_EINVAL; } /* set to usable vfo if needed */ @@ -7212,9 +7215,89 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) return RIG_OK; } } // end is_ftdx101 + else if (is_ft2000) + { + // We need details on the widths here, manuals lack information. + switch (mode) + { + case RIG_MODE_RTTY: + case RIG_MODE_RTTYR: + case RIG_MODE_CW: + case RIG_MODE_CWR: + // Narrow mode overrides DSP filter width on FT-2000 + newcat_set_narrow(rig, vfo, FALSE); + + if (width == RIG_PASSBAND_NORMAL) { w = 16; } + else if (width <= 100) { w = 4; } + else if (width <= 500) { w = 16; } + else { w = 31; } // 2400 + + break; + + case RIG_MODE_PKTUSB: + case RIG_MODE_PKTLSB: + case RIG_MODE_LSB: + case RIG_MODE_USB: + // Narrow mode overrides DSP filter width on FT-2000 + newcat_set_narrow(rig, vfo, FALSE); + + if (width == RIG_PASSBAND_NORMAL) { w = 16; } + else if (width <= 1800) { w = 8; } + else if (width <= 2400) { w = 16; } + else if (width <= 3000) { w = 25; } + else { w = 31; } // 4000 + + break; + + case RIG_MODE_AM: + case RIG_MODE_FM: + case RIG_MODE_PKTFM: + if (width < rig_passband_normal(rig, mode)) + { + err = newcat_set_narrow(rig, vfo, TRUE); + } + else + { + err = newcat_set_narrow(rig, vfo, FALSE); + } + + return err; + + case RIG_MODE_AMN: + case RIG_MODE_FMN: + return RIG_OK; + + default: + return -RIG_EINVAL; + } + + if ((err = set_roofing_filter_for_width(rig, vfo, width)) != RIG_OK) + { + return err; + } + + switch (mode) + { + case RIG_MODE_AM: + case RIG_MODE_AMN: + case RIG_MODE_FM: + case RIG_MODE_PKTFM: + case RIG_MODE_FMN: + if (width < rig_passband_normal(rig, mode)) + { + err = newcat_set_narrow(rig, vfo, TRUE); + } + else + { + err = newcat_set_narrow(rig, vfo, FALSE); + } + + return err; + } + } else { - // FT-450, FT-2000, FTDX 9000 + // FT-450, FTDX 9000 // We need details on the widths here, manuals lack information. switch (mode) { @@ -7224,7 +7307,8 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_RTTYR: case RIG_MODE_CW: case RIG_MODE_CWR: - if (width <= 500) { w = 6; } + if (width == RIG_PASSBAND_NORMAL) { w = 16; } + else if (width <= 500) { w = 6; } else if (width <= 1800) { w = 16; } else { w = 24; } @@ -7232,7 +7316,8 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_LSB: case RIG_MODE_USB: - if (width <= 1800) { w = 8; } + if (width == RIG_PASSBAND_NORMAL) { w = 16; } + else if (width <= 1800) { w = 8; } else if (width <= 2400) { w = 16; } else { w = 25; } // 3000 @@ -7466,6 +7551,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) return err; } + // TODO: check if ft-2000 needs this fix too? if (is_ft950 || is_ftdx5000) { // Some Yaesu rigs cannot query SH in modes such as AM/FM @@ -8373,9 +8459,74 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) rig_debug(RIG_DEBUG_TRACE, "%s: end if FTDX101D\n", __func__); } /* end if is_ftdx101 */ + else if (is_ft2000) + { + switch (mode) + { + case RIG_MODE_RTTY: + case RIG_MODE_RTTYR: + case RIG_MODE_CW: + case RIG_MODE_CWR: + if (w <= 4) + { + *width = 100; + } + else if (w <= 16) + { + *width = 500; + } + else + { + *width = 2400; + } + break; + + case RIG_MODE_PKTUSB: + case RIG_MODE_PKTLSB: + case RIG_MODE_LSB: + case RIG_MODE_USB: + if (w <= 8) + { + *width = 1800; + } + else if (w <= 16) + { + *width = 2400; + } + else if (w <= 25) + { + *width = 3000; + } + else + { + *width = 4000; + } + break; + + case RIG_MODE_AM: + *width = narrow ? 6000 : 9000; + break; + + case RIG_MODE_PKTFM: + case RIG_MODE_FM: + *width = narrow ? 9000 : 16000; + break; + + case RIG_MODE_FMN: + *width = 9000; + break; + + case RIG_MODE_AMN: + *width = 6000; + break; + + default: + return -RIG_EINVAL; + } /* end switch (mode) */ + } /* end if is_ft2000 */ else { - /* FT450, FT2000, FT9000 */ + /* FT450, FT9000 */ switch (mode) { case RIG_MODE_PKTUSB: @@ -8398,13 +8549,24 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { *width = rig_passband_normal(rig, mode); } - break; case RIG_MODE_AM: + *width = narrow ? 6000 : 9000; + break; + case RIG_MODE_PKTFM: case RIG_MODE_FM: - return RIG_OK; + *width = narrow ? 9000 : 16000; + break; + + case RIG_MODE_FMN: + *width = 9000; + break; + + case RIG_MODE_AMN: + *width = 6000; + break; default: return -RIG_EINVAL; commit 99d568df7248099d6cefdf7d2ac615767e462a49 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 5 10:01:55 2020 -0600 Fix compilation with libxml2 https://github.com/Hamlib/Hamlib/issues/456 diff --git a/tests/memload.c b/tests/memload.c index e1a7a1ee..ceeb5f31 100644 --- a/tests/memload.c +++ b/tests/memload.c @@ -99,7 +99,7 @@ int xml_load(RIG *my_rig, const char *infilename) set_chan(my_rig, &chan, node); - status = rig_set_channel(my_rig, &chan); + status = rig_set_channel(my_rig, RIG_VFO_NONE, &chan); if (status != RIG_OK) { diff --git a/tests/memsave.c b/tests/memsave.c index 6ac39523..81a56cc6 100644 --- a/tests/memsave.c +++ b/tests/memsave.c @@ -36,6 +36,7 @@ # include <libxml/tree.h> static int dump_xml_chan(RIG *rig, + vfo_t vfo, channel_t **chan, int channel_num, const chan_t *chan_list, @@ -61,7 +62,7 @@ int xml_save(RIG *rig, const char *outfilename) printf("About to save data, enter cloning mode: %s\n", rig->caps->clone_combo_get); - retval = rig_get_chan_all_cb(rig, dump_xml_chan, root); + retval = rig_get_chan_all_cb(rig, RIG_VFO_NONE, dump_xml_chan, root); if (retval != RIG_OK) { @@ -90,6 +91,7 @@ int xml_parm_save(RIG *rig, const char *outfilename) #ifdef HAVE_XML2 int dump_xml_chan(RIG *rig, + vfo_t vfo, channel_t **chan_pp, int chan_num, const chan_t *chan_list, ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/ft2000.c | 22 +++-- rigs/yaesu/ft2000.h | 42 +++------ rigs/yaesu/ft891.c | 4 +- rigs/yaesu/newcat.c | 237 ++++++++++++++++++++++++++++++++++++++++++++--- rigs/yaesu/newcat.h | 2 +- rotators/gs232a/gs232b.c | 12 +-- tests/example.c | 1 + tests/memload.c | 2 +- tests/memsave.c | 4 +- 9 files changed, 264 insertions(+), 62 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Nate B. <n0...@us...> - 2020-12-05 11:55:40
|
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, Hamlib-4.0 has been updated via 763bb9ae556ba7dc5ee571cab2ebaa9bf65fa1e9 (commit) from 42f9c05c81728cf1137367a3e1954d8948958b19 (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 763bb9ae556ba7dc5ee571cab2ebaa9bf65fa1e9 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 4 23:32:32 2020 -0600 Fix SH command for ft891 https://github.com/Hamlib/Hamlib/issues/455 (cherry picked from commit 12335d5c254af24950d678a797aef2661ebc4f9d) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 27ac0fea..e112876f 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -7261,7 +7261,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) } /* end else */ - if (is_ftdx101) + if (is_ftdx101 || is_ft891) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SH%c0%02d;", main_sub_vfo, w); } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 5c16c129..4443fd03 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201121" +#define NEWCAT_VER "20201204" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 2 +- rigs/yaesu/newcat.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-12-05 05:33:34
|
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 12335d5c254af24950d678a797aef2661ebc4f9d (commit) via 1f7ad94438cee9ea4eec5ec53fcdf5f1dd1c05a3 (commit) via 472293cd57d518f96879168d2e95388e2a22c7eb (commit) via 81a0c521e7a1c5979b9f25c40a8e247c52c96fce (commit) via 457211a7e353d3c5d7a93d606afb5d680ef18a10 (commit) via a661bee28394a9b19d3c4ab87aec36b8fe21a0ea (commit) via bb315270bf18a41be59aeadf129088fa41253e76 (commit) via a48f149955a6c6b6a62af674b623100ff557ac43 (commit) from c4e1deb8b6a97847bec30980d50436028cc626ce (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 12335d5c254af24950d678a797aef2661ebc4f9d Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Dec 4 23:32:32 2020 -0600 Fix SH command for ft891 https://github.com/Hamlib/Hamlib/issues/455 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 27ac0fea..e112876f 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -7261,7 +7261,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) } /* end else */ - if (is_ftdx101) + if (is_ftdx101 || is_ft891) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SH%c0%02d;", main_sub_vfo, w); } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 5c16c129..4443fd03 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201121" +#define NEWCAT_VER "20201204" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 1f7ad94438cee9ea4eec5ec53fcdf5f1dd1c05a3 Merge: c4e1deb8 472293cd Author: Michael Black <mdb...@ya...> Date: Thu Dec 3 16:13:18 2020 -0600 Merge pull request #453 from mikaelnousiainen/rotator-speed-control-and-status Rotator API: Add funcs/levels/parms, implement speed control, add status flags commit 472293cd57d518f96879168d2e95388e2a22c7eb Author: Mikael Nousiainen <mik...@ik...> Date: Thu Dec 3 23:21:57 2020 +0200 Comments diff --git a/include/hamlib/rotator.h b/include/hamlib/rotator.h index 0cff2267..52f22f13 100644 --- a/include/hamlib/rotator.h +++ b/include/hamlib/rotator.h @@ -238,7 +238,7 @@ typedef enum { */ enum rot_level_e { ROT_LEVEL_NONE = 0, /*!< '' -- No Level */ - ROT_LEVEL_SPEED = (1 << 0), /*!< \c SPEED -- Rotation speed, arg int (1-100) */ + ROT_LEVEL_SPEED = (1 << 0), /*!< \c SPEED -- Rotation speed, arg int (default range 1-100 if not specified) */ ROT_LEVEL_63 = CONSTANT_64BIT_FLAG(63), /*!< \c Future use, last level */ }; diff --git a/rigs/dummy/dummy_common.h b/rigs/dummy/dummy_common.h index 84c9bdc9..eba06538 100644 --- a/rigs/dummy/dummy_common.h +++ b/rigs/dummy/dummy_common.h @@ -1,5 +1,5 @@ /* - * Hamlib Dummy backend - shard routines + * Hamlib Dummy backend - shared routines * Copyright (c) 2020 by Mikael Nousiainen * * commit 81a0c521e7a1c5979b9f25c40a8e247c52c96fce Author: Mikael Nousiainen <mik...@ik...> Date: Thu Dec 3 23:07:08 2020 +0200 Add support for ROT_LEVEL_SPEED level in rotator backends that support setting the rotator speed via the move command. Add azimuth-only and elevation-only versions of generic GS-232A and GS-232B backends. diff --git a/include/hamlib/rotlist.h b/include/hamlib/rotlist.h index 2dfd0120..5151013c 100644 --- a/include/hamlib/rotlist.h +++ b/include/hamlib/rotlist.h @@ -261,6 +261,10 @@ #define ROT_MODEL_GS232 ROT_MAKE_MODEL(ROT_GS232A, 6) /* Not A or B */ #define ROT_MODEL_LVB ROT_MAKE_MODEL(ROT_GS232A, 7) #define ROT_MODEL_ST2 ROT_MAKE_MODEL(ROT_GS232A, 8) +#define ROT_MODEL_GS232A_AZ ROT_MAKE_MODEL(ROT_GS232A, 9) +#define ROT_MODEL_GS232A_EL ROT_MAKE_MODEL(ROT_GS232A, 10) +#define ROT_MODEL_GS232B_AZ ROT_MAKE_MODEL(ROT_GS232A, 11) +#define ROT_MODEL_GS232B_EL ROT_MAKE_MODEL(ROT_GS232A, 12) /** * \def ROT_MODEL_PCROTOR diff --git a/rotators/easycomm/easycomm.c b/rotators/easycomm/easycomm.c index 7e691e19..e2955c11 100644 --- a/rotators/easycomm/easycomm.c +++ b/rotators/easycomm/easycomm.c @@ -35,9 +35,12 @@ #include "serial.h" #include "misc.h" #include "register.h" +#include "idx_builtin.h" #include "easycomm.h" +#define EASYCOMM3_LEVELS ROT_LEVEL_SPEED + /* ************************************************************************* */ /** * easycomm_transaction @@ -247,8 +250,7 @@ easycomm_rot_move(ROT *rot, int direction, int speed) return RIG_OK; } -static int -easycomm_rot_move_velocity(ROT *rot, int direction, int speed) +static int easycomm_rot_move_velocity(ROT *rot, int direction, int speed) { struct rot_state *rs = &rot->state; char cmdstr[24]; @@ -258,7 +260,7 @@ easycomm_rot_move_velocity(ROT *rot, int direction, int speed) rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); if (speed == ROT_SPEED_NOCHANGE) { - easycomm_speed = ((rs->current_speed - 1) * 100); + easycomm_speed = rs->current_speed; } else { if (speed < 1 || speed > 100) { @@ -267,8 +269,8 @@ easycomm_rot_move_velocity(ROT *rot, int direction, int speed) return -RIG_EINVAL; } - rs->current_speed = speed; easycomm_speed = ((speed - 1) * 100); + rs->current_speed = easycomm_speed; } /* Speed for EasyComm 3 */ @@ -306,6 +308,49 @@ easycomm_rot_move_velocity(ROT *rot, int direction, int speed) return RIG_OK; } +static int easycomm_rot_get_level(ROT *rot, setting_t level, value_t *val) +{ + struct rot_state *rs = &rot->state; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); + + switch (level) { + case ROT_LEVEL_SPEED: + val->i = rs->current_speed; + break; + default: + return -RIG_ENAVAIL; + } + + return RIG_OK; +} + + +static int easycomm_rot_set_level(ROT *rot, setting_t level, value_t val) +{ + struct rot_state *rs = &rot->state; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); + + switch (level) { + case ROT_LEVEL_SPEED: { + int speed = val.i; + if (speed < 0) { + speed = 0; + } else if (speed > 9999) { + speed = 9999; + } + + rs->current_speed = speed; + break; + } + default: + return -RIG_ENAVAIL; + } + + return RIG_OK; +} + /* * Get Info * returns the model name string @@ -441,6 +486,19 @@ static int easycomm_rot_set_conf(ROT *rot, token_t token, const char *val) return RIG_OK; } + +static int easycomm_rot_init(ROT *rot) +{ + struct rot_state *rs = &rot->state; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + // Set default speed to half of maximum + rs->current_speed = 5000; + + return RIG_OK; +} + /* ************************************************************************* */ /* * Easycomm rotator capabilities. @@ -537,7 +595,7 @@ const struct rot_caps easycomm3_rot_caps = ROT_MODEL(ROT_MODEL_EASYCOMM3), .model_name = "EasycommIII", .mfg_name = "Hamlib", - .version = "20201118.0", + .version = "20201203.0", .copyright = "LGPL", .status = RIG_STATUS_ALPHA, .rot_type = ROT_TYPE_OTHER, @@ -560,7 +618,12 @@ const struct rot_caps easycomm3_rot_caps = .priv = NULL, /* priv */ - .rot_init = NULL, + .has_get_level = EASYCOMM3_LEVELS, + .has_set_level = ROT_LEVEL_SET(EASYCOMM3_LEVELS), + + .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 0 }, .max = { .i = 9999 }, .step = { .i = 1 } } }, + + .rot_init = easycomm_rot_init, .rot_cleanup = NULL, .rot_open = NULL, .rot_close = NULL, @@ -571,6 +634,8 @@ const struct rot_caps easycomm3_rot_caps = .park = easycomm_rot_park, .reset = easycomm_rot_reset, .move = easycomm_rot_move_velocity, + .get_level = easycomm_rot_get_level, + .set_level = easycomm_rot_set_level, .set_conf = easycomm_rot_set_conf, .get_conf = easycomm_rot_get_conf, .get_info = easycomm_rot_get_info, diff --git a/rotators/ether6/ether6.c b/rotators/ether6/ether6.c index 0e90275d..2a5c121a 100644 --- a/rotators/ether6/ether6.c +++ b/rotators/ether6/ether6.c @@ -35,12 +35,15 @@ #include "serial.h" #include "misc.h" #include "register.h" +#include "idx_builtin.h" #include "ether6.h" #define CMD_MAX 32 #define BUF_MAX 64 +#define ETHER_LEVELS ROT_LEVEL_SPEED + /* * Helper function with protocol return code parsing */ @@ -306,6 +309,51 @@ static int ether_rot_move(ROT *rot, int direction, int speed) } +static int ether_rot_get_level(ROT *rot, setting_t level, value_t *val) +{ + struct rot_state *rs = &rot->state; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); + + switch (level) { + case ROT_LEVEL_SPEED: + val->i = rs->current_speed; + break; + default: + return -RIG_ENAVAIL; + } + + return RIG_OK; +} + + +static int ether_rot_set_level(ROT *rot, setting_t level, value_t val) +{ + struct rot_state *rs = &rot->state; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); + + switch (level) { + case ROT_LEVEL_SPEED: { + int speed = val.i; + if (speed < 1) { + speed = 1; + } else if (speed > 100) { + speed = 100; + } + + rs->current_speed = speed; + break; + } + default: + return -RIG_ENAVAIL; + } + + return RIG_OK; +} + + + static const char *ether_rot_get_info(ROT *rot) { rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -314,6 +362,18 @@ static const char *ether_rot_get_info(ROT *rot) } +static int ether_rot_init(ROT *rot) +{ + struct rot_state *rs = &rot->state; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + // Set default speed to half of maximum + rs->current_speed = 00; + + return RIG_OK; +} + /* * Dummy rotator capabilities. @@ -324,7 +384,7 @@ const struct rot_caps ether6_rot_caps = ROT_MODEL(ROT_MODEL_ETHER6), .model_name = "Ether6 (via ethernet)", .mfg_name = "DG9OAA", - .version = "20200106.0", + .version = "20201203.0", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rot_type = ROT_FLAG_AZIMUTH, @@ -339,8 +399,13 @@ const struct rot_caps ether6_rot_caps = .priv = NULL, /* priv */ - /* .rot_init = ether_rot_init, */ - /* .rot_cleanup = ether_rot_cleanup, */ + .has_get_level = ETHER_LEVELS, + .has_set_level = ROT_LEVEL_SET(ETHER_LEVELS), + + .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 0 }, .max = { .i = 9999 }, .step = { .i = 1 } } }, + + .rot_init = ether_rot_init, + .rot_cleanup = NULL, .rot_open = ether_rot_open, .rot_close = ether_rot_close, @@ -351,6 +416,8 @@ const struct rot_caps ether6_rot_caps = .stop = ether_rot_stop, .reset = ether_rot_reset, .move = ether_rot_move, + .get_level = ether_rot_get_level, + .set_level = ether_rot_set_level, .get_info = ether_rot_get_info, }; diff --git a/rotators/gs232a/gs232a.c b/rotators/gs232a/gs232a.c index 29bf8dd7..9647e0f0 100644 --- a/rotators/gs232a/gs232a.c +++ b/rotators/gs232a/gs232a.c @@ -38,6 +38,7 @@ #include "serial.h" #include "misc.h" #include "register.h" +#include "idx_builtin.h" #include "gs232a.h" @@ -46,6 +47,8 @@ #define BUFSZ 64 +#define GS232A_LEVELS ROT_LEVEL_SPEED + /** * gs232a_transaction * @@ -236,36 +239,85 @@ gs232a_rot_stop(ROT *rot) } -static int -gs232a_rot_move(ROT *rot, int direction, int speed) +static int gs232a_rot_get_level(ROT *rot, setting_t level, value_t *val) +{ + struct rot_state *rs = &rot->state; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); + + switch (level) { + case ROT_LEVEL_SPEED: + val->i = rs->current_speed; + break; + default: + return -RIG_ENAVAIL; + } + + return RIG_OK; +} + + +static int gs232a_rot_set_level(ROT *rot, setting_t level, value_t val) { struct rot_state *rs = &rot->state; char cmdstr[24]; int retval; - unsigned x_speed; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); + + switch (level) { + case ROT_LEVEL_SPEED: { + int speed = val.i; + if (speed < 1) { + speed = 1; + } else if (speed > 4) { + speed = 4; + } + + /* between 1 (slowest) and 4 (fastest) */ + sprintf(cmdstr, "X%u" EOM, speed); + retval = gs232a_transaction(rot, cmdstr, NULL, 0, 1); + + if (retval != RIG_OK) { + return retval; + } + + rs->current_speed = speed; + break; + } + default: + return -RIG_ENAVAIL; + } + + return RIG_OK; +} + + +static int gs232a_rot_move(ROT *rot, int direction, int speed) +{ + char cmdstr[24]; + int retval; rig_debug(RIG_DEBUG_TRACE, "%s called %d %d\n", __func__, direction, speed); if (speed != ROT_SPEED_NOCHANGE) { + value_t gs232a_speed; + if (speed < 1 || speed > 100) { rig_debug(RIG_DEBUG_ERR, "%s: Invalid speed value (1-100)! (%d)\n", __func__, speed); return -RIG_EINVAL; } - x_speed = (3 * speed) / 100 + 1; + gs232a_speed.i = (3 * speed) / 100 + 1; - /* between 1 (slowest) and 4 (fastest) */ - sprintf(cmdstr, "X%u" EOM, x_speed); - retval = gs232a_transaction(rot, cmdstr, NULL, 0, 1); + retval = gs232a_rot_set_level(rot, ROT_LEVEL_SPEED, gs232a_speed); if (retval != RIG_OK) { return retval; } - - rs->current_speed = speed; } switch (direction) @@ -302,6 +354,20 @@ gs232a_rot_move(ROT *rot, int direction, int speed) return RIG_OK; } + +static int gs232a_rot_init(ROT *rot) +{ + struct rot_state *rs = &rot->state; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + // Set default speed to half of maximum + rs->current_speed = 3; + + return RIG_OK; +} + + /* ************************************************************************* */ /* * Generic GS23 rotator capabilities. @@ -312,7 +378,7 @@ const struct rot_caps gs23_rot_caps = ROT_MODEL(ROT_MODEL_GS23), .model_name = "GS-23", .mfg_name = "Yaesu/Kenpro", - .version = "20201202.0", + .version = "20201203.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZEL, @@ -333,9 +399,17 @@ const struct rot_caps gs23_rot_caps = .min_el = 0.0, .max_el = 180.0, + .has_get_level = GS232A_LEVELS, + .has_set_level = ROT_LEVEL_SET(GS232A_LEVELS), + + .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, + + .rot_init = gs232a_rot_init, .get_position = gs232a_rot_get_position, .set_position = gs232a_rot_set_position, - .stop = gs232a_rot_stop, + .stop = gs232a_rot_stop, + .get_level = gs232a_rot_get_level, + .set_level = gs232a_rot_set_level, }; /* ************************************************************************* */ @@ -348,7 +422,7 @@ const struct rot_caps gs232_rot_caps = ROT_MODEL(ROT_MODEL_GS232), .model_name = "GS-232", .mfg_name = "Yaesu/Kenpro", - .version = "20201202.0", + .version = "20201203.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZEL, @@ -369,9 +443,17 @@ const struct rot_caps gs232_rot_caps = .min_el = 0.0, .max_el = 180.0, + .has_get_level = GS232A_LEVELS, + .has_set_level = ROT_LEVEL_SET(GS232A_LEVELS), + + .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, + + .rot_init = gs232a_rot_init, .get_position = gs232a_rot_get_position, .set_position = gs232a_rot_set_position, - .stop = gs232a_rot_stop, + .stop = gs232a_rot_stop, + .get_level = gs232a_rot_get_level, + .set_level = gs232a_rot_set_level, }; /* ************************************************************************* */ @@ -384,10 +466,10 @@ const struct rot_caps gs232a_rot_caps = ROT_MODEL(ROT_MODEL_GS232A), .model_name = "GS-232A", .mfg_name = "Yaesu", - .version = "20201205.0", + .version = "20201203.0", .copyright = "LGPL", .status = RIG_STATUS_BETA, - .rot_type = ROT_TYPE_OTHER, + .rot_type = ROT_TYPE_AZEL, .port_type = RIG_PORT_SERIAL, .serial_rate_min = 150, .serial_rate_max = 9600, @@ -405,26 +487,125 @@ const struct rot_caps gs232a_rot_caps = .min_el = 0.0, .max_el = 180.0, /* requires G-5400B, G-5600B, G-5500, or G-500/G-550 */ + .has_get_level = GS232A_LEVELS, + .has_set_level = ROT_LEVEL_SET(GS232A_LEVELS), + + .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, + + .rot_init = gs232a_rot_init, .get_position = gs232a_rot_get_position, .set_position = gs232a_rot_set_position, - .stop = gs232a_rot_stop, + .stop = gs232a_rot_stop, .move = gs232a_rot_move, + .get_level = gs232a_rot_get_level, + .set_level = gs232a_rot_set_level, }; /* ************************************************************************* */ +/* + * Generic GS232A azimuth rotator capabilities. + */ +const struct rot_caps gs232a_az_rot_caps = +{ + ROT_MODEL(ROT_MODEL_GS232A_AZ), + .model_name = "GS-232A azimuth", + .mfg_name = "Yaesu", + .version = "20201203.0", + .copyright = "LGPL", + .status = RIG_STATUS_BETA, + .rot_type = ROT_TYPE_AZIMUTH, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 150, + .serial_rate_max = 9600, + .serial_data_bits = 8, + .serial_stop_bits = 1, + .serial_parity = RIG_PARITY_NONE, + .serial_handshake = RIG_HANDSHAKE_NONE, + .write_delay = 0, + .post_write_delay = 50, + .timeout = 400, + .retry = 3, + .min_az = -180.0, + .max_az = 450.0, /* vary according to rotator type */ + .min_el = 0.0, + .max_el = 0.0, + + .rot_init = gs232a_rot_init, + .has_get_level = GS232A_LEVELS, + .has_set_level = ROT_LEVEL_SET(GS232A_LEVELS), + .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, + + .get_position = gs232a_rot_get_position, + .set_position = gs232a_rot_set_position, + .stop = gs232a_rot_stop, + .move = gs232a_rot_move, + .get_level = gs232a_rot_get_level, + .set_level = gs232a_rot_set_level, +}; +/* ************************************************************************* */ +/* + * Generic GS232A elevation rotator capabilities. + */ + +const struct rot_caps gs232a_el_rot_caps = +{ + ROT_MODEL(ROT_MODEL_GS232A_EL), + .model_name = "GS-232A elevation", + .mfg_name = "Yaesu", + .version = "20201203.0", + .copyright = "LGPL", + .status = RIG_STATUS_BETA, + .rot_type = ROT_TYPE_ELEVATION, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 150, + .serial_rate_max = 9600, + .serial_data_bits = 8, + .serial_stop_bits = 1, + .serial_parity = RIG_PARITY_NONE, + .serial_handshake = RIG_HANDSHAKE_NONE, + .write_delay = 0, + .post_write_delay = 50, + .timeout = 400, + .retry = 3, + + .min_az = 0.0, + .max_az = 0.0, + .min_el = 0.0, + .max_el = 180.0, /* requires G-5400B, G-5600B, G-5500, or G-500/G-550 */ + + .has_get_level = GS232A_LEVELS, + .has_set_level = ROT_LEVEL_SET(GS232A_LEVELS), + + .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, + + .rot_init = gs232a_rot_init, + .get_position = gs232a_rot_get_position, + .set_position = gs232a_rot_set_position, + .stop = gs232a_rot_stop, + .move = gs232a_rot_move, + .get_level = gs232a_rot_get_level, + .set_level = gs232a_rot_set_level, +}; + +/* ************************************************************************* */ + DECLARE_INITROT_BACKEND(gs232a) { rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); rot_register(&gs232a_rot_caps); + rot_register(&gs232a_az_rot_caps); + rot_register(&gs232a_el_rot_caps); rot_register(&gs232_generic_rot_caps); rot_register(&gs232b_rot_caps); + rot_register(&gs232b_az_rot_caps); + rot_register(&gs232b_el_rot_caps); rot_register(&f1tetracker_rot_caps); rot_register(&gs23_rot_caps); rot_register(&gs232_rot_caps); diff --git a/rotators/gs232a/gs232a.h b/rotators/gs232a/gs232a.h index c6c84053..681fbc85 100644 --- a/rotators/gs232a/gs232a.h +++ b/rotators/gs232a/gs232a.h @@ -23,8 +23,12 @@ #define _ROT_GS232A_H 1 extern const struct rot_caps gs232a_rot_caps; +extern const struct rot_caps gs232a_az_rot_caps; +extern const struct rot_caps gs232a_el_rot_caps; extern const struct rot_caps gs232_generic_rot_caps; extern const struct rot_caps gs232b_rot_caps; +extern const struct rot_caps gs232b_az_rot_caps; +extern const struct rot_caps gs232b_el_rot_caps; extern const struct rot_caps f1tetracker_rot_caps; extern const struct rot_caps gs23_rot_caps; extern const struct rot_caps gs232_rot_caps; diff --git a/rotators/gs232a/gs232b.c b/rotators/gs232a/gs232b.c index a9f0f28c..8a5bf593 100644 --- a/rotators/gs232a/gs232b.c +++ b/rotators/gs232a/gs232b.c @@ -27,26 +27,22 @@ // cppcheck-suppress * #include <stdio.h> // cppcheck-suppress * -#include <stdlib.h> -// cppcheck-suppress * #include <string.h> /* String function definitions */ // cppcheck-suppress * -#include <unistd.h> /* UNIX standard function definitions */ -// cppcheck-suppress * #include <math.h> #include "hamlib/rotator.h" #include "serial.h" #include "misc.h" -#include "register.h" - -#include "gs232a.h" +#include "idx_builtin.h" #define EOM "\r" #define REPLY_EOM "\n" #define BUFSZ 64 +#define GS232B_LEVELS ROT_LEVEL_SPEED + /** * gs232b_transaction * @@ -274,36 +270,85 @@ gs232b_rot_stop(ROT *rot) } -static int -gs232b_rot_move(ROT *rot, int direction, int speed) +static int gs232b_rot_get_level(ROT *rot, setting_t level, value_t *val) +{ + struct rot_state *rs = &rot->state; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); + + switch (level) { + case ROT_LEVEL_SPEED: + val->i = rs->current_speed; + break; + default: + return -RIG_ENAVAIL; + } + + return RIG_OK; +} + + +static int gs232b_rot_set_level(ROT *rot, setting_t level, value_t val) { struct rot_state *rs = &rot->state; char cmdstr[24]; int retval; - unsigned x_speed; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); + + switch (level) { + case ROT_LEVEL_SPEED: { + int speed = val.i; + if (speed < 1) { + speed = 1; + } else if (speed > 4) { + speed = 4; + } + + /* between 1 (slowest) and 4 (fastest) */ + sprintf(cmdstr, "X%u" EOM, speed); + retval = gs232b_transaction(rot, cmdstr, NULL, 0, 1); + + if (retval != RIG_OK) { + return retval; + } + + rs->current_speed = speed; + break; + } + default: + return -RIG_ENAVAIL; + } + + return RIG_OK; +} + + +static int gs232b_rot_move(ROT *rot, int direction, int speed) +{ + char cmdstr[24]; + int retval; rig_debug(RIG_DEBUG_TRACE, "%s called %d %d\n", __func__, direction, speed); if (speed != ROT_SPEED_NOCHANGE) { + value_t gs232b_speed; + if (speed < 1 || speed > 100) { rig_debug(RIG_DEBUG_ERR, "%s: Invalid speed value (1-100)! (%d)\n", __func__, speed); return -RIG_EINVAL; } - x_speed = (3 * speed) / 100 + 1; + gs232b_speed.i = (3 * speed) / 100 + 1; - /* between 1 (slowest) and 4 (fastest) */ - sprintf(cmdstr, "X%u" EOM, x_speed); - retval = gs232b_transaction(rot, cmdstr, NULL, 0, 1); + retval = gs232b_rot_set_level(rot, ROT_LEVEL_SPEED, gs232b_speed); if (retval != RIG_OK) { return retval; } - - rs->current_speed = speed; } switch (direction) @@ -340,6 +385,20 @@ gs232b_rot_move(ROT *rot, int direction, int speed) return RIG_OK; } + +static int gs232b_rot_init(ROT *rot) +{ + struct rot_state *rs = &rot->state; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + // Set default speed to half of maximum + rs->current_speed = 3; + + return RIG_OK; +} + + /* ************************************************************************* */ /* * Generic GS232B rotator capabilities. @@ -350,10 +409,10 @@ const struct rot_caps gs232b_rot_caps = ROT_MODEL(ROT_MODEL_GS232B), .model_name = "GS-232B", .mfg_name = "Yaesu", - .version = "20201202.0", + .version = "20201203.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, - .rot_type = ROT_TYPE_OTHER, + .rot_type = ROT_TYPE_AZEL, .port_type = RIG_PORT_SERIAL, .serial_rate_min = 1200, .serial_rate_max = 9600, @@ -371,10 +430,110 @@ const struct rot_caps gs232b_rot_caps = .min_el = 0.0, .max_el = 180.0, /* requires G-5400B, G-5600B, G-5500, or G-500/G-550 */ + .has_get_level = GS232B_LEVELS, + .has_set_level = ROT_LEVEL_SET(GS232B_LEVELS), + + .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, + + .rot_init = gs232b_rot_init, + .get_position = gs232b_rot_get_position, + .set_position = gs232b_rot_set_position, + .stop = gs232b_rot_stop, + .move = gs232b_rot_move, + .get_level = gs232b_rot_get_level, + .set_level = gs232b_rot_set_level, +}; + + +/* ************************************************************************* */ +/* + * Generic GS232B azimuth rotator capabilities. + */ + +const struct rot_caps gs232b_az_rot_caps = +{ + ROT_MODEL(ROT_MODEL_GS232B_AZ), + .model_name = "GS-232B azimuth", + .mfg_name = "Yaesu", + .version = "20201203.0", + .copyright = "LGPL", + .status = RIG_STATUS_STABLE, + .rot_type = ROT_TYPE_AZIMUTH, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 1200, + .serial_rate_max = 9600, + .serial_data_bits = 8, + .serial_stop_bits = 1, + .serial_parity = RIG_PARITY_NONE, + .serial_handshake = RIG_HANDSHAKE_NONE, + .write_delay = 0, + .post_write_delay = 50, + .timeout = 400, + .retry = 3, + + .min_az = -180.0, + .max_az = 450.0, /* vary according to rotator type */ + .min_el = 0.0, + .max_el = 0.0, + + .has_get_level = GS232B_LEVELS, + .has_set_level = ROT_LEVEL_SET(GS232B_LEVELS), + + .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, + + .rot_init = gs232b_rot_init, + .get_position = gs232b_rot_get_position, + .set_position = gs232b_rot_set_position, + .stop = gs232b_rot_stop, + .move = gs232b_rot_move, + .get_level = gs232b_rot_get_level, + .set_level = gs232b_rot_set_level, +}; + + +/* ************************************************************************* */ +/* + * Generic GS232B elevation rotator capabilities. + */ + +const struct rot_caps gs232b_el_rot_caps = +{ + ROT_MODEL(ROT_MODEL_GS232B_EL), + .model_name = "GS-232B elevation", + .mfg_name = "Yaesu", + .version = "20201203.0", + .copyright = "LGPL", + .status = RIG_STATUS_STABLE, + .rot_type = ROT_TYPE_ELEVATION, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 1200, + .serial_rate_max = 9600, + .serial_data_bits = 8, + .serial_stop_bits = 1, + .serial_parity = RIG_PARITY_NONE, + .serial_handshake = RIG_HANDSHAKE_NONE, + .write_delay = 0, + .post_write_delay = 50, + .timeout = 400, + .retry = 3, + + .min_az = 0.0, + .max_az = 0.0, + .min_el = 0.0, + .max_el = 180.0, /* requires G-5400B, G-5600B, G-5500, or G-500/G-550 */ + + .has_get_level = GS232B_LEVELS, + .has_set_level = ROT_LEVEL_SET(GS232B_LEVELS), + + .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, + + .rot_init = gs232b_rot_init, .get_position = gs232b_rot_get_position, .set_position = gs232b_rot_set_position, .stop = gs232b_rot_stop, .move = gs232b_rot_move, + .get_level = gs232b_rot_get_level, + .set_level = gs232b_rot_set_level, }; /* end of file */ commit 457211a7e353d3c5d7a93d606afb5d680ef18a10 Author: Mikael Nousiainen <mik...@ik...> Date: Thu Dec 3 21:40:34 2020 +0200 Add get_status command for rotator status flags. Add missing rotator caps in dumpcaps output. diff --git a/include/hamlib/amplifier.h b/include/hamlib/amplifier.h index 7d61cea8..b7af885d 100644 --- a/include/hamlib/amplifier.h +++ b/include/hamlib/amplifier.h @@ -397,6 +397,10 @@ extern HAMLIB_EXPORT(const char *) amp_strlevel(setting_t); extern HAMLIB_EXPORT(const struct confparams *) rig_ext_lookup HAMLIB_PARAMS((RIG *rig, const char *name)); + +extern HAMLIB_EXPORT(setting_t) amp_parse_level(const char *s); +extern HAMLIB_EXPORT(const char *) amp_strlevel(setting_t); + //! @endcond diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 47696121..b8c4832f 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -2787,16 +2787,6 @@ extern HAMLIB_EXPORT(scan_t) rig_parse_scan(const char *s); extern HAMLIB_EXPORT(rptr_shift_t) rig_parse_rptr_shift(const char *s); extern HAMLIB_EXPORT(chan_type_t) rig_parse_mtype(const char *s); -extern HAMLIB_EXPORT(setting_t) rot_parse_func(const char *s); -extern HAMLIB_EXPORT(setting_t) rot_parse_level(const char *s); -extern HAMLIB_EXPORT(setting_t) rot_parse_parm(const char *s); -extern HAMLIB_EXPORT(const char *) rot_strfunc(setting_t); -extern HAMLIB_EXPORT(const char *) rot_strlevel(setting_t); -extern HAMLIB_EXPORT(const char *) rot_strparm(setting_t); - -extern HAMLIB_EXPORT(setting_t) amp_parse_level(const char *s); -extern HAMLIB_EXPORT(const char *) amp_strlevel(setting_t); - extern HAMLIB_EXPORT(const char *) rig_license HAMLIB_PARAMS(()); extern HAMLIB_EXPORT(const char *) rig_version HAMLIB_PARAMS(()); extern HAMLIB_EXPORT(const char *) rig_copyright HAMLIB_PARAMS(()); diff --git a/include/hamlib/rotator.h b/include/hamlib/rotator.h index 4a38bf87..0cff2267 100644 --- a/include/hamlib/rotator.h +++ b/include/hamlib/rotator.h @@ -200,20 +200,27 @@ typedef enum { * \brief Rotator status flags */ typedef enum { - ROT_STATUS_BUSY = (1 << 1), /*!< Rotator is busy, not accepting commands */ - ROT_STATUS_MOVING = (1 << 2), /*!< Rotator is currently moving (direction type not specified) */ - ROT_STATUS_MOVING_AZ = (1 << 3), /*!< Azimuth rotator is currently moving */ - ROT_STATUS_MOVING_EL = (1 << 4), /*!< Elevation rotator is currently moving */ - ROT_STATUS_UP_LIMIT = (1 << 5), /*!< The elevation rotator has reached its limit to move up */ - ROT_STATUS_DOWN_LIMIT = (1 << 6), /*!< The elevation rotator has reached its limit to move down */ - ROT_STATUS_LEFT_LIMIT = (1 << 7), /*!< The azimuth rotator has reached its limit to move left (CCW) */ - ROT_STATUS_RIGHT_LIMIT = (1 << 8), /*!< The azimuth rotator has reached its limit to move right (CW) */ - ROT_STATUS_UP_OVERLAP = (1 << 9), /*!< The elevation rotator has rotated up past 360 degrees */ - ROT_STATUS_DOWN_OVERLAP = (1 << 10), /*!< The elevation rotator has rotated down past 0 degrees */ - ROT_STATUS_LEFT_OVERLAP = (1 << 11), /*!< The azimuth rotator has rotated left (CCW) past 0 degrees */ - ROT_STATUS_RIGHT_OVERLAP = (1 << 12), /*!< The azimuth rotator has rotated right (CW) past 360 degrees */ + ROT_STATUS_NONE = 0, + ROT_STATUS_BUSY = (1 << 0), /*!< Rotator is busy, not accepting commands */ + ROT_STATUS_MOVING = (1 << 1), /*!< Rotator is currently moving (direction type not specified) */ + ROT_STATUS_MOVING_AZ = (1 << 2), /*!< Azimuth rotator is currently moving (direction not specified) */ + ROT_STATUS_MOVING_LEFT = (1 << 3), /*!< Azimuth rotator is currently moving left */ + ROT_STATUS_MOVING_RIGHT = (1 << 4), /*!< Azimuth rotator is currently moving right */ + ROT_STATUS_MOVING_EL = (1 << 5), /*!< Elevation rotator is currently moving (direction not specified) */ + ROT_STATUS_MOVING_UP = (1 << 6), /*!< Elevation rotator is currently moving up */ + ROT_STATUS_MOVING_DOWN = (1 << 7), /*!< Elevation rotator is currently moving down */ + ROT_STATUS_LIMIT_UP = (1 << 8), /*!< The elevation rotator has reached its limit to move up */ + ROT_STATUS_LIMIT_DOWN = (1 << 9), /*!< The elevation rotator has reached its limit to move down */ + ROT_STATUS_LIMIT_LEFT = (1 << 10), /*!< The azimuth rotator has reached its limit to move left (CCW) */ + ROT_STATUS_LIMIT_RIGHT = (1 << 11), /*!< The azimuth rotator has reached its limit to move right (CW) */ + ROT_STATUS_OVERLAP_UP = (1 << 12), /*!< The elevation rotator has rotated up past 360 degrees */ + ROT_STATUS_OVERLAP_DOWN = (1 << 13), /*!< The elevation rotator has rotated down past 0 degrees */ + ROT_STATUS_OVERLAP_LEFT = (1 << 14), /*!< The azimuth rotator has rotated left (CCW) past 0 degrees */ + ROT_STATUS_OVERLAP_RIGHT = (1 << 16), /*!< The azimuth rotator has rotated right (CW) past 360 degrees */ } rot_status_t; +#define ROT_STATUS_N(n) (1u<<(n)) + /** * \brief Macro for not changing the rotator speed with move() function @@ -339,6 +346,8 @@ struct rot_caps { setting_t has_get_parm; /*!< List of get parm */ setting_t has_set_parm; /*!< List of set parm */ + rot_status_t has_status; /*!< Supported status flags */ + gran_t level_gran[RIG_SETTING_MAX]; /*!< level granularity (i.e. steps) */ gran_t parm_gran[RIG_SETTING_MAX]; /*!< parm granularity (i.e. steps) */ @@ -409,12 +418,9 @@ struct rot_caps { int (*set_ext_parm)(ROT *rot, token_t token, value_t val); int (*get_ext_parm)(ROT *rot, token_t token, value_t *val); - const char *macro_name; /*!< Macro name. */ + int (*get_status)(ROT *rot, rot_status_t *status); - rot_status_t status_caps; /*!< Supported status flags */ - - rot_status_t (*get_status)(ROT *rot); - /* more to come... */ + const char *macro_name; /*!< Macro name. */ }; //! @endcond @@ -449,6 +455,8 @@ struct rot_state { setting_t has_get_parm; /*!< List of get parm */ setting_t has_set_parm; /*!< List of set parm */ + rot_status_t has_status; /*!< Supported status flags */ + gran_t level_gran[RIG_SETTING_MAX]; /*!< level granularity */ gran_t parm_gran[RIG_SETTING_MAX]; /*!< parm granularity */ @@ -614,6 +622,10 @@ rot_get_ext_parm HAMLIB_PARAMS((ROT *rig, extern HAMLIB_EXPORT(const char *) rot_get_info HAMLIB_PARAMS((ROT *rot)); +extern HAMLIB_EXPORT(int) +rot_get_status HAMLIB_PARAMS((ROT *rot, + rot_status_t *status)); + extern HAMLIB_EXPORT(int) rot_register HAMLIB_PARAMS((const struct rot_caps *caps)); @@ -734,6 +746,14 @@ dmmm2dec HAMLIB_PARAMS((int degrees, double seconds, int sw)); +extern HAMLIB_EXPORT(setting_t) rot_parse_func(const char *s); +extern HAMLIB_EXPORT(setting_t) rot_parse_level(const char *s); +extern HAMLIB_EXPORT(setting_t) rot_parse_parm(const char *s); +extern HAMLIB_EXPORT(const char *) rot_strfunc(setting_t); +extern HAMLIB_EXPORT(const char *) rot_strlevel(setting_t); +extern HAMLIB_EXPORT(const char *) rot_strparm(setting_t); +extern HAMLIB_EXPORT(const char *) rot_strstatus(rot_status_t); + //! @endcond /** diff --git a/rigs/dummy/rot_dummy.c b/rigs/dummy/rot_dummy.c index 5cd31783..d5b8b994 100644 --- a/rigs/dummy/rot_dummy.c +++ b/rigs/dummy/rot_dummy.c @@ -39,6 +39,10 @@ #define DUMMY_ROT_LEVEL ROT_LEVEL_SPEED #define DUMMY_ROT_PARM 0 +#define DUMMY_ROT_STATUS (ROT_STATUS_MOVING | ROT_STATUS_MOVING_AZ | ROT_STATUS_MOVING_LEFT | ROT_STATUS_MOVING_RIGHT | \ + ROT_STATUS_MOVING_EL | ROT_STATUS_MOVING_UP | ROT_STATUS_MOVING_DOWN | \ + ROT_STATUS_LIMIT_UP | ROT_STATUS_LIMIT_DOWN | ROT_STATUS_LIMIT_LEFT | ROT_STATUS_LIMIT_RIGHT) + struct dummy_rot_priv_data { azimuth_t az; @@ -47,6 +51,7 @@ struct dummy_rot_priv_data struct timeval tv; /* time last az/el update */ azimuth_t target_az; elevation_t target_el; + rot_status_t status; setting_t funcs; value_t levels[RIG_SETTING_MAX]; @@ -254,27 +259,13 @@ static int dummy_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) return RIG_OK; } - -/* - * Get position of rotor, simulating slow rotation - */ -static int dummy_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) +static void dummy_rot_simulate_rotation(ROT *rot) { - struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *) + struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *) rot->state.priv; struct timeval tv; unsigned elapsed; /* ms */ - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - - if (priv->az == priv->target_az && - priv->el == priv->target_el) - { - *az = priv->az; - *el = priv->el; - return RIG_OK; - } - gettimeofday(&tv, NULL); elapsed = (tv.tv_sec - priv->tv.tv_sec) * 1000 + @@ -289,16 +280,19 @@ static int dummy_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) { /* target reached */ priv->az = priv->target_az; + priv->status &= ~(ROT_STATUS_MOVING_AZ | ROT_STATUS_MOVING_LEFT | ROT_STATUS_MOVING_RIGHT); } else { if (priv->az < priv->target_az) { priv->az += (azimuth_t)elapsed * DEG_PER_MS; + priv->status |= ROT_STATUS_MOVING_AZ | ROT_STATUS_MOVING_RIGHT; } else { priv->az -= (azimuth_t)elapsed * DEG_PER_MS; + priv->status |= ROT_STATUS_MOVING_AZ | ROT_STATUS_MOVING_LEFT; } } @@ -306,23 +300,54 @@ static int dummy_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) { /* target reached */ priv->el = priv->target_el; + priv->status &= ~(ROT_STATUS_MOVING_EL | ROT_STATUS_MOVING_UP | ROT_STATUS_MOVING_DOWN); } else { if (priv->el < priv->target_el) { priv->el += (elevation_t)elapsed * DEG_PER_MS; + priv->status |= ROT_STATUS_MOVING_EL | ROT_STATUS_MOVING_UP; } else { priv->el -= (elevation_t)elapsed * DEG_PER_MS; + priv->status |= ROT_STATUS_MOVING_EL | ROT_STATUS_MOVING_DOWN; } } - *az = priv->az; - *el = priv->el; + if (priv->status & (ROT_STATUS_MOVING_AZ | ROT_STATUS_MOVING_EL)) { + priv->status |= ROT_STATUS_MOVING; + } else { + priv->status &= ~(ROT_STATUS_MOVING); + } priv->tv = tv; +} + + +/* + * Get position of rotor, simulating slow rotation + */ +static int dummy_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) +{ + struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *) + rot->state.priv; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + if (priv->az == priv->target_az && + priv->el == priv->target_el) + { + *az = priv->az; + *el = priv->el; + return RIG_OK; + } + + dummy_rot_simulate_rotation(rot); + + *az = priv->az; + *el = priv->el; return RIG_OK; } @@ -839,16 +864,27 @@ static int dummy_get_ext_parm(ROT *rot, token_t token, value_t *val) } +static int dummy_rot_get_status(ROT *rot, rot_status_t *status) +{ + struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)rot->state.priv; + + dummy_rot_simulate_rotation(rot); + + *status = priv->status; + + return RIG_OK; +} + + /* * Dummy rotator capabilities. */ - const struct rot_caps dummy_rot_caps = { ROT_MODEL(ROT_MODEL_DUMMY), .model_name = "Dummy", .mfg_name = "Hamlib", - .version = "20201202.0", + .version = "20201203.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZEL, @@ -875,6 +911,8 @@ const struct rot_caps dummy_rot_caps = .extparms = dummy_ext_parms, .cfgparams = dummy_cfg_params, + .has_status = DUMMY_ROT_STATUS, + .rot_init = dummy_rot_init, .rot_cleanup = dummy_rot_cleanup, .rot_open = dummy_rot_open, @@ -904,7 +942,8 @@ const struct rot_caps dummy_rot_caps = .set_ext_parm = dummy_set_ext_parm, .get_ext_parm = dummy_get_ext_parm, - .get_info = dummy_rot_get_info, + .get_info = dummy_rot_get_info, + .get_status = dummy_rot_get_status, }; DECLARE_INITROT_BACKEND(dummy) diff --git a/src/misc.c b/src/misc.c index 4893acf9..a4564035 100644 --- a/src/misc.c +++ b/src/misc.c @@ -48,7 +48,6 @@ # include <sys/time.h> #endif -#include <unistd.h> #include <math.h> #include <hamlib/rig.h> @@ -1759,6 +1758,54 @@ int HAMLIB_API rig_flush(hamlib_port_t *port) return serial_flush(port); // we must be on serial port } + +static struct +{ + rot_status_t status; + const char *str; +} rot_status_str[] = +{ + { ROT_STATUS_BUSY, "BUSY" }, + { ROT_STATUS_MOVING, "MOVING" }, + { ROT_STATUS_MOVING_AZ, "MOVING_AZ" }, + { ROT_STATUS_MOVING_LEFT, "MOVING_LEFT" }, + { ROT_STATUS_MOVING_RIGHT, "MOVING_RIGHT" }, + { ROT_STATUS_MOVING_EL, "MOVING_EL" }, + { ROT_STATUS_MOVING_UP, "MOVING_UP" }, + { ROT_STATUS_MOVING_DOWN, "MOVING_DOWN" }, + { ROT_STATUS_LIMIT_UP, "LIMIT_UP" }, + { ROT_STATUS_LIMIT_DOWN, "LIMIT_DOWN" }, + { ROT_STATUS_LIMIT_LEFT, "LIMIT_LEFT" }, + { ROT_STATUS_LIMIT_RIGHT, "LIMIT_RIGHT" }, + { ROT_STATUS_OVERLAP_UP, "OVERLAP_UP" }, + { ROT_STATUS_OVERLAP_DOWN, "OVERLAP_DOWN" }, + { ROT_STATUS_OVERLAP_LEFT, "OVERLAP_LEFT" }, + { ROT_STATUS_OVERLAP_RIGHT, "OVERLAP_RIGHT" }, + { 0xffffff, "" }, +}; + + +/** + * \brief Convert enum ROT_STATUS_... to a string + * \param status ROT_STATUS_... + * \return the corresponding string value + */ +const char *HAMLIB_API rot_strstatus(rot_status_t status) +{ + int i; + + for (i = 0 ; rot_status_str[i].str[0] != '\0'; i++) + { + if (status == rot_status_str[i].status) + { + return rot_status_str[i].str; + } + } + + return ""; +} + + //! @endcond /** @} */ diff --git a/src/rotator.c b/src/rotator.c index 9e687ef7..8cb36a7e 100644 --- a/src/rotator.c +++ b/src/rotator.c @@ -283,6 +283,8 @@ ROT *HAMLIB_API rot_init(rot_model_t rot_model) rs->has_get_parm = caps->has_get_parm; rs->has_set_parm = caps->has_set_parm; + rs->has_status = caps->has_status; + memcpy(rs->level_gran, caps->level_gran, sizeof(gran_t)*RIG_SETTING_MAX); memcpy(rs->parm_gran, caps->parm_gran, sizeof(gran_t)*RIG_SETTING_MAX); @@ -597,6 +599,9 @@ int HAMLIB_API rot_set_position(ROT *rot, return -RIG_EINVAL; } + azimuth += rot->state.az_offset; + elevation += rot->state.el_offset; + caps = rot->caps; rs = &rot->state; @@ -648,6 +653,8 @@ int HAMLIB_API rot_get_position(ROT *rot, { const struct rot_caps *caps; const struct rot_state *rs; + azimuth_t az; + elevation_t el; int retval; rot_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -665,19 +672,21 @@ int HAMLIB_API rot_get_position(ROT *rot, return -RIG_ENAVAIL; } - retval = caps->get_position(rot, azimuth, elevation); + retval = caps->get_position(rot, &az, &el); if (retval != RIG_OK) { return retval; } - rot_debug(RIG_DEBUG_VERBOSE, "%s: got az=%.2f, el=%.2f\n", __func__, *azimuth, - *elevation); + rot_debug(RIG_DEBUG_VERBOSE, "%s: got az=%.2f, el=%.2f\n", __func__, az, el); if (rs->south_zero) { - *azimuth += *azimuth >= 180 ? -180 : 180; - rot_debug(RIG_DEBUG_VERBOSE, "%s: south adj to az=%.2f\n", __func__, *azimuth); + az += az >= 180 ? -180 : 180; + rot_debug(RIG_DEBUG_VERBOSE, "%s: south adj to az=%.2f\n", __func__, az); } + *azimuth = az - rot->state.az_offset; + *elevation = el - rot->state.el_offset; + return RIG_OK; } @@ -841,4 +850,33 @@ const char *HAMLIB_API rot_get_info(ROT *rot) return rot->caps->get_info(rot); } + +/** + * \brief get status flags from the rotator + * \param rot The rot handle + * \param status a pointer to a rot_status_t variable that will receive the status flags + * + * Gets the active status flags from the rotator. + * + * \return RIG_OK if the operation has been successful, otherwise + * a negative value if an error occurred (in which case, cause is + * set appropriately). + */ +int HAMLIB_API rot_get_status(ROT *rot, rot_status_t *status) +{ + rot_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + if (CHECK_ROT_ARG(rot)) + { + return -RIG_EINVAL; + } + + if (rot->caps->get_status == NULL) + { + return -RIG_ENAVAIL; + } + + return rot->caps->get_status(rot, status); +} + /*! @} */ diff --git a/tests/dumpcaps_rot.c b/tests/dumpcaps_rot.c index 0f8def4f..90cfd7c7 100644 --- a/tests/dumpcaps_rot.c +++ b/tests/dumpcaps_rot.c @@ -146,6 +146,17 @@ int dumpcaps_rot(ROT *rot, FILE *fout) "Post Write delay:\t%dmS\n", caps->post_write_delay); + if (rot->state.has_status != 0) + { + rot_sprintf_status(prntbuf, rot->state.has_status); + } + else + { + strcpy(prntbuf, "None\n"); + } + + fprintf(fout, "Status flags: %s\n", prntbuf); + rot_sprintf_func(prntbuf, caps->has_get_func); fprintf(fout, "Get functions: %s\n", prntbuf); @@ -223,7 +234,16 @@ int dumpcaps_rot(ROT *rot, FILE *fout) fprintf(fout, "Can Park:\t\t%c\n", caps->park != NULL ? 'Y' : 'N'); fprintf(fout, "Can Reset:\t\t%c\n", caps->reset != NULL ? 'Y' : 'N'); fprintf(fout, "Can Move:\t\t%c\n", caps->move != NULL ? 'Y' : 'N'); + fprintf(fout, "Can get Info:\t\t%c\n", caps->get_info != NULL ? 'Y' : 'N'); + fprintf(fout, "Can get Status:\t\t%c\n", caps->get_status != NULL ? 'Y' : 'N'); + + fprintf(fout, "Can set Func:\t%c\n", caps->set_func != NULL ? 'Y' : 'N'); + fprintf(fout, "Can get Func:\t%c\n", caps->get_func != NULL ? 'Y' : 'N'); + fprintf(fout, "Can set Level:\t%c\n", caps->set_level != NULL ? 'Y' : 'N'); + fprintf(fout, "Can get Level:\t%c\n", caps->get_level != NULL ? 'Y' : 'N'); + fprintf(fout, "Can set Param:\t%c\n", caps->set_parm != NULL ? 'Y' : 'N'); + fprintf(fout, "Can get Param:\t%c\n", caps->get_parm != NULL ? 'Y' : 'N'); fprintf(fout, "\nOverall backend warnings: %d\n", backend_warnings); diff --git a/tests/rotctl_parse.c b/tests/rotctl_parse.c index 2e500d76..9b45e593 100644 --- a/tests/rotctl_parse.c +++ b/tests/rotctl_parse.c @@ -187,6 +187,7 @@ declare_proto_rot(get_func); declare_proto_rot(set_parm); declare_proto_rot(get_parm); declare_proto_rot(get_info); +declare_proto_rot(get_status); declare_proto_rot(inter_set_conf); /* interactive mode set_conf */ declare_proto_rot(send_cmd); declare_proto_rot(dump_state); @@ -224,6 +225,7 @@ struct test_table test_list[] = { 'x', "get_parm", ACTION(get_parm), ARG_IN1 | ARG_OUT2, "Parm", "Parm Value" }, { 'C', "set_conf", ACTION(inter_set_conf), ARG_IN, "Token", "Value" }, { '_', "get_info", ACTION(get_info), ARG_OUT, "Info" }, + { 's', "get_status", ACTION(get_status), ARG_OUT, "Status flags" }, { 'w', "send_cmd", ACTION(send_cmd), ARG_IN1 | ARG_IN_LINE | ARG_OUT2, "Cmd", "Reply" }, { '1', "dump_caps", ACTION(dump_caps), }, { 0x8f, "dump_state", ACTION(dump_state), ARG_OUT }, @@ -1729,7 +1731,7 @@ declare_proto_rot(set_position) CHKSCN1ARG(sscanf(arg1, "%f", &az)); CHKSCN1ARG(sscanf(arg2, "%f", &el)); - return rot_set_position(rot, az + rot->state.az_offset, el); + return rot_set_position(rot, az, el); } @@ -1742,8 +1744,6 @@ declare_proto_rot(get_position) status = rot_get_position(rot, &az, &el); - az -= rot->state.az_offset; - if (status != RIG_OK) { return status; @@ -1809,6 +1809,32 @@ declare_proto_rot(get_info) } +/* 's' */ +declare_proto_rot(get_status) +{ + int result; + rot_status_t status; + char s[SPRINTF_MAX_SIZE]; + + result = rot_get_status(rot, &status); + + if (result != RIG_OK) + { + return result; + } + + if ((interactive && prompt) || (interactive && !prompt && ext_resp)) + { + fprintf(fout, "%s: ", cmd->arg1); + } + + rot_sprintf_status(s, status); + fprintf(fout, "%s%c", s, resp_sep); + + return RIG_OK; +} + + /* 'M' */ declare_proto_rot(move) { diff --git a/tests/sprintflst.c b/tests/sprintflst.c index 3782aee9..2416df3a 100644 --- a/tests/sprintflst.c +++ b/tests/sprintflst.c @@ -665,6 +665,33 @@ int rig_sprintf_scan(char *str, scan_t rscan) } +int rot_sprintf_status(char *str, rot_status_t status) +{ + int i, len = 0; + + rig_debug(RIG_DEBUG_TRACE, "%s: status=%08x\n", __func__, status); + *str = '\0'; + + if (status == ROT_STATUS_NONE) + { + return 0; + } + + for (i = 0; i < 32; i++) + { + const char *sv; + sv = rot_strstatus(status & ROT_STATUS_N(i)); + + if (sv && sv[0] && (strstr(sv, "None") == 0)) + { + len += sprintf(str + len, "%s ", sv); + } + } + + return len; +} + + char *get_rig_conf_type(enum rig_conf_e type) { switch (type) diff --git a/tests/sprintflst.h b/tests/sprintflst.h index 5fa2c624..2b74f404 100644 --- a/tests/sprintflst.h +++ b/tests/sprintflst.h @@ -23,6 +23,7 @@ #define _SPRINTFLST_H 1 #include <hamlib/rig.h> +#include <hamlib/rotator.h> #define SPRINTF_MAX_SIZE 512 @@ -45,6 +46,7 @@ extern int rig_sprintf_parm_gran(char *str, setting_t parm, const gran_t *gran); extern int rot_sprintf_parm_gran(char *str, setting_t parm, const gran_t *gran); extern int rig_sprintf_vfop(char *str, vfo_op_t op); extern int rig_sprintf_scan(char *str, scan_t rscan); +extern int rot_sprintf_status(char *str, rot_status_t status); extern char *get_rig_conf_type(enum rig_conf_e type); int print_ext_param(const struct confparams *cfp, rig_ptr_t ptr); commit a661bee28394a9b19d3c4ab87aec36b8fe21a0ea Author: Mikael Nousiainen <mik...@ik...> Date: Wed Dec 2 22:35:38 2020 +0200 Add rotator funcs/levels/parms to rotator caps dump diff --git a/rigs/dummy/rot_dummy.c b/rigs/dummy/rot_dummy.c index 8fd9c370..5cd31783 100644 --- a/rigs/dummy/rot_dummy.c +++ b/rigs/dummy/rot_dummy.c @@ -31,6 +31,7 @@ #include "hamlib/rotator.h" #include "dummy_common.h" #include "register.h" +#include "idx_builtin.h" #include "rot_dummy.h" @@ -847,7 +848,7 @@ const struct rot_caps dummy_rot_caps = ROT_MODEL(ROT_MODEL_DUMMY), .model_name = "Dummy", .mfg_name = "Hamlib", - .version = "20200310.0", + .version = "20201202.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZEL, @@ -867,7 +868,7 @@ const struct rot_caps dummy_rot_caps = .has_get_parm = DUMMY_ROT_PARM, .has_set_parm = ROT_PARM_SET(DUMMY_ROT_PARM), - .level_gran = { [ROT_LEVEL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, + .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, .extlevels = dummy_ext_levels, .extfuncs = dummy_ext_funcs, diff --git a/src/idx_builtin.h b/src/idx_builtin.h index d52b2779..220246fa 100644 --- a/src/idx_builtin.h +++ b/src/idx_builtin.h @@ -23,6 +23,7 @@ #define _IDX_BUILTIN_H 1 #include <hamlib/rig.h> +#include <hamlib/rotator.h> /* * only for Hamlib internal use (backend caps) @@ -185,5 +186,9 @@ #define PARM_BAT setting2idx_builtin(RIG_PARM_BAT) #define PARM_KEYLIGHT setting2idx_builtin(RIG_PARM_KEYLIGHT) +/* Rotator levels */ + +#define ROT_LVL_SPEED setting2idx_builtin(ROT_LEVEL_SPEED) + #endif /* _IDX_BUILTIN_H */ diff --git a/tests/dumpcaps.c b/tests/dumpcaps.c index 5617f8c1..2a27f5d0 100644 --- a/tests/dumpcaps.c +++ b/tests/dumpcaps.c @@ -33,12 +33,15 @@ #include "sprintflst.h" #include "rigctl_parse.h" -static int print_ext(RIG *rig, const struct confparams *cfp, rig_ptr_t ptr); void range_print(FILE *fout, const struct freq_range_list range_list[], int rx); int range_sanity_check(const struct freq_range_list range_list[], int rx); int ts_sanity_check(const struct tuning_step_list tuning_step[]); static void dump_chan_caps(const channel_cap_t *chan, FILE *fout); +static int print_ext(RIG *rig, const struct confparams *cfp, rig_ptr_t ptr) +{ + return print_ext_param(cfp, ptr); +} /* * the rig may be in rig_init state, but not opened @@ -832,41 +835,6 @@ int dumpcaps(RIG *rig, FILE *fout) return backend_warnings; } -static int print_ext(RIG *rig, const struct confparams *cfp, rig_ptr_t ptr) -{ - int i; - fprintf((FILE *)ptr, "\t%s\n", cfp->name); - fprintf((FILE *)ptr, "\t\tType: %s\n", get_rig_conf_type(cfp->type)); - fprintf((FILE *)ptr, "\t\tDefault: %s\n", cfp->dflt != NULL ? cfp->dflt : ""); - fprintf((FILE *)ptr, "\t\tLabel: %s\n", cfp->label != NULL ? cfp->label : ""); - fprintf((FILE *)ptr, "\t\tTooltip: %s\n", - cfp->tooltip != NULL ? cfp->tooltip : ""); - - switch (cfp->type) - { - case RIG_CONF_NUMERIC: - fprintf((FILE *)ptr, "\t\tRange: %g..%g/%g\n", cfp->u.n.min, cfp->u.n.max, - cfp->u.n.step); - break; - - case RIG_CONF_COMBO: - fprintf((FILE *)ptr, "\t\tValues:"); - - for (i = 0; i < RIG_COMBO_MAX && cfp->u.c.combostr[i] != NULL; i++) - { - fprintf((FILE *)ptr, " %d=\"%s\"", i, cfp->u.c.combostr[i]); - } - - fprintf((FILE *)ptr, "\n"); - break; - - default: - break; - } - - return 1; /* process them all */ -} - void range_print(FILE *fout, const struct freq_range_list range_list[], int rx) { int i; diff --git a/tests/dumpcaps_rot.c b/tests/dumpcaps_rot.c index bc0b98b9..0f8def4f 100644 --- a/tests/dumpcaps_rot.c +++ b/tests/dumpcaps_rot.c @@ -34,6 +34,11 @@ #include "rotctl_parse.h" +static int print_ext(ROT *rot, const struct confparams *cfp, rig_ptr_t ptr) +{ + return print_ext_param(cfp, ptr); +} + /* * the rot may be in rot_init state, but not opened */ @@ -41,6 +46,7 @@ int dumpcaps_rot(ROT *rot, FILE *fout) { const struct rot_caps *caps; int backend_warnings = 0; + static char prntbuf[1024]; if (!rot || !rot->caps) { @@ -140,6 +146,51 @@ int dumpcaps_rot(ROT *rot, FILE *fout) "Post Write delay:\t%dmS\n", caps->post_write_delay); + rot_sprintf_func(prntbuf, caps->has_get_func); + fprintf(fout, "Get functions: %s\n", prntbuf); + + rot_sprintf_func(prntbuf, caps->has_set_func); + fprintf(fout, "Set functions: %s\n", prntbuf); + + fprintf(fout, "Extra functions:\n"); + rot_ext_func_foreach(rot, print_ext, fout); + + rot_sprintf_level_gran(prntbuf, caps->has_get_level, caps->level_gran); + fprintf(fout, "Get level: %s\n", prntbuf); + + if ((caps->has_get_level & RIG_LEVEL_SQLSTAT)) + { + fprintf(fout, "Warning--backend uses deprecated SQLSTAT level!\n"); + backend_warnings++; + } + + rot_sprintf_level_gran(prntbuf, caps->has_set_level, caps->level_gran); + fprintf(fout, "Set level: %s\n", prntbuf); + + if (caps->has_set_level & ROT_LEVEL_READONLY_LIST) + { + fprintf(fout, "Warning--backend can set readonly levels!\n"); + backend_warnings++; + } + + fprintf(fout, "Extra levels:\n"); + rot_ext_level_foreach(rot, print_ext, fout); + + rot_sprintf_parm_gran(prntbuf, caps->has_get_parm, caps->parm_gran); + fprintf(fout, "Get parameters: %s\n", prntbuf); + + rot_sprintf_parm_gran(prntbuf, caps->has_set_parm, caps->parm_gran); + fprintf(fout, "Set parameters: %s\n", prntbuf); + + if (caps->has_set_parm & ROT_PARM_READONLY_LIST) + { + fprintf(fout, "Warning--backend can set readonly parms!\n"); + backend_warnings++; + } + + fprintf(fout, "Extra parameters:\n"); + rot_ext_parm_foreach(rot, print_ext, fout); + fprintf(fout, "Min Azimuth:\t\t%.2f\n", caps->min_az); fprintf(fout, "Max Azimuth:\t\t%.2f\n", caps->max_az); diff --git a/tests/sprintflst.c b/tests/sprintflst.c index 181d769f..3782aee9 100644 --- a/tests/sprintflst.c +++ b/tests/sprintflst.c @@ -690,3 +690,38 @@ char *get_rig_conf_type(enum rig_conf_e type) return "UNKNOWN"; } + +int print_ext_param(const struct confparams *cfp, rig_ptr_t ptr) +{ + int i; + fprintf((FILE *)ptr, "\t%s\n", cfp->name); + fprintf((FILE *)ptr, "\t\tType: %s\n", get_rig_conf_type(cfp->type)); + fprintf((FILE *)ptr, "\t\tDefault: %s\n", cfp->dflt != NULL ? cfp->dflt : ""); + fprintf((FILE *)ptr, "\t\tLabel: %s\n", cfp->label != NULL ? cfp->label : ""); + fprintf((FILE *)ptr, "\t\tTooltip: %s\n", + cfp->tooltip != NULL ? cfp->tooltip : ""); + + switch (cfp->type) + { + case RIG_CONF_NUMERIC: + fprintf((FILE *)ptr, "\t\tRange: %g..%g/%g\n", cfp->u.n.min, cfp->u.n.max, + cfp->u.n.step); + break; + + case RIG_CONF_COMBO: + fprintf((FILE *)ptr, "\t\tValues:"); + + for (i = 0; i < RIG_COMBO_MAX && cfp->u.c.combostr[i] != NULL; i++) + { + fprintf((FILE *)ptr, " %d=\"%s\"", i, cfp->u.c.combostr[i]); + } + + fprintf((FILE *)ptr, "\n"); + break; + + default: + break; + } + + return 1; /* process them all */ +} diff --git a/tests/sprintflst.h b/tests/sprintflst.h index a1f14217..5fa2c624 100644 --- a/tests/sprintflst.h +++ b/tests/sprintflst.h @@ -46,6 +46,7 @@ extern int rot_sprintf_parm_gran(char *str, setting_t parm, const gran_t *gran); extern int rig_sprintf_vfop(char *str, vfo_op_t op); extern int rig_sprintf_scan(char *str, scan_t rscan); extern char *get_rig_conf_type(enum rig_conf_e type); +int print_ext_param(const struct confparams *cfp, rig_ptr_t ptr); __END_DECLS commit bb315270bf18a41be59aeadf129088fa41253e76 Merge: a48f1499 e49dc2e1 Author: Mikael Nousiainen <mik...@ik...> Date: Wed Dec 2 21:46:23 2020 +0200 Merge branch 'master' into rotator-speed-control-and-status diff -... [truncated message content] |
From: Nate B. <n0...@us...> - 2020-12-04 18:40:03
|
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, Hamlib-4.0 has been updated via 42f9c05c81728cf1137367a3e1954d8948958b19 (commit) via 05d21d830e22242c3bb5476ed7dc64cb612a02a8 (commit) via bd9432a45d2f98f3e1bdee33fefdb6f982926c6d (commit) via aa9caf574ec623f73d6595123698e643b47ac144 (commit) via 2e9922b824761ca39e05ab449f0a3bfa3390d8f9 (commit) via 9bf5db46d820ce54d4aa5d4c0b3ae8c366a34f72 (commit) via 989048e6e5f046d99d49ebef1a4276a372d90569 (commit) via 031f3ef0accb250f19a1298447642c7851dbcc9f (commit) via be9e49df15c960628186705705a5e6b44f9641ba (commit) via ef15cf25301ebdd91b3e0155d2bf8d1b7be3a055 (commit) via 6acb08d62af9d6e2d9e363152230664e435c7a01 (commit) via 948a26198988d3ce7d4d8af7bc1be03618ac1a37 (commit) via d167061fe5903dd3f53be8fedea2e111763a5a3a (commit) via b3aa00511938207c2d0c5adcd91a476e27fba16f (commit) via cd0a993dcadfaac65b1cd21bce483008cd058185 (commit) via 3a9b4ca027795c5fd6e05349cf2ef81437113607 (commit) via 9ea46c07c217f57c6c1dbc98c170c8abdc86e855 (commit) via a9b2907c76de16a1b770d5df49643b6ac4602736 (commit) via 39d9b016c15b61e731cf7c4d2237b0b5e5f3332f (commit) via 5b2fa8dc529d36d38af5842a53f0b3c5aa05c3a2 (commit) via da2dac8b72bcf433e1c69f375bac03bdfd82e09b (commit) via bdbf64091028a734c5c4e616b84a3f694735aa09 (commit) via 8954ecf9d4c3afebde8eb82eca0e8c713dffb6b5 (commit) via a00cc49e10e9a8ab26e71eb94d6fcf1c9ed819de (commit) via be72027f9a3c54b2ac086d3aca456edd503d7ecf (commit) via 5725fcb76f6abb217aca6ea2d0b722e5bc97e50b (commit) via 6faee5c6f7df57bb055e3f3d00011c1b358484ee (commit) via 1bea95992264366a69392f328f880ed05ba7f7c6 (commit) via eea905d14f0f743854fbaac53a5690bcafc34783 (commit) via 1c895f9f81ccc67cd545f374396090038d276f05 (commit) via a1f1fd161b963185e789d5c57a8b2b5d0c604d40 (commit) via 290d8905af6d33c896b0a57b49937736c8635054 (commit) via b040b51603f94df80478eccf2b5acb906772e5df (commit) via 6174d9f9519980edd59f05e880e5496a95483a17 (commit) via d86b0f03b734afcd09d329499090c590778bcf37 (commit) via a76fac7be66f0d68f70ca4bf4155ddd536992528 (commit) via e741e854412d39ce4110da2e4f603f6949325a1f (commit) via cfba9f18cf25ee31b73c815c2b5e26c3a69ea2eb (commit) from c76bf379e79df2f79880e3fefd8e7a05b251217f (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 42f9c05c81728cf1137367a3e1954d8948958b19 Author: Nate Bargmann <n0...@n0...> Date: Fri Dec 4 12:18:10 2020 -0600 Fix release version from botched cherry-pick diff --git a/configure.ac b/configure.ac index cea90ff5..fab6da24 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ dnl however, the use of '~' should be fine as apt (others?) will treat dnl it as an earlier version than the actual release. TNX KA6MAL dnl PACKAGE_NAME + " " + PACKAGE_VERSION must not exceed 20 chars! AC_INIT([Hamlib], - [4.1~git], + [4.0~rc3], [ham...@li...], [hamlib], [http://www.hamlib.org]) @@ -60,7 +60,7 @@ dnl See README.release on setting these values # Values given to -version-info when linking. See libtool documentation. # Set them here to keep c++/Makefile and src/Makefile in sync. ABI_VERSION=4 -ABI_REVISION=1 +ABI_REVISION=0 ABI_AGE=0 AC_DEFINE_UNQUOTED([ABI_VERSION], [$ABI_VERSION], [Frontend ABI version]) commit 05d21d830e22242c3bb5476ed7dc64cb612a02a8 Author: Mikael Nousiainen <mik...@ik...> Date: Thu Dec 3 23:21:57 2020 +0200 Comments (cherry picked from commit 472293cd57d518f96879168d2e95388e2a22c7eb) diff --git a/include/hamlib/rotator.h b/include/hamlib/rotator.h index 0cff2267..52f22f13 100644 --- a/include/hamlib/rotator.h +++ b/include/hamlib/rotator.h @@ -238,7 +238,7 @@ typedef enum { */ enum rot_level_e { ROT_LEVEL_NONE = 0, /*!< '' -- No Level */ - ROT_LEVEL_SPEED = (1 << 0), /*!< \c SPEED -- Rotation speed, arg int (1-100) */ + ROT_LEVEL_SPEED = (1 << 0), /*!< \c SPEED -- Rotation speed, arg int (default range 1-100 if not specified) */ ROT_LEVEL_63 = CONSTANT_64BIT_FLAG(63), /*!< \c Future use, last level */ }; diff --git a/rigs/dummy/dummy_common.h b/rigs/dummy/dummy_common.h index 84c9bdc9..eba06538 100644 --- a/rigs/dummy/dummy_common.h +++ b/rigs/dummy/dummy_common.h @@ -1,5 +1,5 @@ /* - * Hamlib Dummy backend - shard routines + * Hamlib Dummy backend - shared routines * Copyright (c) 2020 by Mikael Nousiainen * * commit bd9432a45d2f98f3e1bdee33fefdb6f982926c6d Author: Mikael Nousiainen <mik...@ik...> Date: Thu Dec 3 23:07:08 2020 +0200 Add support for ROT_LEVEL_SPEED level in rotator backends that support setting the rotator speed via the move command. Add azimuth-only and elevation-only versions of generic GS-232A and GS-232B backends. (cherry picked from commit 81a0c521e7a1c5979b9f25c40a8e247c52c96fce) diff --git a/include/hamlib/rotlist.h b/include/hamlib/rotlist.h index 2dfd0120..5151013c 100644 --- a/include/hamlib/rotlist.h +++ b/include/hamlib/rotlist.h @@ -261,6 +261,10 @@ #define ROT_MODEL_GS232 ROT_MAKE_MODEL(ROT_GS232A, 6) /* Not A or B */ #define ROT_MODEL_LVB ROT_MAKE_MODEL(ROT_GS232A, 7) #define ROT_MODEL_ST2 ROT_MAKE_MODEL(ROT_GS232A, 8) +#define ROT_MODEL_GS232A_AZ ROT_MAKE_MODEL(ROT_GS232A, 9) +#define ROT_MODEL_GS232A_EL ROT_MAKE_MODEL(ROT_GS232A, 10) +#define ROT_MODEL_GS232B_AZ ROT_MAKE_MODEL(ROT_GS232A, 11) +#define ROT_MODEL_GS232B_EL ROT_MAKE_MODEL(ROT_GS232A, 12) /** * \def ROT_MODEL_PCROTOR diff --git a/rotators/easycomm/easycomm.c b/rotators/easycomm/easycomm.c index 7e691e19..e2955c11 100644 --- a/rotators/easycomm/easycomm.c +++ b/rotators/easycomm/easycomm.c @@ -35,9 +35,12 @@ #include "serial.h" #include "misc.h" #include "register.h" +#include "idx_builtin.h" #include "easycomm.h" +#define EASYCOMM3_LEVELS ROT_LEVEL_SPEED + /* ************************************************************************* */ /** * easycomm_transaction @@ -247,8 +250,7 @@ easycomm_rot_move(ROT *rot, int direction, int speed) return RIG_OK; } -static int -easycomm_rot_move_velocity(ROT *rot, int direction, int speed) +static int easycomm_rot_move_velocity(ROT *rot, int direction, int speed) { struct rot_state *rs = &rot->state; char cmdstr[24]; @@ -258,7 +260,7 @@ easycomm_rot_move_velocity(ROT *rot, int direction, int speed) rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); if (speed == ROT_SPEED_NOCHANGE) { - easycomm_speed = ((rs->current_speed - 1) * 100); + easycomm_speed = rs->current_speed; } else { if (speed < 1 || speed > 100) { @@ -267,8 +269,8 @@ easycomm_rot_move_velocity(ROT *rot, int direction, int speed) return -RIG_EINVAL; } - rs->current_speed = speed; easycomm_speed = ((speed - 1) * 100); + rs->current_speed = easycomm_speed; } /* Speed for EasyComm 3 */ @@ -306,6 +308,49 @@ easycomm_rot_move_velocity(ROT *rot, int direction, int speed) return RIG_OK; } +static int easycomm_rot_get_level(ROT *rot, setting_t level, value_t *val) +{ + struct rot_state *rs = &rot->state; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); + + switch (level) { + case ROT_LEVEL_SPEED: + val->i = rs->current_speed; + break; + default: + return -RIG_ENAVAIL; + } + + return RIG_OK; +} + + +static int easycomm_rot_set_level(ROT *rot, setting_t level, value_t val) +{ + struct rot_state *rs = &rot->state; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); + + switch (level) { + case ROT_LEVEL_SPEED: { + int speed = val.i; + if (speed < 0) { + speed = 0; + } else if (speed > 9999) { + speed = 9999; + } + + rs->current_speed = speed; + break; + } + default: + return -RIG_ENAVAIL; + } + + return RIG_OK; +} + /* * Get Info * returns the model name string @@ -441,6 +486,19 @@ static int easycomm_rot_set_conf(ROT *rot, token_t token, const char *val) return RIG_OK; } + +static int easycomm_rot_init(ROT *rot) +{ + struct rot_state *rs = &rot->state; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + // Set default speed to half of maximum + rs->current_speed = 5000; + + return RIG_OK; +} + /* ************************************************************************* */ /* * Easycomm rotator capabilities. @@ -537,7 +595,7 @@ const struct rot_caps easycomm3_rot_caps = ROT_MODEL(ROT_MODEL_EASYCOMM3), .model_name = "EasycommIII", .mfg_name = "Hamlib", - .version = "20201118.0", + .version = "20201203.0", .copyright = "LGPL", .status = RIG_STATUS_ALPHA, .rot_type = ROT_TYPE_OTHER, @@ -560,7 +618,12 @@ const struct rot_caps easycomm3_rot_caps = .priv = NULL, /* priv */ - .rot_init = NULL, + .has_get_level = EASYCOMM3_LEVELS, + .has_set_level = ROT_LEVEL_SET(EASYCOMM3_LEVELS), + + .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 0 }, .max = { .i = 9999 }, .step = { .i = 1 } } }, + + .rot_init = easycomm_rot_init, .rot_cleanup = NULL, .rot_open = NULL, .rot_close = NULL, @@ -571,6 +634,8 @@ const struct rot_caps easycomm3_rot_caps = .park = easycomm_rot_park, .reset = easycomm_rot_reset, .move = easycomm_rot_move_velocity, + .get_level = easycomm_rot_get_level, + .set_level = easycomm_rot_set_level, .set_conf = easycomm_rot_set_conf, .get_conf = easycomm_rot_get_conf, .get_info = easycomm_rot_get_info, diff --git a/rotators/ether6/ether6.c b/rotators/ether6/ether6.c index 0e90275d..2a5c121a 100644 --- a/rotators/ether6/ether6.c +++ b/rotators/ether6/ether6.c @@ -35,12 +35,15 @@ #include "serial.h" #include "misc.h" #include "register.h" +#include "idx_builtin.h" #include "ether6.h" #define CMD_MAX 32 #define BUF_MAX 64 +#define ETHER_LEVELS ROT_LEVEL_SPEED + /* * Helper function with protocol return code parsing */ @@ -306,6 +309,51 @@ static int ether_rot_move(ROT *rot, int direction, int speed) } +static int ether_rot_get_level(ROT *rot, setting_t level, value_t *val) +{ + struct rot_state *rs = &rot->state; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); + + switch (level) { + case ROT_LEVEL_SPEED: + val->i = rs->current_speed; + break; + default: + return -RIG_ENAVAIL; + } + + return RIG_OK; +} + + +static int ether_rot_set_level(ROT *rot, setting_t level, value_t val) +{ + struct rot_state *rs = &rot->state; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); + + switch (level) { + case ROT_LEVEL_SPEED: { + int speed = val.i; + if (speed < 1) { + speed = 1; + } else if (speed > 100) { + speed = 100; + } + + rs->current_speed = speed; + break; + } + default: + return -RIG_ENAVAIL; + } + + return RIG_OK; +} + + + static const char *ether_rot_get_info(ROT *rot) { rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -314,6 +362,18 @@ static const char *ether_rot_get_info(ROT *rot) } +static int ether_rot_init(ROT *rot) +{ + struct rot_state *rs = &rot->state; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + // Set default speed to half of maximum + rs->current_speed = 00; + + return RIG_OK; +} + /* * Dummy rotator capabilities. @@ -324,7 +384,7 @@ const struct rot_caps ether6_rot_caps = ROT_MODEL(ROT_MODEL_ETHER6), .model_name = "Ether6 (via ethernet)", .mfg_name = "DG9OAA", - .version = "20200106.0", + .version = "20201203.0", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rot_type = ROT_FLAG_AZIMUTH, @@ -339,8 +399,13 @@ const struct rot_caps ether6_rot_caps = .priv = NULL, /* priv */ - /* .rot_init = ether_rot_init, */ - /* .rot_cleanup = ether_rot_cleanup, */ + .has_get_level = ETHER_LEVELS, + .has_set_level = ROT_LEVEL_SET(ETHER_LEVELS), + + .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 0 }, .max = { .i = 9999 }, .step = { .i = 1 } } }, + + .rot_init = ether_rot_init, + .rot_cleanup = NULL, .rot_open = ether_rot_open, .rot_close = ether_rot_close, @@ -351,6 +416,8 @@ const struct rot_caps ether6_rot_caps = .stop = ether_rot_stop, .reset = ether_rot_reset, .move = ether_rot_move, + .get_level = ether_rot_get_level, + .set_level = ether_rot_set_level, .get_info = ether_rot_get_info, }; diff --git a/rotators/gs232a/gs232a.c b/rotators/gs232a/gs232a.c index 29bf8dd7..9647e0f0 100644 --- a/rotators/gs232a/gs232a.c +++ b/rotators/gs232a/gs232a.c @@ -38,6 +38,7 @@ #include "serial.h" #include "misc.h" #include "register.h" +#include "idx_builtin.h" #include "gs232a.h" @@ -46,6 +47,8 @@ #define BUFSZ 64 +#define GS232A_LEVELS ROT_LEVEL_SPEED + /** * gs232a_transaction * @@ -236,36 +239,85 @@ gs232a_rot_stop(ROT *rot) } -static int -gs232a_rot_move(ROT *rot, int direction, int speed) +static int gs232a_rot_get_level(ROT *rot, setting_t level, value_t *val) +{ + struct rot_state *rs = &rot->state; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); + + switch (level) { + case ROT_LEVEL_SPEED: + val->i = rs->current_speed; + break; + default: + return -RIG_ENAVAIL; + } + + return RIG_OK; +} + + +static int gs232a_rot_set_level(ROT *rot, setting_t level, value_t val) { struct rot_state *rs = &rot->state; char cmdstr[24]; int retval; - unsigned x_speed; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); + + switch (level) { + case ROT_LEVEL_SPEED: { + int speed = val.i; + if (speed < 1) { + speed = 1; + } else if (speed > 4) { + speed = 4; + } + + /* between 1 (slowest) and 4 (fastest) */ + sprintf(cmdstr, "X%u" EOM, speed); + retval = gs232a_transaction(rot, cmdstr, NULL, 0, 1); + + if (retval != RIG_OK) { + return retval; + } + + rs->current_speed = speed; + break; + } + default: + return -RIG_ENAVAIL; + } + + return RIG_OK; +} + + +static int gs232a_rot_move(ROT *rot, int direction, int speed) +{ + char cmdstr[24]; + int retval; rig_debug(RIG_DEBUG_TRACE, "%s called %d %d\n", __func__, direction, speed); if (speed != ROT_SPEED_NOCHANGE) { + value_t gs232a_speed; + if (speed < 1 || speed > 100) { rig_debug(RIG_DEBUG_ERR, "%s: Invalid speed value (1-100)! (%d)\n", __func__, speed); return -RIG_EINVAL; } - x_speed = (3 * speed) / 100 + 1; + gs232a_speed.i = (3 * speed) / 100 + 1; - /* between 1 (slowest) and 4 (fastest) */ - sprintf(cmdstr, "X%u" EOM, x_speed); - retval = gs232a_transaction(rot, cmdstr, NULL, 0, 1); + retval = gs232a_rot_set_level(rot, ROT_LEVEL_SPEED, gs232a_speed); if (retval != RIG_OK) { return retval; } - - rs->current_speed = speed; } switch (direction) @@ -302,6 +354,20 @@ gs232a_rot_move(ROT *rot, int direction, int speed) return RIG_OK; } + +static int gs232a_rot_init(ROT *rot) +{ + struct rot_state *rs = &rot->state; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + // Set default speed to half of maximum + rs->current_speed = 3; + + return RIG_OK; +} + + /* ************************************************************************* */ /* * Generic GS23 rotator capabilities. @@ -312,7 +378,7 @@ const struct rot_caps gs23_rot_caps = ROT_MODEL(ROT_MODEL_GS23), .model_name = "GS-23", .mfg_name = "Yaesu/Kenpro", - .version = "20201202.0", + .version = "20201203.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZEL, @@ -333,9 +399,17 @@ const struct rot_caps gs23_rot_caps = .min_el = 0.0, .max_el = 180.0, + .has_get_level = GS232A_LEVELS, + .has_set_level = ROT_LEVEL_SET(GS232A_LEVELS), + + .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, + + .rot_init = gs232a_rot_init, .get_position = gs232a_rot_get_position, .set_position = gs232a_rot_set_position, - .stop = gs232a_rot_stop, + .stop = gs232a_rot_stop, + .get_level = gs232a_rot_get_level, + .set_level = gs232a_rot_set_level, }; /* ************************************************************************* */ @@ -348,7 +422,7 @@ const struct rot_caps gs232_rot_caps = ROT_MODEL(ROT_MODEL_GS232), .model_name = "GS-232", .mfg_name = "Yaesu/Kenpro", - .version = "20201202.0", + .version = "20201203.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZEL, @@ -369,9 +443,17 @@ const struct rot_caps gs232_rot_caps = .min_el = 0.0, .max_el = 180.0, + .has_get_level = GS232A_LEVELS, + .has_set_level = ROT_LEVEL_SET(GS232A_LEVELS), + + .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, + + .rot_init = gs232a_rot_init, .get_position = gs232a_rot_get_position, .set_position = gs232a_rot_set_position, - .stop = gs232a_rot_stop, + .stop = gs232a_rot_stop, + .get_level = gs232a_rot_get_level, + .set_level = gs232a_rot_set_level, }; /* ************************************************************************* */ @@ -384,10 +466,10 @@ const struct rot_caps gs232a_rot_caps = ROT_MODEL(ROT_MODEL_GS232A), .model_name = "GS-232A", .mfg_name = "Yaesu", - .version = "20201205.0", + .version = "20201203.0", .copyright = "LGPL", .status = RIG_STATUS_BETA, - .rot_type = ROT_TYPE_OTHER, + .rot_type = ROT_TYPE_AZEL, .port_type = RIG_PORT_SERIAL, .serial_rate_min = 150, .serial_rate_max = 9600, @@ -405,26 +487,125 @@ const struct rot_caps gs232a_rot_caps = .min_el = 0.0, .max_el = 180.0, /* requires G-5400B, G-5600B, G-5500, or G-500/G-550 */ + .has_get_level = GS232A_LEVELS, + .has_set_level = ROT_LEVEL_SET(GS232A_LEVELS), + + .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, + + .rot_init = gs232a_rot_init, .get_position = gs232a_rot_get_position, .set_position = gs232a_rot_set_position, - .stop = gs232a_rot_stop, + .stop = gs232a_rot_stop, .move = gs232a_rot_move, + .get_level = gs232a_rot_get_level, + .set_level = gs232a_rot_set_level, }; /* ************************************************************************* */ +/* + * Generic GS232A azimuth rotator capabilities. + */ +const struct rot_caps gs232a_az_rot_caps = +{ + ROT_MODEL(ROT_MODEL_GS232A_AZ), + .model_name = "GS-232A azimuth", + .mfg_name = "Yaesu", + .version = "20201203.0", + .copyright = "LGPL", + .status = RIG_STATUS_BETA, + .rot_type = ROT_TYPE_AZIMUTH, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 150, + .serial_rate_max = 9600, + .serial_data_bits = 8, + .serial_stop_bits = 1, + .serial_parity = RIG_PARITY_NONE, + .serial_handshake = RIG_HANDSHAKE_NONE, + .write_delay = 0, + .post_write_delay = 50, + .timeout = 400, + .retry = 3, + .min_az = -180.0, + .max_az = 450.0, /* vary according to rotator type */ + .min_el = 0.0, + .max_el = 0.0, + + .rot_init = gs232a_rot_init, + .has_get_level = GS232A_LEVELS, + .has_set_level = ROT_LEVEL_SET(GS232A_LEVELS), + .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, + + .get_position = gs232a_rot_get_position, + .set_position = gs232a_rot_set_position, + .stop = gs232a_rot_stop, + .move = gs232a_rot_move, + .get_level = gs232a_rot_get_level, + .set_level = gs232a_rot_set_level, +}; +/* ************************************************************************* */ +/* + * Generic GS232A elevation rotator capabilities. + */ + +const struct rot_caps gs232a_el_rot_caps = +{ + ROT_MODEL(ROT_MODEL_GS232A_EL), + .model_name = "GS-232A elevation", + .mfg_name = "Yaesu", + .version = "20201203.0", + .copyright = "LGPL", + .status = RIG_STATUS_BETA, + .rot_type = ROT_TYPE_ELEVATION, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 150, + .serial_rate_max = 9600, + .serial_data_bits = 8, + .serial_stop_bits = 1, + .serial_parity = RIG_PARITY_NONE, + .serial_handshake = RIG_HANDSHAKE_NONE, + .write_delay = 0, + .post_write_delay = 50, + .timeout = 400, + .retry = 3, + + .min_az = 0.0, + .max_az = 0.0, + .min_el = 0.0, + .max_el = 180.0, /* requires G-5400B, G-5600B, G-5500, or G-500/G-550 */ + + .has_get_level = GS232A_LEVELS, + .has_set_level = ROT_LEVEL_SET(GS232A_LEVELS), + + .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, + + .rot_init = gs232a_rot_init, + .get_position = gs232a_rot_get_position, + .set_position = gs232a_rot_set_position, + .stop = gs232a_rot_stop, + .move = gs232a_rot_move, + .get_level = gs232a_rot_get_level, + .set_level = gs232a_rot_set_level, +}; + +/* ************************************************************************* */ + DECLARE_INITROT_BACKEND(gs232a) { rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); rot_register(&gs232a_rot_caps); + rot_register(&gs232a_az_rot_caps); + rot_register(&gs232a_el_rot_caps); rot_register(&gs232_generic_rot_caps); rot_register(&gs232b_rot_caps); + rot_register(&gs232b_az_rot_caps); + rot_register(&gs232b_el_rot_caps); rot_register(&f1tetracker_rot_caps); rot_register(&gs23_rot_caps); rot_register(&gs232_rot_caps); diff --git a/rotators/gs232a/gs232a.h b/rotators/gs232a/gs232a.h index c6c84053..681fbc85 100644 --- a/rotators/gs232a/gs232a.h +++ b/rotators/gs232a/gs232a.h @@ -23,8 +23,12 @@ #define _ROT_GS232A_H 1 extern const struct rot_caps gs232a_rot_caps; +extern const struct rot_caps gs232a_az_rot_caps; +extern const struct rot_caps gs232a_el_rot_caps; extern const struct rot_caps gs232_generic_rot_caps; extern const struct rot_caps gs232b_rot_caps; +extern const struct rot_caps gs232b_az_rot_caps; +extern const struct rot_caps gs232b_el_rot_caps; extern const struct rot_caps f1tetracker_rot_caps; extern const struct rot_caps gs23_rot_caps; extern const struct rot_caps gs232_rot_caps; diff --git a/rotators/gs232a/gs232b.c b/rotators/gs232a/gs232b.c index a9f0f28c..8a5bf593 100644 --- a/rotators/gs232a/gs232b.c +++ b/rotators/gs232a/gs232b.c @@ -27,26 +27,22 @@ // cppcheck-suppress * #include <stdio.h> // cppcheck-suppress * -#include <stdlib.h> -// cppcheck-suppress * #include <string.h> /* String function definitions */ // cppcheck-suppress * -#include <unistd.h> /* UNIX standard function definitions */ -// cppcheck-suppress * #include <math.h> #include "hamlib/rotator.h" #include "serial.h" #include "misc.h" -#include "register.h" - -#include "gs232a.h" +#include "idx_builtin.h" #define EOM "\r" #define REPLY_EOM "\n" #define BUFSZ 64 +#define GS232B_LEVELS ROT_LEVEL_SPEED + /** * gs232b_transaction * @@ -274,36 +270,85 @@ gs232b_rot_stop(ROT *rot) } -static int -gs232b_rot_move(ROT *rot, int direction, int speed) +static int gs232b_rot_get_level(ROT *rot, setting_t level, value_t *val) +{ + struct rot_state *rs = &rot->state; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); + + switch (level) { + case ROT_LEVEL_SPEED: + val->i = rs->current_speed; + break; + default: + return -RIG_ENAVAIL; + } + + return RIG_OK; +} + + +static int gs232b_rot_set_level(ROT *rot, setting_t level, value_t val) { struct rot_state *rs = &rot->state; char cmdstr[24]; int retval; - unsigned x_speed; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, rot_strlevel(level)); + + switch (level) { + case ROT_LEVEL_SPEED: { + int speed = val.i; + if (speed < 1) { + speed = 1; + } else if (speed > 4) { + speed = 4; + } + + /* between 1 (slowest) and 4 (fastest) */ + sprintf(cmdstr, "X%u" EOM, speed); + retval = gs232b_transaction(rot, cmdstr, NULL, 0, 1); + + if (retval != RIG_OK) { + return retval; + } + + rs->current_speed = speed; + break; + } + default: + return -RIG_ENAVAIL; + } + + return RIG_OK; +} + + +static int gs232b_rot_move(ROT *rot, int direction, int speed) +{ + char cmdstr[24]; + int retval; rig_debug(RIG_DEBUG_TRACE, "%s called %d %d\n", __func__, direction, speed); if (speed != ROT_SPEED_NOCHANGE) { + value_t gs232b_speed; + if (speed < 1 || speed > 100) { rig_debug(RIG_DEBUG_ERR, "%s: Invalid speed value (1-100)! (%d)\n", __func__, speed); return -RIG_EINVAL; } - x_speed = (3 * speed) / 100 + 1; + gs232b_speed.i = (3 * speed) / 100 + 1; - /* between 1 (slowest) and 4 (fastest) */ - sprintf(cmdstr, "X%u" EOM, x_speed); - retval = gs232b_transaction(rot, cmdstr, NULL, 0, 1); + retval = gs232b_rot_set_level(rot, ROT_LEVEL_SPEED, gs232b_speed); if (retval != RIG_OK) { return retval; } - - rs->current_speed = speed; } switch (direction) @@ -340,6 +385,20 @@ gs232b_rot_move(ROT *rot, int direction, int speed) return RIG_OK; } + +static int gs232b_rot_init(ROT *rot) +{ + struct rot_state *rs = &rot->state; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + // Set default speed to half of maximum + rs->current_speed = 3; + + return RIG_OK; +} + + /* ************************************************************************* */ /* * Generic GS232B rotator capabilities. @@ -350,10 +409,10 @@ const struct rot_caps gs232b_rot_caps = ROT_MODEL(ROT_MODEL_GS232B), .model_name = "GS-232B", .mfg_name = "Yaesu", - .version = "20201202.0", + .version = "20201203.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, - .rot_type = ROT_TYPE_OTHER, + .rot_type = ROT_TYPE_AZEL, .port_type = RIG_PORT_SERIAL, .serial_rate_min = 1200, .serial_rate_max = 9600, @@ -371,10 +430,110 @@ const struct rot_caps gs232b_rot_caps = .min_el = 0.0, .max_el = 180.0, /* requires G-5400B, G-5600B, G-5500, or G-500/G-550 */ + .has_get_level = GS232B_LEVELS, + .has_set_level = ROT_LEVEL_SET(GS232B_LEVELS), + + .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, + + .rot_init = gs232b_rot_init, + .get_position = gs232b_rot_get_position, + .set_position = gs232b_rot_set_position, + .stop = gs232b_rot_stop, + .move = gs232b_rot_move, + .get_level = gs232b_rot_get_level, + .set_level = gs232b_rot_set_level, +}; + + +/* ************************************************************************* */ +/* + * Generic GS232B azimuth rotator capabilities. + */ + +const struct rot_caps gs232b_az_rot_caps = +{ + ROT_MODEL(ROT_MODEL_GS232B_AZ), + .model_name = "GS-232B azimuth", + .mfg_name = "Yaesu", + .version = "20201203.0", + .copyright = "LGPL", + .status = RIG_STATUS_STABLE, + .rot_type = ROT_TYPE_AZIMUTH, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 1200, + .serial_rate_max = 9600, + .serial_data_bits = 8, + .serial_stop_bits = 1, + .serial_parity = RIG_PARITY_NONE, + .serial_handshake = RIG_HANDSHAKE_NONE, + .write_delay = 0, + .post_write_delay = 50, + .timeout = 400, + .retry = 3, + + .min_az = -180.0, + .max_az = 450.0, /* vary according to rotator type */ + .min_el = 0.0, + .max_el = 0.0, + + .has_get_level = GS232B_LEVELS, + .has_set_level = ROT_LEVEL_SET(GS232B_LEVELS), + + .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, + + .rot_init = gs232b_rot_init, + .get_position = gs232b_rot_get_position, + .set_position = gs232b_rot_set_position, + .stop = gs232b_rot_stop, + .move = gs232b_rot_move, + .get_level = gs232b_rot_get_level, + .set_level = gs232b_rot_set_level, +}; + + +/* ************************************************************************* */ +/* + * Generic GS232B elevation rotator capabilities. + */ + +const struct rot_caps gs232b_el_rot_caps = +{ + ROT_MODEL(ROT_MODEL_GS232B_EL), + .model_name = "GS-232B elevation", + .mfg_name = "Yaesu", + .version = "20201203.0", + .copyright = "LGPL", + .status = RIG_STATUS_STABLE, + .rot_type = ROT_TYPE_ELEVATION, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 1200, + .serial_rate_max = 9600, + .serial_data_bits = 8, + .serial_stop_bits = 1, + .serial_parity = RIG_PARITY_NONE, + .serial_handshake = RIG_HANDSHAKE_NONE, + .write_delay = 0, + .post_write_delay = 50, + .timeout = 400, + .retry = 3, + + .min_az = 0.0, + .max_az = 0.0, + .min_el = 0.0, + .max_el = 180.0, /* requires G-5400B, G-5600B, G-5500, or G-500/G-550 */ + + .has_get_level = GS232B_LEVELS, + .has_set_level = ROT_LEVEL_SET(GS232B_LEVELS), + + .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, + + .rot_init = gs232b_rot_init, .get_position = gs232b_rot_get_position, .set_position = gs232b_rot_set_position, .stop = gs232b_rot_stop, .move = gs232b_rot_move, + .get_level = gs232b_rot_get_level, + .set_level = gs232b_rot_set_level, }; /* end of file */ commit aa9caf574ec623f73d6595123698e643b47ac144 Author: Mikael Nousiainen <mik...@ik...> Date: Thu Dec 3 21:40:34 2020 +0200 Add get_status command for rotator status flags. Add missing rotator caps in dumpcaps output. (cherry picked from commit 457211a7e353d3c5d7a93d606afb5d680ef18a10) diff --git a/include/hamlib/amplifier.h b/include/hamlib/amplifier.h index 7d61cea8..b7af885d 100644 --- a/include/hamlib/amplifier.h +++ b/include/hamlib/amplifier.h @@ -397,6 +397,10 @@ extern HAMLIB_EXPORT(const char *) amp_strlevel(setting_t); extern HAMLIB_EXPORT(const struct confparams *) rig_ext_lookup HAMLIB_PARAMS((RIG *rig, const char *name)); + +extern HAMLIB_EXPORT(setting_t) amp_parse_level(const char *s); +extern HAMLIB_EXPORT(const char *) amp_strlevel(setting_t); + //! @endcond diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 47696121..b8c4832f 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -2787,16 +2787,6 @@ extern HAMLIB_EXPORT(scan_t) rig_parse_scan(const char *s); extern HAMLIB_EXPORT(rptr_shift_t) rig_parse_rptr_shift(const char *s); extern HAMLIB_EXPORT(chan_type_t) rig_parse_mtype(const char *s); -extern HAMLIB_EXPORT(setting_t) rot_parse_func(const char *s); -extern HAMLIB_EXPORT(setting_t) rot_parse_level(const char *s); -extern HAMLIB_EXPORT(setting_t) rot_parse_parm(const char *s); -extern HAMLIB_EXPORT(const char *) rot_strfunc(setting_t); -extern HAMLIB_EXPORT(const char *) rot_strlevel(setting_t); -extern HAMLIB_EXPORT(const char *) rot_strparm(setting_t); - -extern HAMLIB_EXPORT(setting_t) amp_parse_level(const char *s); -extern HAMLIB_EXPORT(const char *) amp_strlevel(setting_t); - extern HAMLIB_EXPORT(const char *) rig_license HAMLIB_PARAMS(()); extern HAMLIB_EXPORT(const char *) rig_version HAMLIB_PARAMS(()); extern HAMLIB_EXPORT(const char *) rig_copyright HAMLIB_PARAMS(()); diff --git a/include/hamlib/rotator.h b/include/hamlib/rotator.h index 4a38bf87..0cff2267 100644 --- a/include/hamlib/rotator.h +++ b/include/hamlib/rotator.h @@ -200,20 +200,27 @@ typedef enum { * \brief Rotator status flags */ typedef enum { - ROT_STATUS_BUSY = (1 << 1), /*!< Rotator is busy, not accepting commands */ - ROT_STATUS_MOVING = (1 << 2), /*!< Rotator is currently moving (direction type not specified) */ - ROT_STATUS_MOVING_AZ = (1 << 3), /*!< Azimuth rotator is currently moving */ - ROT_STATUS_MOVING_EL = (1 << 4), /*!< Elevation rotator is currently moving */ - ROT_STATUS_UP_LIMIT = (1 << 5), /*!< The elevation rotator has reached its limit to move up */ - ROT_STATUS_DOWN_LIMIT = (1 << 6), /*!< The elevation rotator has reached its limit to move down */ - ROT_STATUS_LEFT_LIMIT = (1 << 7), /*!< The azimuth rotator has reached its limit to move left (CCW) */ - ROT_STATUS_RIGHT_LIMIT = (1 << 8), /*!< The azimuth rotator has reached its limit to move right (CW) */ - ROT_STATUS_UP_OVERLAP = (1 << 9), /*!< The elevation rotator has rotated up past 360 degrees */ - ROT_STATUS_DOWN_OVERLAP = (1 << 10), /*!< The elevation rotator has rotated down past 0 degrees */ - ROT_STATUS_LEFT_OVERLAP = (1 << 11), /*!< The azimuth rotator has rotated left (CCW) past 0 degrees */ - ROT_STATUS_RIGHT_OVERLAP = (1 << 12), /*!< The azimuth rotator has rotated right (CW) past 360 degrees */ + ROT_STATUS_NONE = 0, + ROT_STATUS_BUSY = (1 << 0), /*!< Rotator is busy, not accepting commands */ + ROT_STATUS_MOVING = (1 << 1), /*!< Rotator is currently moving (direction type not specified) */ + ROT_STATUS_MOVING_AZ = (1 << 2), /*!< Azimuth rotator is currently moving (direction not specified) */ + ROT_STATUS_MOVING_LEFT = (1 << 3), /*!< Azimuth rotator is currently moving left */ + ROT_STATUS_MOVING_RIGHT = (1 << 4), /*!< Azimuth rotator is currently moving right */ + ROT_STATUS_MOVING_EL = (1 << 5), /*!< Elevation rotator is currently moving (direction not specified) */ + ROT_STATUS_MOVING_UP = (1 << 6), /*!< Elevation rotator is currently moving up */ + ROT_STATUS_MOVING_DOWN = (1 << 7), /*!< Elevation rotator is currently moving down */ + ROT_STATUS_LIMIT_UP = (1 << 8), /*!< The elevation rotator has reached its limit to move up */ + ROT_STATUS_LIMIT_DOWN = (1 << 9), /*!< The elevation rotator has reached its limit to move down */ + ROT_STATUS_LIMIT_LEFT = (1 << 10), /*!< The azimuth rotator has reached its limit to move left (CCW) */ + ROT_STATUS_LIMIT_RIGHT = (1 << 11), /*!< The azimuth rotator has reached its limit to move right (CW) */ + ROT_STATUS_OVERLAP_UP = (1 << 12), /*!< The elevation rotator has rotated up past 360 degrees */ + ROT_STATUS_OVERLAP_DOWN = (1 << 13), /*!< The elevation rotator has rotated down past 0 degrees */ + ROT_STATUS_OVERLAP_LEFT = (1 << 14), /*!< The azimuth rotator has rotated left (CCW) past 0 degrees */ + ROT_STATUS_OVERLAP_RIGHT = (1 << 16), /*!< The azimuth rotator has rotated right (CW) past 360 degrees */ } rot_status_t; +#define ROT_STATUS_N(n) (1u<<(n)) + /** * \brief Macro for not changing the rotator speed with move() function @@ -339,6 +346,8 @@ struct rot_caps { setting_t has_get_parm; /*!< List of get parm */ setting_t has_set_parm; /*!< List of set parm */ + rot_status_t has_status; /*!< Supported status flags */ + gran_t level_gran[RIG_SETTING_MAX]; /*!< level granularity (i.e. steps) */ gran_t parm_gran[RIG_SETTING_MAX]; /*!< parm granularity (i.e. steps) */ @@ -409,12 +418,9 @@ struct rot_caps { int (*set_ext_parm)(ROT *rot, token_t token, value_t val); int (*get_ext_parm)(ROT *rot, token_t token, value_t *val); - const char *macro_name; /*!< Macro name. */ + int (*get_status)(ROT *rot, rot_status_t *status); - rot_status_t status_caps; /*!< Supported status flags */ - - rot_status_t (*get_status)(ROT *rot); - /* more to come... */ + const char *macro_name; /*!< Macro name. */ }; //! @endcond @@ -449,6 +455,8 @@ struct rot_state { setting_t has_get_parm; /*!< List of get parm */ setting_t has_set_parm; /*!< List of set parm */ + rot_status_t has_status; /*!< Supported status flags */ + gran_t level_gran[RIG_SETTING_MAX]; /*!< level granularity */ gran_t parm_gran[RIG_SETTING_MAX]; /*!< parm granularity */ @@ -614,6 +622,10 @@ rot_get_ext_parm HAMLIB_PARAMS((ROT *rig, extern HAMLIB_EXPORT(const char *) rot_get_info HAMLIB_PARAMS((ROT *rot)); +extern HAMLIB_EXPORT(int) +rot_get_status HAMLIB_PARAMS((ROT *rot, + rot_status_t *status)); + extern HAMLIB_EXPORT(int) rot_register HAMLIB_PARAMS((const struct rot_caps *caps)); @@ -734,6 +746,14 @@ dmmm2dec HAMLIB_PARAMS((int degrees, double seconds, int sw)); +extern HAMLIB_EXPORT(setting_t) rot_parse_func(const char *s); +extern HAMLIB_EXPORT(setting_t) rot_parse_level(const char *s); +extern HAMLIB_EXPORT(setting_t) rot_parse_parm(const char *s); +extern HAMLIB_EXPORT(const char *) rot_strfunc(setting_t); +extern HAMLIB_EXPORT(const char *) rot_strlevel(setting_t); +extern HAMLIB_EXPORT(const char *) rot_strparm(setting_t); +extern HAMLIB_EXPORT(const char *) rot_strstatus(rot_status_t); + //! @endcond /** diff --git a/rigs/dummy/rot_dummy.c b/rigs/dummy/rot_dummy.c index 5cd31783..d5b8b994 100644 --- a/rigs/dummy/rot_dummy.c +++ b/rigs/dummy/rot_dummy.c @@ -39,6 +39,10 @@ #define DUMMY_ROT_LEVEL ROT_LEVEL_SPEED #define DUMMY_ROT_PARM 0 +#define DUMMY_ROT_STATUS (ROT_STATUS_MOVING | ROT_STATUS_MOVING_AZ | ROT_STATUS_MOVING_LEFT | ROT_STATUS_MOVING_RIGHT | \ + ROT_STATUS_MOVING_EL | ROT_STATUS_MOVING_UP | ROT_STATUS_MOVING_DOWN | \ + ROT_STATUS_LIMIT_UP | ROT_STATUS_LIMIT_DOWN | ROT_STATUS_LIMIT_LEFT | ROT_STATUS_LIMIT_RIGHT) + struct dummy_rot_priv_data { azimuth_t az; @@ -47,6 +51,7 @@ struct dummy_rot_priv_data struct timeval tv; /* time last az/el update */ azimuth_t target_az; elevation_t target_el; + rot_status_t status; setting_t funcs; value_t levels[RIG_SETTING_MAX]; @@ -254,27 +259,13 @@ static int dummy_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) return RIG_OK; } - -/* - * Get position of rotor, simulating slow rotation - */ -static int dummy_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) +static void dummy_rot_simulate_rotation(ROT *rot) { - struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *) + struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *) rot->state.priv; struct timeval tv; unsigned elapsed; /* ms */ - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - - if (priv->az == priv->target_az && - priv->el == priv->target_el) - { - *az = priv->az; - *el = priv->el; - return RIG_OK; - } - gettimeofday(&tv, NULL); elapsed = (tv.tv_sec - priv->tv.tv_sec) * 1000 + @@ -289,16 +280,19 @@ static int dummy_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) { /* target reached */ priv->az = priv->target_az; + priv->status &= ~(ROT_STATUS_MOVING_AZ | ROT_STATUS_MOVING_LEFT | ROT_STATUS_MOVING_RIGHT); } else { if (priv->az < priv->target_az) { priv->az += (azimuth_t)elapsed * DEG_PER_MS; + priv->status |= ROT_STATUS_MOVING_AZ | ROT_STATUS_MOVING_RIGHT; } else { priv->az -= (azimuth_t)elapsed * DEG_PER_MS; + priv->status |= ROT_STATUS_MOVING_AZ | ROT_STATUS_MOVING_LEFT; } } @@ -306,23 +300,54 @@ static int dummy_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) { /* target reached */ priv->el = priv->target_el; + priv->status &= ~(ROT_STATUS_MOVING_EL | ROT_STATUS_MOVING_UP | ROT_STATUS_MOVING_DOWN); } else { if (priv->el < priv->target_el) { priv->el += (elevation_t)elapsed * DEG_PER_MS; + priv->status |= ROT_STATUS_MOVING_EL | ROT_STATUS_MOVING_UP; } else { priv->el -= (elevation_t)elapsed * DEG_PER_MS; + priv->status |= ROT_STATUS_MOVING_EL | ROT_STATUS_MOVING_DOWN; } } - *az = priv->az; - *el = priv->el; + if (priv->status & (ROT_STATUS_MOVING_AZ | ROT_STATUS_MOVING_EL)) { + priv->status |= ROT_STATUS_MOVING; + } else { + priv->status &= ~(ROT_STATUS_MOVING); + } priv->tv = tv; +} + + +/* + * Get position of rotor, simulating slow rotation + */ +static int dummy_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) +{ + struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *) + rot->state.priv; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + if (priv->az == priv->target_az && + priv->el == priv->target_el) + { + *az = priv->az; + *el = priv->el; + return RIG_OK; + } + + dummy_rot_simulate_rotation(rot); + + *az = priv->az; + *el = priv->el; return RIG_OK; } @@ -839,16 +864,27 @@ static int dummy_get_ext_parm(ROT *rot, token_t token, value_t *val) } +static int dummy_rot_get_status(ROT *rot, rot_status_t *status) +{ + struct dummy_rot_priv_data *priv = (struct dummy_rot_priv_data *)rot->state.priv; + + dummy_rot_simulate_rotation(rot); + + *status = priv->status; + + return RIG_OK; +} + + /* * Dummy rotator capabilities. */ - const struct rot_caps dummy_rot_caps = { ROT_MODEL(ROT_MODEL_DUMMY), .model_name = "Dummy", .mfg_name = "Hamlib", - .version = "20201202.0", + .version = "20201203.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZEL, @@ -875,6 +911,8 @@ const struct rot_caps dummy_rot_caps = .extparms = dummy_ext_parms, .cfgparams = dummy_cfg_params, + .has_status = DUMMY_ROT_STATUS, + .rot_init = dummy_rot_init, .rot_cleanup = dummy_rot_cleanup, .rot_open = dummy_rot_open, @@ -904,7 +942,8 @@ const struct rot_caps dummy_rot_caps = .set_ext_parm = dummy_set_ext_parm, .get_ext_parm = dummy_get_ext_parm, - .get_info = dummy_rot_get_info, + .get_info = dummy_rot_get_info, + .get_status = dummy_rot_get_status, }; DECLARE_INITROT_BACKEND(dummy) diff --git a/src/misc.c b/src/misc.c index 4893acf9..a4564035 100644 --- a/src/misc.c +++ b/src/misc.c @@ -48,7 +48,6 @@ # include <sys/time.h> #endif -#include <unistd.h> #include <math.h> #include <hamlib/rig.h> @@ -1759,6 +1758,54 @@ int HAMLIB_API rig_flush(hamlib_port_t *port) return serial_flush(port); // we must be on serial port } + +static struct +{ + rot_status_t status; + const char *str; +} rot_status_str[] = +{ + { ROT_STATUS_BUSY, "BUSY" }, + { ROT_STATUS_MOVING, "MOVING" }, + { ROT_STATUS_MOVING_AZ, "MOVING_AZ" }, + { ROT_STATUS_MOVING_LEFT, "MOVING_LEFT" }, + { ROT_STATUS_MOVING_RIGHT, "MOVING_RIGHT" }, + { ROT_STATUS_MOVING_EL, "MOVING_EL" }, + { ROT_STATUS_MOVING_UP, "MOVING_UP" }, + { ROT_STATUS_MOVING_DOWN, "MOVING_DOWN" }, + { ROT_STATUS_LIMIT_UP, "LIMIT_UP" }, + { ROT_STATUS_LIMIT_DOWN, "LIMIT_DOWN" }, + { ROT_STATUS_LIMIT_LEFT, "LIMIT_LEFT" }, + { ROT_STATUS_LIMIT_RIGHT, "LIMIT_RIGHT" }, + { ROT_STATUS_OVERLAP_UP, "OVERLAP_UP" }, + { ROT_STATUS_OVERLAP_DOWN, "OVERLAP_DOWN" }, + { ROT_STATUS_OVERLAP_LEFT, "OVERLAP_LEFT" }, + { ROT_STATUS_OVERLAP_RIGHT, "OVERLAP_RIGHT" }, + { 0xffffff, "" }, +}; + + +/** + * \brief Convert enum ROT_STATUS_... to a string + * \param status ROT_STATUS_... + * \return the corresponding string value + */ +const char *HAMLIB_API rot_strstatus(rot_status_t status) +{ + int i; + + for (i = 0 ; rot_status_str[i].str[0] != '\0'; i++) + { + if (status == rot_status_str[i].status) + { + return rot_status_str[i].str; + } + } + + return ""; +} + + //! @endcond /** @} */ diff --git a/src/rotator.c b/src/rotator.c index 9e687ef7..8cb36a7e 100644 --- a/src/rotator.c +++ b/src/rotator.c @@ -283,6 +283,8 @@ ROT *HAMLIB_API rot_init(rot_model_t rot_model) rs->has_get_parm = caps->has_get_parm; rs->has_set_parm = caps->has_set_parm; + rs->has_status = caps->has_status; + memcpy(rs->level_gran, caps->level_gran, sizeof(gran_t)*RIG_SETTING_MAX); memcpy(rs->parm_gran, caps->parm_gran, sizeof(gran_t)*RIG_SETTING_MAX); @@ -597,6 +599,9 @@ int HAMLIB_API rot_set_position(ROT *rot, return -RIG_EINVAL; } + azimuth += rot->state.az_offset; + elevation += rot->state.el_offset; + caps = rot->caps; rs = &rot->state; @@ -648,6 +653,8 @@ int HAMLIB_API rot_get_position(ROT *rot, { const struct rot_caps *caps; const struct rot_state *rs; + azimuth_t az; + elevation_t el; int retval; rot_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -665,19 +672,21 @@ int HAMLIB_API rot_get_position(ROT *rot, return -RIG_ENAVAIL; } - retval = caps->get_position(rot, azimuth, elevation); + retval = caps->get_position(rot, &az, &el); if (retval != RIG_OK) { return retval; } - rot_debug(RIG_DEBUG_VERBOSE, "%s: got az=%.2f, el=%.2f\n", __func__, *azimuth, - *elevation); + rot_debug(RIG_DEBUG_VERBOSE, "%s: got az=%.2f, el=%.2f\n", __func__, az, el); if (rs->south_zero) { - *azimuth += *azimuth >= 180 ? -180 : 180; - rot_debug(RIG_DEBUG_VERBOSE, "%s: south adj to az=%.2f\n", __func__, *azimuth); + az += az >= 180 ? -180 : 180; + rot_debug(RIG_DEBUG_VERBOSE, "%s: south adj to az=%.2f\n", __func__, az); } + *azimuth = az - rot->state.az_offset; + *elevation = el - rot->state.el_offset; + return RIG_OK; } @@ -841,4 +850,33 @@ const char *HAMLIB_API rot_get_info(ROT *rot) return rot->caps->get_info(rot); } + +/** + * \brief get status flags from the rotator + * \param rot The rot handle + * \param status a pointer to a rot_status_t variable that will receive the status flags + * + * Gets the active status flags from the rotator. + * + * \return RIG_OK if the operation has been successful, otherwise + * a negative value if an error occurred (in which case, cause is + * set appropriately). + */ +int HAMLIB_API rot_get_status(ROT *rot, rot_status_t *status) +{ + rot_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + if (CHECK_ROT_ARG(rot)) + { + return -RIG_EINVAL; + } + + if (rot->caps->get_status == NULL) + { + return -RIG_ENAVAIL; + } + + return rot->caps->get_status(rot, status); +} + /*! @} */ diff --git a/tests/dumpcaps_rot.c b/tests/dumpcaps_rot.c index 0f8def4f..90cfd7c7 100644 --- a/tests/dumpcaps_rot.c +++ b/tests/dumpcaps_rot.c @@ -146,6 +146,17 @@ int dumpcaps_rot(ROT *rot, FILE *fout) "Post Write delay:\t%dmS\n", caps->post_write_delay); + if (rot->state.has_status != 0) + { + rot_sprintf_status(prntbuf, rot->state.has_status); + } + else + { + strcpy(prntbuf, "None\n"); + } + + fprintf(fout, "Status flags: %s\n", prntbuf); + rot_sprintf_func(prntbuf, caps->has_get_func); fprintf(fout, "Get functions: %s\n", prntbuf); @@ -223,7 +234,16 @@ int dumpcaps_rot(ROT *rot, FILE *fout) fprintf(fout, "Can Park:\t\t%c\n", caps->park != NULL ? 'Y' : 'N'); fprintf(fout, "Can Reset:\t\t%c\n", caps->reset != NULL ? 'Y' : 'N'); fprintf(fout, "Can Move:\t\t%c\n", caps->move != NULL ? 'Y' : 'N'); + fprintf(fout, "Can get Info:\t\t%c\n", caps->get_info != NULL ? 'Y' : 'N'); + fprintf(fout, "Can get Status:\t\t%c\n", caps->get_status != NULL ? 'Y' : 'N'); + + fprintf(fout, "Can set Func:\t%c\n", caps->set_func != NULL ? 'Y' : 'N'); + fprintf(fout, "Can get Func:\t%c\n", caps->get_func != NULL ? 'Y' : 'N'); + fprintf(fout, "Can set Level:\t%c\n", caps->set_level != NULL ? 'Y' : 'N'); + fprintf(fout, "Can get Level:\t%c\n", caps->get_level != NULL ? 'Y' : 'N'); + fprintf(fout, "Can set Param:\t%c\n", caps->set_parm != NULL ? 'Y' : 'N'); + fprintf(fout, "Can get Param:\t%c\n", caps->get_parm != NULL ? 'Y' : 'N'); fprintf(fout, "\nOverall backend warnings: %d\n", backend_warnings); diff --git a/tests/rotctl_parse.c b/tests/rotctl_parse.c index 2e500d76..9b45e593 100644 --- a/tests/rotctl_parse.c +++ b/tests/rotctl_parse.c @@ -187,6 +187,7 @@ declare_proto_rot(get_func); declare_proto_rot(set_parm); declare_proto_rot(get_parm); declare_proto_rot(get_info); +declare_proto_rot(get_status); declare_proto_rot(inter_set_conf); /* interactive mode set_conf */ declare_proto_rot(send_cmd); declare_proto_rot(dump_state); @@ -224,6 +225,7 @@ struct test_table test_list[] = { 'x', "get_parm", ACTION(get_parm), ARG_IN1 | ARG_OUT2, "Parm", "Parm Value" }, { 'C', "set_conf", ACTION(inter_set_conf), ARG_IN, "Token", "Value" }, { '_', "get_info", ACTION(get_info), ARG_OUT, "Info" }, + { 's', "get_status", ACTION(get_status), ARG_OUT, "Status flags" }, { 'w', "send_cmd", ACTION(send_cmd), ARG_IN1 | ARG_IN_LINE | ARG_OUT2, "Cmd", "Reply" }, { '1', "dump_caps", ACTION(dump_caps), }, { 0x8f, "dump_state", ACTION(dump_state), ARG_OUT }, @@ -1729,7 +1731,7 @@ declare_proto_rot(set_position) CHKSCN1ARG(sscanf(arg1, "%f", &az)); CHKSCN1ARG(sscanf(arg2, "%f", &el)); - return rot_set_position(rot, az + rot->state.az_offset, el); + return rot_set_position(rot, az, el); } @@ -1742,8 +1744,6 @@ declare_proto_rot(get_position) status = rot_get_position(rot, &az, &el); - az -= rot->state.az_offset; - if (status != RIG_OK) { return status; @@ -1809,6 +1809,32 @@ declare_proto_rot(get_info) } +/* 's' */ +declare_proto_rot(get_status) +{ + int result; + rot_status_t status; + char s[SPRINTF_MAX_SIZE]; + + result = rot_get_status(rot, &status); + + if (result != RIG_OK) + { + return result; + } + + if ((interactive && prompt) || (interactive && !prompt && ext_resp)) + { + fprintf(fout, "%s: ", cmd->arg1); + } + + rot_sprintf_status(s, status); + fprintf(fout, "%s%c", s, resp_sep); + + return RIG_OK; +} + + /* 'M' */ declare_proto_rot(move) { diff --git a/tests/sprintflst.c b/tests/sprintflst.c index 3782aee9..2416df3a 100644 --- a/tests/sprintflst.c +++ b/tests/sprintflst.c @@ -665,6 +665,33 @@ int rig_sprintf_scan(char *str, scan_t rscan) } +int rot_sprintf_status(char *str, rot_status_t status) +{ + int i, len = 0; + + rig_debug(RIG_DEBUG_TRACE, "%s: status=%08x\n", __func__, status); + *str = '\0'; + + if (status == ROT_STATUS_NONE) + { + return 0; + } + + for (i = 0; i < 32; i++) + { + const char *sv; + sv = rot_strstatus(status & ROT_STATUS_N(i)); + + if (sv && sv[0] && (strstr(sv, "None") == 0)) + { + len += sprintf(str + len, "%s ", sv); + } + } + + return len; +} + + char *get_rig_conf_type(enum rig_conf_e type) { switch (type) diff --git a/tests/sprintflst.h b/tests/sprintflst.h index 5fa2c624..2b74f404 100644 --- a/tests/sprintflst.h +++ b/tests/sprintflst.h @@ -23,6 +23,7 @@ #define _SPRINTFLST_H 1 #include <hamlib/rig.h> +#include <hamlib/rotator.h> #define SPRINTF_MAX_SIZE 512 @@ -45,6 +46,7 @@ extern int rig_sprintf_parm_gran(char *str, setting_t parm, const gran_t *gran); extern int rot_sprintf_parm_gran(char *str, setting_t parm, const gran_t *gran); extern int rig_sprintf_vfop(char *str, vfo_op_t op); extern int rig_sprintf_scan(char *str, scan_t rscan); +extern int rot_sprintf_status(char *str, rot_status_t status); extern char *get_rig_conf_type(enum rig_conf_e type); int print_ext_param(const struct confparams *cfp, rig_ptr_t ptr); commit 2e9922b824761ca39e05ab449f0a3bfa3390d8f9 Author: Mikael Nousiainen <mik...@ik...> Date: Wed Dec 2 22:35:38 2020 +0200 Add rotator funcs/levels/parms to rotator caps dump (cherry picked from commit a661bee28394a9b19d3c4ab87aec36b8fe21a0ea) diff --git a/rigs/dummy/rot_dummy.c b/rigs/dummy/rot_dummy.c index 8fd9c370..5cd31783 100644 --- a/rigs/dummy/rot_dummy.c +++ b/rigs/dummy/rot_dummy.c @@ -31,6 +31,7 @@ #include "hamlib/rotator.h" #include "dummy_common.h" #include "register.h" +#include "idx_builtin.h" #include "rot_dummy.h" @@ -847,7 +848,7 @@ const struct rot_caps dummy_rot_caps = ROT_MODEL(ROT_MODEL_DUMMY), .model_name = "Dummy", .mfg_name = "Hamlib", - .version = "20200310.0", + .version = "20201202.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZEL, @@ -867,7 +868,7 @@ const struct rot_caps dummy_rot_caps = .has_get_parm = DUMMY_ROT_PARM, .has_set_parm = ROT_PARM_SET(DUMMY_ROT_PARM), - .level_gran = { [ROT_LEVEL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, + .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, .extlevels = dummy_ext_levels, .extfuncs = dummy_ext_funcs, diff --git a/src/idx_builtin.h b/src/idx_builtin.h index d52b2779..220246fa 100644 --- a/src/idx_builtin.h +++ b/src/idx_builtin.h @@ -23,6 +23,7 @@ #define _IDX_BUILTIN_H 1 #include <hamlib/rig.h> +#include <hamlib/rotator.h> /* * only for Hamlib internal use (backend caps) @@ -185,5 +186,9 @@ #define PARM_BAT setting2idx_builtin(RIG_PARM_BAT) #define PARM_KEYLIGHT setting2idx_builtin(RIG_PARM_KEYLIGHT) +/* Rotator levels */ + +#define ROT_LVL_SPEED setting2idx_builtin(ROT_LEVEL_SPEED) + #endif /* _IDX_BUILTIN_H */ diff --git a/tests/dumpcaps.c b/tests/dumpcaps.c index 5617f8c1..2a27f5d0 100644 --- a/tests/dumpcaps.c +++ b/tests/dumpcaps.c @@ -33,12 +33,15 @@ #include "sprintflst.h" #include "rigctl_parse.h" -static int print_ext(RIG *rig, const struct confparams *cfp, rig_ptr_t ptr); void range_print(FILE *fout, const struct freq_range_list range_list[], int rx); int range_sanity_check(const struct freq_range_list range_list[], int rx); int ts_sanity_check(const struct tuning_step_list tuning_step[]); static void dump_chan_caps(const channel_cap_t *chan, FILE *fout); +static int print_ext(RIG *rig, const struct confparams *cfp, rig_ptr_t ptr) +{ + return print_ext_param(cfp, ptr); +} /* * the rig may be in rig_init state, but not opened @@ -832,41 +835,6 @@ int dumpcaps(RIG *rig, FILE *fout) return backend_warnings; } -static int print_ext(RIG *rig, const struct confparams *cfp, rig_ptr_t ptr) -{ - int i; - fprintf((FILE *)ptr, "\t%s\n", cfp->name); - fprintf((FILE *)ptr, "\t\tType: %s\n", get_rig_conf_type(cfp->type)); - fprintf((FILE *)ptr, "\t\tDefault: %s\n", cfp->dflt != NULL ? cfp->dflt : ""); - fprintf((FILE *)ptr, "\t\tLabel: %s\n", cfp->label != NULL ? cfp->label : ""); - fprintf((FILE *)ptr, "\t\tTooltip: %s\n", - cfp->tooltip != NULL ? cfp->tooltip : ""); - - switch (cfp->type) - { - case RIG_CONF_NUMERIC: - fprintf((FILE *)ptr, "\t\tRange: %g..%g/%g\n", cfp->u.n.min, cfp->u.n.max, - cfp->u.n.step); - break; - - case RIG_CONF_COMBO: - fprintf((FILE *)ptr, "\t\tValues:"); - - for (i = 0; i < RIG_COMBO_MAX && cfp->u.c.combostr[i] != NULL; i++) - { - fprintf((FILE *)ptr, " %d=\"%s\"", i, cfp->u.c.combostr[i]); - } - - fprintf((FILE *)ptr, "\n"); - break; - - default: - break; - } - - return 1; /* process them all */ -} - void range_print(FILE *fout, const struct freq_range_list range_list[], int rx) { int i; diff --git a/tests/dumpcaps_rot.c b/tests/dumpcaps_rot.c index bc0b98b9..0f8def4f 100644 --- a/tests/dumpcaps_rot.c +++ b/tests/dumpcaps_rot.c @@ -34,6 +34,11 @@ #include "rotctl_parse.h" +static int print_ext(ROT *rot, const struct confparams *cfp, rig_ptr_t ptr) +{ + return print_ext_param(cfp, ptr); +} + /* * the rot may be in rot_init state, but not opened */ @@ -41,6 +46,7 @@ int dumpcaps_rot(ROT *rot, FILE *fout) { const struct rot_caps *caps; int backend_warnings = 0; + static char prntbuf[1024]; if (!rot || !rot->caps) { @@ -140,6 +146,51 @@ int dumpcaps_rot(ROT *rot, FILE *fout) "Post Write delay:\t%dmS\n", caps->post_write_delay); + rot_sprintf_func(prntbuf, caps->has_get_func); + fprintf(fout, "Get functions: %s\n", prntbuf); + + rot_sprintf_func(prntbuf, caps->has_set_func); + fprintf(fout, "Set functions: %s\n", prntbuf); + + fprintf(fout, "Extra functions:\n"); + rot_ext_func_foreach(rot, print_ext, fout); + + rot_sprintf_level_gran(prntbuf, caps->has_get_level, caps->level_gran); + fprintf(fout, "Get level: %s\n", prntbuf); + + if ((caps->has_get_level & RIG_LEVEL_SQLSTAT)) + { + fprintf(fout, "Warning--backend uses deprecated SQLSTAT level!\n"); + backend_warnings++; + } + + rot_sprintf_level_gran(prntbuf, caps->has_set_level, caps->level_gran); + fprintf(fout, "Set level: %s\n", prntbuf); + + if (caps->has_set_level & ROT_LEVEL_READONLY_LIST) + { + fprintf(fout, "Warning--backend can set readonly levels!\n"); + backend_warnings++; + } + + fprintf(fout, "Extra levels:\n"); + rot_ext_level_foreach(rot, print_ext, fout); + + rot_sprintf_parm_gran(prntbuf, caps->has_get_parm, caps->parm_gran); + fprintf(fout, "Get parameters: %s\n", prntbuf); + + rot_sprintf_parm_gran(prntbuf, caps->has_set_parm, caps->parm_gran); + fprintf(fout, "Set parameters: %s\n", prntbuf); + + if (caps->has_set_parm & ROT_PARM_READONLY_LIST) + { + fprintf(fout, "Warning--backend can set readonly parms!\n"); + backend_warnings++; + } + + fprintf(fout, "Extra parameters:\n"); + rot_ext_parm_foreach(rot, print_ext, fout); + fprintf(fout, "Min Azimuth:\t\t%.2f\n", caps->min_az); fprintf(fout, "Max Azimuth:\t\t%.2f\n", caps->max_az); diff --git a/tests/sprintflst.c b/tests/sprintflst.c index 181d769f..3782aee9 100644 --- a/tests/sprintflst.c +++ b/tests/sprintflst.c @@ -690,3 +690,38 @@ char *get_rig_conf_type(enum rig_conf_e type) return "... [truncated message content] |
From: Michael B. <mdb...@us...> - 2020-12-03 05:49:41
|
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 c4e1deb8b6a97847bec30980d50436028cc626ce (commit) via e49dc2e1f5174574d46b8050bc7a98079e5f9b38 (commit) via 4f8de2487371a9c60041a88884b8a7aa3ccea539 (commit) from eb8082b1f882706f589b2d5ff605d9d130e597e4 (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 c4e1deb8b6a97847bec30980d50436028cc626ce Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 2 23:47:30 2020 -0600 Add flushx parameter to rotctl https://github.com/Hamlib/Hamlib/issues/371 diff --git a/src/rot_conf.c b/src/rot_conf.c index 874bbc8d..9faa6aef 100644 --- a/src/rot_conf.c +++ b/src/rot_conf.c @@ -73,6 +73,12 @@ static const struct confparams rotfrontend_cfg_params[] = TOK_RETRY, "retry", "Retry", "Max number of retry", "0", RIG_CONF_NUMERIC, { .n = { 0, 10, 1 } } }, + { + TOK_FLUSHX, "flushx", "Flush with read instead of TCFLUSH", + "True enables flushing serial port with read instead of TCFLUSH -- MicroHam", + "0", RIG_CONF_CHECKBUTTON, { } + }, + { TOK_MIN_AZ, "min_az", "Minimum azimuth", @@ -296,6 +302,10 @@ int frontrot_set_conf(ROT *rot, token_t token, const char *val) break; + case TOK_FLUSHX: + rs->rotport.flushx = atoi(val); + break; + case TOK_MIN_AZ: rs->min_az = atof(val); break; commit e49dc2e1f5174574d46b8050bc7a98079e5f9b38 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 2 07:50:11 2020 -0600 astyle gs232a/gs232b diff --git a/rotators/gs232a/gs232a.c b/rotators/gs232a/gs232a.c index 81386a81..a6faf0c3 100644 --- a/rotators/gs232a/gs232a.c +++ b/rotators/gs232a/gs232a.c @@ -103,11 +103,12 @@ transaction_write: retval = read_string(&rs->rotport, data, data_len, REPLY_EOM, strlen(REPLY_EOM)); - if (strncmp(data,"\r\n",2) == 0 - ||strchr(data,'>')) + if (strncmp(data, "\r\n", 2) == 0 + || strchr(data, '>')) { - rig_debug(RIG_DEBUG_ERR,"%s: wrong response nbytes=%d\n", __func__, (int)strlen(data)); - dump_hex((unsigned char*)data,strlen(data)); + rig_debug(RIG_DEBUG_ERR, "%s: wrong response nbytes=%d\n", __func__, + (int)strlen(data)); + dump_hex((unsigned char *)data, strlen(data)); retval = -1; // force retry } diff --git a/rotators/gs232a/gs232b.c b/rotators/gs232a/gs232b.c index 7dc9c6a6..740a7af9 100644 --- a/rotators/gs232a/gs232b.c +++ b/rotators/gs232a/gs232b.c @@ -110,11 +110,12 @@ transaction_write: retval = read_string(&rs->rotport, data, data_len, REPLY_EOM, strlen(REPLY_EOM)); - if (strncmp(data,"\r\n",2) == 0 - ||strchr(data,'>')) + if (strncmp(data, "\r\n", 2) == 0 + || strchr(data, '>')) { - rig_debug(RIG_DEBUG_ERR,"%s: wrong response nbytes=%d\n", __func__, (int)strlen(data)); - dump_hex((unsigned char*)data,strlen(data)); + rig_debug(RIG_DEBUG_ERR, "%s: wrong response nbytes=%d\n", __func__, + (int)strlen(data)); + dump_hex((unsigned char *)data, strlen(data)); retval = -1; // force retry } commit 4f8de2487371a9c60041a88884b8a7aa3ccea539 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 2 07:48:21 2020 -0600 Change gs232a/b post_write_delay to 50ms Add retry when > char is seen indicating ?> error response https://github.com/Hamlib/Hamlib/issues/371 diff --git a/rotators/gs232a/gs232a.c b/rotators/gs232a/gs232a.c index a2ccd3f6..81386a81 100644 --- a/rotators/gs232a/gs232a.c +++ b/rotators/gs232a/gs232a.c @@ -103,7 +103,13 @@ transaction_write: retval = read_string(&rs->rotport, data, data_len, REPLY_EOM, strlen(REPLY_EOM)); - if (strncmp(data,"\r\n",2)==0) retval = -1; + if (strncmp(data,"\r\n",2) == 0 + ||strchr(data,'>')) + { + rig_debug(RIG_DEBUG_ERR,"%s: wrong response nbytes=%d\n", __func__, (int)strlen(data)); + dump_hex((unsigned char*)data,strlen(data)); + retval = -1; // force retry + } if (retval < 0) { @@ -294,7 +300,7 @@ const struct rot_caps gs23_rot_caps = ROT_MODEL(ROT_MODEL_GS23), .model_name = "GS-23", .mfg_name = "Yaesu/Kenpro", - .version = "20201201.0", + .version = "20201202.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZEL, @@ -306,7 +312,7 @@ const struct rot_caps gs23_rot_caps = .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = 0, - .post_write_delay = 25, + .post_write_delay = 50, .timeout = 400, .retry = 3, @@ -330,7 +336,7 @@ const struct rot_caps gs232_rot_caps = ROT_MODEL(ROT_MODEL_GS232), .model_name = "GS-232", .mfg_name = "Yaesu/Kenpro", - .version = "20201201.0", + .version = "20201202.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZEL, @@ -342,7 +348,7 @@ const struct rot_caps gs232_rot_caps = .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = 0, - .post_write_delay = 25, + .post_write_delay = 50, .timeout = 400, .retry = 3, @@ -378,7 +384,7 @@ const struct rot_caps gs232a_rot_caps = .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = 0, - .post_write_delay = 25, + .post_write_delay = 50, .timeout = 400, .retry = 3, diff --git a/rotators/gs232a/gs232b.c b/rotators/gs232a/gs232b.c index 143f3f02..7dc9c6a6 100644 --- a/rotators/gs232a/gs232b.c +++ b/rotators/gs232a/gs232b.c @@ -110,7 +110,14 @@ transaction_write: retval = read_string(&rs->rotport, data, data_len, REPLY_EOM, strlen(REPLY_EOM)); - if (strncmp(data,"\r\n",2)==0) retval = -1; + if (strncmp(data,"\r\n",2) == 0 + ||strchr(data,'>')) + { + rig_debug(RIG_DEBUG_ERR,"%s: wrong response nbytes=%d\n", __func__, (int)strlen(data)); + dump_hex((unsigned char*)data,strlen(data)); + retval = -1; // force retry + } + if (retval < 0) { @@ -331,7 +338,7 @@ const struct rot_caps gs232b_rot_caps = ROT_MODEL(ROT_MODEL_GS232B), .model_name = "GS-232B", .mfg_name = "Yaesu", - .version = "20201201.0", + .version = "20201202.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_OTHER, @@ -343,7 +350,7 @@ const struct rot_caps gs232b_rot_caps = .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = 0, - .post_write_delay = 25, + .post_write_delay = 50, .timeout = 400, .retry = 3, ----------------------------------------------------------------------- Summary of changes: rotators/gs232a/gs232a.c | 19 +++++++++++++------ rotators/gs232a/gs232b.c | 14 +++++++++++--- src/rot_conf.c | 10 ++++++++++ 3 files changed, 34 insertions(+), 9 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |