hamlib-cvs-digest Mailing List for Ham Radio Control Libraries (Page 14)
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
(20) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael B. <mdb...@us...> - 2021-04-14 12:06: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 10e4e36aa2547f782ce52e8cc9fa4a7643f4c79f (commit) from 7366522883d7d7a5e73f2d06a8373bfea683ec38 (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 10e4e36aa2547f782ce52e8cc9fa4a7643f4c79f Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Apr 13 22:22:05 2021 -0500 Remove MAIN and SUB VFOs from ic7100.c -- rig doesn't have them These have been in there for 8 years but just got exposed as a bug with new VFO handling https://github.com/Hamlib/Hamlib/issues/660 diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 00d17590..bb85e9d0 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -328,6 +328,16 @@ static int netrigctl_open(RIG *rig) { break; } + switch(i) + { + } + rig->caps->tx_range_list1->startf = rs->tx_range_list[i].startf; + rig->caps->tx_range_list1->endf = rs->tx_range_list[i].endf; + rig->caps->tx_range_list1->modes = rs->tx_range_list[i].modes; + rig->caps->tx_range_list1->low_power = rs->tx_range_list[i].low_power; + rig->caps->tx_range_list1->high_power = rs->tx_range_list[i].high_power; + rig->caps->tx_range_list1->vfo = rs->tx_range_list[i].vfo; + rig->caps->tx_range_list1->ant = rs->tx_range_list[i].ant; } for (i = 0; i < HAMLIB_TSLSTSIZ; i++) diff --git a/rigs/icom/ic7100.c b/rigs/icom/ic7100.c index 6eb03b2d..c4f09c1b 100644 --- a/rigs/icom/ic7100.c +++ b/rigs/icom/ic7100.c @@ -41,7 +41,7 @@ #define IC7100_OTHER_TX_MODES ((IC7100_MODES) & ~(RIG_MODE_AM|RIG_MODE_PKTAM)) -#define IC7100_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MAIN|RIG_VFO_SUB|RIG_VFO_MEM) +#define IC7100_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM) #define IC7100_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM|RIG_SCAN_SLCT|RIG_SCAN_PRIO) ----------------------------------------------------------------------- Summary of changes: rigs/dummy/netrigctl.c | 10 ++++++++++ rigs/icom/ic7100.c | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-04-13 20:36: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 7366522883d7d7a5e73f2d06a8373bfea683ec38 (commit) from fa582b17c11119a6864e8a10ab140e29374ed273 (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 7366522883d7d7a5e73f2d06a8373bfea683ec38 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Apr 13 15:31:57 2021 -0500 Remove SATMODE from ic7100.c -- rig does not have satellite mode commands https://github.com/Hamlib/Hamlib/issues/660 diff --git a/rigs/icom/ic7100.c b/rigs/icom/ic7100.c index a1e1f617..6eb03b2d 100644 --- a/rigs/icom/ic7100.c +++ b/rigs/icom/ic7100.c @@ -61,7 +61,6 @@ RIG_FUNC_VOX| \ RIG_FUNC_FBKIN| \ RIG_FUNC_AFC| \ - RIG_FUNC_SATMODE| \ RIG_FUNC_VSC| \ RIG_FUNC_MN| \ RIG_FUNC_LOCK| \ @@ -208,7 +207,7 @@ const struct rig_caps ic7100_caps = RIG_MODEL(RIG_MODEL_IC7100), .model_name = "IC-7100", .mfg_name = "Icom", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, ----------------------------------------------------------------------- Summary of changes: rigs/icom/ic7100.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-04-13 13:20:48
|
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 fa582b17c11119a6864e8a10ab140e29374ed273 (commit) from 2f2322068e308ce704e8359571047cc2afe80b93 (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 fa582b17c11119a6864e8a10ab140e29374ed273 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Apr 13 08:19:48 2021 -0500 Update vfo_fixup to change VFO_A to Main and VFO_B to Sub as appropriate https://github.com/Hamlib/Hamlib/issues/654 diff --git a/src/misc.c b/src/misc.c index bf841e3a..1bf9b475 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1629,7 +1629,9 @@ int HAMLIB_API rig_set_cache_timeout_ms(RIG *rig, hamlib_cache_t selection, return RIG_OK; } - +// we're mappping our VFO here to work with either VFO A/B rigs or Main/Sub +// Hamlib uses VFO_A and VFO_B as TX/RX as of 2021-04-13 +// So we map these to Main/Sub as required vfo_t HAMLIB_API vfo_fixup(RIG *rig, vfo_t vfo) { rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__, rig_strvfo(vfo)); @@ -1640,7 +1642,7 @@ vfo_t HAMLIB_API vfo_fixup(RIG *rig, vfo_t vfo) return vfo; // don't modify vfo for RIG_VFO_CURR } - if (vfo == RIG_VFO_RX) + if (vfo == RIG_VFO_RX || vfo == RIG_VFO_A) { vfo = RIG_VFO_A; @@ -1649,7 +1651,7 @@ vfo_t HAMLIB_API vfo_fixup(RIG *rig, vfo_t vfo) if (VFO_HAS_MAIN_SUB_A_B_ONLY) { vfo = RIG_VFO_MAIN; } } - if (vfo == RIG_VFO_TX) + else if (vfo == RIG_VFO_TX || RIG_VFO_B) { int retval; split_t split = 0; @@ -1877,8 +1879,8 @@ const char *HAMLIB_API rot_strstatus(rot_status_t status) * \param RIG* and rig_function_e * \return the corresponding function pointer */ -void * HAMLIB_API rig_get_function_ptr(rig_model_t rig_model, - enum rig_function_e rig_function) +void *HAMLIB_API rig_get_function_ptr(rig_model_t rig_model, + enum rig_function_e rig_function) { const struct rig_caps *caps = rig_get_caps(rig_model); @@ -2150,7 +2152,8 @@ void * HAMLIB_API rig_get_function_ptr(rig_model_t rig_model, * \param RIG* and rig_caps_int_e * \return the corresponding long value -- -RIG_EINVAL is the only error possible */ -long long HAMLIB_API rig_get_caps_int(rig_model_t rig_model, enum rig_caps_int_e rig_caps) +long long HAMLIB_API rig_get_caps_int(rig_model_t rig_model, + enum rig_caps_int_e rig_caps) { const struct rig_caps *caps = rig_get_caps(rig_model); @@ -2177,8 +2180,8 @@ long long HAMLIB_API rig_get_caps_int(rig_model_t rig_model, enum rig_caps_int_e } } -const char * HAMLIB_API rig_get_caps_cptr(rig_model_t rig_model, - enum rig_caps_cptr_e rig_caps) +const char *HAMLIB_API rig_get_caps_cptr(rig_model_t rig_model, + enum rig_caps_cptr_e rig_caps) { const struct rig_caps *caps = rig_get_caps(rig_model); ----------------------------------------------------------------------- Summary of changes: src/misc.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-04-12 14:32:48
|
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 2f2322068e308ce704e8359571047cc2afe80b93 (commit) from ec813ae57d872f9c67784cd192385f3f2edb5ed1 (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 2f2322068e308ce704e8359571047cc2afe80b93 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Apr 12 09:31:53 2021 -0500 Update Radant rotator https://github.com/Hamlib/Hamlib/pull/658 diff --git a/NEWS b/NEWS index fede7ed1..ccf0f3eb 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,7 @@ Please send Hamlib bug reports to ham...@li... Version 4.2 * 2021-04-06 + * Added Radan rotator * Added Malachite SDR * Major rework for PRM80 * Add twiddle_timeout and twiddle_rit --set-conf options diff --git a/rotators/radant/radant.c b/rotators/radant/radant.c index 351aadc7..c9b7d7eb 100644 --- a/rotators/radant/radant.c +++ b/rotators/radant/radant.c @@ -180,8 +180,8 @@ radant_rot_stop(ROT *rot) const struct rot_caps radant_rot_caps = { ROT_MODEL(ROT_MODEL_RADANT), - .model_name = "Radant", - .mfg_name = "Hamlib", + .model_name = "AZ-1/AZV-1", + .mfg_name = "Radant", .version = "20210409.0", .copyright = "LGPL", .status = RIG_STATUS_BETA, ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + rotators/radant/radant.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-04-12 14:31:36
|
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 ec813ae57d872f9c67784cd192385f3f2edb5ed1 (commit) from 974d978eaad6ae1d8ebd582c0185a012d009b7a8 (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 ec813ae57d872f9c67784cd192385f3f2edb5ed1 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Apr 12 09:31:10 2021 -0500 Fix cppcheck warning in flrig.c diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 1e630571..fca7c0e6 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -1050,7 +1050,7 @@ static int flrig_close(RIG *rig) */ static int flrig_cleanup(RIG *rig) { - struct flrig_priv_data *priv = (struct flrig_priv_data *)rig->state.priv; + struct flrig_priv_data *priv; rig_debug(RIG_DEBUG_TRACE, "%s\n", __func__); @@ -1059,6 +1059,8 @@ static int flrig_cleanup(RIG *rig) RETURNFUNC(-RIG_EINVAL); } + priv = (struct flrig_priv_data *)rig->state.priv; + free(priv->ext_parms); free(rig->state.priv); ----------------------------------------------------------------------- Summary of changes: rigs/dummy/flrig.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-04-12 13:34:32
|
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 974d978eaad6ae1d8ebd582c0185a012d009b7a8 (commit) from 681c2ae953662b927a2b4238fcd7696dfd1ff388 (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 974d978eaad6ae1d8ebd582c0185a012d009b7a8 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Apr 12 08:33:58 2021 -0500 Eliminate debug msg from rigctld.c diff --git a/tests/rigctld.c b/tests/rigctld.c index 41cc030e..f43a1491 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -496,7 +496,7 @@ int main(int argc, char *argv[]) case 'o': vfo_mode++; - rig_debug(RIG_DEBUG_ERR, "%s: #0 vfo_mode=%d\n", __func__, vfo_mode); + //rig_debug(RIG_DEBUG_ERR, "%s: #0 vfo_mode=%d\n", __func__, vfo_mode); break; case 'v': ----------------------------------------------------------------------- Summary of changes: tests/rigctld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-04-12 12:36:25
|
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 681c2ae953662b927a2b4238fcd7696dfd1ff388 (commit) via 3ef3a255ff287f454d1bc50bf37d880d7c83b5f4 (commit) via 9a0e9c370a21884dade0ad362702eb91f5ec24ea (commit) via 0165d81e479965c17f0cd1fcbf1662bc2e9d41f3 (commit) from 9d38e9a726fbcf6678158fcc6dc023ea4bd5ff9f (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 681c2ae953662b927a2b4238fcd7696dfd1ff388 Merge: 3ef3a255 0165d81e Author: Michael Black <mdb...@ya...> Date: Mon Apr 12 07:34:31 2021 -0500 Merge pull request #658 from b-o-r-m-a-l-e-y/radant Add Radant AZV-1 Rotator controller protocol. commit 3ef3a255ff287f454d1bc50bf37d880d7c83b5f4 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Apr 11 17:34:53 2021 -0500 Remove more verbosity from flrig.c diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index cbb0b508..1e630571 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -1572,7 +1572,7 @@ static int flrig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) if (vfo == RIG_VFO_A) { *mode = priv->curr_modeA; } else { *mode = priv->curr_modeB; } - rig_debug(RIG_DEBUG_WARN, "%s call not made as PTT=1\n", __func__); + rig_debug(RIG_DEBUG_VERBOSE, "%s call not made as PTT=1\n", __func__); RETURNFUNC(RIG_OK); // just return OK and ignore this } @@ -1893,7 +1893,7 @@ static int flrig_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) if (priv->ptt) { - rig_debug(RIG_DEBUG_WARN, "%s call not made as PTT=1\n", __func__); + rig_debug(RIG_DEBUG_VERBOSE, "%s call not made as PTT=1\n", __func__); RETURNFUNC(RIG_OK); // just return OK and ignore this } @@ -1971,7 +1971,7 @@ static int flrig_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t freq, if (priv->ptt) { - rig_debug(RIG_DEBUG_WARN, "%s set_mode call not made as PTT=1\n", __func__); + rig_debug(RIG_DEBUG_VERBOSE, "%s set_mode call not made as PTT=1\n", __func__); RETURNFUNC(RIG_OK); // just return OK and ignore this } commit 9a0e9c370a21884dade0ad362702eb91f5ec24ea Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Apr 11 16:56:04 2021 -0500 Reduce flrig verbosity a bit diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index bed6e679..cbb0b508 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -1380,7 +1380,7 @@ static int flrig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (priv->ptt) { - rig_debug(RIG_DEBUG_WARN, "%s set_mode call not made as PTT=1\n", __func__); + rig_debug(RIG_DEBUG_VERBOSE, "%s set_mode call not made as PTT=1\n", __func__); RETURNFUNC(RIG_OK); // just return OK and ignore this } commit 0165d81e479965c17f0cd1fcbf1662bc2e9d41f3 Author: Evgeniy Titorenko <evg...@sp...> Date: Fri Apr 9 19:19:08 2021 +0300 Add Radant AZV-1 Rotator controller protocol. diff --git a/configure.ac b/configure.ac index 4ba505b3..7086bb01 100644 --- a/configure.ac +++ b/configure.ac @@ -48,7 +48,7 @@ dnl Beware of duplication should a backend directory include both rig and dnl rotor definitions, e.g. "dummy". Optional backends will not be listed dnl here but will be added later, e.g. "winradio". RIG_BACKEND_LIST="rigs/adat rigs/alinco rigs/aor rigs/barrett rigs/dorji rigs/drake rigs/dummy rigs/elad rigs/flexradio rigs/icom rigs/icmarine rigs/jrc rigs/kachina rigs/kenwood rigs/kit rigs/lowe rigs/pcr rigs/prm80 rigs/racal rigs/rft rigs/rs rigs/skanti rigs/tapr rigs/tentec rigs/tuner rigs/uniden rigs/winradio rigs/wj rigs/yaesu" -ROT_BACKEND_LIST="rotators/amsat rotators/ars rotators/celestron rotators/cnctrk rotators/easycomm rotators/ether6 rotators/fodtrack rotators/gs232a rotators/heathkit rotators/m2 rotators/meade rotators/rotorez rotators/sartek rotators/spid rotators/ts7400 rotators/prosistel rotators/ioptron rotators/satel" +ROT_BACKEND_LIST="rotators/amsat rotators/ars rotators/celestron rotators/cnctrk rotators/easycomm rotators/ether6 rotators/fodtrack rotators/gs232a rotators/heathkit rotators/m2 rotators/meade rotators/rotorez rotators/sartek rotators/spid rotators/ts7400 rotators/prosistel rotators/ioptron rotators/satel rotators/radant" # Amplifiers are all in the amplifiers directory AMP_BACKEND_LIST="amplifiers/elecraft" @@ -832,6 +832,7 @@ rotators/spid/Makefile rotators/ts7400/Makefile rotators/indi/Makefile rotators/satel/Makefile +rotators/radant/Makefile rigs/adat/Makefile rigs/alinco/Makefile rigs/aor/Makefile diff --git a/include/hamlib/rotlist.h b/include/hamlib/rotlist.h index cdfe840c..939cad56 100644 --- a/include/hamlib/rotlist.h +++ b/include/hamlib/rotlist.h @@ -604,6 +604,19 @@ #define ROT_MODEL_SATEL ROT_MAKE_MODEL(ROT_SATEL, 1) +/** + * \brief A macro that returns the model number of the RADANT backend. + * + * \def ROT_MODEL_RADANT + * + * The RADANT backend can be used with rotators that support the MS232 + * interface. + */ +//! @cond Doxygen_Suppress +#define ROT_RADANT 22 +#define ROT_BACKEND_RADANT "radant" +//! @endcond +#define ROT_MODEL_RADANT ROT_MAKE_MODEL(ROT_RADANT, 1) /** diff --git a/rotators/radant/Makefile.am b/rotators/radant/Makefile.am new file mode 100644 index 00000000..42da545f --- /dev/null +++ b/rotators/radant/Makefile.am @@ -0,0 +1,5 @@ + +noinst_LTLIBRARIES = libhamlib-radant.la +libhamlib_radant_la_SOURCES = radant.c radant.h + +EXTRA_DIST = radant.txt diff --git a/rotators/radant/radant.c b/rotators/radant/radant.c new file mode 100644 index 00000000..351aadc7 --- /dev/null +++ b/rotators/radant/radant.c @@ -0,0 +1,224 @@ +/* + * Hamlib Rotator backend - Radant + * Copyright (c) 2001-2003 by Stephane Fillod + * Contributed by Francois Retief <fgr...@su...> + * Copyright (c) 2014 by Alexander Schultze <ale...@gm...> + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> /* String function definitions */ +#include <unistd.h> /* UNIX standard function definitions */ +#include <math.h> + +#include "hamlib/rotator.h" +#include "serial.h" +#include "misc.h" +#include "register.h" +#include "idx_builtin.h" + +#include "radant.h" + +//#define EASYCOMM3_LEVELS ROT_LEVEL_SPEED + +/* ************************************************************************* */ +/** + * radant_transaction + * + * Assumes rot!=NULL and cmdstr!=NULL + * + * cmdstr - string to send to rotator + * data - buffer for reply string + * data_len - (input) Maximum size of buffer + * (output) Number of bytes read. + */ +static int +radant_transaction(ROT *rot, const char *cmdstr, char *data, size_t data_len) +{ + struct rot_state *rs; + int retval; + + rig_debug(RIG_DEBUG_TRACE, "%s called: %s\n", __func__, cmdstr); + + if (!rot) + { + return -RIG_EINVAL; + } + + rs = &rot->state; + rig_flush(&rs->rotport); + retval = write_block(&rs->rotport, cmdstr, strlen(cmdstr)); + + if (retval != RIG_OK) + { + goto transaction_quit; + } + + if (data == NULL) + { + return RIG_OK; /* don't want a reply */ + } + + retval = read_string(&rs->rotport, data, data_len, "\n", 1); + + if (retval < 0) + { + rig_debug(RIG_DEBUG_TRACE, "%s read_string failed with status %d\n", __func__, + retval); + goto transaction_quit; + } + else + { + rig_debug(RIG_DEBUG_TRACE, "%s read_string: %s\n", __func__, data); + retval = RIG_OK; + } + +transaction_quit: + return retval; +} + +/* ************************************************************************* */ + +static int +radant_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) +{ + char cmdstr[13]; + int retval; + rig_debug(RIG_DEBUG_TRACE, "%s called: %f %f\n", __func__, az, el); + + + sprintf(cmdstr, "Q%.1f %1.f\r", az, el); + + retval = radant_transaction(rot, cmdstr, NULL, 0); + + if (retval != RIG_OK) + { + return retval; + } + + /* TODO: Error processing */ + return RIG_OK; +} + +static int +radant_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) +{ + char cmdstr[4], ackbuf[16]; + int retval; + + rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); + + sprintf(cmdstr, "Y\r"); + + retval = radant_transaction(rot, cmdstr, ackbuf, sizeof(ackbuf)); + + if (retval != RIG_OK) + { + rig_debug(RIG_DEBUG_TRACE, "%s got error: %d\n", __func__, retval); + return retval; + } + + rig_debug(RIG_DEBUG_TRACE, "%s got response: %s\n", __func__, ackbuf); + retval = sscanf(ackbuf, "OK%f %f\r", az, el); + + if (retval != 2) + { + rig_debug(RIG_DEBUG_ERR, "%s: unknown response (%s)\n", __func__, ackbuf); + return -RIG_ERJCTED; + } + + return RIG_OK; +} + +static int +radant_rot_stop(ROT *rot) +{ + int retval; + + rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); + + retval = radant_transaction(rot, "S\r", NULL, 0); + + if (retval != RIG_OK) + { + return retval; + } + + /* TODO: error processing */ + + return RIG_OK; +} + +/* ************************************************************************* */ +/* + * Radant rotator capabilities. + */ + +/** Radant implement set and get position function and stop, but + * there is no velocity and other configurations functions + */ +const struct rot_caps radant_rot_caps = +{ + ROT_MODEL(ROT_MODEL_RADANT), + .model_name = "Radant", + .mfg_name = "Hamlib", + .version = "20210409.0", + .copyright = "LGPL", + .status = RIG_STATUS_BETA, + .rot_type = ROT_TYPE_OTHER, + .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 = 200, + .retry = 3, + + .min_az = 0.0, + .max_az = 360.0, + .min_el = 0.0, + .max_el = 180.0, + + .priv = NULL, /* priv */ + + .set_position = radant_rot_set_position, + .get_position = radant_rot_get_position, + .stop = radant_rot_stop, +}; + +/* ************************************************************************* */ + +DECLARE_INITROT_BACKEND(radant) +{ + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + rot_register(&radant_rot_caps); + return RIG_OK; +} + +/* ************************************************************************* */ +/* end of file */ diff --git a/rotators/radant/radant.h b/rotators/radant/radant.h new file mode 100644 index 00000000..72226b54 --- /dev/null +++ b/rotators/radant/radant.h @@ -0,0 +1,46 @@ +/* + * Hamlib Rotator backend - Easycomm interface protocol + * Copyright (c) 2001-2003 by Stephane Fillod + * Contributed by Francois Retief <fgr...@su...> + * Copyright (c) 2014 by Alexander Schultze <ale...@gm...> + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef _ROT_RADANT_H +#define _ROT_RADANT_H 1 + +#include "token.h" + +extern const struct rot_caps radant_rot_caps; + +/* + * Tokens used by rotorez_rot_set_conf and get_conf and the 'C' command in rotctl + * and rotctld. + */ + +#define TOK_GET_CONFIG TOKEN_BACKEND(1) +#define TOK_SET_CONFIG TOKEN_BACKEND(2) +#define TOK_GET_STATUS TOKEN_BACKEND(3) +#define TOK_GET_ERRORS TOKEN_BACKEND(4) +#define TOK_GET_VERSION TOKEN_BACKEND(5) +#define TOK_GET_INPUT TOKEN_BACKEND(6) +#define TOK_SET_OUTPUT TOKEN_BACKEND(7) +#define TOK_GET_ANALOG_INPUT TOKEN_BACKEND(8) + + +#endif /* _ROT_RADANT_H */ diff --git a/rotators/radant/radant.txt b/rotators/radant/radant.txt new file mode 100644 index 00000000..c6d10a56 --- /dev/null +++ b/rotators/radant/radant.txt @@ -0,0 +1,27 @@ +Standart protocol for both El and Az axes. Working with russian Radant version 1.0 - 1.4: Радант AZV-1 + +Serial port mode 9600 8N1. + + +------------ Main commands ----------------- +<CR> means carriage return + + - Set desired angle: +"Qaaa.a eee.e<CR>", where +aaa.a - azimuth angle value with floating point, +eee.e - elevation angle with floating point. + + - After receiving command 'Q' rotator will send message +"ACK<CR>" if rotator received correct command, or +"ERR<CR>", if there were any mistakes. + + - After reaching destination angle rotator will send +"OKaaa.a[.]eee.e<CR>" + + - Request current axes angle command: +"Y<CR>" without parameters + - Rotator will reply: +"OKaaa.a[.]eee.e<CR>" + +Command for stop positioning: +"S<CR>" diff --git a/src/rot_reg.c b/src/rot_reg.c index 8a341872..3a97ed71 100644 --- a/src/rot_reg.c +++ b/src/rot_reg.c @@ -85,6 +85,7 @@ DEFINE_INITROT_BACKEND(prosistel); DEFINE_INITROT_BACKEND(meade); DEFINE_INITROT_BACKEND(ioptron); DEFINE_INITROT_BACKEND(satel); +DEFINE_INITROT_BACKEND(radant); #if HAVE_LIBINDI DEFINE_INITROT_BACKEND(indi); #endif @@ -128,6 +129,7 @@ static struct { ROT_MEADE, ROT_BACKEND_MEADE, ROT_FUNCNAMA(meade) }, { ROT_IOPTRON, ROT_BACKEND_IOPTRON, ROT_FUNCNAMA(ioptron) }, { ROT_SATEL, ROT_BACKEND_SATEL, ROT_FUNCNAMA(satel) }, + { ROT_RADANT, ROT_BACKEND_RADANT, ROT_FUNCNAMA(radant)}, #if HAVE_LIBINDI { ROT_INDI, ROT_BACKEND_INDI, ROT_FUNCNAMA(indi) }, #endif ----------------------------------------------------------------------- Summary of changes: configure.ac | 3 +- include/hamlib/rotlist.h | 13 ++ rigs/dummy/flrig.c | 8 +- rotators/radant/Makefile.am | 5 + rotators/radant/radant.c | 224 ++++++++++++++++++++++ rotators/{easycomm/easycomm.h => radant/radant.h} | 10 +- rotators/radant/radant.txt | 27 +++ src/rot_reg.c | 2 + 8 files changed, 281 insertions(+), 11 deletions(-) create mode 100644 rotators/radant/Makefile.am create mode 100644 rotators/radant/radant.c copy rotators/{easycomm/easycomm.h => radant/radant.h} (86%) create mode 100644 rotators/radant/radant.txt hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-04-11 21:13:18
|
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 9d38e9a726fbcf6678158fcc6dc023ea4bd5ff9f (commit) from 73464a6c2e2453f988dd12b9ed3e4a737632c85e (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 9d38e9a726fbcf6678158fcc6dc023ea4bd5ff9f Author: Bill Somerville <bi...@cl...> Date: Sun Apr 11 20:56:38 2021 +0100 Add missing shared library API exports diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 57421e3a..cc6ceb46 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -1969,7 +1969,7 @@ enum rig_function_e { * */ //! @cond Doxygen_Suppress -extern void *rig_get_function_ptr(rig_model_t rig_model, enum rig_function_e rig_function); +extern HAMLIB_EXPORT (void *) rig_get_function_ptr(rig_model_t rig_model, enum rig_function_e rig_function); /** * \brief Enumeration of rig->caps values @@ -1997,14 +1997,14 @@ enum rig_caps_cptr_e { * Does not support > 32-bit rig_caps values */ //! @cond Doxygen_Suppress -extern long long rig_get_caps_int(rig_model_t rig_model, enum rig_caps_int_e rig_caps); +extern HAMLIB_EXPORT (long long) rig_get_caps_int(rig_model_t rig_model, enum rig_caps_int_e rig_caps); /** * \brief Function to return char pointer value from rig->caps * */ //! @cond Doxygen_Suppress -extern const char* rig_get_caps_cptr(rig_model_t rig_model, enum rig_caps_cptr_e rig_caps); +extern HAMLIB_EXPORT (const char *) rig_get_caps_cptr(rig_model_t rig_model, enum rig_caps_cptr_e rig_caps); /** * \brief Port definition diff --git a/src/misc.c b/src/misc.c index fbf00320..bf841e3a 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1877,8 +1877,8 @@ const char *HAMLIB_API rot_strstatus(rot_status_t status) * \param RIG* and rig_function_e * \return the corresponding function pointer */ -void *rig_get_function_ptr(rig_model_t rig_model, - enum rig_function_e rig_function) +void * HAMLIB_API rig_get_function_ptr(rig_model_t rig_model, + enum rig_function_e rig_function) { const struct rig_caps *caps = rig_get_caps(rig_model); @@ -2150,7 +2150,7 @@ void *rig_get_function_ptr(rig_model_t rig_model, * \param RIG* and rig_caps_int_e * \return the corresponding long value -- -RIG_EINVAL is the only error possible */ -long long rig_get_caps_int(rig_model_t rig_model, enum rig_caps_int_e rig_caps) +long long HAMLIB_API rig_get_caps_int(rig_model_t rig_model, enum rig_caps_int_e rig_caps) { const struct rig_caps *caps = rig_get_caps(rig_model); @@ -2177,7 +2177,7 @@ long long rig_get_caps_int(rig_model_t rig_model, enum rig_caps_int_e rig_caps) } } -const char *rig_get_caps_cptr(rig_model_t rig_model, +const char * HAMLIB_API rig_get_caps_cptr(rig_model_t rig_model, enum rig_caps_cptr_e rig_caps) { const struct rig_caps *caps = rig_get_caps(rig_model); ----------------------------------------------------------------------- Summary of changes: include/hamlib/rig.h | 6 +++--- src/misc.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-04-11 16:51:15
|
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 73464a6c2e2453f988dd12b9ed3e4a737632c85e (commit) via 778758200eec2bf403222484331c817a8e40db32 (commit) via 758e9bc3a7ff9e19da0954166b93683d41ab622c (commit) via 601f0ab1f1c4f05e7771c2cd0401014f8058e7be (commit) from 1d1259545a7074b5b2d4419503abc5caebc67233 (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 73464a6c2e2453f988dd12b9ed3e4a737632c85e Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Apr 11 11:49:37 2021 -0500 Fix IC910 behavior with gpredict -- also should fix some Main/Sub behavior elsewhere too https://github.com/Hamlib/Hamlib/issues/657 diff --git a/rigs/icom/ic910.c b/rigs/icom/ic910.c index 66b101d7..bfb50a7a 100644 --- a/rigs/icom/ic910.c +++ b/rigs/icom/ic910.c @@ -65,266 +65,6 @@ static int ic910_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) } #endif /* HAVE_WEIRD_IC910_MODES */ -/* this function compares 2 frequencies - * returns 1 if they are in the same band - * returns 0 if they are in different bands - */ - -static int compareFrequencies(RIG *rig, freq_t freq1, freq_t freq2) -{ - int freq1band = 0, freq2band = 0; - freq_range_t noband = RIG_FRNG_END; - - while (rig->caps->rx_range_list1[freq1band].startf != noband.startf) - { - if (freq1 >= rig->caps->rx_range_list1[freq1band].startf && - freq1 <= rig->caps->rx_range_list1[freq1band].endf) - { - break; - } - - ++freq1band; - //fprintf(stderr, "%i\n", freq1band); - } - - while (rig->caps->rx_range_list1[freq2band].startf != noband.startf) - { - if (freq2 >= rig->caps->rx_range_list1[freq2band].startf && - freq2 <= rig->caps->rx_range_list1[freq2band].endf) - { - break; - } - - ++freq2band; - } - - if (freq2band == freq1band) { return 1; } - else { return 0; } -} - -static int ic910_set_freq(RIG *rig, vfo_t vfo, freq_t freq) -{ - int retval; - freq_t otherfreq; - freq_t origfreq; - - if ((retval = icom_get_freq(rig, RIG_VFO_CURR, &origfreq)) != RIG_OK) { return retval; } - - if (compareFrequencies(rig, freq, origfreq)) - { - /* correct band already */ - if (RIG_VFO_A == vfo || RIG_VFO_B == vfo) - { - /* switch to desired VFO and read its frequency */ - if ((retval = icom_set_vfo(rig, vfo)) != RIG_OK) { return retval; } - - if ((retval = icom_get_freq(rig, vfo, &otherfreq)) != RIG_OK) { return retval; } - - retval = icom_set_freq(rig, RIG_VFO_CURR, freq); - - if (otherfreq != origfreq) - { - /* swap VFOs back as original was the other one */ - icom_set_vfo(rig, RIG_VFO_A == vfo ? RIG_VFO_B : RIG_VFO_A); - } - } - else if (RIG_VFO_MAIN == vfo || RIG_VFO_SUB == vfo) - { - /* switch to the desired of MAIN and SUB and read its frequency */ - if ((retval = icom_set_vfo(rig, vfo)) != RIG_OK) { return retval; } - - if ((retval = icom_get_freq(rig, vfo, &otherfreq)) != RIG_OK) { return retval; } - - if (otherfreq != origfreq) - { - /* started on a different so band exchange MAIN and SUB */ - if ((retval = icom_vfo_op(rig, RIG_VFO_CURR, RIG_OP_XCHG)) != RIG_OK) { return retval; } - - retval = icom_set_freq(rig, RIG_VFO_CURR, freq); - /* swap MAIN/SUB back as original was the other one */ - icom_set_vfo(rig, RIG_VFO_MAIN == vfo ? RIG_VFO_SUB : RIG_VFO_MAIN); - } - else - { - /* already correct one of MAIN and SUB */ - retval = icom_set_freq(rig, RIG_VFO_CURR, freq); - } - } - else if (RIG_VFO_CURR == vfo) - { - retval = icom_set_freq(rig, RIG_VFO_CURR, freq); - } - else { retval = -RIG_EVFO; } - } - else - { - /* wrong band */ - if (RIG_VFO_A == vfo || RIG_VFO_B == vfo) - { - /* try and set frequency, may fail if band is already on other of MAIN/SUB */ - retval = icom_set_freq(rig, RIG_VFO_CURR, freq); - - if (-RIG_ERJCTED == retval) - { - /* exchange MAIN & SUB */ - if ((retval = icom_vfo_op(rig, RIG_VFO_CURR, RIG_OP_XCHG)) != RIG_OK) { return retval; } - - if ((retval = icom_get_freq(rig, vfo, &origfreq)) != RIG_OK) { return retval; } - - if ((retval = icom_set_vfo(rig, vfo)) != RIG_OK) { return retval; } - - if ((retval = icom_get_freq(rig, vfo, &otherfreq)) != RIG_OK) { return retval; } - - retval = icom_set_freq(rig, RIG_VFO_CURR, freq); - - if (-RIG_ERJCTED == retval) - { - /* band not fitted so swap MAIN & SUB back and give up */ - icom_vfo_op(rig, RIG_VFO_CURR, RIG_OP_XCHG); - return retval; - } - else if (retval != RIG_OK) { return retval; } - - if (otherfreq != origfreq) - { - /* swap VFOs back as original was the other one */ - icom_set_vfo(rig, RIG_VFO_A == vfo ? RIG_VFO_B : RIG_VFO_A); - } - - /* we do not exchange bands back as this is taken to - mean set VFOA/B on MAIN to the specified frequency - as Hamlib does not recognize A on MAIN or B on SUB - etc. This is probably reasonable since we cannot Tx - on SUB */ - return retval; - } - - /* we changed band to the "third band" which always makes - VFO A current so just make the requested one the - specified frequency as well if it is VFO B. There is no - way of going to the "third band" without changing VFO - A */ - if (RIG_VFO_B == vfo) - { - if ((retval = icom_set_vfo(rig, vfo)) != RIG_OK) { return retval; } - - retval = icom_set_freq(rig, RIG_VFO_CURR, freq); - icom_set_vfo(rig, RIG_VFO_A); - } - } - else if (RIG_VFO_MAIN == vfo || RIG_VFO_SUB == vfo) - { - if ((retval = icom_set_vfo(rig, vfo)) != RIG_OK) { return retval; } - - if ((retval = icom_get_freq(rig, vfo, &otherfreq)) != RIG_OK) { return retval; } - - retval = icom_set_freq(rig, RIG_VFO_CURR, freq); - - if (-RIG_ERJCTED == retval) - { - /* required band is on other of MAIN or SUB */ - if ((retval = icom_vfo_op(rig, RIG_VFO_CURR, RIG_OP_XCHG)) != RIG_OK) { return retval; } - - retval = icom_set_freq(rig, RIG_VFO_CURR, freq); - } - else if (retval != RIG_OK) { return retval; } - - if (otherfreq != origfreq) - { - /* started on other of MAIN & SUB so switch back */ - icom_set_vfo(rig, - RIG_VFO_MAIN == vfo ? - RIG_VFO_SUB : RIG_VFO_MAIN); - } - } - else if (RIG_VFO_CURR == vfo) - { - retval = icom_set_freq(rig, RIG_VFO_CURR, freq); - - if (-RIG_ERJCTED == retval) - { - /* exchange MAIN & SUB */ - if ((retval = icom_vfo_op(rig, RIG_VFO_CURR, RIG_OP_XCHG)) != RIG_OK) { return retval; } - - retval = icom_set_freq(rig, RIG_VFO_CURR, freq); - - if (-RIG_ERJCTED == retval) - { - /* band not fitted so swap MAIN & SUB back and give up */ - icom_vfo_op(rig, RIG_VFO_CURR, RIG_OP_XCHG); - return retval; - } - } - } - else { retval = -RIG_EVFO; } - } - - return retval; -} - -static int ic910_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) -{ - int retval; - freq_t origfreq; - vfo_t vfo_save; - struct icom_priv_data *priv = (struct icom_priv_data *) rig->state.priv; - - /* start off by reading the current VFO frequency */ - if ((retval = icom_get_freq(rig, RIG_VFO_CURR, &origfreq)) != RIG_OK) { return retval; } - - vfo_save = rig->state.current_vfo; - rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__, rig_strvfo(vfo)); - - if (RIG_VFO_A == vfo || RIG_VFO_B == vfo) - { - /* switch to desired VFO and read its frequency */ - if (vfo_save != vfo) - { - if ((retval = icom_set_vfo(rig, vfo)) != RIG_OK) { return retval; } - } - - if ((retval = icom_get_freq(rig, vfo, freq)) != RIG_OK) { return retval; } - - if (vfo_save != vfo) - { - /* swap VFOs back as original was the other one */ - icom_set_vfo(rig, vfo_save); - } - } - else if (RIG_VFO_MAIN == vfo || RIG_VFO_SUB == vfo) - { - /* switch to the desired of MAIN and SUB and read its frequency */ - if ((retval = icom_set_vfo(rig, vfo)) != RIG_OK) { return retval; } - - if ((retval = icom_get_freq(rig, vfo, freq)) != RIG_OK) { return retval; } - - if (*freq != origfreq) - { - /* started on a different so switch back MAIN or SUB */ - icom_set_vfo(rig, RIG_VFO_MAIN == vfo ? RIG_VFO_SUB : RIG_VFO_MAIN); - } - } - else if (RIG_VFO_CURR == vfo) - { - *freq = origfreq; - } - else if (RIG_VFO_TX == vfo) - { - vfo = priv->tx_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s: VFO_TX asked for so vfo=%s\n", __func__, - rig_strvfo(vfo)); - } - else if (RIG_VFO_RX == vfo) - { - vfo = priv->rx_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s: VFO_RX asked for so vfo=%s\n", __func__, - rig_strvfo(vfo)); - } - else { retval = -RIG_EVFO; } - - return retval; -} - /* * This function does the special bandwidth coding for IC-910 * (1 - normal, 2 - narrow) @@ -464,7 +204,7 @@ const struct rig_caps ic910_caps = RIG_MODEL(RIG_MODEL_IC910), .model_name = "IC-910", .mfg_name = "Icom", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -574,8 +314,8 @@ const struct rig_caps ic910_caps = .set_conf = icom_set_conf, .get_conf = icom_get_conf, - .get_freq = ic910_get_freq, - .set_freq = ic910_set_freq, + .get_freq = icom_get_freq, + .set_freq = icom_set_freq, #ifdef HAVE_WEIRD_IC910_MODES .get_mode = ic910_get_mode, diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index ad83437e..ef5e4519 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2234,6 +2234,8 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) } else if (vfo == RIG_VFO_TX) { + rig_debug(RIG_DEBUG_TRACE, "%s: vfo line#%d vfo=%s\n", __func__, __LINE__, + rig_strvfo(vfo)); vfo = RIG_VFO_A; if (VFO_HAS_A_B_ONLY && rig->state.cache.satmode) { vfo = RIG_VFO_B; } @@ -2243,13 +2245,17 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) else if ((vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) && VFO_HAS_DUAL) { + rig_debug(RIG_DEBUG_TRACE, "%s: vfo line#%d vfo=%s, split=%d\n", __func__, + __LINE__, rig_strvfo(vfo), rig->state.cache.split); // If we're being asked for A/Main but we are a MainA/MainB rig change it vfo = RIG_VFO_MAIN; - if (rig->state.cache.split == RIG_SPLIT_ON) { vfo = RIG_VFO_A; } + if (rig->state.cache.split == RIG_SPLIT_ON && !rig->state.cache.satmode) { vfo = RIG_VFO_A; } } else if ((vfo == RIG_VFO_B || vfo == RIG_VFO_SUB) && VFO_HAS_DUAL) { + rig_debug(RIG_DEBUG_TRACE, "%s: vfo line#%d vfo=%s\n", __func__, __LINE__, + rig_strvfo(vfo)); // If we're being asked for B/Sub but we are a MainA/MainB rig change it vfo = RIG_VFO_SUB; @@ -2286,7 +2292,7 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) priv->curr_freq = 0; // reset curr_freq so set_freq works 1st time } - rig_debug(RIG_DEBUG_TRACE, "%s: debug#2\n", __func__); + rig_debug(RIG_DEBUG_TRACE, "%s: line#%d\n", __func__, __LINE__); switch (vfo) { @@ -2439,10 +2445,10 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) RETURNFUNC(-RIG_EINVAL); } - rig_debug(RIG_DEBUG_TRACE, "%s: debug#3\n", __func__); + rig_debug(RIG_DEBUG_TRACE, "%s: line#%d\n", __func__, __LINE__); retval = icom_transaction(rig, C_SET_VFO, icvfo, NULL, 0, ackbuf, &ack_len); - rig_debug(RIG_DEBUG_TRACE, "%s: debug#4\n", __func__); + rig_debug(RIG_DEBUG_TRACE, "%s: line#%d\n", __func__, __LINE__); if (retval != RIG_OK) { @@ -2464,7 +2470,7 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) } rig->state.current_vfo = vfo; - rig_debug(RIG_DEBUG_TRACE, "%s: debug#5 curr_vfo=%s\n", __func__, + rig_debug(RIG_DEBUG_TRACE, "%s: line#%d curr_vfo=%s\n", __func__, __LINE__, rig_strvfo(rig->state.current_vfo)); RETURNFUNC(RIG_OK); } diff --git a/src/rig.c b/src/rig.c index 252b59e1..0acace4e 100644 --- a/src/rig.c +++ b/src/rig.c @@ -2525,7 +2525,7 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo) if (retcode == RIG_OK) { - rig->state.current_vfo = vfo; + vfo = rig->state.current_vfo; // vfo may change in the rig backend rig->state.cache.vfo = vfo; elapsed_ms(&rig->state.cache.time_vfo, HAMLIB_ELAPSED_SET); rig_debug(RIG_DEBUG_TRACE, "%s: rig->state.current_vfo=%s\n", __func__, @@ -3778,10 +3778,8 @@ int HAMLIB_API rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) if (caps->set_vfo) { // If we started with RIG_VFO_CURR we need to choose VFO_A/MAIN as appropriate to return to - if (save_vfo == RIG_VFO_CURR) - { - save_vfo = VFO_HAS_A_B_ONLY ? RIG_VFO_A : RIG_VFO_MAIN; - } + //rig_debug(RIG_DEBUG_TRACE, "%s: save_vfo=%s, hasmainsub=%d\n",__func__, rig_strvfo(save_vfo), VFO_HAS_MAIN_SUB); + save_vfo = VFO_HAS_MAIN_SUB ? RIG_VFO_MAIN : RIG_VFO_A; rig_debug(RIG_DEBUG_TRACE, "%s: restoring vfo=%s\n", __func__, rig_strvfo(save_vfo)); commit 778758200eec2bf403222484331c817a8e40db32 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Apr 10 14:22:53 2021 -0500 A more robust rigctld that can survive the rig disappearing and coming back again. This means when a rigctld client sees RIG_EIO it can keep polling and will reconnect when the rig reappears. diff --git a/src/rig.c b/src/rig.c index 2821d07d..252b59e1 100644 --- a/src/rig.c +++ b/src/rig.c @@ -767,6 +767,7 @@ int HAMLIB_API rig_open(RIG *rig) if (status < 0) { + rs->comm_state = 0; RETURNFUNC(status); } diff --git a/tests/rigctl.c b/tests/rigctl.c index f1248367..9a57316a 100644 --- a/tests/rigctl.c +++ b/tests/rigctl.c @@ -604,6 +604,7 @@ int main(int argc, char *argv[]) #endif /* HAVE_LIBREADLINE */ int rig_opened = 1; // our rig is already open + do { if (!rig_opened) @@ -630,7 +631,7 @@ int main(int argc, char *argv[]) hl_usleep(1000 * 1000); rig_debug(RIG_DEBUG_ERR, "%s: rig_close retcode=%d\n", __func__, retcode); retcode = rig_open(my_rig); - if (retcode != RIG_OK) rig_opened = 0; + rig_opened = retcode == RIG_OK ? 1 : 0; rig_debug(RIG_DEBUG_ERR, "%s: rig_open retcode=%d\n", __func__, retcode); } while (retry-- > 0 && retcode != RIG_OK); diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 90049882..c99cfbfe 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -1651,6 +1651,11 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc, } rig_debug(RIG_DEBUG_TRACE, "%s: vfo_opt=%d\n", __func__, *vfo_opt); + if (my_rig->state.comm_state == 0) + { + rig_debug(RIG_DEBUG_WARN, "%s: rig not open...trying to reopen\n", __func__); + rig_open(my_rig); + } retcode = (*cmd_entry->rig_routine)(my_rig, fout, fin, diff --git a/tests/rigctld.c b/tests/rigctld.c index 93fcbada..41cc030e 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -549,11 +549,13 @@ int main(int argc, char *argv[]) } #if 0 + if (!vfo_mode) { printf("Recommend using --vfo switch for rigctld if client supports it\n"); printf("rigctl and netrigctl will automatically detect vfo mode\n"); } + #endif rig_set_debug(verbose); @@ -1066,15 +1068,32 @@ void *handle_socket(void *arg) #endif + int rig_opened = 1; // our rig is already open + do { - rig_debug(RIG_DEBUG_TRACE, "%s: doing rigctl_parse vfo_mode=%d\n", __func__, - handle_data_arg->vfo_mode); - retcode = rigctl_parse(handle_data_arg->rig, fsockin, fsockout, NULL, 0, - sync_callback, - 1, 0, &handle_data_arg->vfo_mode, send_cmd_term, &ext_resp, &resp_sep); + if (!rig_opened) + { + retcode = rig_open(my_rig); + rig_opened = retcode == RIG_OK ? 1 : 0; + rig_debug(RIG_DEBUG_ERR, "%s: rig_open reopened retcode=%d\n", __func__, + retcode); + } - if (retcode != 0) { rig_debug(RIG_DEBUG_ERR, "%s: rigctl_parse retcode=%d\n", __func__, retcode); } + if (rig_opened) // only do this if rig is open + { + rig_debug(RIG_DEBUG_TRACE, "%s: doing rigctl_parse vfo_mode=%d\n", __func__, + handle_data_arg->vfo_mode); + retcode = rigctl_parse(handle_data_arg->rig, fsockin, fsockout, NULL, 0, + sync_callback, + 1, 0, &handle_data_arg->vfo_mode, send_cmd_term, &ext_resp, &resp_sep); + + if (retcode != 0) { rig_debug(RIG_DEBUG_ERR, "%s: rigctl_parse retcode=%d\n", __func__, retcode); } + } + else + { + retcode = -RIG_EIO; + } // if we get a hard error we try to reopen the rig again // this should cover short dropouts that can occur @@ -1089,7 +1108,9 @@ void *handle_socket(void *arg) hl_usleep(1000 * 1000); rig_debug(RIG_DEBUG_ERR, "%s: rig_close retcode=%d\n", __func__, retcode); retcode = rig_open(my_rig); - rig_debug(RIG_DEBUG_ERR, "%s: rig_open retcode=%d\n", __func__, retcode); + rig_opened = retcode == RIG_OK ? 1 : 0; + rig_debug(RIG_DEBUG_ERR, "%s: rig_open retcode=%d, opened=%d\n", __func__, + retcode, rig_opened); } while (retry-- > 0 && retcode != RIG_OK); } commit 758e9bc3a7ff9e19da0954166b93683d41ab622c Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Apr 10 11:07:10 2021 -0500 Use different method to detect rigctld port being offline diff --git a/tests/rigctl.c b/tests/rigctl.c index 86e419d3..f1248367 100644 --- a/tests/rigctl.c +++ b/tests/rigctl.c @@ -603,10 +603,10 @@ int main(int argc, char *argv[]) } #endif /* HAVE_LIBREADLINE */ - + int rig_opened = 1; // our rig is already open do { - if (my_rig->state.comm_state == 0) + if (!rig_opened) { // rig may have closed on us to try once to reopen retcode = rig_open(my_rig); @@ -630,6 +630,7 @@ int main(int argc, char *argv[]) hl_usleep(1000 * 1000); rig_debug(RIG_DEBUG_ERR, "%s: rig_close retcode=%d\n", __func__, retcode); retcode = rig_open(my_rig); + if (retcode != RIG_OK) rig_opened = 0; rig_debug(RIG_DEBUG_ERR, "%s: rig_open retcode=%d\n", __func__, retcode); } while (retry-- > 0 && retcode != RIG_OK); commit 601f0ab1f1c4f05e7771c2cd0401014f8058e7be Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Apr 10 10:43:49 2021 -0500 Allow rigctl to reopen port if it has been closed diff --git a/tests/rigctl.c b/tests/rigctl.c index 126f5275..86e419d3 100644 --- a/tests/rigctl.c +++ b/tests/rigctl.c @@ -606,6 +606,13 @@ int main(int argc, char *argv[]) do { + if (my_rig->state.comm_state == 0) + { + // rig may have closed on us to try once to reopen + retcode = rig_open(my_rig); + rig_debug(RIG_DEBUG_WARN, "%s: rig_open again retcode=%d\n", __func__, retcode); + } + retcode = rigctl_parse(my_rig, stdin, stdout, argv, argc, NULL, interactive, prompt, &vfo_opt, send_cmd_term, &ext_resp, &resp_sep); ----------------------------------------------------------------------- Summary of changes: rigs/icom/ic910.c | 266 +-------------------------------------------------- rigs/icom/icom.c | 16 +++- src/rig.c | 9 +- tests/rigctl.c | 9 ++ tests/rigctl_parse.c | 5 + tests/rigctld.c | 35 +++++-- 6 files changed, 60 insertions(+), 280 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-04-10 13:04:22
|
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 1d1259545a7074b5b2d4419503abc5caebc67233 (commit) from 89c434cc26b6cb037fa064e97274ba9ce1bd8ab1 (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 1d1259545a7074b5b2d4419503abc5caebc67233 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Apr 10 07:58:38 2021 -0500 Change CHECK_RIG in rig.c to return RIGEIO instead of RIGEINVAL This is a hard error and allows rigctld to reopen ports and not have to restart diff --git a/src/rig.c b/src/rig.c index 95c6688c..2821d07d 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1281,7 +1281,7 @@ int HAMLIB_API rig_set_twiddle(RIG *rig, int seconds) if (CHECK_RIG_ARG(rig)) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } rig->state.twiddle_timeout = seconds; @@ -1306,7 +1306,7 @@ int HAMLIB_API rig_set_uplink(RIG *rig, int val) if (CHECK_RIG_ARG(rig)) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } rig->state.uplink = val; @@ -1332,7 +1332,7 @@ int HAMLIB_API rig_get_twiddle(RIG *rig, int *seconds) if (CHECK_RIG_ARG(rig) || !seconds) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } *seconds = rig->state.twiddle_timeout; @@ -1694,7 +1694,7 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (CHECK_RIG_ARG(rig)) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } caps = rig->caps; @@ -1883,18 +1883,20 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) rmode_t mode; pbwidth_t width; - rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s\n", __func__, rig_strvfo(vfo)); - cache_show(rig, __func__, __LINE__); - -#if 0 // don't think we really need this check + if (CHECK_RIG_ARG(rig)) + { + RETURNFUNC(-RIG_EIO); + } - if (CHECK_RIG_ARG(rig) || !freq) + if (!freq) { - rig_debug(RIG_DEBUG_TRACE, "%s: rig or freq ptr invalid\n", __func__); + rig_debug(RIG_DEBUG_TRACE, "%s: freq ptr invalid\n", __func__); RETURNFUNC(-RIG_EINVAL); } -#endif + rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s\n", __func__, rig_strvfo(vfo)); + cache_show(rig, __func__, __LINE__); + curr_vfo = rig->state.current_vfo; // save vfo for restore later @@ -2116,7 +2118,7 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (CHECK_RIG_ARG(rig)) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } caps = rig->caps; @@ -2203,7 +2205,12 @@ int HAMLIB_API rig_get_mode(RIG *rig, ENTERFUNC; - if (CHECK_RIG_ARG(rig) || !mode || !width) + if (CHECK_RIG_ARG(rig)) + { + RETURNFUNC(-RIG_EIO); + } + + if (!mode || !width) { RETURNFUNC(-RIG_EINVAL); } @@ -2476,7 +2483,7 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo) if (CHECK_RIG_ARG(rig)) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } if (vfo == RIG_VFO_CURR) { RETURNFUNC(RIG_OK); } @@ -2586,7 +2593,12 @@ int HAMLIB_API rig_get_vfo(RIG *rig, vfo_t *vfo) if (CHECK_RIG_ARG(rig) || !vfo) { - rig_debug(RIG_DEBUG_ERR, "%s: no rig and/or vfo? rig=%p, vfo=%p\n", __func__, + RETURNFUNC(-RIG_EIO); + } + + if (!vfo) + { + rig_debug(RIG_DEBUG_ERR, "%s: no vfo? rig=%p, vfo=%p\n", __func__, rig, vfo); RETURNFUNC(-RIG_EINVAL); } @@ -2660,7 +2672,7 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) if (CHECK_RIG_ARG(rig)) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } caps = rig->caps; @@ -2914,7 +2926,12 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) ENTERFUNC; - if (CHECK_RIG_ARG(rig) || !ptt) + if (CHECK_RIG_ARG(rig)) + { + RETURNFUNC(-RIG_EIO); + } + + if (!ptt) { RETURNFUNC(-RIG_EINVAL); } @@ -3148,7 +3165,12 @@ int HAMLIB_API rig_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) ENTERFUNC; - if (CHECK_RIG_ARG(rig) || !dcd) + if (CHECK_RIG_ARG(rig)) + { + RETURNFUNC(-RIG_EIO); + } + + if (!dcd) { RETURNFUNC(-RIG_EINVAL); } @@ -3257,7 +3279,7 @@ int HAMLIB_API rig_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift) if (CHECK_RIG_ARG(rig)) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } caps = rig->caps; @@ -3323,7 +3345,12 @@ int HAMLIB_API rig_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift) ENTERFUNC; - if (CHECK_RIG_ARG(rig) || !rptr_shift) + if (CHECK_RIG_ARG(rig)) + { + RETURNFUNC(-RIG_EIO); + } + + if (!rptr_shift) { RETURNFUNC(-RIG_EINVAL); } @@ -3393,7 +3420,7 @@ int HAMLIB_API rig_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs) if (CHECK_RIG_ARG(rig)) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } caps = rig->caps; @@ -3459,7 +3486,12 @@ int HAMLIB_API rig_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs) ENTERFUNC; - if (CHECK_RIG_ARG(rig) || !rptr_offs) + if (CHECK_RIG_ARG(rig)) + { + RETURNFUNC(-RIG_EIO); + } + + if (!rptr_offs) { RETURNFUNC(-RIG_EINVAL); } @@ -3527,7 +3559,7 @@ int HAMLIB_API rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) if (CHECK_RIG_ARG(rig)) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s, curr_vfo=%s\n", __func__, @@ -3663,7 +3695,12 @@ int HAMLIB_API rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) ENTERFUNC; - if (CHECK_RIG_ARG(rig) || !tx_freq) + if (CHECK_RIG_ARG(rig)) + { + RETURNFUNC(-RIG_EIO); + } + + if (!tx_freq) { RETURNFUNC(-RIG_EINVAL); } @@ -3797,7 +3834,7 @@ int HAMLIB_API rig_set_split_mode(RIG *rig, if (CHECK_RIG_ARG(rig)) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } caps = rig->caps; @@ -3906,7 +3943,12 @@ int HAMLIB_API rig_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, ENTERFUNC; - if (CHECK_RIG_ARG(rig) || !tx_mode || !tx_width) + if (CHECK_RIG_ARG(rig)) + { + RETURNFUNC(-RIG_EIO); + } + + if (!tx_mode || !tx_width) { RETURNFUNC(-RIG_EINVAL); } @@ -4031,7 +4073,7 @@ int HAMLIB_API rig_set_split_freq_mode(RIG *rig, if (CHECK_RIG_ARG(rig)) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } caps = rig->caps; @@ -4130,7 +4172,12 @@ int HAMLIB_API rig_get_split_freq_mode(RIG *rig, ENTERFUNC; - if (CHECK_RIG_ARG(rig) || !tx_freq || !tx_mode || !tx_width) + if (CHECK_RIG_ARG(rig)) + { + RETURNFUNC(-RIG_EIO); + } + + if (!tx_freq || !tx_mode || !tx_width) { RETURNFUNC(-RIG_EINVAL); } @@ -4182,7 +4229,7 @@ int HAMLIB_API rig_set_split_vfo(RIG *rig, if (CHECK_RIG_ARG(rig)) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } caps = rig->caps; @@ -4279,7 +4326,12 @@ int HAMLIB_API rig_get_split_vfo(RIG *rig, ENTERFUNC; - if (CHECK_RIG_ARG(rig) || !split || !tx_vfo) + if (CHECK_RIG_ARG(rig)) + { + RETURNFUNC(-RIG_EIO); + } + + if (!split || !tx_vfo) { RETURNFUNC(-RIG_EINVAL); } @@ -4383,7 +4435,7 @@ int HAMLIB_API rig_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) if (CHECK_RIG_ARG(rig)) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } caps = rig->caps; @@ -4450,7 +4502,12 @@ int HAMLIB_API rig_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) ENTERFUNC; - if (CHECK_RIG_ARG(rig) || !rit) + if (CHECK_RIG_ARG(rig)) + { + RETURNFUNC(-RIG_EIO); + } + + if (!rit) { RETURNFUNC(-RIG_EINVAL); } @@ -4521,7 +4578,7 @@ int HAMLIB_API rig_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit) if (CHECK_RIG_ARG(rig)) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } caps = rig->caps; @@ -4588,7 +4645,12 @@ int HAMLIB_API rig_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) ENTERFUNC; - if (CHECK_RIG_ARG(rig) || !xit) + if (CHECK_RIG_ARG(rig)) + { + RETURNFUNC(-RIG_EIO); + } + + if (!xit) { RETURNFUNC(-RIG_EINVAL); } @@ -4659,7 +4721,7 @@ int HAMLIB_API rig_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts) if (CHECK_RIG_ARG(rig)) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } caps = rig->caps; @@ -4725,7 +4787,12 @@ int HAMLIB_API rig_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts) ENTERFUNC; - if (CHECK_RIG_ARG(rig) || !ts) + if (CHECK_RIG_ARG(rig)) + { + RETURNFUNC(-RIG_EIO); + } + + if (!ts) { RETURNFUNC(-RIG_EINVAL); } @@ -4800,7 +4867,7 @@ int HAMLIB_API rig_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) if (CHECK_RIG_ARG(rig)) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } caps = rig->caps; @@ -4874,7 +4941,12 @@ int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, *ant_tx = *ant_rx = RIG_ANT_UNKNOWN; - if (CHECK_RIG_ARG(rig) || !ant_curr) + if (CHECK_RIG_ARG(rig)) + { + RETURNFUNC(-RIG_EIO); + } + + if (ant_curr) { RETURNFUNC(-RIG_EINVAL); } @@ -5102,7 +5174,7 @@ int HAMLIB_API rig_set_powerstat(RIG *rig, powerstat_t status) if (CHECK_RIG_ARG(rig)) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } if (rig->caps->set_powerstat == NULL) @@ -5136,7 +5208,12 @@ int HAMLIB_API rig_get_powerstat(RIG *rig, powerstat_t *status) ENTERFUNC; - if (CHECK_RIG_ARG(rig) || !status) + if (CHECK_RIG_ARG(rig)) + { + RETURNFUNC(-RIG_EIO); + } + + if (!status) { RETURNFUNC(-RIG_EINVAL); } @@ -5173,7 +5250,7 @@ int HAMLIB_API rig_reset(RIG *rig, reset_t reset) if (CHECK_RIG_ARG(rig)) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } if (rig->caps->reset == NULL) @@ -5311,7 +5388,7 @@ int HAMLIB_API rig_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) if (CHECK_RIG_ARG(rig)) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } caps = rig->caps; @@ -5413,7 +5490,7 @@ int HAMLIB_API rig_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) if (CHECK_RIG_ARG(rig)) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } caps = rig->caps; @@ -5480,7 +5557,12 @@ int HAMLIB_API rig_send_dtmf(RIG *rig, vfo_t vfo, const char *digits) ENTERFUNC; - if (CHECK_RIG_ARG(rig) || !digits) + if (CHECK_RIG_ARG(rig)) + { + RETURNFUNC(-RIG_EIO); + } + + if (!digits) { RETURNFUNC(-RIG_EINVAL); } @@ -5549,7 +5631,12 @@ int HAMLIB_API rig_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length) ENTERFUNC; - if (CHECK_RIG_ARG(rig) || !digits || !length) + if (CHECK_RIG_ARG(rig)) + { + RETURNFUNC(-RIG_EIO); + } + + if (!digits || !length) { RETURNFUNC(-RIG_EINVAL); } @@ -5617,7 +5704,12 @@ int HAMLIB_API rig_send_morse(RIG *rig, vfo_t vfo, const char *msg) ENTERFUNC; - if (CHECK_RIG_ARG(rig) || !msg) + if (CHECK_RIG_ARG(rig)) + { + RETURNFUNC(-RIG_EIO); + } + + if (!msg) { RETURNFUNC(-RIG_EINVAL); } @@ -5835,7 +5927,7 @@ int HAMLIB_API rig_send_voice_mem(RIG *rig, vfo_t vfo, int ch) if CHECK_RIG_ARG(rig) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } caps = rig->caps; @@ -5991,7 +6083,7 @@ int HAMLIB_API rig_get_vfo_info(RIG *rig, vfo_t vfo, freq_t *freq, if (CHECK_RIG_ARG(rig)) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } //if (vfo == RIG_VFO_CURR) { vfo = rig->state.current_vfo; } @@ -6047,7 +6139,7 @@ int HAMLIB_API rig_get_vfo_list(RIG *rig, char *buf, int buflen) if (CHECK_RIG_ARG(rig)) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC(-RIG_EIO); } rig_sprintf_vfo(buf, buflen - 1, rig->state.vfo_list); ----------------------------------------------------------------------- Summary of changes: src/rig.c | 190 ++++++++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 141 insertions(+), 49 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-04-10 03:53:48
|
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 89c434cc26b6cb037fa064e97274ba9ce1bd8ab1 (commit) from 9644825308cc8f04d14a12b4bf82027ab18c6764 (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 89c434cc26b6cb037fa064e97274ba9ce1bd8ab1 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Apr 9 22:53:06 2021 -0500 Remove comment from flrig.c diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 55dd16b9..bed6e679 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -853,7 +853,6 @@ static int flrig_open(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s: getmodeA is available\n", __func__); } - /* see if set_vfoA_fast is available */ freq_t freq; retval = flrig_get_freq(rig, RIG_VFO_CURR, &freq); ----------------------------------------------------------------------- Summary of changes: rigs/dummy/flrig.c | 1 - 1 file changed, 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-04-10 03:48:43
|
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 9644825308cc8f04d14a12b4bf82027ab18c6764 (commit) from dae869f390c051357acaa220b37179231247ff49 (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 9644825308cc8f04d14a12b4bf82027ab18c6764 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Apr 9 22:47:56 2021 -0500 Update flrig.c to use new set_verify cmds for freq & ptt diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 258448e5..55dd16b9 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -61,7 +61,7 @@ #define FLRIG_LEVELS (RIG_LEVEL_AF | RIG_LEVEL_RF | RIG_LEVEL_MICGAIN | RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER_METER | RIG_LEVEL_RFPOWER_METER_WATTS | RIG_LEVEL_RFPOWER) -#define FLRIG_PARM (TOK_FLRIG_FAST_SET_FREQ|TOK_FLRIG_FAST_SET_PTT) +#define FLRIG_PARM (TOK_FLRIG_VERIFY_FREQ|TOK_FLRIG_VERIFY_PTT) #define streq(s1,s2) (strcmp(s1,s2)==0) @@ -118,24 +118,23 @@ 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 */ - int has_set_freq_fast; - int has_set_ptt_fast; + int has_verify_cmds; // has the verify cmd in FLRig 1.3.54.1 or higher float powermeter_scale; /* So we can scale power meter to 0-1 */ value_t parms[RIG_SETTING_MAX]; struct ext_list *ext_parms; }; /* level's and parm's tokens */ -#define TOK_FLRIG_FAST_SET_FREQ TOKEN_BACKEND(1) -#define TOK_FLRIG_FAST_SET_PTT TOKEN_BACKEND(2) +#define TOK_FLRIG_VERIFY_FREQ TOKEN_BACKEND(1) +#define TOK_FLRIG_VERIFY_PTT TOKEN_BACKEND(2) static const struct confparams flrig_ext_parms[] = { { - TOK_FLRIG_FAST_SET_FREQ, "FAST_SET_FREQ", "Use fast set_freq", "If true uses fast set_freq otherwise set_freq is confirmed", "1", RIG_CONF_CHECKBUTTON, {} + TOK_FLRIG_VERIFY_FREQ, "VERIFY_FREQ", "Verify set_freq", "If true will verify set_freq otherwise is fire and forget", "0", RIG_CONF_CHECKBUTTON, {} }, { - TOK_FLRIG_FAST_SET_PTT, "FAST_SET_PTT", "Use fast set_ott", "If true uses fast set_ptt otherwise set_ptt is confirmed", "1", RIG_CONF_CHECKBUTTON, {} + TOK_FLRIG_VERIFY_PTT, "VERIFY_PTT", "Verify set_ptt", "If true will verify set_ptt otherwise set_ptt is fire and forget", "0", RIG_CONF_CHECKBUTTON, {} }, { RIG_CONF_END, NULL, } }; @@ -799,6 +798,22 @@ static int flrig_open(RIG *rig) RETURNFUNC(retval); } + int v1, v2, v3, v4; + sscanf(value, "%d.%d.%d.%d", &v1, &v2, &v3, &v4); + + if (v1 >= 1 || (v1 >= 1 && v2 >= 3) || (v1 >= 1 && v2 >= 3 && v3 >= 54)) + { + priv->has_verify_cmds = 1; + rig_debug(RIG_DEBUG_VERBOSE, "%s: verify set_vfoA/ptt is available\n", + __func__); + } + else + { + priv->has_verify_cmds = 0; + rig_debug(RIG_DEBUG_VERBOSE, "%s: verify set vfoA/ptt is not available\n", + __func__); + } + rig_debug(RIG_DEBUG_VERBOSE, "%s FlRig version %s\n", __func__, value); retval = flrig_transaction(rig, "rig.get_xcvr", NULL, value, sizeof(value)); @@ -849,29 +864,6 @@ static int flrig_open(RIG *rig) } - value_t val; - val.i = 1; // we'll try fast and if it fails turn it off - priv->has_set_freq_fast = 1; - rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, val); - rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_PTT, val); - - retval = flrig_set_freq(rig, RIG_VFO_CURR, freq); - - if (retval == RIG_ENAVAIL) // must not have it - { - val.i = 0; - rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, val); - rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_PTT, val); - priv->has_set_freq_fast = 0; - priv->has_set_ptt_fast = 0; // they both will not be there - rig_debug(RIG_DEBUG_VERBOSE, "%s: set_vfoA_fast/ptt is not available\n", - __func__); - } - else - { - rig_debug(RIG_DEBUG_VERBOSE, "%s: set_vfoA_fast/ptt is available\n", __func__); - } - /* see if get_bwA is available */ retval = flrig_transaction(rig, "rig.get_bwA", NULL, value, sizeof(value)); @@ -1196,14 +1188,14 @@ static int flrig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) "<params><param><value><double>%.0f</double></value></param></params>", freq); value_t val; - rig_get_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, &val); - rig_debug(RIG_DEBUG_VERBOSE, "%s: fast_set_freq=%d\n", __func__, val.i); + rig_get_ext_parm(rig, TOK_FLRIG_VERIFY_FREQ, &val); + rig_debug(RIG_DEBUG_VERBOSE, "%s: set_verify_vfoA/B=%d\n", __func__, val.i); if (vfo == RIG_VFO_A) { cmd = "rig.set_vfoA"; - if (val.i) { cmd = "rig.set_vfoA_fast"; } + if (val.i) { cmd = "rig.set_verify_vfoA"; } rig_debug(RIG_DEBUG_TRACE, "%s %.0f\n", cmd, freq); priv->curr_freqA = freq; @@ -1212,7 +1204,7 @@ static int flrig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { cmd = "rig.set_vfoB"; - if (val.i) { cmd = "rig.set_vfoB_fast"; } + if (val.i) { cmd = "rig.set_verify_vfoB"; } rig_debug(RIG_DEBUG_TRACE, "%s %.0f\n", cmd, freq); priv->curr_freqB = freq; @@ -1255,7 +1247,7 @@ static int flrig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) value_t val; char *cmd = "rig.set_ptt"; - rig_get_ext_parm(rig, TOK_FLRIG_FAST_SET_PTT, &val); + rig_get_ext_parm(rig, TOK_FLRIG_VERIFY_FREQ, &val); rig_debug(RIG_DEBUG_VERBOSE, "%s: fast_set_ptt=%d\n", __func__, val.i); if (val.i) { cmd = "rig.set_ptt_fast"; } @@ -2208,12 +2200,12 @@ static int flrig_set_ext_parm(RIG *rig, token_t token, value_t val) switch (token) { - case TOK_FLRIG_FAST_SET_FREQ: - case TOK_FLRIG_FAST_SET_PTT: - if (val.i && !priv->has_set_freq_fast) + case TOK_FLRIG_VERIFY_FREQ: + case TOK_FLRIG_VERIFY_PTT: + if (val.i && !priv->has_verify_cmds) { rig_debug(RIG_DEBUG_ERR, - "%s: FLRig version 1.3.54.14 or higher needed to support fast functions\n", + "%s: FLRig version 1.3.54.18 or higher needed to support fast functions\n", __func__); RETURNFUNC(-RIG_EINVAL); } @@ -2286,8 +2278,8 @@ static int flrig_get_ext_parm(RIG *rig, token_t token, value_t *val) switch (token) { - case TOK_FLRIG_FAST_SET_FREQ: - case TOK_FLRIG_FAST_SET_PTT: + case TOK_FLRIG_VERIFY_FREQ: + case TOK_FLRIG_VERIFY_PTT: break; default: ----------------------------------------------------------------------- Summary of changes: rigs/dummy/flrig.c | 74 ++++++++++++++++++++++++------------------------------ 1 file changed, 33 insertions(+), 41 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-04-09 22:33:57
|
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 dae869f390c051357acaa220b37179231247ff49 (commit) from eb63b1c9ea2efc5c8517e5fd7cda04c5ebcfd3eb (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 dae869f390c051357acaa220b37179231247ff49 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Apr 9 17:33:18 2021 -0500 Fix punctuation error in flrig.c diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 2a809d5d..258448e5 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -145,7 +145,7 @@ const struct rig_caps flrig_caps = RIG_MODEL(RIG_MODEL_FLRIG), .model_name = "FLRig", .mfg_name = "FLRig", - .version = "20210409"; + .version = "20210409", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, ----------------------------------------------------------------------- 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...> - 2021-04-09 22:31: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 eb63b1c9ea2efc5c8517e5fd7cda04c5ebcfd3eb (commit) from c4e37ef27728ae6d0ff1be9f052242d324140b96 (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 eb63b1c9ea2efc5c8517e5fd7cda04c5ebcfd3eb Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Apr 9 17:30:35 2021 -0500 Enable set_ptt_fast in flrig.c -- Fixed in 1.3.54.17 diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 775a1ad7..2a809d5d 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -145,7 +145,7 @@ const struct rig_caps flrig_caps = RIG_MODEL(RIG_MODEL_FLRIG), .model_name = "FLRig", .mfg_name = "FLRig", - .version = "20210408", + .version = "20210409"; .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -852,11 +852,6 @@ static int flrig_open(RIG *rig) value_t val; val.i = 1; // we'll try fast and if it fails turn it off priv->has_set_freq_fast = 1; -#if 0 - priv->has_set_ptt_fast = 1; // they both will be there -#else - priv->has_set_ptt_fast = 0; // Broken in FLRig 1.3.54.14 and before -#endif rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, val); rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_PTT, val); ----------------------------------------------------------------------- Summary of changes: rigs/dummy/flrig.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-04-09 20:52: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 c4e37ef27728ae6d0ff1be9f052242d324140b96 (commit) from 6901bb1cdaf6f2e0647c8e549ffdd2d80d009334 (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 c4e37ef27728ae6d0ff1be9f052242d324140b96 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Apr 9 15:35:30 2021 -0500 Add timeout to dump_state so rigctld will use the rig's timeout value plus 200ms for additional network delays diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 5d37ed83..00d17590 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -612,6 +612,12 @@ static int netrigctl_open(RIG *rig) if (!has) { rig->caps->get_freq = NULL; } } + else if (strcmp(setting, "timeout") == 0) + { + // use the rig's timeout value pluse 200ms for potential network delays + rig->caps->timeout = strtol(value, NULL, 0) + 200; + rig_debug(RIG_DEBUG_TRACE, "%s: timeout value = '%s', final timeout=%d\n", __func__, value, rig->caps->timeout); + } else { // not an error -- just a warning for backward compatibility @@ -2288,7 +2294,7 @@ struct rig_caps netrigctl_caps = RIG_MODEL(RIG_MODEL_NETRIGCTL), .model_name = "NET rigctl", .mfg_name = "Hamlib", - .version = "20210326.0", + .version = "20210409.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index af398965..90049882 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -4319,6 +4319,7 @@ declare_proto_rig(dump_state) fprintf(fout, "has_get_vfo=%d\n", rig->caps->get_vfo != NULL); fprintf(fout, "has_set_freq=%d\n", rig->caps->set_freq != NULL); fprintf(fout, "has_get_freq=%d\n", rig->caps->get_freq != NULL); + fprintf(fout, "timeout=%d\n", rig->caps->timeout); fprintf(fout, "done\n"); } ----------------------------------------------------------------------- Summary of changes: rigs/dummy/netrigctl.c | 8 +++++++- tests/rigctl_parse.c | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-04-09 20:20:54
|
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 6901bb1cdaf6f2e0647c8e549ffdd2d80d009334 (commit) via 7ea4fd17aa728555ea3b05b74dca0f5e8a7b4efe (commit) via 609c9ad8d52bd5f3c9d6611058f5afe89565c9a9 (commit) via def3aee7a613cc74123639603dffd65a9c2cf579 (commit) via e90147f83ca8d3df0391a4f072df6410ce673f0e (commit) via 716866bd45c8bddc938326a45a18fccfa0093b63 (commit) via 74654e18778e8441789b14b429b2b94798cb4ff5 (commit) via 4c8dc6e2451e9ef5d793c14294d73237ca136b73 (commit) via 313e46acf307396901899eb8d9ec450296851eb5 (commit) via 87ae220a1a1ca10824c537fd43a0b5a992fc86e7 (commit) via bddf8684143aeebc3bfcf7f4939e9ec64a6ee621 (commit) via 993a3162fd0f5f49f66af986202a4876388e2890 (commit) via 03b69afee667e9bfad14c93c3679c8ecc7ae4a25 (commit) via 72161dd316d99aa92aebb4139ebc6935386b963c (commit) via 0981fa630d3dac9854f35e5256ce835f284bdb08 (commit) via c02b079fb3de17e766399cfc82daae096f646751 (commit) via aa1972fb5d794184bf852b2cbf6ac5da73fc2a88 (commit) via 124a6faafd0c545fd7ec9a20bf6a582968d4c769 (commit) via 8d95db88d41bd5daa4c7b1174b5780b77a4408cb (commit) via eb0f5961042606ed143f219ff9e3d5cfc90d0c5f (commit) via 623287aa02823bf900b9ac7b7d94c6f84529d0a8 (commit) via 4c2f60b9b0e03bb83e36b4e4a8f2dc0e1b580e95 (commit) via f8c4f80fd64a8dfc1a16d23ab4fb5d41fb8cc9f7 (commit) via c25e8f9e5b5652ee18bd0c653b31d868dac06e0d (commit) via 502c41d7465883922a4caec186a4fa00efc0d427 (commit) via 7d2a5078c48f188a54609fd7b0bbe654764a850a (commit) via 809f2744e66ca52742e35c2c90422c990902b424 (commit) via 6cb6043a432b65f88c747856996ee2e94a092637 (commit) via 1bd2cf37d7d779ce84dcb3930ec4418fd8faa957 (commit) via 2b104ba37d8b6dbe72b084bfec892e3019365c48 (commit) from bbc8e00074fbcb43b77badeba8028e1800e58bdb (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 6901bb1cdaf6f2e0647c8e549ffdd2d80d009334 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Apr 9 15:16:41 2021 -0500 Remove vfo_mode printout diff --git a/tests/rigctld.c b/tests/rigctld.c index 2cc7c262..93fcbada 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -548,11 +548,13 @@ int main(int argc, char *argv[]) } } +#if 0 if (!vfo_mode) { printf("Recommend using --vfo switch for rigctld if client supports it\n"); printf("rigctl and netrigctl will automatically detect vfo mode\n"); } +#endif rig_set_debug(verbose); commit 7ea4fd17aa728555ea3b05b74dca0f5e8a7b4efe Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Apr 8 22:37:36 2021 -0500 Fix icom.c default vfo to usa VFOA/Main as appropriate https://github.com/Hamlib/Hamlib/issues/654 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 5ad415ba..ad83437e 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1251,7 +1251,9 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) if (rig->state.current_vfo == RIG_VFO_NONE) { - retval = rig_set_vfo(rig, RIG_VFO_A); // we default to VFOA + // we default to VFOA/MAIN as appropriate + vfo = (rig->state.vfo_list & RIG_VFO_B) ? RIG_VFO_A : RIG_VFO_MAIN; + retval = rig_set_vfo(rig, vfo); if (retval != RIG_OK) { diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 286e6536..fd44e5a2 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -30,7 +30,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20210330" +#define BACKEND_VER "20210408" /* * defines used by comp_cal_str in rig.c commit 609c9ad8d52bd5f3c9d6611058f5afe89565c9a9 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Apr 8 16:16:35 2021 -0500 Temporarily disable fast_set_ptt in flrig.c -- not working in FLRig 1.3.54.14 diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 88071859..775a1ad7 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -852,7 +852,11 @@ static int flrig_open(RIG *rig) value_t val; val.i = 1; // we'll try fast and if it fails turn it off priv->has_set_freq_fast = 1; +#if 0 priv->has_set_ptt_fast = 1; // they both will be there +#else + priv->has_set_ptt_fast = 0; // Broken in FLRig 1.3.54.14 and before +#endif rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, val); rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_PTT, val); commit def3aee7a613cc74123639603dffd65a9c2cf579 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Apr 8 14:29:40 2021 -0500 Add set_ptt_fast capability to flrig.c as default if available diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index ed6ee2a0..88071859 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -145,7 +145,7 @@ const struct rig_caps flrig_caps = RIG_MODEL(RIG_MODEL_FLRIG), .model_name = "FLRig", .mfg_name = "FLRig", - .version = "20210407", + .version = "20210408", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1253,7 +1253,15 @@ static int flrig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) sprintf(cmd_arg, "<params><param><value><i4>%d</i4></value></param></params>", ptt); - retval = flrig_transaction(rig, "rig.set_ptt", cmd_arg, NULL, 0); + + value_t val; + char *cmd = "rig.set_ptt"; + rig_get_ext_parm(rig, TOK_FLRIG_FAST_SET_PTT, &val); + rig_debug(RIG_DEBUG_VERBOSE, "%s: fast_set_ptt=%d\n", __func__, val.i); + + if (val.i) { cmd = "rig.set_ptt_fast"; } + + retval = flrig_transaction(rig, cmd, cmd_arg, NULL, 0); if (retval != RIG_OK) { commit e90147f83ca8d3df0391a4f072df6410ce673f0e Merge: 74654e18 716866bd Author: Nate Bargmann <n0...@n0...> Date: Wed Apr 7 11:12:35 2021 -0500 Merge pull request #653 from N0NB/doxygen_work Update Doxygen comments in commit 716866bd45c8bddc938326a45a18fccfa0093b63 Author: Nate Bargmann <n0...@n0...> Date: Wed Apr 7 11:08:02 2021 -0500 Update Doxygen comments in amp_settings.c amplifier.c rot_settings.c diff --git a/src/amp_settings.c b/src/amp_settings.c index 81aeda23..6493664a 100644 --- a/src/amp_settings.c +++ b/src/amp_settings.c @@ -50,19 +50,23 @@ /** - * \brief Check retrieval ability of level settings. + * \brief Check which level settings can be queried. * * \param amp The #AMP handle. - * \param level The level settings to check. + * \param level The level settings bitmap. * - * Checks if an amplifier is capable of *getting* a level setting. Since the - * \a level is an OR'ed bitwise argument, more than one level can be checked - * at the same time. + * Checks if an amplifier is capable of *getting* a level setting. Since the + * \a level is an OR'ed bitwise argument, more than one level can be checked + * at the same time. * - * EXAMPLE: \code if (amp_has_get_level(my_amp, AMP_LVL_SWR)) disp_SWR();\endcode + * EXAMPLE: + * \code + * if (amp_has_get_level(my_amp, AMP_LVL_SWR)) + * my_disp_SWR(); + * \endcode * * \return A bit map of supported level settings that can be retrieved, - * otherwise 0 if none supported. + * otherwise 0 if none supported or \a amp is NULL or inconsistent. * * \sa amp_has_set_level(), amp_get_level() */ diff --git a/src/amplifier.c b/src/amplifier.c index 7f518b1b..c56364e0 100644 --- a/src/amplifier.c +++ b/src/amplifier.c @@ -703,6 +703,8 @@ const char *HAMLIB_API amp_get_info(AMP *amp) * * Query the \a val corresponding to the \a level. * + * \note \a val can be any type defined by #value_t. + * * \return RIG_OK if the operation was successful, otherwise a **negative * value** if an error occurred (in which case, cause is set appropriately). * diff --git a/src/rot_settings.c b/src/rot_settings.c index 5ac67118..749834bb 100644 --- a/src/rot_settings.c +++ b/src/rot_settings.c @@ -1,17 +1,3 @@ -/** - * \addtogroup rotator - * @{ - */ - -/** - * \file rot_settings.c - * \brief rotator func/level/parm interface - * \author Mikael Nousiainen - * \date 2020 - * - * Hamlib interface is a frontend implementing wrapper functions. - */ - /* * Hamlib Interface - rotator func/level/parm * Copyright (c) 2020 by Mikael Nousiainen @@ -33,6 +19,22 @@ * */ +/** + * \addtogroup rotator + * @{ + */ + +/** + * \file rot_settings.c + * \brief Rotator functions/levels/parameters interface. + * + * \author Mikael Nousiainen + * \date 2020 + * + * This Hamlib interface is a frontend implementing wrapper functions. + */ + + #ifdef HAVE_CONFIG_H # include "config.h" #endif @@ -58,18 +60,24 @@ /** - * \brief set a rotator level setting - * \param rig The rotator handle - * \param level The level setting - * \param val The value to set the level setting to + * \brief Set a rotator level to a given value. + * + * \param rot The #ROT handle. + * \param level The level to set. + * \param val The value of the level. + * + * Set \a level to \a val. * - * Sets the level of a setting. - * The level value \a val can be a float or an integer. See #value_t - * for more information. + * \note \a val can be any type defined by #value_t. + * \note As this function calls rot_has_set_level(), this may be considered a + * higher level API. * - * \return RIG_OK if the operation has been successful, otherwise - * a negative value if an error occurred (in which case, cause is - * set appropriately). + * \return RIG_OK if the operation has been successful, otherwise a **negative + * value** if an error occurred (in which case, cause is set appropriately). + * + * \retval RIG_OK Setting the level was successful. + * \retval RIG_EINVAL \a rot is NULL or inconsistent. + * \retval RIG_ENAVAIL rot_caps#set_level() capability is not available. * * \sa rot_has_set_level(), rot_get_level() */ @@ -96,18 +104,24 @@ int HAMLIB_API rot_set_level(ROT *rot, setting_t level, value_t val) /** - * \brief get the value of a level - * \param rig The rotator handle - * \param level The level setting - * \param val The location where to store the value of \a level + * \brief Query the value of a requested rotator level. + * + * \param rot The #ROT handle. + * \param level The requested level. + * \param val The variable to store the \a level value. + * + * Query the \a val corresponding to the \a level. * - * Retrieves the value of a \a level. - * The level value \a val can be a float or an integer. See #value_t - * for more information. + * \note \a val can be any type defined by #value_t. + * \note As this function calls rot_has_get_level(), this may be considered a + * higher level API. * - * \return RIG_OK if the operation has been successful, otherwise - * a negative value if an error occurred (in which case, cause is - * set appropriately). + * \return RIG_OK if the operation has been successful, otherwise a **negative + * value** if an error occurred (in which case, cause is set appropriately). + * + * \retval RIG_OK The query was successful. + * \retval RIG_EINVAL \a rot is NULL or inconsistent. + * \retval RIG_ENAVAIL rot_caps#get_level() capability is not available. * * \sa rot_has_get_level(), rot_set_level() */ @@ -135,18 +149,24 @@ int HAMLIB_API rot_get_level(ROT *rot, setting_t level, value_t *val) /** - * \brief set a rotator parameter - * \param rig The rotator handle - * \param parm The parameter - * \param val The value to set the parameter + * \brief Set a rotator parameter to a given value. + * + * \param rot The #ROT handle. + * \param parm The parameter to set. + * \param val The value of the parameter. * - * Sets a parameter. - * The parameter value \a val can be a float or an integer. See #value_t - * for more information. + * Sets \a parm to \a val. * - * \return RIG_OK if the operation has been successful, otherwise - * a negative value if an error occurred (in which case, cause is - * set appropriately). + * \note \a val can be any type defined by #value_t. + * \note As this function calls rot_has_set_parm(), this may be considered a + * higher level API. + * + * \return RIG_OK if the operation has been successful, otherwise a **negative + * value** if an error occurred (in which case, cause is set appropriately). + * + * \retval RIG_OK The parameter was set successfully. + * \retval RIG_EINVAL \a rot is NULL or inconsistent. + * \retval RIG_ENAVAIL rot_caps#set_parm() capability is not available. * * \sa rot_has_set_parm(), rot_get_parm() */ @@ -169,18 +189,24 @@ int HAMLIB_API rot_set_parm(ROT *rot, setting_t parm, value_t val) /** - * \brief get the value of a parameter - * \param rig The rotator handle - * \param parm The parameter - * \param val The location where to store the value of \a parm + * \brief Query the value of a requested rotator parameter. + * + * \param rot The #ROT handle. + * \param parm The requested parameter. + * \param val The variable to store the \a parm value. + * + * Query the \a val corresponding to the \a parm. * - * Retrieves the value of a \a parm. - * The parameter value \a val can be a float or an integer. See #value_t - * for more information. + * \note \a val can be any type defined by #value_t. + * \note As this function calls rot_has_get_parm(), this may be considered a + * higher level API. * - * \return RIG_OK if the operation has been successful, otherwise - * a negative value if an error occurred (in which case, cause is - * set appropriately). + * \return RIG_OK if the operation has been successful, otherwise a **negative + * value** if an error occurred (in which case, cause is set appropriately). + * + * \retval RIG_OK The parameter was queried successfully. + * \retval RIG_EINVAL \a rot is NULL or inconsistent. + * \retval RIG_ENAVAIL rot_caps#get_parm() capability is not available. * * \sa rot_has_get_parm(), rot_set_parm() */ @@ -203,20 +229,28 @@ int HAMLIB_API rot_get_parm(ROT *rot, setting_t parm, value_t *val) /** - * \brief check retrieval ability of level settings - * \param rig The rotator handle - * \param level The level settings + * \brief Check which rotator level settings can be queried. * - * Checks if a rotator is capable of *getting* a level setting. - * Since the \a level is an OR'ed bitwise argument, more than - * one level can be checked at the same time. + * \param rot The #ROT handle. + * \param level The level settings bitmap. * - * EXAMPLE: if (rot_has_get_level(my_rig, RIG_LEVEL_SPEED)) + * Checks if a rotator is capable of *getting* a level setting. Since + * \a level is an OR'ed bitwise argument, more than one level can be checked + * at the same time. * - * \return a bit map of supported level settings that can be retrieved, - * otherwise 0 if none supported. + * EXAMPLE: + * \code + * if (rot_has_get_level(my_rot, ROT_LEVEL_SPEED)) + * my_get_speed(&my_speed); + * \endcode * - * \sa rot_has_set_level(), rot_get_level() + * \note As this function is called by rot_get_level(), this may be considered + * a lower level API. + * + * \return A bit map of supported level settings that can be retrieved, + * otherwise 0 if none supported or \a rot is NULL or inconsistent. + * + * \sa rot_get_level(), rot_has_set_level() */ setting_t HAMLIB_API rot_has_get_level(ROT *rot, setting_t level) { @@ -234,20 +268,27 @@ setting_t HAMLIB_API rot_has_get_level(ROT *rot, setting_t level) /** - * \brief check settable ability of level settings - * \param rig The rotator handle - * \param level The level settings + * \brief Query the rotator levels that may be set. * - * Checks if a rotator can *set* a level setting. - * Since the \a level is an OR'ed bitwise argument, more than - * one level can be check at the same time. + * \param rot The #ROT handle. + * \param level The level settings bitmap. * - * EXAMPLE: if (rot_has_set_level(my_rig, ROT_LEVEL_SPEED)) + * Checks if a rotator can *set* a level setting. Since \a level is an OR'ed + * bitwise argument, more than one level can be checked at the same time. * - * \return a bit map of supported level settings that can be set, - * otherwise 0 if none supported. + * EXAMPLE: + * \code + * if (rot_has_set_level(my_rot, ROT_LEVEL_SPEED)) + * my_set_speed(MEDIUM); + * \endcode * - * \sa rot_has_get_level(), rot_set_level() + * \note As this function is called by rot_set_level(), this may be considered + * a lower level API. + * + * \return A bit map of supported level settings that can be set, otherwise 0 + * if none supported or \a rot is NULL or inconsistent. + * + * \sa rot_set_level(), rot_has_get_level() */ setting_t HAMLIB_API rot_has_set_level(ROT *rot, setting_t level) { @@ -264,20 +305,28 @@ setting_t HAMLIB_API rot_has_set_level(ROT *rot, setting_t level) /** - * \brief check retrieval ability of parameter settings - * \param rig The rotator handle - * \param parm The parameter settings + * \brief Check which rotator parameter settings can be queried. * - * Checks if a rotator is capable of *getting* a parm setting. - * Since the \a parm is an OR'ed bitwise argument, more than - * one parameter can be checked at the same time. + * \param rot The #ROT handle. + * \param parm The parameter settings bitmap. * - * EXAMPLE: if (rot_has_get_parm(my_rig, ROT_PARM_NONE)) + * Checks if a rotator is capable of *getting* a parameter setting. Since + * \a parm is an OR'ed bitwise argument, more than one parameter can be + * checked at the same time. * - * \return a bit map of supported parameter settings that can be retrieved, - * otherwise 0 if none supported. + * EXAMPLE: + * \code + * if (rot_has_get_parm(my_rot, ROT_PARM_NONE)) + * my_get_parms(&parms); + * \endcode * - * \sa rot_has_set_parm(), rot_get_parm() + * \note As this function is called by rot_get_parm(), this may be considered + * a lower level API. + * + * \return A bit map of supported parameter settings that can be retrieved, + * otherwise 0 if none supported or \a rot is NULL or inconsistent. + * + * \sa rot_get_parm(), rot_has_set_parm() */ setting_t HAMLIB_API rot_has_get_parm(ROT *rot, setting_t parm) { @@ -293,20 +342,28 @@ setting_t HAMLIB_API rot_has_get_parm(ROT *rot, setting_t parm) /** - * \brief check settable ability of parameter settings - * \param rig The rotator handle - * \param parm The parameter settings + * \brief Query the rotator parameters that may be set. * - * Checks if a rotator can *set* a parameter setting. - * Since the \a parm is an OR'ed bitwise argument, more than - * one parameter can be check at the same time. + * \param rot The #ROT handle. + * \param parm The parameter settings bitmap. * - * EXAMPLE: if (rot_has_set_parm(my_rig, RIG_PARM_NONE)) + * Checks if a rotator can *set* a parameter setting. Since \a parm is an + * OR'ed bitwise argument, more than one parameter can be checked at the same + * time. * - * \return a bit map of supported parameter settings that can be set, - * otherwise 0 if none supported. + * EXAMPLE: + * \code + * if (rot_has_set_parm(my_rig, ROT_PARM_NONE)) + * my_set_parm(parameter); + * \endcode * - * \sa rot_has_get_parm(), rot_set_parm() + * \note As this function is called by rot_set_parm(), this may be considered + * a lower level API. + * + * \return A bit map of supported parameter settings that can be set, + * otherwise 0 if none supported or \a rot is NULL or inconsistent. + * + * \sa rot_set_parm(), rot_has_get_parm() */ setting_t HAMLIB_API rot_has_set_parm(ROT *rot, setting_t parm) { @@ -322,20 +379,27 @@ setting_t HAMLIB_API rot_has_set_parm(ROT *rot, setting_t parm) /** - * \brief check ability of rotator functions - * \param rig The rotator handle - * \param func The functions + * \brief Check which rotator functions can be queried. + * + * \param rot The #ROT handle. + * \param func The functions bitmap. + * + * Checks if a rotator supports a set of functions. Since \a func is an OR'ed + * bitwise argument, more than one function can be checked at the same time. * - * Checks if a rotator supports a set of functions. - * Since the \a func is an OR'ed bitwise argument, more than - * one function can be checked at the same time. + * EXAMPLE: + * \code + * if (rot_has_get_func(my_rig, RIG_FUNC_NONE)) + * do_something(); + * \endcode * - * EXAMPLE: if (rot_has_get_func(my_rig, RIG_FUNC_NONE)) + * \note As this function is called by rot_get_func(), this may be considered + * a lower level API. * - * \return a bit map of supported functions, - * otherwise 0 if none supported. + * \return A bit map of supported functions that can be retrieved, otherwise 0 + * if none supported or \a rot is NULL or inconsistent. * - * \sa rot_has_set_func(), rot_get_func() + * \sa rot_get_func(), rot_has_set_func() */ setting_t HAMLIB_API rot_has_get_func(ROT *rot, setting_t func) { @@ -352,18 +416,25 @@ setting_t HAMLIB_API rot_has_get_func(ROT *rot, setting_t func) /** - * \brief check ability of rotator functions - * \param rig The rotator handle - * \param func The functions + * \brief Query support of rotator functions. * - * Checks if a rotator supports a set of functions. - * Since the \a func is an OR'ed bitwise argument, more than - * one function can be checked at the same time. + * \param rot The #ROT handle. + * \param func The functions bitmap. * - * EXAMPLE: if (rot_has_set_func(my_rig, RIG_FUNC_NONE)) + * Checks if a rotator supports a set of functions. Since \a func is an OR'ed + * bitwise argument, more than one function can be checked at the same time. * - * \return a bit map of supported functions, - * otherwise 0 if none supported. + * EXAMPLE: + * \code + * if (rot_has_set_func(my_rig, RIG_FUNC_NONE)) + * do_this_func(my_func); + * \endcode + * + * \note As this function is called by rot_set_func(), this may be considered + * a lower level API. + * + * \return A bit map of supported functions that can be set, otherwise 0 if + * none supported or \a rot is NULL or inconsistent. * * \sa rot_set_func(), rot_has_get_func() */ @@ -381,19 +452,25 @@ setting_t HAMLIB_API rot_has_set_func(ROT *rot, setting_t func) /** - * \brief activate/de-activate functions of rotator - * \param rig The rotator handle - * \param func The function to activate - * \param status The status (on or off) to set to + * \brief Activate or deactivate functions of a rotator. + * + * \param rot The #ROT handle. + * \param func The function to activate or deactivate. + * \param status The status (On or Off) to set. + * + * Activate or deactivate a function of the rotator. * - * Activate/de-activate a function of the radio. + * The \a status argument is a value that is not NULL for "activate", + * "deactivate" otherwise, much as TRUE or FALSE boolean definitions in the C + * language. * - * The \a status argument is a non null value for "activate", - * "de-activate" otherwise, much as TRUE/FALSE definitions in C language. + * \return RIG_OK if the operation has been successful, otherwise a **negative + * value** if an error occurred (in which case, cause is set appropriately). * - * \return RIG_OK if the operation has been successful, otherwise - * a negative value if an error occurred (in which case, cause is - * set appropriately). + * \retval RIG_OK The function was activated or deactivated successfully. + * \retval RIG_EINVAL \a rot is NULL or inconsistent. + * \retval RIG_ENAVAIL rot_caps#set_func() capability is not available or + * \a func is not supported. * * \sa rot_get_func() */ @@ -420,20 +497,24 @@ int HAMLIB_API rot_set_func(ROT *rot, setting_t func, int status) /** - * \brief get the status of functions of the rotator - * \param rig The rotator handle - * \param func The function to get the status - * \param status The location where to store the function status + * \brief Query the status of functions of the rotator. * - * Retrieves the status (on/off) of a function of the rotator. - * Upon return, \a status will hold the status of the function, - * The value pointer to by the \a status argument is a non null - * value for "on", "off" otherwise, much as TRUE/FALSE - * definitions in C language. + * \param rot The #ROT handle. + * \param func The function to query the status. + * \param status The variable to store the function status. * - * \return RIG_OK if the operation has been successful, otherwise - * a negative value if an error occurred (in which case, cause is - * set appropriately). + * Retrieves the status (On or Off) of a function of the rotator. Upon + * return, \a status will hold the status of the function. The value pointed + * to by the \a status argument is not NULL for "On", or "Off" otherwise, much + * as TRUE or FALSE boolean definitions in the C language. + * + * \return RIG_OK if the operation has been successful, otherwise a **negative + * value** if an error occurred (in which case, cause is set appropriately). + * + * \retval RIG_OK The function status was queried successfully. + * \retval RIG_EINVAL \a rot is NULL or inconsistent. + * \retval RIG_ENAVAIL rot_caps#get_func() capability is not available or + * \a func is not supported. * * \sa rot_set_func() */ @@ -461,16 +542,22 @@ int HAMLIB_API rot_get_func(ROT *rot, setting_t func, int *status) /** - * \brief set a rotator level extra parameter - * \param rig The rotator handle - * \param token The parameter - * \param val The value to set the parameter to + * \brief Set a rotator extension level to a given value. + * + * \param rot The #ROT handle. + * \param token The extension level token. + * \param val The value of the extension level. + * + * Set extension level \a token to \a val. + * + * \note \a val can be any type defined by #value_t. * - * Sets an level extra parameter. + * \return RIG_OK if the operation has been successful, otherwise a **negative + * value** if an error occurred (in which case, cause is set appropriately). * - * \return RIG_OK if the operation has been successful, otherwise - * a negative value if an error occurred (in which case, cause is - * set appropriately). + * \retval RIG_OK The extension level was set successfully. + * \retval RIG_EINVAL \a rot is NULL or inconsistent. + * \retval RIG_ENAVAIL rot_caps#set_ext_level() capability is not available. * * \sa rot_get_ext_level() */ @@ -497,16 +584,20 @@ int HAMLIB_API rot_set_ext_level(ROT *rot, token_t token, value_t val) /** - * \brief get the value of a level extra parameter - * \param rig The rotator handle - * \param token The parameter - * \param val The location where to store the value of \a token + * \brief Query the value of a requested rotator extension level. * - * Retrieves the value of a level extra parameter associated with \a token. + * \param rot The #ROT handle. + * \param token The extension level token. + * \param val The location where to store the value of \a token. * - * \return RIG_OK if the operation has been successful, otherwise - * a negative value if an error occurred (in which case, cause is - * set appropriately). + * Query the \a val corresponding to the extension level \a token. + * + * \return RIG_OK if the operation has been successful, otherwise a **negative + * value** if an error occurred (in which case, cause is set appropriately). + * + * \retval RIG_OK The extension level was queried successfully. + * \retval RIG_EINVAL \a rot is NULL or inconsistent. + * \retval RIG_ENAVAIL rot_caps#get_ext_level() capability is not available. * * \sa rot_set_ext_level() */ @@ -533,16 +624,24 @@ int HAMLIB_API rot_get_ext_level(ROT *rot, token_t token, value_t *val) /** - * \brief set a rotator function extra parameter - * \param rig The rotator handle - * \param token The parameter - * \param status The value to set the parameter to + * \brief Activate or deactivate extension functions of a rotator. + * + * \param rot The #ROT handle. + * \param token The extension function to activate or deactivate. + * \param status The status (On or Off) to set. + * + * Activate or deactivate an extension function of the rotator. * - * Sets a function extra parameter. + * The \a status argument is a value that is not NULL for "activate", + * "deactivate" otherwise, much as TRUE or FALSE boolean definitions in the C + * language. * - * \return RIG_OK if the operation has been successful, otherwise - * a negative value if an error occurred (in which case, cause is - * set appropriately). + * \return RIG_OK if the operation has been successful, otherwise a **negative + * value** if an error occurred (in which case, cause is set appropriately). + * + * \retval RIG_OK The extension function status was set successfully. + * \retval RIG_EINVAL \a rot is NULL or inconsistent. + * \retval RIG_ENAVAIL rot_caps#get_ext_func() capability is not available. * * \sa rot_get_ext_func() */ @@ -569,16 +668,24 @@ int HAMLIB_API rot_set_ext_func(ROT *rot, token_t token, int status) /** - * \brief get the value of a function extra parameter - * \param rig The rotator handle - * \param token The parameter - * \param status The location where to store the value of \a token + * \brief Query the status of extension functions of a rotator. + * + * \param rot The #ROT handle. + * \param token The extension function to query the status. + * \param status The variable to store the extension function status. + * + * Retrieves the status (On or Off) of an extension function of the rotator. + * Upon return, \a status will hold the status of the extension function. The + * value pointed to by the \a status argument is not NULL for "On", or "Off" + * otherwise, much as TRUE or FALSE boolean definitions in the C language. * - * Retrieves the value of a function extra parameter associated with \a token. + * \return RIG_OK if the operation has been successful, otherwise a **negative + * value** if an error occurred (in which case, cause is set appropriately). * - * \return RIG_OK if the operation has been successful, otherwise - * a negative value if an error occurred (in which case, cause is - * set appropriately). + * \retval RIG_OK The extension function status was queried successfully. + * \retval RIG_EINVAL \a rot is NULL or inconsistent. + * \retval RIG_ENAVAIL rot_caps#get_ext_func() capability is not available or + * \a token is not supported. * * \sa rot_set_ext_func() */ @@ -605,16 +712,22 @@ int HAMLIB_API rot_get_ext_func(ROT *rot, token_t token, int *status) /** - * \brief set a rotator parm extra parameter - * \param rig The rotator handle - * \param token The parameter - * \param val The value to set the parameter to + * \brief Set a rotator extension parameter to a given value. + * + * \param rot The #ROT handle. + * \param token The extension parameter token. + * \param val The value of the extension parameter. + * + * Set an extension parameter \a token to \a val. * - * Sets an parm extra parameter. + * \note \a val can be any type defined by #value_t. * - * \return RIG_OK if the operation has been successful, otherwise - * a negative value if an error occurred (in which case, cause is - * set appropriately). + * \return RIG_OK if the operation has been successful, otherwise a **negative + * value** if an error occurred (in which case, cause is set appropriately). + * + * \retval RIG_OK The extension parameter was set successfully. + * \retval RIG_EINVAL \a rot is NULL or inconsistent. + * \retval RIG_ENAVAIL rot_caps#set_ext_parm() capability is not available. * * \sa rot_get_ext_parm() */ @@ -637,16 +750,22 @@ int HAMLIB_API rot_set_ext_parm(ROT *rot, token_t token, value_t val) /** - * \brief get the value of a parm extra parameter - * \param rig The rotator handle - * \param token The parameter - * \param val The location where to store the value of \a token + * \brief Query the value of a requested rotator extension parameter. + * + * \param rot The #ROT handle. + * \param token The extension parameter to query the status. + * \param val The variable to store the extension parameter status. + * + * Query the \a val corresponding to the extension parameter \a token. + * + * \note \a val can be any type defined by #value_t. * - * Retrieves the value of a parm extra parameter associated with \a token. + * \return RIG_OK if the operation has been successful, otherwise a **negative + * value** if an error occurred (in which case, cause is set appropriately). * - * \return RIG_OK if the operation has been successful, otherwise - * a negative value if an error occurred (in which case, cause is - * set appropriately). + * \retval RIG_OK The extension parameter was queried successfully. + * \retval RIG_EINVAL \a rot is NULL or inconsistent. + * \retval RIG_ENAVAIL rot_caps#get_ext_parm() capability is not available. * * \sa rot_set_ext_parm() */ commit 74654e18778e8441789b14b429b2b94798cb4ff5 Merge: 4c8dc6e2 313e46ac Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Apr 7 08:28:06 2021 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 4c8dc6e2451e9ef5d793c14294d73237ca136b73 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Apr 7 08:26:18 2021 -0500 Fix flrig vfo inaccessible in flrig_set_split_freq_mode https://github.com/Hamlib/Hamlib/issues/651 diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index a63c94c9..ed6ee2a0 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -145,7 +145,7 @@ const struct rig_caps flrig_caps = RIG_MODEL(RIG_MODEL_FLRIG), .model_name = "FLRig", .mfg_name = "FLRig", - .version = "20210403", + .version = "20210407", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1955,11 +1955,7 @@ static int flrig_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t freq, ENTERFUNC; - if (vfo != RIG_VFO_CURR && vfo != RIG_VFO_TX) - { - RETURNFUNC(-RIG_ENTARGET); - } - + // we alway do split on VFOB retval = flrig_set_freq(rig, RIG_VFO_B, freq); if (retval != RIG_OK) commit 313e46acf307396901899eb8d9ec450296851eb5 Merge: bddf8684 87ae220a Author: Michael Black <mdb...@ya...> Date: Wed Apr 7 07:37:04 2021 -0500 Merge pull request #649 from mdblack98/master Update build-w64-jtsdk.sh commit 87ae220a1a1ca10824c537fd43a0b5a992fc86e7 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Apr 7 00:02:54 2021 -0500 Update build-w64-jtsdk.sh diff --git a/scripts/build-w64-jtsdk.sh b/scripts/build-w64-jtsdk.sh index c57a1f74..ddef2ea5 100755 --- a/scripts/build-w64-jtsdk.sh +++ b/scripts/build-w64-jtsdk.sh @@ -14,7 +14,11 @@ export PATH=$PATH:$GCCD_F:. # Set this to a desired directory -BUILD_DIR=~/builds +if [[ -z "${BUILD_BASE_DIR}" ]]; then + BUILD_DIR=~/builds +else + BUILD_DIR=~/${BUILD_BASE_DIR} +fi # Set this to LibUSB archive extracted in $BUILD_DIR LIBUSB_VER=libusb-1.0.24 @@ -233,7 +237,7 @@ END_OF_README LDFLAGS="-L${libusb_dir_f}/MinGW64/dll" -make -j 4 install +make -j ${CPUS} install mkdir -p ${ZIP_DIR}/bin ${ZIP_DIR}/lib/msvc ${ZIP_DIR}/lib/gcc ${ZIP_DIR}/include ${ZIP_DIR}/doc cp -a src/libhamlib.def ${ZIP_DIR}/lib/msvc/libhamlib-4.def commit bddf8684143aeebc3bfcf7f4939e9ec64a6ee621 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Apr 6 17:38:59 2021 -0500 Make Malachite do 2-freq set all the time -- seems to work well https://github.com/Hamlib/Hamlib/issues/645 diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index 457233d7..893b2d8c 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -948,15 +948,13 @@ int malachite_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { int retval; - // Malachite has bug on VHF and up where it takes two freq set to make it work - if (freq > 100e6) - { - retval = kenwood_set_freq(rig, vfo, freq + 1); + // Malachite has a bug where it takes two freq set to make it work + // under some band changes -- so we just do this all the time + retval = kenwood_set_freq(rig, vfo, freq + 1); - if (retval != RIG_OK) { RETURNFUNC(retval); } + if (retval != RIG_OK) { RETURNFUNC(retval); } - retval = kenwood_set_freq(rig, vfo, freq); - } + retval = kenwood_set_freq(rig, vfo, freq); RETURNFUNC(retval); } commit 993a3162fd0f5f49f66af986202a4876388e2890 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Apr 6 17:13:14 2021 -0500 Fix FTDX101 and FT9000 RFPOWER_METER_WATTS https://github.com/Hamlib/Hamlib/issues/641 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 8c601c8a..8ed66d2d 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -4569,12 +4569,6 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RM08%c", cat_term); } - - if (is_ftdx101d || is_ftdx101mp) - { - // separate meters for Main and Sub - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RM0%c", cat_term); - } else { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RM5%c", cat_term); diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 3c7b5e38..e9598c3e 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20210330" +#define NEWCAT_VER "20210406" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 03b69afee667e9bfad14c93c3679c8ecc7ae4a25 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Apr 6 16:47:02 2021 -0500 Update NEWS for 4.2 release diff --git a/NEWS b/NEWS index ca7ea694..fede7ed1 100644 --- a/NEWS +++ b/NEWS @@ -7,10 +7,8 @@ Copyright (C) 2000-2021 Michael Black W9MDB, and others Please send Hamlib bug reports to ham...@li... Version 4.2 - * 2021-04-?? -- anticipated release date + * 2021-04-06 * Added Malachite SDR - * Frequency and PTT are now validated -- may solve some random problems - ** where freq and ptt get stuck or not changed * Major rework for PRM80 * Add twiddle_timeout and twiddle_rit --set-conf options rigctld --set-conf=twiddle_timeout=5,twiddle_rit=1 @@ -18,8 +16,6 @@ Version 4.2 For twiddle timeout VFOB will not be polled for 5 seconds after VFO twiddling is detected rigctld --twiddle is deprecated and will be removed in 5.0 along with get_twiddle and set_twiddle -Version 4.2 - Version 4.1 2021-01-31 * rigctld and rigs should be more robust for disconnect problems commit 72161dd316d99aa92aebb4139ebc6935386b963c Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Apr 6 16:14:36 2021 -0500 https://github.com/Hamlib/Hamlib/issues/645 diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index 136cce32..457233d7 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -944,6 +944,23 @@ int malachite_init(RIG *rig) RETURNFUNC(RIG_OK); } +int malachite_set_freq(RIG *rig, vfo_t vfo, freq_t freq) +{ + int retval; + + // Malachite has bug on VHF and up where it takes two freq set to make it work + if (freq > 100e6) + { + retval = kenwood_set_freq(rig, vfo, freq + 1); + + if (retval != RIG_OK) { RETURNFUNC(retval); } + + retval = kenwood_set_freq(rig, vfo, freq); + } + + RETURNFUNC(retval); +} + /* * Malachite SDR rig capabilities. * Notice that some rigs share the same functions. @@ -986,12 +1003,12 @@ const struct rig_caps malachite_caps = .rig_init = malachite_init, .rig_open = kenwood_open, .rig_cleanup = kenwood_cleanup, - .set_freq = kenwood_set_freq, + .set_freq = malachite_set_freq, .get_freq = kenwood_get_freq, .set_mode = kenwood_set_mode, .get_mode = kenwood_get_mode, .set_vfo = kenwood_set_vfo, // Malachite only supports VFOA - .get_vfo = kenwood_get_vfo_if, + .get_vfo = kenwood_get_vfo_if, .set_powerstat = kenwood_set_powerstat, .get_powerstat = kenwood_get_powerstat, }; commit 0981fa630d3dac9854f35e5256ce835f284bdb08 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Apr 6 11:40:02 2021 -0500 astyle files diff --git a/src/rig.c b/src/rig.c index 872760bd..95c6688c 100644 --- a/src/rig.c +++ b/src/rig.c @@ -6003,9 +6003,13 @@ int HAMLIB_API rig_get_vfo_info(RIG *rig, vfo_t vfo, freq_t *freq, if (retval != RIG_OK) { RETURNFUNC(retval); } // we will ask for other vfo mode just once if not targetable - int allTheTimeA = vfo & (RIG_VFO_A | RIG_VFO_CURR | RIG_VFO_MAIN_A | RIG_VFO_SUB_A); - int allTheTimeB = (vfo &(RIG_VFO_B | RIG_VFO_SUB)) && (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE); - int justOnceB = (vfo &(RIG_VFO_B | RIG_VFO_SUB)) && (rig->state.cache.modeMainB == RIG_MODE_NONE); + int allTheTimeA = vfo & (RIG_VFO_A | RIG_VFO_CURR | RIG_VFO_MAIN_A | + RIG_VFO_SUB_A); + int allTheTimeB = (vfo & (RIG_VFO_B | RIG_VFO_SUB)) + && (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE); + int justOnceB = (vfo & (RIG_VFO_B | RIG_VFO_SUB)) + && (rig->state.cache.modeMainB == RIG_MODE_NONE); + if (allTheTimeA || allTheTimeB || justOnceB) { retval = rig_get_mode(rig, vfo, mode, width); commit c02b079fb3de17e766399cfc82daae096f646751 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Apr 6 10:45:18 2021 -0500 Update timeout values based on testing with Malchite SDR https://github.com/Hamlib/Hamlib/issues/645 diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 08758db6..5d37ed83 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -2296,7 +2296,7 @@ struct rig_caps netrigctl_caps = .ptt_type = RIG_PTT_RIG_MICDATA, .dcd_type = RIG_DCD_RIG, .port_type = RIG_PORT_NETWORK, - .timeout = 1000, /* enough for the worst rig we have */ + .timeout = 3000, /* enough for the worst rig we have */ .retry = 5, /* 5 seconds total */ /* following fields updated in rig_state at opening time */ diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index 5f251858..136cce32 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -961,14 +961,14 @@ const struct rig_caps malachite_caps = .ptt_type = RIG_PTT_NONE, .port_type = RIG_PORT_SERIAL, .serial_rate_min = 4800, - .serial_rate_max = 115200, + .serial_rate_max = 38400, .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 = 200, + .post_write_delay = 400, + .timeout = 3000, .retry = 3, .preamp = {0, RIG_DBLST_END,}, .attenuator = {0, RIG_DBLST_END,}, @@ -978,7 +978,8 @@ const struct rig_caps malachite_caps = .rx_range_list1 = { - {kHz(100), GHz(1), TS480_ALL_MODES, -1, -1, RIG_VFO_A, RIG_ANT_CURR, "Generic" }, + {kHz(50), MHz(250), TS480_ALL_MODES, -1, -1, RIG_VFO_A, RIG_ANT_CURR, "Generic" }, + {MHz(400), GHz(2), TS480_ALL_MODES, -1, -1, RIG_VFO_A, RIG_ANT_CURR, "Generic" }, RIG_FRNG_END, }, .priv = (void *)& ts480_priv_caps, commit aa1972fb5d794184bf852b2cbf6ac5da73fc2a88 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Apr 6 09:47:31 2021 -0500 Show match when rig model is recognized in kenwood.c diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 9eedbfd8..8e3d674f 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -911,6 +911,7 @@ int kenwood_open(RIG *rig) int retval; split_t split; vfo_t tx_vfo; + rig_debug(RIG_DEBUG_VERBOSE, "%s: found the right driver for %s(%d)\n", __func__, rig->caps->model_name, rig->caps->rig_model); /* get current AI state so it can be restored */ kenwood_get_trn(rig, &priv->trn_state); /* ignore errors */ commit 124a6faafd0c545fd7ec9a20bf6a582968d4c769 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Apr 6 09:38:36 2021 -0500 More Malachite updates https://github.com/Hamlib/Hamlib/issues/645 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 704d3a9a..9eedbfd8 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -131,6 +131,7 @@ static const struct kenwood_id_string kenwood_id_string_list[] = { RIG_MODEL_THF6A, "TH-F6" }, { RIG_MODEL_THF7E, "TH-F7" }, { RIG_MODEL_THG71, "TH-G71" }, + { RIG_MODEL_MALACHITE, "020" }, { RIG_MODEL_NONE, NULL }, /* end marker */ }; @@ -867,7 +868,7 @@ int kenwood_open(RIG *rig) id); // Malachite SDR gives no reponse to ID and is supposed to be TS480 compatible - if (RIG_IS_TS480) { strcpy(id, "ID020"); } + if (RIG_IS_MALACHITE) { strcpy(id, "ID020"); } } diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index fda7d0d4..fc2e7654 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -104,6 +104,7 @@ extern const struct confparams kenwood_cfg_params[]; #define RIG_IS_XG3 (rig->caps->rig_model == RIG_MODEL_XG3) #define RIG_IS_PT8000A (rig->caps->rig_model == RIG_MODEL_PT8000A) #define RIG_IS_POWERSDR (rig->caps->rig_model == RIG_MODEL_POWERSDR) +#define RIG_IS_MALACHITE (rig->caps->rig_model == RIG_MODEL_MALACHITE) struct kenwood_priv_caps { commit 8d95db88d41bd5daa4c7b1174b5780b77a4408cb Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Apr 6 09:12:20 2021 -0500 More Malachite updates https://github.com/Hamlib/Hamlib/issues/645 diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index 97bd2ebc..5f251858 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -978,7 +978,7 @@ const struct rig_caps malachite_caps = .rx_range_list1 = { - {kHz(100), GHz(1), TS480_ALL_MODES, -1, -1, RIG_VFO_A}, + {kHz(100), GHz(1), TS480_ALL_MODES, -1, -1, RIG_VFO_A, RIG_ANT_CURR, "Generic" }, RIG_FRNG_END, }, .priv = (void *)& ts480_priv_caps, commit eb0f5961042606ed143f219ff9e3d5cfc90d0c5f Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Apr 6 09:07:42 2021 -0500 More Malachite updates https://github.com/Hamlib/Hamlib/issues/645 diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index 4d6a9759..97bd2ebc 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -969,9 +969,9 @@ const struct rig_caps malachite_caps = .write_delay = 0, .post_write_delay = 0, .timeout = 200, - .retry = 10, - .preamp = {12, RIG_DBLST_END,}, - .attenuator = {12, RIG_DBLST_END,}, + .retry = 3, + .preamp = {0, RIG_DBLST_END,}, + .attenuator = {0, RIG_DBLST_END,}, .max_ifshift = Hz(0), .targetable_vfo = RIG_TARGETABLE_FREQ, .transceive = RIG_TRN_POLL, @@ -987,33 +987,11 @@ const struct rig_caps malachite_caps = .rig_cleanup = kenwood_cleanup, .set_freq = kenwood_set_freq, .get_freq = kenwood_get_freq, - .set_rit = kenwood_set_rit, /* FIXME should this switch to rit mode or just set the frequency? */ - .get_rit = kenwood_get_rit, - .set_xit = kenwood_set_xit, /* FIXME should this switch to xit mode or just set the frequency? */ - .get_xit = kenwood_get_xit, .set_mode = kenwood_set_mode, .get_mode = kenwood_get_mode, - .set_vfo = kenwood_set_vfo, // Malachite does not support any VFOS - .get_vfo = kenwood_get_vfo_if, // Malachite does not support ant VFOS -// .set_split_vfo = kenwood_set_split_vfo, -// .get_split_vfo = kenwood_get_split_vfo_if, -// .get_ptt = kenwood_get_ptt, -// .set_ptt = kenwood_set_ptt, - .get_dcd = kenwood_get_dcd, + .set_vfo = kenwood_set_vfo, // Malachite only supports VFOA + .get_vfo = kenwood_get_vfo_if, .set_powerstat = kenwood_set_powerstat, .get_powerstat = kenwood_get_powerstat, - .get_info = kenwood_ts480_get_info, -// .reset = kenwood_reset, -// .set_ant = kenwood_set_ant, -// .get_ant = kenwood_get_ant, -// .scan = kenwood_scan, /* not working, invalid arguments using rigctl; kenwood_scan does only support on/off and not tone and CTCSS scan */ -// .has_set_level = TS480_LEVEL_ALL, -// .has_get_level = TS480_LEVEL_ALL, -// .set_level = kenwood_ts480_set_level, -// .get_level = kenwood_ts480_get_level, -// .has_get_func = TS480_FUNC_ALL, -// .has_set_func = TS480_FUNC_ALL, -// .set_func = kenwood_set_func, -// .get_func = kenwood_get_func, }; commit 623287aa02823bf900b9ac7b7d94c6f84529d0a8 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Apr 6 08:54:53 2021 -0500 Updates for Malchite SDR https://github.com/Hamlib/Hamlib/issues/645 diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index 8d8a4342..4d6a9759 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -995,25 +995,25 @@ const struct rig_caps malachite_caps = .get_mode = kenwood_get_mode, .set_vfo = kenwood_set_vfo, // Malachite does not support any VFOS .get_vfo = kenwood_get_vfo_if, // Malachite does not support ant VFOS - .set_split_vfo = kenwood_set_split_vfo, - .get_split_vfo = kenwood_get_split_vfo_if, - .get_ptt = kenwood_get_ptt, - .set_ptt = kenwood_set_ptt, +// .set_split_vfo = kenwood_set_split_vfo, +// .get_split_vfo = kenwood_get_split_vfo_if, +// .get_ptt = kenwood_get_ptt, +// .set_ptt = kenwood_set_ptt, .get_dcd = kenwood_get_dcd, .set_powerstat = kenwood_set_powerstat, .get_powerstat = kenwood_get_powerstat, .get_info = kenwood_ts480_get_info, - .reset = kenwood_reset, - .set_ant = kenwood_set_ant, - .get_ant = kenwood_get_ant, - .scan = kenwood_scan, /* not working, invalid arguments using rigctl; kenwood_scan does only support on/off and not tone and CTCSS scan */ - .has_set_level = TS480_LEVEL_ALL, - .has_get_level = TS480_LEVEL_ALL, - .set_level = kenwood_ts480_set_level, - .get_level = kenwood_ts480_get_level, - .has_get_func = TS480_FUNC_ALL, - .has_set_func = TS480_FUNC_ALL, - .set_func = kenwood_set_func, - .get_func = kenwood_get_func, +// .reset = kenwood_reset, +// .set_ant = kenwood_set_ant, +// .get_ant = kenwood_get_ant, +// .scan = kenwood_scan, /* not working, invalid arguments using rigctl; kenwood_scan does only support on/off and not tone and CTCSS scan */ +// .has_set_level = TS480_LEVEL_ALL, +// .has_get_level = TS480_LEVEL_ALL, +// .set_level = kenwood_ts480_set_level, +// .get_level = kenwood_ts480_get_level, +// .has_get_func = TS480_FUNC_ALL, +// .has_set_func = TS480_FUNC_ALL, +// .set_func = kenwood_set_func, +// .get_func = kenwood_get_func, }; commit 4c2f60b9b0e03bb83e36b4e4a8f2dc0e1b580e95 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Apr 6 08:46:49 2021 -0500 Fix no_id check in kenwood.c for Malchite SDR https://github.com/Hamlib/Hamlib/issues/645 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index a925becf..704d3a9a 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -334,7 +334,7 @@ transaction_write: if (retval == RIG_OK && strncmp(cmdstr, "RX", 2) == 0) { goto transaction_quit; } // Malachite SDR cannot send ID after FA - if (priv->no_id) { RETURNFUNC(RIG_OK); } + if (!datasize && priv->no_id) { RETURNFUNC(RIG_OK); } if (!datasize) { diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 1aa8f855..fda7d0d4 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "misc.h" -#define BACKEND_VER "20210404" +#define BACKEND_VER "20210406" #define EOM_KEN ';' #define EOM_TH '\r' diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index 8597d99f..8d8a4342 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -955,13 +955,10 @@ const struct rig_caps malachite_caps = .model_name = "DSP", .mfg_name = "Malachite", .version = BACKEND_VER ".0", - .mfg_name = "Malachite", - .version = BACKEND_VER ".0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, - .rig_type = RIG_TYPE_TRANSCEIVER, - .ptt_type = RIG_PTT_RIG_MICDATA, - .dcd_type = RIG_DCD_RIG, + .rig_type = RIG_TYPE_RECEIVER, + .ptt_type = RIG_PTT_NONE, .port_type = RIG_PORT_SERIAL, .serial_rate_min = 4800, .serial_rate_max = 115200, @@ -975,92 +972,14 @@ const struct rig_caps malachite_caps = .retry = 10, .preamp = {12, RIG_DBLST_END,}, .attenuator = {12, RIG_DBLST_END,}, - .max_rit = kHz(9.99), - .max_xit = kHz(9.99), .max_ifshift = Hz(0), .targetable_vfo = RIG_TARGETABLE_FREQ, - .transceive = RIG_TRN_RIG, + .transceive = RIG_TRN_POLL, .rx_range_list1 = { - {kHz(100), Hz(59999999), TS480_ALL_MODES, -1, -1, TS480_VFO}, + {kHz(100), GHz(1), TS480_ALL_MODES, -1, -1, RIG_VFO_A}, RIG_FRNG_END, - }, /*!< Receive frequency range list for ITU region 1 */ - .tx_range_list1 = { - {kHz(1810), kHz(1850), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, /* 100W class */ - {kHz(1810), kHz(1850), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, /* 25W class */ - {kHz(3500), kHz(3800), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, - {kHz(3500), kHz(3800), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, - {MHz(7), kHz(7200), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, - {MHz(7), kHz(7200), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, - {kHz(10100), kHz(10150), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, - {kHz(10100), kHz(10150), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, - {MHz(14), kHz(14350), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, - {MHz(14), kHz(14350), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, - {kHz(18068), kHz(18168), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, - {kHz(18068), kHz(18168), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, - {MHz(21), kHz(21450), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, - {MHz(21), kHz(21450), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, - {kHz(24890), kHz(24990), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, - {kHz(24890), kHz(24990), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, - {MHz(28), kHz(29700), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, - {MHz(28), kHz(29700), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, - {MHz(50), kHz(52000), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, - {MHz(50), kHz(52000), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, - RIG_FRNG_END, - }, /*!< Transmit frequency range list for ITU region 1 */ - .rx_range_list2 = { - {kHz(100), Hz(59999999), TS480_ALL_MODES, -1, -1, TS480_VFO}, - RIG_FRNG_END, - }, /*!< Receive frequency range list for ITU region 2 */ - .tx_range_list2 = { - {kHz(1800), MHz(2) - 1, TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, /* 100W class */ - {kHz(1800), MHz(2) - 1, TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, /* 25W class */ - {kHz(3500), MHz(4) - 1, TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, - {kHz(3500), MHz(4) - 1, TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, - {kHz(5250), kHz(5450), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, - {kHz(5250), kHz(5450), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, - {MHz(7), kHz(7300), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, - {MHz(7), kHz(7300), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, - {kHz(10100), kHz(10150), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, - {MHz(14), kHz(14350), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, - {kHz(18068), kHz(18168), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, - {kHz(18068), kHz(18168), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, - {MHz(21), kHz(21450), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, - {MHz(21), kHz(21450), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, - {kHz(24890), kHz(24990), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, - {kHz(24890), kHz(24990), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, - {MHz(28), kHz(29700), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, - {MHz(28), kHz(29700), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, - {MHz(50), kHz(52000), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, - {MHz(50), kHz(52000), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, - RIG_FRNG_END, - }, /*!< Transmit frequency range list for ITU region 2 */ - .tuning_steps = { - {TS480_ALL_MODES, kHz(1)}, - {TS480_ALL_MODES, Hz(2500)}, - {TS480_ALL_MODES, kHz(5)}, - {TS480_ALL_MODES, Hz(6250)}, - {TS480_ALL_MODES, kHz(10)}, - {TS480_ALL_MODES, Hz(12500)}, - {TS480_ALL_MODES, kHz(15)}, - {TS480_ALL_MODES, kHz(20)}, - {TS480_ALL_MODES, kHz(25)}, - {TS480_ALL_MODES, kHz(30)}, - {TS480_ALL_MODES, kHz(100)}, - {TS480_ALL_MODES, kHz(500)}, - {TS480_ALL_MODES, MHz(1)}, - {TS480_ALL_MODES, 0}, /* any tuning step */ - RIG_TS_END, - }, - /* mode/filter list, remember: order matters! */ - .filters = { - {RIG_MODE_SSB, kHz(2.4)}, - {RIG_MODE_CW, Hz(200)}, - {RIG_MODE_RTTY, Hz(500)}, - {RIG_MODE_AM, kHz(9)}, - {RIG_MODE_FM, kHz(14)}, - RIG_FLT_END, }, .priv = (void *)& ts480_priv_caps, .rig_init = malachite_init, @@ -1074,8 +993,8 @@ const struct rig_caps malachite_caps = .get_xit = kenwood_get_xit, .set_mode = kenwood_set_mode, .get_mode = kenwood_get_mode, -// .set_vfo = kenwood_set_vfo, // Malachite does not support any VFOS -// .get_vfo = kenwood_get_vfo_if, // Malachite does not support ant VFOS + .set_vfo = kenwood_set_vfo, // Malachite does not support any VFOS + .get_vfo = kenwood_get_vfo_if, // Malachite does not support ant VFOS .set_split_vfo = kenwood_set_split_vfo, .get_split_vfo = kenwood_get_split_vfo_if, .get_ptt = kenwood_get_ptt, commit f8c4f80fd64a8dfc1a16d23ab4fb5d41fb8cc9f7 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Apr 6 07:22:28 2021 -0500 Add C++11 check to ampclass.h diff --git a/include/hamlib/ampclass.h b/include/hamlib/ampclass.h index a626ef21..69a9617c 100644 --- a/include/hamlib/ampclass.h +++ b/include/hamlib/ampclass.h @@ -38,10 +38,12 @@ public: virtual ~Amplifier(); +#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201103L) || __cplusplus >= 201103L) Amplifier(const Amplifier&) = default; Amplifier(Amplifier&&) = default; Amplifier& operator=(const Amplifier&) = default; Amplifier& operator=(Amplifier&&) = default; +#endif const struct amp_caps *caps; commit c25e8f9e5b5652ee18bd0c653b31d868dac06e0d Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Apr 6 07:22:19 2021 -0500 Add TX/RX VFOs to dummy.c diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index 1bc0a4ce..a7c65380 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -2080,7 +2080,7 @@ static int dummy_mW2power(RIG *rig, float *power, unsigned int mwpower, #define DUMMY_VFO_OP 0x7ffffffUL /* All possible VFO OPs */ #define DUMMY_SCAN 0x7ffffffUL /* All possible scan OPs */ -#define DUMMY_VFOS (RIG_VFO_A|RIG_VFO_B|RIG_VFO_C|RIG_VFO_MEM|RIG_VFO_MAIN|RIG_VFO_SUB|RIG_VFO_MAIN_A|RIG_VFO_MAIN_B|RIG_VFO_SUB_A|RIG_VFO_SUB_B) +#define DUMMY_VFOS (RIG_VFO_TX|RIG_VFO_TX|RIG_VFO_A|RIG_VFO_B|RIG_VFO_C|RIG_VFO_MEM|RIG_VFO_MAIN|RIG_VFO_SUB|RIG_VFO_MAIN_A|RIG_VFO_MAIN_B|RIG_VFO_SUB_A|RIG_VFO_SUB_B) #define DUMMY_MODES (RIG_MODE_AM | RIG_MODE_CW | RIG_MODE_RTTY | \ RIG_MODE_SSB | RIG_MODE_FM | RIG_MODE_WFM | \ commit 502c... [truncated message content] |
From: Michael B. <mdb...@us...> - 2021-04-04 17:50:47
|
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 bbc8e00074fbcb43b77badeba8028e1800e58bdb (commit) via d312945729bda1a01f910559276555bef9918397 (commit) via bdb4ff5b45f71c6910420cd7b15f779db363cdcb (commit) via 93f0cc78e99eb1ba6b72b013b9fb89f9fb587a16 (commit) via e06cce4f0d132f656f23189e2274d3f5bca44279 (commit) via b9faf48a176f4badcb253f9186e06006c21c598e (commit) via a42142312f9f0e344b4b14722edb662507199e98 (commit) via fb9c1eac3882f6af916e38616d8342f783222daf (commit) via 92e40eca30b99e2dff25b957c6a582908b948f95 (commit) from 35d945e002f475edb72421aef6c85afb100fbb7e (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 bbc8e00074fbcb43b77badeba8028e1800e58bdb Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Apr 4 12:50:07 2021 -0500 astyle files diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 340b7cf1..a63c94c9 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -588,8 +588,8 @@ static int flrig_transaction(RIG *rig, char *cmd, char *cmd_arg, char *value, read_transaction(rig, xml, sizeof(xml)); // this might time out -- that's OK - // we get an uknown response if function does not exist - if (strstr(xml,"unknown")) RETURNFUNC(RIG_ENAVAIL); + // we get an uknown response if function does not exist + if (strstr(xml, "unknown")) { RETURNFUNC(RIG_ENAVAIL); } if (value) { @@ -834,37 +834,39 @@ static int flrig_open(RIG *rig) } else { - priv->has_get_modeA = 1; + priv->has_get_modeA = 1; rig_debug(RIG_DEBUG_VERBOSE, "%s: getmodeA is available\n", __func__); } /* see if set_vfoA_fast is available */ freq_t freq; retval = flrig_get_freq(rig, RIG_VFO_CURR, &freq); + if (retval != RIG_OK) { rig_debug(RIG_DEBUG_ERR, "%s: flrig_get_freq not working!!\n", __func__); - RETURNFUNC(RIG_EPROTO); + RETURNFUNC(RIG_EPROTO); } - + value_t val; val.i = 1; // we'll try fast and if it fails turn it off priv->has_set_freq_fast = 1; priv->has_set_ptt_fast = 1; // they both will be there - rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, val); - rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_PTT, val); + rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, val); + rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_PTT, val); retval = flrig_set_freq(rig, RIG_VFO_CURR, freq); if (retval == RIG_ENAVAIL) // must not have it { - val.i = 0; - rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, val); - rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_PTT, val); + val.i = 0; + rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, val); + rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_PTT, val); priv->has_set_freq_fast = 0; priv->has_set_ptt_fast = 0; // they both will not be there - rig_debug(RIG_DEBUG_VERBOSE, "%s: set_vfoA_fast/ptt is not available\n", __func__); + rig_debug(RIG_DEBUG_VERBOSE, "%s: set_vfoA_fast/ptt is not available\n", + __func__); } else { @@ -874,7 +876,7 @@ static int flrig_open(RIG *rig) /* see if get_bwA is available */ retval = flrig_transaction(rig, "rig.get_bwA", NULL, value, sizeof(value)); - if (retval == RIG_ENAVAIL) // must not have it + if (retval == RIG_ENAVAIL) // must not have it { priv->has_get_bwA = 0; rig_debug(RIG_DEBUG_VERBOSE, "%s: get_bwA is available=%s\n", __func__, @@ -1036,7 +1038,7 @@ static int flrig_open(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s: hamlib modes=%s\n", __func__, value); - + RETURNFUNC(retval); } @@ -1197,17 +1199,22 @@ static int flrig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) value_t val; rig_get_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, &val); rig_debug(RIG_DEBUG_VERBOSE, "%s: fast_set_freq=%d\n", __func__, val.i); + if (vfo == RIG_VFO_A) { cmd = "rig.set_vfoA"; - if (val.i) cmd = "rig.set_vfoA_fast"; + + if (val.i) { cmd = "rig.set_vfoA_fast"; } + rig_debug(RIG_DEBUG_TRACE, "%s %.0f\n", cmd, freq); priv->curr_freqA = freq; } else { cmd = "rig.set_vfoB"; - if (val.i) cmd = "rig.set_vfoB_fast"; + + if (val.i) { cmd = "rig.set_vfoB_fast"; } + rig_debug(RIG_DEBUG_TRACE, "%s %.0f\n", cmd, freq); priv->curr_freqB = freq; } @@ -2200,10 +2207,14 @@ static int flrig_set_ext_parm(RIG *rig, token_t token, value_t val) { case TOK_FLRIG_FAST_SET_FREQ: case TOK_FLRIG_FAST_SET_PTT: - if (val.i && !priv->has_set_freq_fast) { - rig_debug(RIG_DEBUG_ERR, "%s: FLRig version 1.3.54.14 or higher needed to support fast functions\n",__func__); - RETURNFUNC(-RIG_EINVAL); - } + if (val.i && !priv->has_set_freq_fast) + { + rig_debug(RIG_DEBUG_ERR, + "%s: FLRig version 1.3.54.14 or higher needed to support fast functions\n", + __func__); + RETURNFUNC(-RIG_EINVAL); + } + break; default: diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 575fa567..08758db6 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -585,7 +585,8 @@ static int netrigctl_open(RIG *rig) else if (strcmp(setting, "targetable_vfo") == 0) { rig->caps->targetable_vfo = strtol(value, NULL, 0); - rig_debug(RIG_DEBUG_ERR, "%s: targetable_vfo=0x%2x\n", __func__, rig->caps->targetable_vfo); + rig_debug(RIG_DEBUG_ERR, "%s: targetable_vfo=0x%2x\n", __func__, + rig->caps->targetable_vfo); } else if (strcmp(setting, "has_set_vfo") == 0) { diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 6655f965..4e219be6 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -333,8 +333,8 @@ transaction_write: // We may eventually want to verify PTT with rig_get_ptt instead if (retval == RIG_OK && strncmp(cmdstr, "RX", 2) == 0) { goto transaction_quit; } - // Malachite SDR cannot send ID after FA - if (priv->no_id) RETURNFUNC(RIG_OK); + // Malachite SDR cannot send ID after FA + if (priv->no_id) { RETURNFUNC(RIG_OK); } if (!datasize) { @@ -2810,6 +2810,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) retval = kenwood_get_power_minmax(rig, &power_now, &power_min, &power_max, 1); if (retval != RIG_OK) { RETURNFUNC(retval); } + power_min = 0; // our return scale is 0-max to match the input scale val->f = (power_now - power_min) / (float)(power_max - power_min); RETURNFUNC(RIG_OK); @@ -3764,7 +3765,7 @@ int kenwood_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) int retval = kenwood_transaction(rig, ptt_cmd, NULL, 0); - if (ptt == RIG_PTT_OFF) hl_usleep(100*1000); // a little time for PTT to turn off + if (ptt == RIG_PTT_OFF) { hl_usleep(100 * 1000); } // a little time for PTT to turn off RETURNFUNC(retval); } diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index 220e734f..bacb8fdf 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -918,7 +918,8 @@ const struct rig_caps ts890s_caps = const struct confparams malachite_cfg_parms[] = { - { // the Malachite SDR cannot handle sending ID; after FA; commands + { + // the Malachite SDR cannot handle sending ID; after FA; commands TOK_NO_ID, "no_id", "No ID", "If true do not send ID; with set commands", NULL, RIG_CONF_CHECKBUTTON, { } }, @@ -927,12 +928,13 @@ const struct confparams malachite_cfg_parms[] = int malachite_init(RIG *rig) { - + struct kenwood_priv_data *priv = rig->state.priv; int retval; retval = kenwood_init(rig); - if (retval != RIG_OK) RETURNFUNC(retval); + + if (retval != RIG_OK) { RETURNFUNC(retval); } priv->no_id = 1; // the Malchite doesn't like the ID; verify cmd diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index 3b0768ef..12df2a91 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -1016,7 +1016,8 @@ int ft857_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) } n = ft857_send_cmd(rig, index); - if (ptt == RIG_PTT_OFF) hl_usleep(200*1000); // FT857 takes a bit to come out of PTT + + if (ptt == RIG_PTT_OFF) { hl_usleep(200 * 1000); } // FT857 takes a bit to come out of PTT rig_force_cache_timeout(&((struct ft857_priv_data *) rig->state.priv)->tx_status_tv); diff --git a/src/iofunc.c b/src/iofunc.c index c7008f5e..b83cabbd 100644 --- a/src/iofunc.c +++ b/src/iofunc.c @@ -64,7 +64,7 @@ int HAMLIB_API port_open(hamlib_port_t *p) { int status; int want_state_delay = 0; - + ENTERFUNC; p->fd = -1; @@ -275,7 +275,7 @@ static ssize_t port_read(hamlib_port_t *p, void *buf, size_t count) } //RETURNFUNC(ret); // too verbose - return ret; + return ret; } else if (p->type.rig == RIG_PORT_NETWORK || p->type.rig == RIG_PORT_UDP_NETWORK) diff --git a/src/rig.c b/src/rig.c index da09e9b0..40174d54 100644 --- a/src/rig.c +++ b/src/rig.c @@ -3605,11 +3605,11 @@ int HAMLIB_API rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) do { - // doing get_freq seems to break on some rigs that can't read freq immediately after set + // doing get_freq seems to break on some rigs that can't read freq immediately after set if (caps->set_split_freq) { retcode = caps->set_split_freq(rig, vfo, tx_freq); - //rig_get_freq(rig, vfo, &tfreq); + //rig_get_freq(rig, vfo, &tfreq); } else { @@ -4039,7 +4039,9 @@ int HAMLIB_API rig_set_split_freq_mode(RIG *rig, // in split mode we alwasy use VFOB // in the future we may start using RIG_VFO_TX and let the backend figure out what VFO to use vfo = RIG_VFO_B; // in split mode we always use VFOB - rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s, tx_freq=%.0f, tx_mode=%s, tx_width=%d\n", __func__, rig_strvfo(vfo), tx_freq, rig_strrmode(tx_mode), (int)tx_width); + rig_debug(RIG_DEBUG_VERBOSE, + "%s: vfo=%s, tx_freq=%.0f, tx_mode=%s, tx_width=%d\n", __func__, + rig_strvfo(vfo), tx_freq, rig_strrmode(tx_mode), (int)tx_width); if (caps->set_split_freq_mode) { @@ -6000,7 +6002,8 @@ int HAMLIB_API rig_get_vfo_info(RIG *rig, vfo_t vfo, freq_t *freq, if (retval != RIG_OK) { RETURNFUNC(retval); } - if ((vfo == RIG_VFO_B || vfo == RIG_VFO_SUB) && (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE)) + if ((vfo == RIG_VFO_B || vfo == RIG_VFO_SUB) + && (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE)) { retval = rig_get_mode(rig, vfo, mode, width); commit d312945729bda1a01f910559276555bef9918397 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Apr 4 11:54:35 2021 -0500 Added Malachite DSP -- emulates TS480 but needed to avoid sending ID; command https://github.com/Hamlib/Hamlib/issues/645 diff --git a/NEWS b/NEWS index b0d16aa5..ca7ea694 100644 --- a/NEWS +++ b/NEWS @@ -7,7 +7,8 @@ Copyright (C) 2000-2021 Michael Black W9MDB, and others Please send Hamlib bug reports to ham...@li... Version 4.2 - * 2021-03-?? -- anticipated release date + * 2021-04-?? -- anticipated release date + * Added Malachite SDR * Frequency and PTT are now validated -- may solve some random problems ** where freq and ptt get stuck or not changed * Major rework for PRM80 diff --git a/include/hamlib/riglist.h b/include/hamlib/riglist.h index 6161bc05..a044d8c4 100644 --- a/include/hamlib/riglist.h +++ b/include/hamlib/riglist.h @@ -176,7 +176,7 @@ #define RIG_MODEL_PT8000A RIG_MAKE_MODEL(RIG_KENWOOD, 46) #define RIG_MODEL_K4 RIG_MAKE_MODEL(RIG_KENWOOD, 47) #define RIG_MODEL_POWERSDR RIG_MAKE_MODEL(RIG_KENWOOD, 48) - +#define RIG_MODEL_MALACHITE RIG_MAKE_MODEL(RIG_KENWOOD, 49) /* * Icom diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index b98b6e48..6655f965 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -202,6 +202,10 @@ const struct confparams kenwood_cfg_params[] = TOK_RIT, "rit", "RIT", "RIT", NULL, RIG_CONF_CHECKBUTTON, { } }, + { + TOK_NO_ID, "no_id", "No ID", "If true do not send ID; with set commands", + NULL, RIG_CONF_CHECKBUTTON, { } + }, { RIG_CONF_END, NULL, } }; @@ -329,6 +333,9 @@ transaction_write: // We may eventually want to verify PTT with rig_get_ptt instead if (retval == RIG_OK && strncmp(cmdstr, "RX", 2) == 0) { goto transaction_quit; } + // Malachite SDR cannot send ID after FA + if (priv->no_id) RETURNFUNC(RIG_OK); + if (!datasize) { rig->state.hold_decode = 0; @@ -4497,6 +4504,7 @@ int kenwood_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan) int kenwood_set_ext_parm(RIG *rig, token_t token, value_t val) { + struct kenwood_priv_data *priv = rig->state.priv; char buf[4]; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -4517,6 +4525,10 @@ int kenwood_set_ext_parm(RIG *rig, token_t token, value_t val) case TOK_RIT: snprintf(buf, sizeof(buf), "RT%c", (val.i == 0) ? '0' : '1'); RETURNFUNC(kenwood_transaction(rig, buf, NULL, 0)); + + case TOK_NO_ID: + priv->no_id = val.i; + RETURNFUNC(RIG_OK); } RETURNFUNC(-RIG_EINVAL); @@ -4833,6 +4845,7 @@ DECLARE_INITRIG_BACKEND(kenwood) rig_register(&pihpsdr_caps); rig_register(&ts890s_caps); rig_register(&pt8000a_caps); + rig_register(&malachite_caps); RETURNFUNC(RIG_OK); } diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 9c30d27b..1aa8f855 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "misc.h" -#define BACKEND_VER "20210402" +#define BACKEND_VER "20210404" #define EOM_KEN ';' #define EOM_TH '\r' @@ -45,6 +45,7 @@ #define TOK_FINE TOKEN_BACKEND(2) #define TOK_XIT TOKEN_BACKEND(3) #define TOK_RIT TOKEN_BACKEND(4) +#define TOK_NO_ID TOKEN_BACKEND(5) /* Token structure assigned to .cfgparams in rig_caps */ extern const struct confparams kenwood_cfg_params[]; @@ -142,6 +143,7 @@ struct kenwood_priv_data int is_k4; int is_k4d; int is_k4hd; + int no_id; // if true will not send ID; with every set command }; @@ -274,6 +276,7 @@ extern const struct rig_caps powersdr_caps; extern const struct rig_caps pihpsdr_caps; extern const struct rig_caps ts890s_caps; extern const struct rig_caps pt8000a_caps; +extern const struct rig_caps malachite_caps; /* use when not interested in the answer, but want to check its len */ static int inline kenwood_simple_transaction(RIG *rig, const char *cmd, diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index ab33c845..220e734f 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -48,7 +48,7 @@ * kenwood_ts480_get_info * Assumes rig!=NULL */ -static const char * +const char * kenwood_ts480_get_info(RIG *rig) { char firmbuf[50]; @@ -916,3 +916,180 @@ const struct rig_caps ts890s_caps = .get_func = kenwood_get_func, }; +const struct confparams malachite_cfg_parms[] = +{ + { // the Malachite SDR cannot handle sending ID; after FA; commands + TOK_NO_ID, "no_id", "No ID", "If true do not send ID; with set commands", + NULL, RIG_CONF_CHECKBUTTON, { } + }, + { RIG_CONF_END, NULL, } +}; + +int malachite_init(RIG *rig) +{ + + struct kenwood_priv_data *priv = rig->state.priv; + int retval; + + retval = kenwood_init(rig); + if (retval != RIG_OK) RETURNFUNC(retval); + + priv->no_id = 1; // the Malchite doesn't like the ID; verify cmd + + return RIG_OK; +} + +/* + * Malachite SDR rig capabilities. + * Notice that some rigs share the same functions. + * Also this struct is READONLY! + */ +const struct rig_caps malachite_caps = +{ + RIG_MODEL(RIG_MODEL_MALACHITE), + .model_name = "DSP", + .mfg_name = "Malachite", + .version = BACKEND_VER ".0", + .mfg_name = "Malachite", + .version = BACKEND_VER ".0", + .copyright = "LGPL", + .status = RIG_STATUS_STABLE, + .rig_type = RIG_TYPE_TRANSCEIVER, + .ptt_type = RIG_PTT_RIG_MICDATA, + .dcd_type = RIG_DCD_RIG, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 4800, + .serial_rate_max = 115200, + .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 = 200, + .retry = 10, + .preamp = {12, RIG_DBLST_END,}, + .attenuator = {12, RIG_DBLST_END,}, + .max_rit = kHz(9.99), + .max_xit = kHz(9.99), + .max_ifshift = Hz(0), + .targetable_vfo = RIG_TARGETABLE_FREQ, + .transceive = RIG_TRN_RIG, + + + .rx_range_list1 = { + {kHz(100), Hz(59999999), TS480_ALL_MODES, -1, -1, TS480_VFO}, + RIG_FRNG_END, + }, /*!< Receive frequency range list for ITU region 1 */ + .tx_range_list1 = { + {kHz(1810), kHz(1850), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, /* 100W class */ + {kHz(1810), kHz(1850), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, /* 25W class */ + {kHz(3500), kHz(3800), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {kHz(3500), kHz(3800), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {MHz(7), kHz(7200), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {MHz(7), kHz(7200), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {kHz(10100), kHz(10150), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {kHz(10100), kHz(10150), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {MHz(14), kHz(14350), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {MHz(14), kHz(14350), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {kHz(18068), kHz(18168), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {kHz(18068), kHz(18168), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {MHz(21), kHz(21450), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {MHz(21), kHz(21450), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {kHz(24890), kHz(24990), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {kHz(24890), kHz(24990), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {MHz(28), kHz(29700), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {MHz(28), kHz(29700), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {MHz(50), kHz(52000), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {MHz(50), kHz(52000), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + RIG_FRNG_END, + }, /*!< Transmit frequency range list for ITU region 1 */ + .rx_range_list2 = { + {kHz(100), Hz(59999999), TS480_ALL_MODES, -1, -1, TS480_VFO}, + RIG_FRNG_END, + }, /*!< Receive frequency range list for ITU region 2 */ + .tx_range_list2 = { + {kHz(1800), MHz(2) - 1, TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, /* 100W class */ + {kHz(1800), MHz(2) - 1, TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, /* 25W class */ + {kHz(3500), MHz(4) - 1, TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {kHz(3500), MHz(4) - 1, TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {kHz(5250), kHz(5450), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {kHz(5250), kHz(5450), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {MHz(7), kHz(7300), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {MHz(7), kHz(7300), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {kHz(10100), kHz(10150), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {MHz(14), kHz(14350), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {kHz(18068), kHz(18168), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {kHz(18068), kHz(18168), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {MHz(21), kHz(21450), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {MHz(21), kHz(21450), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {kHz(24890), kHz(24990), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {kHz(24890), kHz(24990), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {MHz(28), kHz(29700), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {MHz(28), kHz(29700), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + {MHz(50), kHz(52000), TS480_OTHER_TX_MODES, 5000, 100000, TS480_VFO}, + {MHz(50), kHz(52000), TS480_AM_TX_MODES, 5000, 25000, TS480_VFO}, + RIG_FRNG_END, + }, /*!< Transmit frequency range list for ITU region 2 */ + .tuning_steps = { + {TS480_ALL_MODES, kHz(1)}, + {TS480_ALL_MODES, Hz(2500)}, + {TS480_ALL_MODES, kHz(5)}, + {TS480_ALL_MODES, Hz(6250)}, + {TS480_ALL_MODES, kHz(10)}, + {TS480_ALL_MODES, Hz(12500)}, + {TS480_ALL_MODES, kHz(15)}, + {TS480_ALL_MODES, kHz(20)}, + {TS480_ALL_MODES, kHz(25)}, + {TS480_ALL_MODES, kHz(30)}, + {TS480_ALL_MODES, kHz(100)}, + {TS480_ALL_MODES, kHz(500)}, + {TS480_ALL_MODES, MHz(1)}, + {TS480_ALL_MODES, 0}, /* any tuning step */ + RIG_TS_END, + }, + /* mode/filter list, remember: order matters! */ + .filters = { + {RIG_MODE_SSB, kHz(2.4)}, + {RIG_MODE_CW, Hz(200)}, + {RIG_MODE_RTTY, Hz(500)}, + {RIG_MODE_AM, kHz(9)}, + {RIG_MODE_FM, kHz(14)}, + RIG_FLT_END, + }, + .priv = (void *)& ts480_priv_caps, + .rig_init = malachite_init, + .rig_open = kenwood_open, + .rig_cleanup = kenwood_cleanup, + .set_freq = kenwood_set_freq, + .get_freq = kenwood_get_freq, + .set_rit = kenwood_set_rit, /* FIXME should this switch to rit mode or just set the frequency? */ + .get_rit = kenwood_get_rit, + .set_xit = kenwood_set_xit, /* FIXME should this switch to xit mode or just set the frequency? */ + .get_xit = kenwood_get_xit, + .set_mode = kenwood_set_mode, + .get_mode = kenwood_get_mode, + .set_vfo = kenwood_set_vfo, + .get_vfo = kenwood_get_vfo_if, + .set_split_vfo = kenwood_set_split_vfo, + .get_split_vfo = kenwood_get_split_vfo_if, + .get_ptt = kenwood_get_ptt, + .set_ptt = kenwood_set_ptt, + .get_dcd = kenwood_get_dcd, + .set_powerstat = kenwood_set_powerstat, + .get_powerstat = kenwood_get_powerstat, + .get_info = kenwood_ts480_get_info, + .reset = kenwood_reset, + .set_ant = kenwood_set_ant, + .get_ant = kenwood_get_ant, + .scan = kenwood_scan, /* not working, invalid arguments using rigctl; kenwood_scan does only support on/off and not tone and CTCSS scan */ + .has_set_level = TS480_LEVEL_ALL, + .has_get_level = TS480_LEVEL_ALL, + .set_level = kenwood_ts480_set_level, + .get_level = kenwood_ts480_get_level, + .has_get_func = TS480_FUNC_ALL, + .has_set_func = TS480_FUNC_ALL, + .set_func = kenwood_set_func, + .get_func = kenwood_get_func, +}; + commit bdb4ff5b45f71c6910420cd7b15f779db363cdcb Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Apr 4 08:07:55 2021 -0500 Update VFOs.txt diff --git a/VFOs.txt b/VFOs.txt index 0e55edfe..014bdc22 100644 --- a/VFOs.txt +++ b/VFOs.txt @@ -1,7 +1,10 @@ VFO Abstraction -2021-03-30 +2021-04-04 Mike Black W9MDB +RX -- The default receive -- we always use RX=VFOA -- we do not support reverse split as of 2021-04-04 +TX -- The default transmit -- based on mode could be VFOA, or if in split/satellite VFOB or Sub + Main_A RIG_VFO_A RIG_VFO_MAIN @@ -16,6 +19,7 @@ Sub_A Sub_B RIG_VFO_SUB_B -- unknown use for this so far but has set/get functions +# Note the IC-910 introduced a 3rd VFO Main_C RIG_VFO_C -- - unknown use for this so far but has set/get functions RIG_VFO_MAIN_C -- - unknown use for this so far but has set/get functions commit 93f0cc78e99eb1ba6b72b013b9fb89f9fb587a16 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Apr 3 23:45:49 2021 -0500 Fix flrig.c ordering of statement to prevent warning message diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 79a803c1..340b7cf1 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -850,10 +850,10 @@ static int flrig_open(RIG *rig) value_t val; val.i = 1; // we'll try fast and if it fails turn it off - rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, val); - rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_PTT, val); priv->has_set_freq_fast = 1; priv->has_set_ptt_fast = 1; // they both will be there + rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, val); + rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_PTT, val); retval = flrig_set_freq(rig, RIG_VFO_CURR, freq); commit e06cce4f0d132f656f23189e2274d3f5bca44279 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Apr 3 23:41:22 2021 -0500 Fix FLRig initial check of fast modes to avoid setting freq to zero diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index bb2a469a..79a803c1 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -839,11 +839,26 @@ static int flrig_open(RIG *rig) } /* see if set_vfoA_fast is available */ - retval = flrig_transaction(rig, "rig.set_vfoA_fast", NULL, NULL, 0); + freq_t freq; + retval = flrig_get_freq(rig, RIG_VFO_CURR, &freq); + if (retval != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: flrig_get_freq not working!!\n", __func__); + RETURNFUNC(RIG_EPROTO); + } + + + value_t val; + val.i = 1; // we'll try fast and if it fails turn it off + rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, val); + rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_PTT, val); + priv->has_set_freq_fast = 1; + priv->has_set_ptt_fast = 1; // they both will be there + + retval = flrig_set_freq(rig, RIG_VFO_CURR, freq); if (retval == RIG_ENAVAIL) // must not have it { - value_t val; val.i = 0; rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, val); rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_PTT, val); @@ -853,12 +868,6 @@ static int flrig_open(RIG *rig) } else { - value_t val; - val.i = 1; - rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, val); - rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_PTT, val); - priv->has_set_freq_fast = 1; - priv->has_set_ptt_fast = 1; // they both will be there rig_debug(RIG_DEBUG_VERBOSE, "%s: set_vfoA_fast/ptt is available\n", __func__); } commit b9faf48a176f4badcb253f9186e06006c21c598e Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Apr 3 23:16:57 2021 -0500 Fix FLRig detection of fast modes Timing on ANAN 100 at 115200 is 136ms with freq confirm and 4ms in fast mode diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 2b6a663c..bb2a469a 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -161,8 +161,6 @@ const struct rig_caps flrig_caps = .has_set_func = RIG_FUNC_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, .has_get_parm = FLRIG_PARM, .has_set_parm = RIG_PARM_SET(FLRIG_PARM), @@ -841,7 +839,7 @@ static int flrig_open(RIG *rig) } /* see if set_vfoA_fast is available */ - retval = flrig_transaction(rig, "rig.set_vfoA_fast", NULL, value, sizeof(value)); + retval = flrig_transaction(rig, "rig.set_vfoA_fast", NULL, NULL, 0); if (retval == RIG_ENAVAIL) // must not have it { @@ -857,8 +855,8 @@ static int flrig_open(RIG *rig) { value_t val; val.i = 1; - rig_set_parm(rig, TOK_FLRIG_FAST_SET_FREQ, val); - rig_set_parm(rig, TOK_FLRIG_FAST_SET_PTT, val); + rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, val); + rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_PTT, val); priv->has_set_freq_fast = 1; priv->has_set_ptt_fast = 1; // they both will be there rig_debug(RIG_DEBUG_VERBOSE, "%s: set_vfoA_fast/ptt is available\n", __func__); @@ -2194,7 +2192,7 @@ static int flrig_set_ext_parm(RIG *rig, token_t token, value_t val) case TOK_FLRIG_FAST_SET_FREQ: case TOK_FLRIG_FAST_SET_PTT: if (val.i && !priv->has_set_freq_fast) { - rig_debug(RIG_DEBUG_ERR, "%s: FLRig version 1.3.54.11 or higher needed to support fast functions\n",__func__); + rig_debug(RIG_DEBUG_ERR, "%s: FLRig version 1.3.54.14 or higher needed to support fast functions\n",__func__); RETURNFUNC(-RIG_EINVAL); } break; commit a42142312f9f0e344b4b14722edb662507199e98 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Apr 3 16:52:35 2021 -0500 Fix FLRig use of fast functions. Defaults to fast functions if they are available. param FAST_SET_FREQ 0 to turn on confirmation calls for set_freq param FAST_SET_PTT 0 to turn on confirmation calls for set_ptt diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 863f77a1..2b6a663c 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -37,6 +37,7 @@ #include <register.h> #include <network.h> +#include "dummy_common.h" #include "flrig.h" #define DEBUG 1 @@ -60,6 +61,8 @@ #define FLRIG_LEVELS (RIG_LEVEL_AF | RIG_LEVEL_RF | RIG_LEVEL_MICGAIN | RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER_METER | RIG_LEVEL_RFPOWER_METER_WATTS | RIG_LEVEL_RFPOWER) +#define FLRIG_PARM (TOK_FLRIG_FAST_SET_FREQ|TOK_FLRIG_FAST_SET_PTT) + #define streq(s1,s2) (strcmp(s1,s2)==0) static int flrig_init(RIG *rig); @@ -115,15 +118,14 @@ 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 */ - int has_set_vfo_fast; - int use_set_vfo_fast; + int has_set_freq_fast; int has_set_ptt_fast; - int use_set_ptt_fast; float powermeter_scale; /* So we can scale power meter to 0-1 */ + value_t parms[RIG_SETTING_MAX]; struct ext_list *ext_parms; }; -/* ext_level's and ext_parm's tokens */ +/* level's and parm's tokens */ #define TOK_FLRIG_FAST_SET_FREQ TOKEN_BACKEND(1) #define TOK_FLRIG_FAST_SET_PTT TOKEN_BACKEND(2) @@ -161,6 +163,9 @@ const struct rig_caps flrig_caps = .has_set_level = RIG_LEVEL_SET(FLRIG_LEVELS), .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, + .has_get_parm = FLRIG_PARM, + .has_set_parm = RIG_PARM_SET(FLRIG_PARM), + .filters = { RIG_FLT_END }, @@ -182,7 +187,8 @@ const struct rig_caps flrig_caps = .tuning_steps = { {FLRIG_MODES, 1}, {FLRIG_MODES, RIG_TS_ANY}, RIG_TS_END, }, .priv = NULL, /* priv */ - .extparms = flrig_ext_parms, + .extparms = flrig_ext_parms, + .rig_init = flrig_init, .rig_open = flrig_open, .rig_close = flrig_close, @@ -622,6 +628,7 @@ static int flrig_init(RIG *rig) priv = rig->state.priv; memset(priv, 0, sizeof(struct flrig_priv_data)); + memset(priv->parms, 0, RIG_SETTING_MAX * sizeof(value_t)); /* * set arbitrary initial status @@ -633,8 +640,6 @@ static int flrig_init(RIG *rig) priv->curr_modeB = -1; priv->curr_widthA = -1; priv->curr_widthB = -1; - priv->use_set_vfo_fast = 1; // default to fast VFO - priv->use_set_ptt_fast = 1; // deafult to fast PTT if (!rig->caps) { @@ -644,6 +649,14 @@ static int flrig_init(RIG *rig) strncpy(rig->state.rigport.pathname, DEFAULTPATH, sizeof(rig->state.rigport.pathname)); + priv->ext_parms = alloc_init_ext(flrig_ext_parms); + + if (!priv->ext_parms) + { + RETURNFUNC(-RIG_ENOMEM); + } + + RETURNFUNC(RIG_OK); } @@ -832,14 +845,21 @@ static int flrig_open(RIG *rig) if (retval == RIG_ENAVAIL) // must not have it { - priv->has_set_vfo_fast = 0; + value_t val; + val.i = 0; + rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, val); + rig_set_ext_parm(rig, TOK_FLRIG_FAST_SET_PTT, val); + priv->has_set_freq_fast = 0; priv->has_set_ptt_fast = 0; // they both will not be there - rig_debug(RIG_DEBUG_VERBOSE, "%s: set_vfoA_fast/ptt is not available=%s\n", __func__, - value); + rig_debug(RIG_DEBUG_VERBOSE, "%s: set_vfoA_fast/ptt is not available\n", __func__); } else { - priv->has_set_vfo_fast = 1; + value_t val; + val.i = 1; + rig_set_parm(rig, TOK_FLRIG_FAST_SET_FREQ, val); + rig_set_parm(rig, TOK_FLRIG_FAST_SET_PTT, val); + priv->has_set_freq_fast = 1; priv->has_set_ptt_fast = 1; // they both will be there rig_debug(RIG_DEBUG_VERBOSE, "%s: set_vfoA_fast/ptt is available\n", __func__); } @@ -1031,6 +1051,8 @@ static int flrig_close(RIG *rig) */ static int flrig_cleanup(RIG *rig) { + struct flrig_priv_data *priv = (struct flrig_priv_data *)rig->state.priv; + rig_debug(RIG_DEBUG_TRACE, "%s\n", __func__); if (!rig) @@ -1038,7 +1060,9 @@ static int flrig_cleanup(RIG *rig) RETURNFUNC(-RIG_EINVAL); } + free(priv->ext_parms); free(rig->state.priv); + rig->state.priv = NULL; // we really don't need to free this up as it's only done once @@ -1163,24 +1187,27 @@ static int flrig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) sprintf(cmd_arg, "<params><param><value><double>%.0f</double></value></param></params>", freq); + value_t val; + rig_get_ext_parm(rig, TOK_FLRIG_FAST_SET_FREQ, &val); + rig_debug(RIG_DEBUG_VERBOSE, "%s: fast_set_freq=%d\n", __func__, val.i); if (vfo == RIG_VFO_A) { cmd = "rig.set_vfoA"; - if (priv->has_set_vfo_fast) cmd = "rig.set_vfoA_fast"; + if (val.i) cmd = "rig.set_vfoA_fast"; rig_debug(RIG_DEBUG_TRACE, "%s %.0f\n", cmd, freq); priv->curr_freqA = freq; } else { cmd = "rig.set_vfoB"; - if (priv->has_set_vfo_fast) cmd = "rig.set_vfoB_fast"; + if (val.i) cmd = "rig.set_vfoB_fast"; rig_debug(RIG_DEBUG_TRACE, "%s %.0f\n", cmd, freq); priv->curr_freqB = freq; } retval = flrig_transaction(rig, cmd, cmd_arg, NULL, 0); - if (retval < 0) + if (retval != RIG_OK) { RETURNFUNC(retval); } @@ -2147,37 +2174,91 @@ static int flrig_mW2power(RIG *rig, float *power, unsigned int mwpower, } -int flrig_set_ext_parm(RIG *rig, token_t token, value_t val) +static int flrig_set_ext_parm(RIG *rig, token_t token, value_t val) { - struct flrig_priv_data *priv = rig->state.priv; + struct flrig_priv_data *priv = (struct flrig_priv_data *)rig->state.priv; + char lstr[64]; + const struct confparams *cfp; + struct ext_list *epp; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; + cfp = rig_ext_lookup_tok(rig, token); + + if (!cfp) + { + RETURNFUNC(-RIG_EINVAL); + } switch (token) { case TOK_FLRIG_FAST_SET_FREQ: - priv->use_set_vfo_fast = val.i; - break; - - case TOK_FLRIG_FAST_SET_PTT: - priv->use_set_ptt_fast = val.i; - break; + if (val.i && !priv->has_set_freq_fast) { + rig_debug(RIG_DEBUG_ERR, "%s: FLRig version 1.3.54.11 or higher needed to support fast functions\n",__func__); + RETURNFUNC(-RIG_EINVAL); + } + break; default: RETURNFUNC(-RIG_EINVAL); } - RETURNFUNC(RIG_OK); + switch (cfp->type) + { + case RIG_CONF_STRING: + strcpy(lstr, val.s); + break; + + + case RIG_CONF_COMBO: + sprintf(lstr, "%d", val.i); + break; + + case RIG_CONF_NUMERIC: + sprintf(lstr, "%f", val.f); + break; + + case RIG_CONF_CHECKBUTTON: + sprintf(lstr, "%s", val.i ? "ON" : "OFF"); + break; + + case RIG_CONF_BUTTON: + lstr[0] = '\0'; + break; + + default: + RETURNFUNC(-RIG_EINTERNAL); + } + + epp = find_ext(priv->ext_parms, token); + + if (!epp) + { + RETURNFUNC(-RIG_EINTERNAL); + } + + /* store value */ + epp->val = val; + + + rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s %s\n", __func__, + cfp->name, lstr); + + RETURNFUNC(RIG_OK); } -int flrig_get_ext_parm(RIG *rig, token_t token, value_t *val) +static int flrig_get_ext_parm(RIG *rig, token_t token, value_t *val) { - struct flrig_priv_data *priv = rig->state.priv; + struct flrig_priv_data *priv = (struct flrig_priv_data *)rig->state.priv; + const struct confparams *cfp; + struct ext_list *epp; + + ENTERFUNC; + /* TODO: load value from priv->ext_parms */ - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + cfp = rig_ext_lookup_tok(rig, token); - if (!val) + if (!cfp) { RETURNFUNC(-RIG_EINVAL); } @@ -2185,17 +2266,78 @@ int flrig_get_ext_parm(RIG *rig, token_t token, value_t *val) switch (token) { case TOK_FLRIG_FAST_SET_FREQ: - val->i = priv->use_set_vfo_fast; - break; - case TOK_FLRIG_FAST_SET_PTT: - val->i = priv->use_set_ptt_fast; - break; + break; default: - RETURNFUNC(-RIG_ENIMPL); + RETURNFUNC(-RIG_EINVAL); } + epp = find_ext(priv->ext_parms, token); + + if (!epp) + { + RETURNFUNC(-RIG_EINTERNAL); + } + + /* load value */ + *val = epp->val; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, + cfp->name); + RETURNFUNC(RIG_OK); } + +#if 0 +static int flrig_set_ext_parm(RIG *rig, setting_t parm, value_t val) +{ + struct flrig_priv_data *priv = (struct flrig_priv_data *)rig->state.priv; + int idx; + char pstr[32]; + + ENTERFUNC; + idx = rig_setting2idx(parm); + + if (idx >= RIG_SETTING_MAX) + { + RETURNFUNC(-RIG_EINVAL); + } + + if (RIG_PARM_IS_FLOAT(parm)) + { + sprintf(pstr, "%f", val.f); + } + else + { + sprintf(pstr, "%d", val.i); + } + + rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s %s\n", __func__, + rig_strparm(parm), pstr); + priv->parms[idx] = val; + + RETURNFUNC(RIG_OK); +} + +static int flrig_get_ext_parm(RIG *rig, setting_t parm, value_t *val) +{ + struct flrig_priv_data *priv = (struct flrig_priv_data *)rig->state.priv; + int idx; + + ENTERFUNC; + idx = rig_setting2idx(parm); + + if (idx >= RIG_SETTING_MAX) + { + RETURNFUNC(-RIG_EINVAL); + } + + *val = priv->parms[idx]; + rig_debug(RIG_DEBUG_VERBOSE, "%s called %s\n", __func__, + rig_strparm(parm)); + + RETURNFUNC(RIG_OK); +} +#endif commit fb9c1eac3882f6af916e38616d8342f783222daf Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Apr 3 14:28:15 2021 -0500 Fix FLRig set_VFOA to be default Add FAST_SET_FREQ and FAST_SET_PTT params to enable new function calls in FLRig for fast VFO/PTT setting This should better support Doppler speed in SATPC32 and gpredict diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 5fec5f0b..863f77a1 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -90,6 +90,9 @@ static int flrig_get_split_freq_mode(RIG *rig, vfo_t vfo, freq_t *freq, 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 int flrig_set_ext_parm(RIG *rig, token_t token, value_t val); +static int flrig_get_ext_parm(RIG *rig, token_t token, value_t *val); + static const char *flrig_get_info(RIG *rig); static int flrig_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq, rmode_t mode); @@ -112,8 +115,27 @@ 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 */ - int has_set_vfoA_fast; + int has_set_vfo_fast; + int use_set_vfo_fast; + int has_set_ptt_fast; + int use_set_ptt_fast; float powermeter_scale; /* So we can scale power meter to 0-1 */ + struct ext_list *ext_parms; +}; + +/* ext_level's and ext_parm's tokens */ +#define TOK_FLRIG_FAST_SET_FREQ TOKEN_BACKEND(1) +#define TOK_FLRIG_FAST_SET_PTT TOKEN_BACKEND(2) + +static const struct confparams flrig_ext_parms[] = +{ + { + TOK_FLRIG_FAST_SET_FREQ, "FAST_SET_FREQ", "Use fast set_freq", "If true uses fast set_freq otherwise set_freq is confirmed", "1", RIG_CONF_CHECKBUTTON, {} + }, + { + TOK_FLRIG_FAST_SET_PTT, "FAST_SET_PTT", "Use fast set_ott", "If true uses fast set_ptt otherwise set_ptt is confirmed", "1", RIG_CONF_CHECKBUTTON, {} + }, + { RIG_CONF_END, NULL, } }; const struct rig_caps flrig_caps = @@ -121,7 +143,7 @@ const struct rig_caps flrig_caps = RIG_MODEL(RIG_MODEL_FLRIG), .model_name = "FLRig", .mfg_name = "FLRig", - .version = "20210402", + .version = "20210403", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -160,6 +182,7 @@ const struct rig_caps flrig_caps = .tuning_steps = { {FLRIG_MODES, 1}, {FLRIG_MODES, RIG_TS_ANY}, RIG_TS_END, }, .priv = NULL, /* priv */ + .extparms = flrig_ext_parms, .rig_init = flrig_init, .rig_open = flrig_open, .rig_close = flrig_close, @@ -183,6 +206,8 @@ const struct rig_caps flrig_caps = .get_split_freq_mode = flrig_get_split_freq_mode, .set_level = flrig_set_level, .get_level = flrig_get_level, + .set_ext_parm = flrig_set_ext_parm, + .get_ext_parm = flrig_get_ext_parm, .power2mW = flrig_power2mW, .mW2power = flrig_mW2power }; @@ -559,6 +584,9 @@ static int flrig_transaction(RIG *rig, char *cmd, char *cmd_arg, char *value, read_transaction(rig, xml, sizeof(xml)); // this might time out -- that's OK + // we get an uknown response if function does not exist + if (strstr(xml,"unknown")) RETURNFUNC(RIG_ENAVAIL); + if (value) { xml_parse(xml, value, value_len); @@ -605,6 +633,8 @@ static int flrig_init(RIG *rig) priv->curr_modeB = -1; priv->curr_widthA = -1; priv->curr_widthB = -1; + priv->use_set_vfo_fast = 1; // default to fast VFO + priv->use_set_ptt_fast = 1; // deafult to fast PTT if (!rig->caps) { @@ -775,11 +805,9 @@ static int flrig_open(RIG *rig) retval = flrig_transaction(rig, "rig.get_pwrmeter_scale", NULL, value, sizeof(value)); - if (retval != RIG_OK) { RETURNFUNC(retval); } - priv->powermeter_scale = 1; // default - if (strlen(value) > 0) + if (retval == RIG_OK) { priv->powermeter_scale = atof(value); } @@ -787,48 +815,47 @@ static int flrig_open(RIG *rig) /* see if get_modeA is available */ retval = flrig_transaction(rig, "rig.get_modeA", NULL, value, sizeof(value)); - if (retval != RIG_OK) { RETURNFUNC(retval); } - - if (strlen(value) > 0) /* must have it since we got an answer */ + if (retval == RIG_ENAVAIL) // must not have it { - priv->has_get_modeA = 1; - rig_debug(RIG_DEBUG_VERBOSE, "%s: getmodeA is available=%s\n", __func__, + priv->has_get_modeA = 0; + rig_debug(RIG_DEBUG_VERBOSE, "%s: getmodeA is not available=%s\n", __func__, value); } else { - rig_debug(RIG_DEBUG_VERBOSE, "%s: getmodeA is not available\n", __func__); + priv->has_get_modeA = 1; + rig_debug(RIG_DEBUG_VERBOSE, "%s: getmodeA is available\n", __func__); } /* see if set_vfoA_fast is available */ retval = flrig_transaction(rig, "rig.set_vfoA_fast", NULL, value, sizeof(value)); - if (retval != RIG_OK) { RETURNFUNC(retval); } - - if (strlen(value) > 0) /* must have it since we got an answer */ + if (retval == RIG_ENAVAIL) // must not have it { - priv->has_set_vfoA_fast = 1; - rig_debug(RIG_DEBUG_VERBOSE, "%s: set_vfoA_fast is available=%s\n", __func__, + priv->has_set_vfo_fast = 0; + priv->has_set_ptt_fast = 0; // they both will not be there + rig_debug(RIG_DEBUG_VERBOSE, "%s: set_vfoA_fast/ptt is not available=%s\n", __func__, value); } else { - rig_debug(RIG_DEBUG_VERBOSE, "%s: set_vfoA_fast is not available\n", __func__); + priv->has_set_vfo_fast = 1; + priv->has_set_ptt_fast = 1; // they both will be there + rig_debug(RIG_DEBUG_VERBOSE, "%s: set_vfoA_fast/ptt is available\n", __func__); } /* see if get_bwA is available */ retval = flrig_transaction(rig, "rig.get_bwA", NULL, value, sizeof(value)); - if (retval != RIG_OK) { RETURNFUNC(retval); } - - if (strlen(value) > 0) /* must have it since we got an answer */ + if (retval == RIG_ENAVAIL) // must not have it { - priv->has_get_bwA = 1; + priv->has_get_bwA = 0; rig_debug(RIG_DEBUG_VERBOSE, "%s: get_bwA is available=%s\n", __func__, value); } else { + priv->has_get_bwA = 1; rig_debug(RIG_DEBUG_VERBOSE, "%s: get_bwA is not available\n", __func__); } @@ -982,6 +1009,8 @@ static int flrig_open(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s: hamlib modes=%s\n", __func__, value); + + RETURNFUNC(retval); } @@ -1137,14 +1166,14 @@ static int flrig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (vfo == RIG_VFO_A) { cmd = "rig.set_vfoA"; - if (priv->has_set_vfoA_fast) cmd = "rig.set_vfoA_fast"; + if (priv->has_set_vfo_fast) cmd = "rig.set_vfoA_fast"; rig_debug(RIG_DEBUG_TRACE, "%s %.0f\n", cmd, freq); priv->curr_freqA = freq; } else { cmd = "rig.set_vfoB"; - if (priv->has_set_vfoA_fast) cmd = "rig.set_vfoB_fast"; + if (priv->has_set_vfo_fast) cmd = "rig.set_vfoB_fast"; rig_debug(RIG_DEBUG_TRACE, "%s %.0f\n", cmd, freq); priv->curr_freqB = freq; } @@ -2114,6 +2143,59 @@ static int flrig_mW2power(RIG *rig, float *power, unsigned int mwpower, *power = ((float)mwpower / 100000); + RETURNFUNC(RIG_OK); + +} + +int flrig_set_ext_parm(RIG *rig, token_t token, value_t val) +{ + struct flrig_priv_data *priv = rig->state.priv; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + switch (token) + { + case TOK_FLRIG_FAST_SET_FREQ: + priv->use_set_vfo_fast = val.i; + break; + + + case TOK_FLRIG_FAST_SET_PTT: + priv->use_set_ptt_fast = val.i; + break; + + default: + RETURNFUNC(-RIG_EINVAL); + } + RETURNFUNC(RIG_OK); + +} + +int flrig_get_ext_parm(RIG *rig, token_t token, value_t *val) +{ + struct flrig_priv_data *priv = rig->state.priv; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + if (!val) + { + RETURNFUNC(-RIG_EINVAL); + } + + switch (token) + { + case TOK_FLRIG_FAST_SET_FREQ: + val->i = priv->use_set_vfo_fast; + break; + + case TOK_FLRIG_FAST_SET_PTT: + val->i = priv->use_set_ptt_fast; + break; + + default: + RETURNFUNC(-RIG_ENIMPL); + } + RETURNFUNC(RIG_OK); } commit 92e40eca30b99e2dff25b957c6a582908b948f95 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Apr 3 10:32:43 2021 -0500 In rig.c reduce tx_range from ERR to VERBOSE -- it's not fatal at all Was causing problems with powershell execution detecting the error condition diff --git a/src/rig.c b/src/rig.c index 60e6edf9..da09e9b0 100644 --- a/src/rig.c +++ b/src/rig.c @@ -498,7 +498,7 @@ RIG *HAMLIB_API rig_init(rig_model_t rig_model) if (rs->tx_range_list[0].startf == 0) { - rig_debug(RIG_DEBUG_ERR, "%s: rig does not have tx_range!!\n", __func__); + rig_debug(RIG_DEBUG_VERBOSE, "%s: rig does not have tx_range!!\n", __func__); //return(NULL); // this is not fatal } ----------------------------------------------------------------------- Summary of changes: NEWS | 3 +- VFOs.txt | 6 +- include/hamlib/riglist.h | 2 +- rigs/dummy/flrig.c | 296 ++++++++++++++++++++++++++++++++++++++++++----- rigs/dummy/netrigctl.c | 3 +- rigs/kenwood/kenwood.c | 16 ++- rigs/kenwood/kenwood.h | 5 +- rigs/kenwood/ts480.c | 181 ++++++++++++++++++++++++++++- rigs/yaesu/ft857.c | 3 +- src/iofunc.c | 4 +- src/rig.c | 13 ++- 11 files changed, 490 insertions(+), 42 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-04-02 21:41:13
|
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 35d945e002f475edb72421aef6c85afb100fbb7e (commit) via 02c985ce3d2eb7839501669a47f4db83d89c8d1d (commit) via ca9667a47e39cd6687c215563231a7a23982b43b (commit) via a3fe52ea6c8f96e42b0819ee58aff18f76380b41 (commit) via 04b4b83f15564f020106a0e02e07a4e9a27f0fd0 (commit) via c5b0b97383bf86463285ee4ace85929d5c0dd5a3 (commit) via 0794e6e1e65dfb4c8dc2c50bb974d48f57d8c50b (commit) via 33f299d16d83e27c9c19221caa65946b13d486a1 (commit) from 8e1fae4ea44fd47f585262f34abd82f9eba48c9e (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 35d945e002f475edb72421aef6c85afb100fbb7e Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Apr 2 16:36:46 2021 -0500 Add 100ms sleep to kenwood.c after set_ptt OFF In kenwood.c when ? reply is receive write the transaction again instead of just reading https://github.com/Hamlib/Hamlib/issues/644 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 22e20fe4..b98b6e48 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -450,7 +450,7 @@ transaction_read: { rig_debug(RIG_DEBUG_ERR, "%s: Retrying shortly\n", __func__); hl_usleep(rig->caps->timeout * 1000); - goto transaction_read; + goto transaction_write; } retval = -RIG_ERJCTED; @@ -3757,6 +3757,8 @@ int kenwood_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) int retval = kenwood_transaction(rig, ptt_cmd, NULL, 0); + if (ptt == RIG_PTT_OFF) hl_usleep(100*1000); // a little time for PTT to turn off + RETURNFUNC(retval); } diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index c1639e5b..9c30d27b 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "misc.h" -#define BACKEND_VER "20210328" +#define BACKEND_VER "20210402" #define EOM_KEN ';' #define EOM_TH '\r' commit 02c985ce3d2eb7839501669a47f4db83d89c8d1d Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Apr 2 12:07:34 2021 -0500 Add FLRig set_vfoA_fast detection and use it by default Need to add option to use the regular set_vfoA diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 3e25443e..5fec5f0b 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -112,6 +112,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 */ + int has_set_vfoA_fast; float powermeter_scale; /* So we can scale power meter to 0-1 */ }; @@ -120,7 +121,7 @@ const struct rig_caps flrig_caps = RIG_MODEL(RIG_MODEL_FLRIG), .model_name = "FLRig", .mfg_name = "FLRig", - .version = BACKEND_VER ".0", + .version = "20210402", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -580,7 +581,7 @@ static int flrig_init(RIG *rig) struct flrig_priv_data *priv; ENTERFUNC; - rig_debug(RIG_DEBUG_TRACE, "%s version %s\n", __func__, BACKEND_VER); + rig_debug(RIG_DEBUG_TRACE, "%s version %s\n", __func__, rig->caps->version); rig->state.priv = (struct flrig_priv_data *)malloc(sizeof( struct flrig_priv_data)); @@ -746,7 +747,7 @@ static int flrig_open(RIG *rig) struct flrig_priv_data *priv = (struct flrig_priv_data *) rig->state.priv; ENTERFUNC; - rig_debug(RIG_DEBUG_VERBOSE, "%s version %s\n", __func__, BACKEND_VER); + rig_debug(RIG_DEBUG_VERBOSE, "%s version %s\n", __func__, rig->caps->version); retval = flrig_transaction(rig, "main.get_version", NULL, value, sizeof(value)); @@ -799,6 +800,22 @@ static int flrig_open(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s: getmodeA is not available\n", __func__); } + /* see if set_vfoA_fast is available */ + retval = flrig_transaction(rig, "rig.set_vfoA_fast", NULL, value, sizeof(value)); + + if (retval != RIG_OK) { RETURNFUNC(retval); } + + if (strlen(value) > 0) /* must have it since we got an answer */ + { + priv->has_set_vfoA_fast = 1; + rig_debug(RIG_DEBUG_VERBOSE, "%s: set_vfoA_fast is available=%s\n", __func__, + value); + } + else + { + rig_debug(RIG_DEBUG_VERBOSE, "%s: set_vfoA_fast is not available\n", __func__); + } + /* see if get_bwA is available */ retval = flrig_transaction(rig, "rig.get_bwA", NULL, value, sizeof(value)); @@ -1120,13 +1137,15 @@ static int flrig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (vfo == RIG_VFO_A) { cmd = "rig.set_vfoA"; - rig_debug(RIG_DEBUG_TRACE, "rig.set_vfoA %.0f\n", freq); + if (priv->has_set_vfoA_fast) cmd = "rig.set_vfoA_fast"; + rig_debug(RIG_DEBUG_TRACE, "%s %.0f\n", cmd, freq); priv->curr_freqA = freq; } else { cmd = "rig.set_vfoB"; - rig_debug(RIG_DEBUG_TRACE, "rig.set_vfoB %.0f\n", freq); + if (priv->has_set_vfoA_fast) cmd = "rig.set_vfoB_fast"; + rig_debug(RIG_DEBUG_TRACE, "%s %.0f\n", cmd, freq); priv->curr_freqB = freq; } diff --git a/rigs/dummy/flrig.h b/rigs/dummy/flrig.h index 06b76781..faec3511 100644 --- a/rigs/dummy/flrig.h +++ b/rigs/dummy/flrig.h @@ -28,8 +28,6 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20210402" - #define EOM "\r" #define TRUE 1 #define FALSE 0 commit ca9667a47e39cd6687c215563231a7a23982b43b Merge: a3fe52ea 04b4b83f Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Apr 2 10:28:47 2021 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit a3fe52ea6c8f96e42b0819ee58aff18f76380b41 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Apr 2 10:28:14 2021 -0500 In FlRig make rig.get_xcvr null answer non-fatal diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 4ef18e6d..3e25443e 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -763,27 +763,8 @@ static int flrig_open(RIG *rig) if (retval != RIG_OK) { - rig_debug(RIG_DEBUG_ERR, "%s: get_xcvr failed: %s\n", __func__, + rig_debug(RIG_DEBUG_ERR, "%s: get_xcvr failed,,,not fatal: %s\n", __func__, rigerror(retval)); - RETURNFUNC(retval); - } - - retval = flrig_transaction(rig, "rig.get_xcvr", NULL, value, sizeof(value)); - - if (retval != RIG_OK) - { - rig_debug(RIG_DEBUG_ERR, "%s: get_xcvr failed: %s\n", __func__, - rigerror(retval)); - RETURNFUNC(retval); - } - - retval = flrig_transaction(rig, "rig.get_xcvr", NULL, value, sizeof(value)); - - if (retval != RIG_OK) - { - rig_debug(RIG_DEBUG_ERR, "%s: get_xcvr failed: %s\n", __func__, - rigerror(retval)); - RETURNFUNC(retval); } strncpy(priv->info, value, sizeof(priv->info)); diff --git a/rigs/dummy/flrig.h b/rigs/dummy/flrig.h index 59f9a975..06b76781 100644 --- a/rigs/dummy/flrig.h +++ b/rigs/dummy/flrig.h @@ -28,7 +28,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20210331" +#define BACKEND_VER "20210402" #define EOM "\r" #define TRUE 1 commit 04b4b83f15564f020106a0e02e07a4e9a27f0fd0 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Apr 2 08:19:15 2021 -0500 Add a ptt check to ensure ptt is off for FTDX3000 and FTDX5000 Will wait up to 300ms for PTT off to occur Should help prevent trying to set freq while ptt is on https://github.com/Hamlib/Hamlib/issues/639 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 9dad47bc..8c601c8a 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -806,13 +806,26 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (is_ftdx3000 || is_ftdx5000) { // we have a few rigs that can't set freq while PTT_ON + // so we'll try a few times to see if we just need to wait a bit + // 3 retries should be about 400ms -- hopefully more than enough ptt_t ptt; + int retry = 3; - if (RIG_OK != (err = newcat_get_ptt(rig, vfo, &ptt))) + do { - ERRMSG(err, "newcat_set_cmd failed"); - RETURNFUNC(err); + if (RIG_OK != (err = newcat_get_ptt(rig, vfo, &ptt))) + { + ERRMSG(err, "newcat_set_cmd failed"); + RETURNFUNC(err); + } + + if (ptt == RIG_PTT_ON) + { + rig_debug(RIG_DEBUG_WARN, "%s: ptt still on...retry#%d\n", __func__, retry); + hl_usleep(100 * 1000); // 100ms pause if ptt still on + } } + while (err == RIG_OK && ptt == RIG_PTT_ON && retry-- > 0); if (ptt) { return RIG_ENTARGET; } } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index f13ca362..3c7b5e38 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20210327" +#define NEWCAT_VER "20210330" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit c5b0b97383bf86463285ee4ace85929d5c0dd5a3 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Apr 2 08:07:26 2021 -0500 Add comment to RIG_TARGETABLE_VFO https://github.com/Hamlib/Hamlib/issues/643 diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index fbb76171..57421e3a 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -491,7 +491,7 @@ typedef unsigned int vfo_t; //! @cond Doxygen_Suppress #define RIG_TARGETABLE_NONE 0 #define RIG_TARGETABLE_FREQ (1<<0) -#define RIG_TARGETABLE_MODE (1<<1) +#define RIG_TARGETABLE_MODE (1<<1) // mode by vfo or same mode on both vfos #define RIG_TARGETABLE_PURE (1<<2) // deprecated -- not used -- reuse it #define RIG_TARGETABLE_TONE (1<<3) #define RIG_TARGETABLE_FUNC (1<<4) commit 0794e6e1e65dfb4c8dc2c50bb974d48f57d8c50b Merge: 33f299d1 8e1fae4e Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Apr 2 08:04:37 2021 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 33f299d16d83e27c9c19221caa65946b13d486a1 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Apr 2 08:03:13 2021 -0500 Change get_vfo_info return VFOA cached mode/width when TARGETABLE_VFO is false https://github.com/Hamlib/Hamlib/issues/643 diff --git a/src/rig.c b/src/rig.c index c4813acb..3340019f 100644 --- a/src/rig.c +++ b/src/rig.c @@ -5999,9 +5999,17 @@ int HAMLIB_API rig_get_vfo_info(RIG *rig, vfo_t vfo, freq_t *freq, if (retval != RIG_OK) { RETURNFUNC(retval); } - retval = rig_get_mode(rig, vfo, mode, width); + if ((vfo == RIG_VFO_B || vfo == RIG_VFO_SUB) && (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE)) + { + retval = rig_get_mode(rig, vfo, mode, width); - if (retval != RIG_OK) { RETURNFUNC(retval); } + if (retval != RIG_OK) { RETURNFUNC(retval); } + } + else // we'll just us VFOA so we don't swap vfos -- freq is what's important + { + *mode = rig->state.cache.modeMainA; + *width = rig->state.cache.widthMainA; + } // we should only need to ask for VFO_CURR to minimize display swapping retval = rig_get_split(rig, RIG_VFO_CURR, split); ----------------------------------------------------------------------- Summary of changes: include/hamlib/rig.h | 2 +- rigs/dummy/flrig.c | 50 +++++++++++++++++++++++++------------------------- rigs/dummy/flrig.h | 2 -- rigs/kenwood/kenwood.c | 4 +++- rigs/kenwood/kenwood.h | 2 +- rigs/yaesu/newcat.c | 19 ++++++++++++++++--- rigs/yaesu/newcat.h | 2 +- src/rig.c | 12 ++++++++++-- 8 files changed, 57 insertions(+), 36 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-04-01 22:57: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 8e1fae4ea44fd47f585262f34abd82f9eba48c9e (commit) via ac5a94a6f19338bee22d7036dcf6225b7979f1b0 (commit) via ca090e258c9987ddfe4ea21c518ef626110d0a07 (commit) via 42c842c1a56c8b6be67dfa467e050a0e36ec9d03 (commit) via da46e7cbdffd42675b85b96315a82f477bbec4f1 (commit) via bcb3aaf162c8b1bc97716263a93c551cb7f211ee (commit) via 92a4b76c0bd8627c80eb48a31205a4ff982d48df (commit) via c6608569fcd07895d2a1a8f523b8851fd55e3957 (commit) via 36fbb266559f6945d59da5527771a153a3a9cb06 (commit) via ebbf96efacb82289a7c8752dcf8c3c3fc302b0d1 (commit) via 169c0ed2b59db5b6f1591ba03a35b3971bb11112 (commit) via b696391a66d2f2a5a521ef40f2d1f231ce5a7f4b (commit) via b16eb6ac425d165028e1a076b5ee593dc840298a (commit) via ea269b224c939a7772380d18ffc3defa56f7be11 (commit) via 1bac47ecc140c9c2911b93c5c00f63742b7f1992 (commit) via dcf7d10b253cd27921c68196f5b642b1e89982d5 (commit) via fffaf27f872701fa8469c68194d0dba02e3d2fc0 (commit) via 91527ccd54b85d6db4bee71b47728c7dec60f816 (commit) via 3317dd3d7a0f7eab99ad8c71b7df17ed3a01ec1d (commit) via 0063cb7549a7393957a80bb4010864adda88b727 (commit) from e70d33f59db41d586d76a7db2d6a3427019f7325 (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 8e1fae4ea44fd47f585262f34abd82f9eba48c9e Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Apr 1 08:02:49 2021 -0500 Fix rig_set_split_freq in rig.c -- was not setting freq at all for non-targetable rigs https://github.com/Hamlib/Hamlib/issues/640 diff --git a/src/rig.c b/src/rig.c index f8ab6d0e..14ab3cfd 100644 --- a/src/rig.c +++ b/src/rig.c @@ -3605,22 +3605,19 @@ int HAMLIB_API rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) do { -#if 0 // this verification seems to be causing bad behavior on some reigs - + // doing get_freq seems to break on some rigs that can't read freq immediately after set if (caps->set_split_freq) { retcode = caps->set_split_freq(rig, vfo, tx_freq); - rig_get_freq(rig, vfo, &tfreq); + //rig_get_freq(rig, vfo, &tfreq); } else { retcode = rig_set_freq(rig, RIG_VFO_CURR, tx_freq); - rig_get_freq(rig, vfo, &tfreq); + //rig_get_freq(rig, vfo, &tfreq); } -#else tfreq = tx_freq; -#endif } while (tfreq != tx_freq && retry-- > 0 && retcode == RIG_OK); commit ac5a94a6f19338bee22d7036dcf6225b7979f1b0 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Apr 1 07:57:49 2021 -0500 Fix debug statement in rig.c diff --git a/src/rig.c b/src/rig.c index 77160795..f8ab6d0e 100644 --- a/src/rig.c +++ b/src/rig.c @@ -4042,7 +4042,7 @@ int HAMLIB_API rig_set_split_freq_mode(RIG *rig, // in split mode we alwasy use VFOB // in the future we may start using RIG_VFO_TX and let the backend figure out what VFO to use vfo = RIG_VFO_B; // in split mode we always use VFOB - rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s, tx_freq=%.0f, tx_mode=%s, tx_width=%d\n", __func__, rig_strvfo(vfo), tx_freq, rig_strvfo(tx_mode), (int)tx_width); + rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s, tx_freq=%.0f, tx_mode=%s, tx_width=%d\n", __func__, rig_strvfo(vfo), tx_freq, rig_strrmode(tx_mode), (int)tx_width); if (caps->set_split_freq_mode) { commit ca090e258c9987ddfe4ea21c518ef626110d0a07 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Mar 31 22:55:36 2021 -0500 Force rig_set_split_freq_mode to use VFOB https://github.com/Hamlib/Hamlib/issues/640 diff --git a/src/rig.c b/src/rig.c index f229fb09..77160795 100644 --- a/src/rig.c +++ b/src/rig.c @@ -4039,6 +4039,10 @@ int HAMLIB_API rig_set_split_freq_mode(RIG *rig, caps = rig->caps; + // in split mode we alwasy use VFOB + // in the future we may start using RIG_VFO_TX and let the backend figure out what VFO to use + vfo = RIG_VFO_B; // in split mode we always use VFOB + rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s, tx_freq=%.0f, tx_mode=%s, tx_width=%d\n", __func__, rig_strvfo(vfo), tx_freq, rig_strvfo(tx_mode), (int)tx_width); if (caps->set_split_freq_mode) { commit 42c842c1a56c8b6be67dfa467e050a0e36ec9d03 Merge: da46e7cb bcb3aaf1 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Mar 31 22:17:09 2021 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit da46e7cbdffd42675b85b96315a82f477bbec4f1 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Mar 31 22:16:21 2021 -0500 Remove 3.8 python check from configure.ac to enable Mac python bindings work on python 3.8/3.9 https://github.com/Hamlib/Hamlib/issues/642 diff --git a/configure.ac b/configure.ac index 5c49ee4d..4ba505b3 100644 --- a/configure.ac +++ b/configure.ac @@ -578,12 +578,6 @@ dnl Determine whether to install pytest.py or py3test.py to $(docdir)/examples AM_PYTHON_CHECK_VERSION([${PYTHON}], [3.0], [pyver_3="yes"], [pyver_3="no"]) AM_CONDITIONAL([PYVER_3], [test x"${pyver_3}" = x"yes"]) -dnl Determine whether to link libpython as it is unneeded for Python >= 3.8 -AM_PYTHON_CHECK_VERSION([${PYTHON}], [3.8], [pyver_3_8="yes"], [pyver_3_8="no"]) -AS_IF([test x"${pyver_3_8}" = "xyes"],[ - PYTHON_LIBS="" -]) - # Tcl binding AC_MSG_CHECKING([Whether to build Tcl bindings]) AC_ARG_WITH([tcl-binding], commit bcb3aaf162c8b1bc97716263a93c551cb7f211ee Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Mar 31 16:37:46 2021 -0500 Increase flrig timeout to 2 seconds diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 9efa9ca2..4ef18e6d 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -129,7 +129,7 @@ const struct rig_caps flrig_caps = .port_type = RIG_PORT_NETWORK, .write_delay = 0, .post_write_delay = 0, - .timeout = 1000, + .timeout = 2000, .retry = 2, .has_get_func = RIG_FUNC_NONE, diff --git a/rigs/dummy/flrig.h b/rigs/dummy/flrig.h index 464a8db0..59f9a975 100644 --- a/rigs/dummy/flrig.h +++ b/rigs/dummy/flrig.h @@ -28,7 +28,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20210315" +#define BACKEND_VER "20210331" #define EOM "\r" #define TRUE 1 commit 92a4b76c0bd8627c80eb48a31205a4ff982d48df Merge: ebbf96ef c6608569 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Mar 31 16:29:03 2021 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit c6608569fcd07895d2a1a8f523b8851fd55e3957 Merge: 36fbb266 169c0ed2 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Mar 31 11:41:06 2021 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 36fbb266559f6945d59da5527771a153a3a9cb06 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Mar 31 11:40:48 2021 -0500 Fix parsing of targetable_vfo in netrigctl.c diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index c8de5277..575fa567 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -584,9 +584,8 @@ static int netrigctl_open(RIG *rig) } else if (strcmp(setting, "targetable_vfo") == 0) { - int has = strtol(value, NULL, 0); - - if (!has) { rig->caps->targetable_vfo = strtol(value, NULL, 0); } + rig->caps->targetable_vfo = strtol(value, NULL, 0); + rig_debug(RIG_DEBUG_ERR, "%s: targetable_vfo=0x%2x\n", __func__, rig->caps->targetable_vfo); } else if (strcmp(setting, "has_set_vfo") == 0) { commit ebbf96efacb82289a7c8752dcf8c3c3fc302b0d1 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Mar 31 07:41:16 2021 -0500 Fix spelling error in rig.c diff --git a/src/rig.c b/src/rig.c index c4813acb..f229fb09 100644 --- a/src/rig.c +++ b/src/rig.c @@ -3571,7 +3571,7 @@ int HAMLIB_API rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) if (retcode != RIG_OK) { RETURNFUNC(retcode); } -#if 0 // this verification seems to be causing bad behavior on some reigs +#if 0 // this verification seems to be causing bad behavior on some rigs retcode = rig_get_freq(rig, tx_vfo, &tfreq); #else tfreq = tx_freq; commit 169c0ed2b59db5b6f1591ba03a35b3971bb11112 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Mar 30 23:05:04 2021 -0500 Fix rig_set_split_vfo to use tx_vfo on non-vfo swap check https://github.com/Hamlib/Hamlib/issues/640 diff --git a/src/rig.c b/src/rig.c index ffa9560e..c4813acb 100644 --- a/src/rig.c +++ b/src/rig.c @@ -3535,10 +3535,20 @@ int HAMLIB_API rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) caps = rig->caps; + /* Use previously setup TxVFO */ + if (vfo == RIG_VFO_CURR || vfo == RIG_VFO_TX) + { + tx_vfo = rig->state.tx_vfo; + } + else + { + tx_vfo = vfo; + } + if (caps->set_split_freq && (vfo == RIG_VFO_CURR || vfo == RIG_VFO_TX - || vfo == rig->state.current_vfo)) + || tx_vfo == rig->state.current_vfo)) { retcode = caps->set_split_freq(rig, vfo, tx_freq); RETURNFUNC(retcode); @@ -3550,16 +3560,6 @@ int HAMLIB_API rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) /* Assisted mode */ curr_vfo = rig->state.current_vfo; - /* Use previously setup TxVFO */ - if (vfo == RIG_VFO_CURR || vfo == RIG_VFO_TX) - { - tx_vfo = rig->state.tx_vfo; - } - else - { - tx_vfo = vfo; - } - if (caps->set_freq && (caps->targetable_vfo & RIG_TARGETABLE_FREQ)) { int retry = 3; commit b696391a66d2f2a5a521ef40f2d1f231ce5a7f4b Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Mar 30 15:40:17 2021 -0500 Try another method of setting Icom default vfo diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 7316a06d..5ad415ba 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -45,6 +45,7 @@ #include "frame.h" static int set_vfo_curr(RIG *rig, vfo_t vfo, vfo_t curr_vfo); +static int icom_set_default_vfo(RIG *rig); const cal_table_float_t icom_default_swr_cal = { @@ -804,7 +805,7 @@ icom_rig_open(RIG *rig) } } - rig_set_vfo(rig,RIG_VFO_MAIN_A); // set rig to default vfo + icom_set_default_vfo(rig); priv->poweron = 1; if (rig->caps->has_get_func & RIG_FUNC_SATMODE) @@ -877,7 +878,7 @@ icom_rig_close(RIG *rig) * So they will get defaults of Main/VFOA as the selected VFO * and we force that selection */ -int icom_set_default_vfo(RIG *rig) +static int icom_set_default_vfo(RIG *rig) { int retval; commit b16eb6ac425d165028e1a076b5ee593dc840298a Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Mar 30 14:48:41 2021 -0500 Force Icom rigs to MAIN_A on open diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index cb325b5d..7316a06d 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -804,6 +804,7 @@ icom_rig_open(RIG *rig) } } + rig_set_vfo(rig,RIG_VFO_MAIN_A); // set rig to default vfo priv->poweron = 1; if (rig->caps->has_get_func & RIG_FUNC_SATMODE) commit ea269b224c939a7772380d18ffc3defa56f7be11 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Mar 30 14:43:57 2021 -0500 Fix vfo selection for Icom rigs when in split mode https://github.com/Hamlib/Hamlib/issues/637 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 47ce5409..cb325b5d 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2241,6 +2241,8 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) { // If we're being asked for A/Main but we are a MainA/MainB rig change it vfo = RIG_VFO_MAIN; + + if (rig->state.cache.split == RIG_SPLIT_ON) { vfo = RIG_VFO_A; } } else if ((vfo == RIG_VFO_B || vfo == RIG_VFO_SUB) && VFO_HAS_DUAL) { @@ -2252,6 +2254,7 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) { vfo = RIG_VFO_SUB_A; } + else if (rig->state.cache.split == RIG_SPLIT_ON) { vfo = RIG_VFO_B; } } else if ((vfo == RIG_VFO_A || vfo == RIG_VFO_B) && !VFO_HAS_A_B && VFO_HAS_MAIN_SUB) commit 1bac47ecc140c9c2911b93c5c00f63742b7f1992 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Mar 30 12:04:16 2021 -0500 Add VFO abtstraction info diff --git a/VFOs.txt b/VFOs.txt new file mode 100644 index 00000000..0e55edfe --- /dev/null +++ b/VFOs.txt @@ -0,0 +1,23 @@ +VFO Abstraction +2021-03-30 +Mike Black W9MDB + +Main_A + RIG_VFO_A + RIG_VFO_MAIN + RIG_VFO_MAIN_A +Main_B + RIG_VFO_B + RIG_VFO_SUB -- for single VFO rig or dual VFO not in satmode + RIG_VFO_MAIN_B +Sub_A + RIG_VFO_SUB -- for dual VFO when in satmode + RIG_VFO_SUB_A +Sub_B + RIG_VFO_SUB_B -- unknown use for this so far but has set/get functions + +Main_C + RIG_VFO_C -- - unknown use for this so far but has set/get functions + RIG_VFO_MAIN_C -- - unknown use for this so far but has set/get functions +Sub_C + RIG_VFO_SUB_C -- unknown use for this so far but has set/get functions commit dcf7d10b253cd27921c68196f5b642b1e89982d5 Merge: fffaf27f 91527ccd Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Mar 30 11:49:25 2021 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit fffaf27f872701fa8469c68194d0dba02e3d2fc0 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Mar 30 11:48:25 2021 -0500 Change icom.c to use Main instead of Main_A and Sub instead of Main_B https://github.com/Hamlib/Hamlib/issues/637 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 0afebe10..47ce5409 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2240,12 +2240,12 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) else if ((vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) && VFO_HAS_DUAL) { // If we're being asked for A/Main but we are a MainA/MainB rig change it - vfo = RIG_VFO_MAIN_A; + vfo = RIG_VFO_MAIN; } else if ((vfo == RIG_VFO_B || vfo == RIG_VFO_SUB) && VFO_HAS_DUAL) { // If we're being asked for B/Sub but we are a MainA/MainB rig change it - vfo = RIG_VFO_MAIN_B; + vfo = RIG_VFO_SUB; // If we're in satmode for rigs like IC9700 we want the 2nd VFO if (rig->state.cache.satmode) diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index c43fc484..286e6536 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -30,7 +30,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20210326" +#define BACKEND_VER "20210330" /* * defines used by comp_cal_str in rig.c commit 91527ccd54b85d6db4bee71b47728c7dec60f816 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Mar 30 11:25:13 2021 -0500 Fix merge error in ft857.c https://github.com/Hamlib/Hamlib/issues/636 diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index b4d6df76..3b0768ef 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -155,11 +155,7 @@ const struct rig_caps ft857_caps = RIG_MODEL(RIG_MODEL_FT857), .model_name = "FT-857", .mfg_name = "Yaesu", -<<<<<<< HEAD .version = "20210330.0", -======= - .version = "20210329.0", ->>>>>>> e70d33f59db41d586d76a7db2d6a3427019f7325 .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 3317dd3d7a0f7eab99ad8c71b7df17ed3a01ec1d Merge: 0063cb75 e70d33f5 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Mar 30 10:54:39 2021 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib diff --cc rigs/yaesu/ft857.c index eb133ba9,f4602deb..b4d6df76 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@@ -155,7 -155,7 +155,11 @@@ const struct rig_caps ft857_caps RIG_MODEL(RIG_MODEL_FT857), .model_name = "FT-857", .mfg_name = "Yaesu", ++<<<<<<< HEAD + .version = "20210330.0", ++======= + .version = "20210329.0", ++>>>>>>> e70d33f59db41d586d76a7db2d6a3427019f7325 .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 0063cb7549a7393957a80bb4010864adda88b727 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Mar 30 10:53:47 2021 -0500 In ft857.c add a 200ms delay during set_ptt OFF -- seems to take a while to come out of TX https://github.com/Hamlib/Hamlib/issues/636 diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index 0ed04f5e..eb133ba9 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 = "20210221.0", + .version = "20210330.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1083,6 +1083,7 @@ int ft857_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) } n = ft857_send_cmd(rig, index); + if (ptt == RIG_PTT_OFF) hl_usleep(200*1000); // FT857 takes a bit to come out of PTT rig_force_cache_timeout(&((struct ft857_priv_data *) rig->state.priv)->tx_status_tv); ----------------------------------------------------------------------- Summary of changes: VFOs.txt | 23 +++++++++++++++++++++++ configure.ac | 6 ------ rigs/dummy/flrig.c | 2 +- rigs/dummy/flrig.h | 2 +- rigs/dummy/netrigctl.c | 5 ++--- rigs/icom/icom.c | 11 ++++++++--- rigs/icom/icom.h | 2 +- rigs/yaesu/ft857.c | 3 ++- src/rig.c | 37 +++++++++++++++++++------------------ 9 files changed, 57 insertions(+), 34 deletions(-) create mode 100644 VFOs.txt hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-03-30 04:49:16
|
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 e70d33f59db41d586d76a7db2d6a3427019f7325 (commit) via ff659d9c749d0a3d516e512c4bcbdefeca49be4a (commit) via f6dc32778ba95fecd11328def654d77924237580 (commit) via f55fcd9353902f87de3c64bd4475b76d8726f84c (commit) via d18f540b3561cb13a3db1dff1f7f868fb8a12cde (commit) via 0f0dad177b591c974aaf8b73a416a4780ae3a628 (commit) from 89da1b934199d04ae7c32ab893116d7721dbe367 (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 e70d33f59db41d586d76a7db2d6a3427019f7325 Merge: ff659d9c f6dc3277 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Mar 29 23:40:20 2021 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit ff659d9c749d0a3d516e512c4bcbdefeca49be4a Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Mar 29 23:39:29 2021 -0500 Reverse MD6/MD9 for k3.c https://github.com/Hamlib/Hamlib/issues/638 diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 2b6042ce..de9594c0 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -183,7 +183,7 @@ const struct rig_caps k3_caps = RIG_MODEL(RIG_MODEL_K3), .model_name = "K3", .mfg_name = "Elecraft", - .version = BACKEND_VER ".10", + .version = BACKEND_VER ".11", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1102,13 +1102,13 @@ int k3_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) switch (mode) { case RIG_MODE_PKTLSB: - mode = RIG_MODE_RTTY; // in "DT0" Subband RIG_MODE_RTTYR = USB and RIG_MODE_RTTY = LSB + mode = RIG_MODE_RTTYR; // in "DT0" Subband RIG_MODE_RTTYR = USB and RIG_MODE_RTTY = LSB snprintf(cmd_m, sizeof(cmd_m), "DT0"); /* DATA A mode - DATA (REV) on LSB optimized for HF Packet, VFO dial is suppressed carrier QRG */ break; case RIG_MODE_PKTUSB: - mode = RIG_MODE_RTTYR; // in "DT0" Subband RIG_MODE_RTTYR = USB and RIG_MODE_RTTY = LSB + mode = RIG_MODE_RTTY; // in "DT0" Subband RIG_MODE_RTTYR = USB and RIG_MODE_RTTY = LSB snprintf(cmd_m, sizeof(cmd_m), "DT0"); /* DATA A mode - DATA on USB general, VFO dial is suppressed carrier QRG */ break; commit f6dc32778ba95fecd11328def654d77924237580 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Mar 29 13:01:26 2021 -0500 Reduce verbosity in iofunc.c diff --git a/src/iofunc.c b/src/iofunc.c index aefa48df..c7008f5e 100644 --- a/src/iofunc.c +++ b/src/iofunc.c @@ -247,6 +247,7 @@ static ssize_t port_read(hamlib_port_t *p, void *buf, size_t count) int i; ssize_t ret; + //ENTERFUNC; // too verbose /* * Since WIN32 does its special serial read, we have * to catch the microHam case to do just "read". @@ -273,7 +274,8 @@ static ssize_t port_read(hamlib_port_t *p, void *buf, size_t count) } } - RETURNFUNC(ret); + //RETURNFUNC(ret); // too verbose + return ret; } else if (p->type.rig == RIG_PORT_NETWORK || p->type.rig == RIG_PORT_UDP_NETWORK) commit f55fcd9353902f87de3c64bd4475b76d8726f84c Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Mar 29 12:45:45 2021 -0500 Remove checks for VFO_CURR from FT847 FT857 FT897 -- we don't care what VFO is requested diff --git a/rigs/yaesu/ft847.c b/rigs/yaesu/ft847.c index 1af53c82..9ac8e081 100644 --- a/rigs/yaesu/ft847.c +++ b/rigs/yaesu/ft847.c @@ -1346,11 +1346,6 @@ int ft847_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return -RIG_ENIMPL; } - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - switch (level) { case RIG_LEVEL_STRENGTH: @@ -1483,11 +1478,6 @@ int ft847_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift) { unsigned char cmd_index; /* index of sequence to send */ - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - switch (rptr_shift) { case RIG_RPT_SHIFT_NONE: @@ -1518,11 +1508,6 @@ int ft847_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs) return -RIG_ENIMPL; } - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - memcpy(p_cmd, &ncmd[FT_847_NATIVE_CAT_SET_RPT_OFFSET].nseq, YAESU_CMD_LENGTH); diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index 36e8fa13..f4602deb 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -564,11 +564,6 @@ 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 && vfo != RIG_VFO_A) - { - return -RIG_ENTARGET; - } - if (check_cache_timeout(&p->fm_status_tv)) { int n; @@ -661,11 +656,6 @@ int ft857_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - if (check_cache_timeout(&p->fm_status_tv)) { int n; @@ -688,11 +678,6 @@ int ft857_get_split_freq_mode(RIG *rig, vfo_t vfo, freq_t *freq, rmode_t *mode, rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); - if (vfo != RIG_VFO_CURR && vfo != RIG_VFO_TX) - { - return -RIG_ENTARGET; - } - retcode = ft857_send_cmd(rig, FT857_NATIVE_CAT_SET_VFOAB); if (RIG_OK != retcode) @@ -719,11 +704,6 @@ int ft857_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - if (check_cache_timeout(&p->tx_status_tv)) if ((n = ft857_get_status(rig, FT857_NATIVE_CAT_GET_TX_STATUS)) < 0) { @@ -756,11 +736,6 @@ int ft857_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - if (check_cache_timeout(&p->tx_status_tv)) { int n; @@ -831,11 +806,6 @@ int ft857_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - switch (level) { case RIG_LEVEL_STRENGTH: @@ -857,11 +827,6 @@ int ft857_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - if (check_cache_timeout(&p->rx_status_tv)) { int n; @@ -891,11 +856,6 @@ int ft857_set_freq(RIG *rig, vfo_t vfo, freq_t freq) rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "ft857: requested freq = %"PRIfreq" Hz\n", freq); /* fill in the frequency */ @@ -913,14 +873,6 @@ int ft857_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); - if (vfo != RIG_VFO_CURR) - { - rig_debug(RIG_DEBUG_ERR, "%s: must have RIG_VFO_CURR, got %s\n", - rig_strvfo(RIG_VFO_CURR), rig_strvfo(vfo)); - - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "%s: generic mode = %s\n", __func__, rig_strrmode(mode)); @@ -986,11 +938,6 @@ int ft857_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t freq, rmode_t mode, rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); - if (vfo != RIG_VFO_CURR && vfo != RIG_VFO_TX) - { - return -RIG_ENTARGET; - } - retcode = rig_set_split_vfo(rig, RIG_VFO_A, RIG_SPLIT_ON, RIG_VFO_B); if (retcode != RIG_OK) { RETURNFUNC(retcode); } @@ -1054,13 +1001,6 @@ int ft857_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - - rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - switch (ptt) { case RIG_PTT_ON: @@ -1092,11 +1032,6 @@ int ft857_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) { rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - switch (func) { case RIG_FUNC_LOCK: @@ -1165,11 +1100,6 @@ int ft857_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code) rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "ft857: set DCS code (%u)\n", code); if (code == 0) @@ -1196,11 +1126,6 @@ int ft857_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone) rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "ft857: set CTCSS tone (%.1f)\n", tone / 10.0); if (tone == 0) @@ -1227,11 +1152,6 @@ int ft857_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code) rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "ft857: set DCS sql (%u)\n", code); if (code == 0) @@ -1258,11 +1178,6 @@ int ft857_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone) rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "ft857: set CTCSS sql (%.1f)\n", tone / 10.0); if (tone == 0) @@ -1286,11 +1201,6 @@ int ft857_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t shift) { rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "ft857: set repeter shift = %i\n", shift); switch (shift) @@ -1314,11 +1224,6 @@ int ft857_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "ft857: set repeter offs = %li\n", offs); /* fill in the offset freq */ @@ -1334,11 +1239,6 @@ int ft857_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "ft857: set rit = %li)\n", rit); /* fill in the RIT freq */ diff --git a/rigs/yaesu/ft897.c b/rigs/yaesu/ft897.c index 95b95134..ccc40395 100644 --- a/rigs/yaesu/ft897.c +++ b/rigs/yaesu/ft897.c @@ -659,12 +659,6 @@ int ft897_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - // can only deal with VFO_CURR and VFO_A - if (vfo != RIG_VFO_CURR && vfo != RIG_VFO_A) - { - return -RIG_ENTARGET; - } - if (check_cache_timeout(&p->fm_status_tv)) { int n; @@ -686,11 +680,6 @@ int ft897_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - if (check_cache_timeout(&p->fm_status_tv)) { int n; @@ -775,11 +764,6 @@ int ft897_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - if (check_cache_timeout(&p->tx_status_tv)) { int n; @@ -898,11 +882,6 @@ int ft897_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - switch (level) { case RIG_LEVEL_STRENGTH: @@ -930,11 +909,6 @@ int ft897_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - if (check_cache_timeout(&p->rx_status_tv)) { int n; @@ -1009,11 +983,6 @@ int ft897_set_freq(RIG *rig, vfo_t vfo, freq_t freq) rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "%s: requested freq = %"PRIfreq" Hz\n", __func__, freq); @@ -1033,11 +1002,6 @@ int ft897_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "%s: generic mode = %s\n", __func__, rig_strrmode(mode)); @@ -1098,13 +1062,6 @@ int ft897_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - - rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - switch (ptt) { case RIG_PTT_ON: @@ -1138,13 +1095,6 @@ int ft897_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - - rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - switch (op) { case RIG_OP_TOGGLE: @@ -1173,13 +1123,6 @@ int ft897_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - - rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - switch (split) { case RIG_SPLIT_OFF: @@ -1214,11 +1157,6 @@ int ft897_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - if (check_cache_timeout(&p->tx_status_tv)) if ((n = ft897_get_status(rig, FT897_NATIVE_CAT_GET_TX_STATUS)) < 0) { @@ -1249,11 +1187,6 @@ int ft897_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) { rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - switch (func) { case RIG_FUNC_LOCK: @@ -1322,11 +1255,6 @@ int ft897_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code) rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "ft897: set DCS code (%u)\n", code); if (code == 0) @@ -1353,11 +1281,6 @@ int ft897_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone) rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "ft897: set CTCSS tone (%.1f)\n", tone / 10.0); if (tone == 0) @@ -1384,11 +1307,6 @@ int ft897_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code) rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "ft897: set DCS sql (%u)\n", code); if (code == 0) @@ -1415,11 +1333,6 @@ int ft897_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone) rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "ft897: set CTCSS sql (%.1f)\n", tone / 10.0); if (tone == 0) @@ -1443,11 +1356,6 @@ int ft897_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t shift) { rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "ft897: set repeter shift = %i\n", shift); switch (shift) @@ -1471,11 +1379,6 @@ int ft897_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "ft897: set repeter offs = %li\n", offs); /* fill in the offset freq */ @@ -1491,11 +1394,6 @@ int ft897_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - rig_debug(RIG_DEBUG_VERBOSE, "ft897: set rit = %li)\n", rit); /* fill in the RIT freq */ commit d18f540b3561cb13a3db1dff1f7f868fb8a12cde Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Mar 29 12:40:11 2021 -0500 Fix FT857 unnecessary vfo check in ft857_set_split_freq_mode https://github.com/Hamlib/Hamlib/issues/636 diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index 0ed04f5e..36e8fa13 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 = "20210221.0", + .version = "20210329.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1021,13 +1021,6 @@ int ft857_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); - if (vfo != RIG_VFO_CURR) - { - return -RIG_ENTARGET; - } - - rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - switch (split) { case RIG_SPLIT_ON: commit 0f0dad177b591c974aaf8b73a416a4780ae3a628 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Mar 28 14:35:20 2021 -0500 Reduce timeout in flrig.c -- timeouts causing problems with Log4OMV2 diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 5dc5bfd1..9efa9ca2 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -129,8 +129,8 @@ const struct rig_caps flrig_caps = .port_type = RIG_PORT_NETWORK, .write_delay = 0, .post_write_delay = 0, - .timeout = 5000, - .retry = 5, + .timeout = 1000, + .retry = 2, .has_get_func = RIG_FUNC_NONE, .has_set_func = RIG_FUNC_NONE, ----------------------------------------------------------------------- Summary of changes: rigs/dummy/flrig.c | 4 +- rigs/kenwood/k3.c | 6 +-- rigs/yaesu/ft847.c | 15 -------- rigs/yaesu/ft857.c | 109 +---------------------------------------------------- rigs/yaesu/ft897.c | 102 ------------------------------------------------- src/iofunc.c | 4 +- 6 files changed, 9 insertions(+), 231 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-03-28 17:32: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 89da1b934199d04ae7c32ab893116d7721dbe367 (commit) from 6cc8e5a20fd1d50b80af720a627e72fe978d1c95 (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 89da1b934199d04ae7c32ab893116d7721dbe367 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Mar 28 12:31:33 2021 -0500 Revert kenwood RTTY/RTTYR and fix k3.c's DT mode to match it https://github.com/Hamlib/Hamlib/issues/576 diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 2ad5cfe0..2b6042ce 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -1116,13 +1116,13 @@ int k3_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_RTTY: mode = RIG_MODE_RTTY; // in "DT1" Subband RIG_MODE_RTTY = LSB and RIG_MODE_RTTYR = USB snprintf(cmd_m, sizeof(cmd_m), - "DT1"); /* FSK D mode - direct FSK on LSB optimized for RTTY, VFO dial is MARK */ + "DT2"); /* FSK D mode - direct FSK on LSB optimized for RTTY, VFO dial is MARK */ break; case RIG_MODE_RTTYR: mode = RIG_MODE_RTTYR; // in "DT2" Subband RIG_MODE_RTTY = LSB and RIG_MODE_RTTYR = USB snprintf(cmd_m, sizeof(cmd_m), - "DT2"); /* FSK D mode - direct FSK keying, LSB is "normal", VFO dial is MARK */ + "DT1"); /* FSK D mode - direct FSK keying, LSB is "normal", VFO dial is MARK */ break; case RIG_MODE_PSK: diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 93d556eb..22e20fe4 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -142,12 +142,10 @@ rmode_t kenwood_mode_table[KENWOOD_MODE_TABLE_MAX] = [3] = RIG_MODE_CW, [4] = RIG_MODE_FM, [5] = RIG_MODE_AM, - // Yes -- RTTYR is Mode 6 RTTY is LSB, RTTYR USB - // FSK mode is mapped the other way round - [6] = RIG_MODE_RTTYR, // FSK Mode + [6] = RIG_MODE_RTTY, // FSK Mode [7] = RIG_MODE_CWR, [8] = RIG_MODE_NONE, /* TUNE mode */ - [9] = RIG_MODE_RTTY, // FSKR Mode + [9] = RIG_MODE_RTTYR, // FSKR Mode [10] = RIG_MODE_PSK, [11] = RIG_MODE_PSKR, [12] = RIG_MODE_PKTLSB, diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index d03c48f4..c1639e5b 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "misc.h" -#define BACKEND_VER "20210326" +#define BACKEND_VER "20210328" #define EOM_KEN ';' #define EOM_TH '\r' ----------------------------------------------------------------------- Summary of changes: rigs/kenwood/k3.c | 4 ++-- rigs/kenwood/kenwood.c | 6 ++---- rigs/kenwood/kenwood.h | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-03-27 22:42:24
|
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 6cc8e5a20fd1d50b80af720a627e72fe978d1c95 (commit) via 753cd792d34ae966fc2b0507540c739ccdd25cf2 (commit) via 3bcdb1c005061cc2fdf678f47660d41d2029a057 (commit) from c0d11bc8b65ff8a23f914b6198d2d7ffbab5091e (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 6cc8e5a20fd1d50b80af720a627e72fe978d1c95 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Mar 27 15:35:12 2021 -0500 Change LIBUSB definitions to cover both conditions https://github.com/Hamlib/Hamlib/issues/634 diff --git a/src/iofunc.c b/src/iofunc.c index 722b629e..aefa48df 100644 --- a/src/iofunc.c +++ b/src/iofunc.c @@ -149,7 +149,7 @@ int HAMLIB_API port_open(hamlib_port_t *p) p->fd = status; break; -#ifdef HAVE_LIBUSB_H +#if defined(HAVE_LIBUSB_H) || defined (HAVE_LIBUSB_1_0_LIBUSB_H) case RIG_PORT_USB: status = usb_port_open(p); @@ -206,7 +206,7 @@ int HAMLIB_API port_close(hamlib_port_t *p, rig_port_t port_type) ret = ser_close(p); break; -#ifdef HAVE_LIBUSB_H +#if defined(HAVE_LIBUSB_H) || defined (HAVE_LIBUSB_1_0_LIBUSB_H) case RIG_PORT_USB: ret = usb_port_close(p); @@ -255,7 +255,7 @@ static ssize_t port_read(hamlib_port_t *p, void *buf, size_t count) */ if (is_uh_radio_fd(p->fd)) { - return( read(p->fd, buf, count); + return read(p->fd, buf, count); } if (p->type.rig == RIG_PORT_SERIAL) @@ -273,7 +273,7 @@ static ssize_t port_read(hamlib_port_t *p, void *buf, size_t count) } } - RETURNFUNC( ret; + RETURNFUNC(ret); } else if (p->type.rig == RIG_PORT_NETWORK || p->type.rig == RIG_PORT_UDP_NETWORK) diff --git a/src/rotator.c b/src/rotator.c index 51787ea7..aec502e0 100644 --- a/src/rotator.c +++ b/src/rotator.c @@ -61,7 +61,7 @@ #include <hamlib/rotator.h> #include "serial.h" #include "parallel.h" -#ifdef HAVE_LIBUSB_H +#if defined(HAVE_LIB_USB_H) || defined(HAMB_LIBUSB_1_0_LIBUSB_H) #include "usb_port.h" #endif #include "network.h" @@ -418,7 +418,7 @@ int HAMLIB_API rot_open(ROT *rot) rs->rotport.fd = status; break; -#ifdef HAVE_LIBUSB_H +#if defined(HAVE_LIB_USB_H) || defined(HAMB_LIBUSB_1_0_LIBUSB_H) case RIG_PORT_USB: status = usb_port_open(&rs->rotport); @@ -531,7 +531,7 @@ int HAMLIB_API rot_close(ROT *rot) par_close(&rs->rotport); break; -#ifdef HAVE_LIBUSB_H +#if defined(HAVE_LIB_USB_H) || defined(HAMB_LIBUSB_1_0_LIBUSB_H) case RIG_PORT_USB: usb_port_close(&rs->rotport); commit 753cd792d34ae966fc2b0507540c739ccdd25cf2 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Mar 27 15:17:52 2021 -0500 Add debug to iofunc.c https://github.com/Hamlib/Hamlib/issues/635 diff --git a/src/iofunc.c b/src/iofunc.c index b79bcd5c..722b629e 100644 --- a/src/iofunc.c +++ b/src/iofunc.c @@ -64,8 +64,8 @@ int HAMLIB_API port_open(hamlib_port_t *p) { int status; int want_state_delay = 0; - - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + ENTERFUNC; p->fd = -1; @@ -76,7 +76,8 @@ int HAMLIB_API port_open(hamlib_port_t *p) if (status < 0) { - return status; + rig_debug(RIG_DEBUG_ERR, "%s: serial_open status=%d\n", __func__, status); + RETURNFUNC(status); } if (p->parm.serial.rts_state != RIG_SIGNAL_UNSET @@ -89,7 +90,8 @@ int HAMLIB_API port_open(hamlib_port_t *p) if (status != 0) { - return status; + rig_debug(RIG_DEBUG_ERR, "%s: set_rts status=%d\n", __func__, status); + RETURNFUNC(status); } if (p->parm.serial.dtr_state != RIG_SIGNAL_UNSET) @@ -101,7 +103,8 @@ int HAMLIB_API port_open(hamlib_port_t *p) if (status != 0) { - return status; + rig_debug(RIG_DEBUG_ERR, "%s: set_dtr status=%d\n", __func__, status); + RETURNFUNC(status); } /* @@ -120,7 +123,7 @@ int HAMLIB_API port_open(hamlib_port_t *p) if (status < 0) { - return status; + RETURNFUNC(status); } break; @@ -130,7 +133,7 @@ int HAMLIB_API port_open(hamlib_port_t *p) if (status < 0) { - return status; + RETURNFUNC(status); } break; @@ -140,7 +143,7 @@ int HAMLIB_API port_open(hamlib_port_t *p) if (status < 0) { - return -RIG_EIO; + RETURNFUNC(-RIG_EIO); } p->fd = status; @@ -153,7 +156,7 @@ int HAMLIB_API port_open(hamlib_port_t *p) if (status < 0) { - return status; + RETURNFUNC(status); } break; @@ -170,16 +173,16 @@ int HAMLIB_API port_open(hamlib_port_t *p) if (status < 0) { - return status; + RETURNFUNC(status); } break; default: - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -193,7 +196,7 @@ int HAMLIB_API port_close(hamlib_port_t *p, rig_port_t port_type) { int ret = RIG_OK; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (p->fd != -1) { @@ -227,7 +230,7 @@ int HAMLIB_API port_close(hamlib_port_t *p, rig_port_t port_type) p->fd = -1; } - return ret; + RETURNFUNC(ret); } @@ -252,7 +255,7 @@ static ssize_t port_read(hamlib_port_t *p, void *buf, size_t count) */ if (is_uh_radio_fd(p->fd)) { - return read(p->fd, buf, count); + return( read(p->fd, buf, count); } if (p->type.rig == RIG_PORT_SERIAL) @@ -270,7 +273,7 @@ static ssize_t port_read(hamlib_port_t *p, void *buf, size_t count) } } - return ret; + RETURNFUNC( ret; } else if (p->type.rig == RIG_PORT_NETWORK || p->type.rig == RIG_PORT_UDP_NETWORK) commit 3bcdb1c005061cc2fdf678f47660d41d2029a057 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Mar 27 14:55:38 2021 -0500 FIx RFPOWER in kenwood.c so read scale matches input scale https://github.com/Hamlib/Hamlib/issues/630 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index ece488e2..93d556eb 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2805,7 +2805,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) retval = kenwood_get_power_minmax(rig, &power_now, &power_min, &power_max, 1); if (retval != RIG_OK) { RETURNFUNC(retval); } - + power_min = 0; // our return scale is 0-max to match the input scale val->f = (power_now - power_min) / (float)(power_max - power_min); RETURNFUNC(RIG_OK); ----------------------------------------------------------------------- Summary of changes: rigs/kenwood/kenwood.c | 2 +- src/iofunc.c | 37 ++++++++++++++++++++----------------- src/rotator.c | 6 +++--- 3 files changed, 24 insertions(+), 21 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-03-27 15:08:50
|
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 c0d11bc8b65ff8a23f914b6198d2d7ffbab5091e (commit) via c831e32db16d29b7212f85042bce3f3cababcb43 (commit) via 8e89aad2eaa185325356164613c392f6d6901f3b (commit) via 8b82e3f5691b65e8e470247950160b11b41ec40d (commit) from dd156f74e26af017a1ca092135c3c60245018ca8 (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 c0d11bc8b65ff8a23f914b6198d2d7ffbab5091e Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Mar 27 10:07:33 2021 -0500 newcat.c VFO_MEM defaults to VFO_A https://github.com/Hamlib/Hamlib/issues/633 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index cb1039ae..9dad47bc 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -772,6 +772,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { case RIG_VFO_A: case RIG_VFO_MAIN: + case RIG_VFO_MEM: c = 'A'; break; diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 19ea6aa0..f13ca362 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20210309" +#define NEWCAT_VER "20210327" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit c831e32db16d29b7212f85042bce3f3cababcb43 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Mar 26 23:09:36 2021 -0500 Fix icom.c frequency offset when the 0x25 is attempted and fails https://github.com/Hamlib/Hamlib/issues/629 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 082d8869..0afebe10 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1278,7 +1278,7 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) { priv->x25cmdfails = 1; rig_debug(RIG_DEBUG_WARN, - "%s: rig does not support 0x25 CI-V cmd...vfo swapping will occur\n", __func__); + "%s: rig does not support 0x25 CI-V cmd\n", __func__); } freq_len--; // 0x25 cmd is 1 byte longer than 0x03 cmd @@ -1287,6 +1287,7 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) if (priv->x25cmdfails) // then we're doing this the hard way....swap+read { + freqbuf_offset = 1; retval = set_vfo_curr(rig, vfo, rig->state.current_vfo); if (retval != RIG_OK) commit 8e89aad2eaa185325356164613c392f6d6901f3b Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Mar 26 22:32:08 2021 -0500 During newcat.c AG format check reduce retries to zero to speed it up https://github.com/Hamlib/Hamlib/issues/630 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 2fb25aa0..ece488e2 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2816,6 +2816,8 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) // This could be done by rig but easy enough to make it automagic if (priv->ag_format < 0) { + int retry_save = rig->state.rigport.retry; + rig->state.rigport.retry = 0; // speed up this check so no retries rig_debug(RIG_DEBUG_TRACE, "%s: AF format check determination...\n", __func__); // Determine AG format // =-1 == Undetermine @@ -2852,6 +2854,8 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } } } + + rig->state.rigport.retry = retry_save; } rig_debug(RIG_DEBUG_TRACE, "%s: ag_format=%d\n", __func__, priv->ag_format); diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 90dee848..d03c48f4 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "misc.h" -#define BACKEND_VER "20210309" +#define BACKEND_VER "20210326" #define EOM_KEN ';' #define EOM_TH '\r' commit 8b82e3f5691b65e8e470247950160b11b41ec40d Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Mar 26 14:41:38 2021 -0500 Add TARGETABLE_FREQ and TARGETABLE mode to IC705 https://github.com/Hamlib/Hamlib/issues/626 diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 43fcbcc6..82b3ac22 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -721,7 +721,7 @@ const struct rig_caps ic705_caps = RIG_MODEL(RIG_MODEL_IC705), .model_name = "IC-705", .mfg_name = "Icom", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -759,7 +759,7 @@ const struct rig_caps ic705_caps = .max_rit = Hz(9999), .max_xit = Hz(9999), .max_ifshift = Hz(0), - .targetable_vfo = 0, + .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, .vfo_ops = IC7300_VFO_OPS, .scan_ops = IC7300_SCAN_OPS, .transceive = RIG_TRN_RIG, ----------------------------------------------------------------------- Summary of changes: rigs/icom/ic7300.c | 4 ++-- rigs/icom/icom.c | 3 ++- rigs/kenwood/kenwood.c | 4 ++++ rigs/kenwood/kenwood.h | 2 +- rigs/yaesu/newcat.c | 1 + rigs/yaesu/newcat.h | 2 +- 6 files changed, 11 insertions(+), 5 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-03-26 19:27:25
|
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 dd156f74e26af017a1ca092135c3c60245018ca8 (commit) via 2aec11f5febca1bfe5489d6a9e3f3a2b2ceda37f (commit) via 4135a65503abfb1e41ffb520212f4a53ba2b25f2 (commit) via 7a4190d7ab2a7b388868b6a065699f48efdb2ab6 (commit) via db4f164427bf30318f3e08b6165c95dcf6bbd843 (commit) via 33e9839080bc7c2216057e0e1f873c0db8c7f50b (commit) from 377bea198c178ab5662a69f6bad4c2ee686f2339 (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 dd156f74e26af017a1ca092135c3c60245018ca8 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Mar 26 14:26:56 2021 -0500 astyle files in preparation for 4.2 release diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index eea0b498..c8de5277 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -871,7 +871,8 @@ static int netrigctl_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) char buf[BUF_MAX]; char vfostr[16] = ""; - rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s, ptt=%d\n", __func__, rig_strvfo(vfo), ptt); + rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s, ptt=%d\n", __func__, + rig_strvfo(vfo), ptt); ret = netrigctl_vfostr(rig, vfostr, sizeof(vfostr), RIG_VFO_A); diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 80a1ee0b..43fcbcc6 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -340,7 +340,7 @@ const struct rig_caps ic7300_caps = .max_rit = Hz(9999), .max_xit = Hz(9999), .max_ifshift = Hz(0), - .targetable_vfo = RIG_TARGETABLE_FREQ|RIG_TARGETABLE_MODE, + .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, .vfo_ops = IC7300_VFO_OPS, .scan_ops = IC7300_SCAN_OPS, .transceive = RIG_TRN_RIG, @@ -512,7 +512,7 @@ const struct rig_caps ic9700_caps = .max_rit = Hz(9999), .max_xit = Hz(9999), .max_ifshift = Hz(0), - .targetable_vfo = RIG_TARGETABLE_FREQ|RIG_TARGETABLE_MODE, + .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, .vfo_ops = IC9700_VFO_OPS, .scan_ops = IC9700_SCAN_OPS, .transceive = RIG_TRN_RIG, diff --git a/rigs/icom/ic7610.c b/rigs/icom/ic7610.c index b569f466..1aabcf66 100644 --- a/rigs/icom/ic7610.c +++ b/rigs/icom/ic7610.c @@ -208,7 +208,7 @@ const struct rig_caps ic7610_caps = .max_rit = Hz(9999), .max_xit = Hz(9999), .max_ifshift = Hz(0), - .targetable_vfo = RIG_TARGETABLE_FREQ|RIG_TARGETABLE_MODE, + .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, .vfo_ops = IC7610_VFO_OPS, .scan_ops = IC7610_SCAN_OPS, .transceive = RIG_TRN_RIG, diff --git a/rigs/icom/ic7800.c b/rigs/icom/ic7800.c index 641b18b1..32d0dfec 100644 --- a/rigs/icom/ic7800.c +++ b/rigs/icom/ic7800.c @@ -196,7 +196,7 @@ const struct rig_caps ic7800_caps = .max_rit = Hz(9999), .max_xit = Hz(9999), .max_ifshift = Hz(0), - .targetable_vfo = RIG_TARGETABLE_FREQ|RIG_TARGETABLE_MODE, + .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, .vfo_ops = IC7800_VFO_OPS, .scan_ops = IC7800_SCAN_OPS, .transceive = RIG_TRN_RIG, diff --git a/rigs/icom/ic785x.c b/rigs/icom/ic785x.c index 37927f51..087dfe7e 100644 --- a/rigs/icom/ic785x.c +++ b/rigs/icom/ic785x.c @@ -202,7 +202,7 @@ const struct rig_caps ic785x_caps = .max_rit = Hz(9999), .max_xit = Hz(9999), .max_ifshift = Hz(0), - .targetable_vfo = RIG_TARGETABLE_FREQ|RIG_TARGETABLE_MODE, + .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, .vfo_ops = IC785x_VFO_OPS, .scan_ops = IC785x_SCAN_OPS, .transceive = RIG_TRN_RIG, diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index 2c9bc60a..0d59d7eb 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -765,7 +765,7 @@ int ft1000mp_set_freq(RIG *rig, vfo_t vfo, freq_t freq) memcpy(&p->p_cmd, &ncmd[cmd_index].nseq, YAESU_CMD_LENGTH); // round freq to 10Hz intervals due to rig restriction - freq = round(freq/10.0)*10.0; + freq = round(freq / 10.0) * 10.0; to_bcd(p->p_cmd, freq / 10, 8); /* store bcd format in in p_cmd */ diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 45963be2..af398965 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -2232,8 +2232,10 @@ declare_proto_rig(get_vfo_info) rig_debug(RIG_DEBUG_ERR, "%s: vfo=%s\n", __func__, rig_strvfo(vfo)); } - const char * modestr = rig_strrmode(mode); - if (strlen(modestr) == 0) modestr = "None"; + const char *modestr = rig_strrmode(mode); + + if (strlen(modestr) == 0) { modestr = "None"; } + if ((interactive && prompt) || (interactive && !prompt && ext_resp)) { fprintf(fout, "%s: %.0f\n", cmd->arg1, freq); diff --git a/tests/testrig.c b/tests/testrig.c index efe06937..f4124c65 100644 --- a/tests/testrig.c +++ b/tests/testrig.c @@ -488,10 +488,11 @@ int main(int argc, char *argv[]) printf("port %s closed ok \n", SERIAL_PORT); - for(unsigned long i=1;i<0x80000000;i=i<<1) + for (unsigned long i = 1; i < 0x80000000; i = i << 1) { const char *vfostr = rig_strvfo(i); - if (strlen(vfostr)>0) printf("0x%08lx=%s\n", i, vfostr); + + if (strlen(vfostr) > 0) { printf("0x%08lx=%s\n", i, vfostr); } } return 0; commit 2aec11f5febca1bfe5489d6a9e3f3a2b2ceda37f Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Mar 26 14:25:32 2021 -0500 Fix Hamlib NET rigctl so it works from WSJT-X/JTDX when rigctld --vfo is used https://github.com/Hamlib/Hamlib/issues/628 diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 3eaf8df7..eea0b498 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -123,7 +123,7 @@ static int netrigctl_vfostr(RIG *rig, char *vfostr, int len, vfo_t vfo) rig_debug(RIG_DEBUG_TRACE, "%s: vfo_opt=%d\n", __func__, rig->state.vfo_opt); - if (rig->state.vfo_opt) + if (rig->state.vfo_opt || priv->rigctld_vfo_mode) { rig_debug(RIG_DEBUG_TRACE, "%s: vfo_opt vfo=%u\n", __func__, vfo); char *myvfo; @@ -871,7 +871,7 @@ static int netrigctl_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) char buf[BUF_MAX]; char vfostr[16] = ""; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s, ptt=%d\n", __func__, rig_strvfo(vfo), ptt); ret = netrigctl_vfostr(rig, vfostr, sizeof(vfostr), RIG_VFO_A); @@ -879,6 +879,8 @@ static int netrigctl_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) len = sprintf(cmd, "T%s %d\n", vfostr, ptt); + rig_debug(RIG_DEBUG_TRACE, "%s: cmd=%s", __func__, cmd); + ret = netrigctl_transaction(rig, cmd, len, buf); if (ret > 0) @@ -2285,7 +2287,7 @@ struct rig_caps netrigctl_caps = RIG_MODEL(RIG_MODEL_NETRIGCTL), .model_name = "NET rigctl", .mfg_name = "Hamlib", - .version = "20210207.0", + .version = "20210326.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, commit 4135a65503abfb1e41ffb520212f4a53ba2b25f2 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Mar 26 10:51:00 2021 -0500 Add TARGETABLE_FREQ and TARGETABLE mode to IC7300 IC7610 IC7800 IC785X IC9700 This reduces VFO swapping during get_freq and get_mode operations Log4OMV2 2.0.12 supports vfo mode using new get_vfo_info call New debug level RIG_DEBUG_CACHE as it can get very verbose https://github.com/Hamlib/Hamlib/issues/626 diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 8c878da1..fbb76171 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -168,7 +168,8 @@ enum rig_debug_level_e { RIG_DEBUG_ERR, /*!< error case (e.g. protocol, memory allocation) */ RIG_DEBUG_WARN, /*!< warning */ RIG_DEBUG_VERBOSE, /*!< verbose */ - RIG_DEBUG_TRACE /*!< tracing */ + RIG_DEBUG_TRACE, /*!< tracing */ + RIG_DEBUG_CACHE /*!< caching */ }; @@ -2085,7 +2086,8 @@ typedef enum { HAMLIB_CACHE_FREQ, HAMLIB_CACHE_MODE, HAMLIB_CACHE_PTT, - HAMLIB_CACHE_SPLIT + HAMLIB_CACHE_SPLIT, + HAMLIB_CACHE_WIDTH } hamlib_cache_t; /** diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 5e707625..3030b503 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -562,6 +562,7 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, void icom2rig_mode(RIG *rig, unsigned char md, int pd, rmode_t *mode, pbwidth_t *width) { + ENTERFUNC; rig_debug(RIG_DEBUG_TRACE, "%s: mode=0x%02x, pd=%d\n", __func__, md, pd); *width = RIG_PASSBAND_NORMAL; diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index c5ed85cf..80a1ee0b 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -301,7 +301,7 @@ const struct rig_caps ic7300_caps = RIG_MODEL(RIG_MODEL_IC7300), .model_name = "IC-7300", .mfg_name = "Icom", - .version = BACKEND_VER ".3", + .version = BACKEND_VER ".4", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -340,7 +340,7 @@ const struct rig_caps ic7300_caps = .max_rit = Hz(9999), .max_xit = Hz(9999), .max_ifshift = Hz(0), - .targetable_vfo = 0, + .targetable_vfo = RIG_TARGETABLE_FREQ|RIG_TARGETABLE_MODE, .vfo_ops = IC7300_VFO_OPS, .scan_ops = IC7300_SCAN_OPS, .transceive = RIG_TRN_RIG, @@ -474,7 +474,7 @@ const struct rig_caps ic9700_caps = RIG_MODEL(RIG_MODEL_IC9700), .model_name = "IC-9700", .mfg_name = "Icom", - .version = BACKEND_VER ".2", + .version = BACKEND_VER ".3", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -512,7 +512,7 @@ const struct rig_caps ic9700_caps = .max_rit = Hz(9999), .max_xit = Hz(9999), .max_ifshift = Hz(0), - .targetable_vfo = 0, + .targetable_vfo = RIG_TARGETABLE_FREQ|RIG_TARGETABLE_MODE, .vfo_ops = IC9700_VFO_OPS, .scan_ops = IC9700_SCAN_OPS, .transceive = RIG_TRN_RIG, diff --git a/rigs/icom/ic7610.c b/rigs/icom/ic7610.c index f26b3b67..b569f466 100644 --- a/rigs/icom/ic7610.c +++ b/rigs/icom/ic7610.c @@ -169,7 +169,7 @@ const struct rig_caps ic7610_caps = RIG_MODEL(RIG_MODEL_IC7610), .model_name = "IC-7610", .mfg_name = "Icom", - .version = BACKEND_VER ".1", + .version = BACKEND_VER ".2", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -208,7 +208,7 @@ const struct rig_caps ic7610_caps = .max_rit = Hz(9999), .max_xit = Hz(9999), .max_ifshift = Hz(0), - .targetable_vfo = 0, + .targetable_vfo = RIG_TARGETABLE_FREQ|RIG_TARGETABLE_MODE, .vfo_ops = IC7610_VFO_OPS, .scan_ops = IC7610_SCAN_OPS, .transceive = RIG_TRN_RIG, diff --git a/rigs/icom/ic7800.c b/rigs/icom/ic7800.c index 83091b3c..641b18b1 100644 --- a/rigs/icom/ic7800.c +++ b/rigs/icom/ic7800.c @@ -157,7 +157,7 @@ const struct rig_caps ic7800_caps = RIG_MODEL(RIG_MODEL_IC7800), .model_name = "IC-7800", .mfg_name = "Icom", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_UNTESTED, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -196,7 +196,7 @@ const struct rig_caps ic7800_caps = .max_rit = Hz(9999), .max_xit = Hz(9999), .max_ifshift = Hz(0), - .targetable_vfo = 0, + .targetable_vfo = RIG_TARGETABLE_FREQ|RIG_TARGETABLE_MODE, .vfo_ops = IC7800_VFO_OPS, .scan_ops = IC7800_SCAN_OPS, .transceive = RIG_TRN_RIG, diff --git a/rigs/icom/ic785x.c b/rigs/icom/ic785x.c index 99029bb5..37927f51 100644 --- a/rigs/icom/ic785x.c +++ b/rigs/icom/ic785x.c @@ -163,7 +163,7 @@ const struct rig_caps ic785x_caps = RIG_MODEL(RIG_MODEL_IC785x), .model_name = "IC-785x", .mfg_name = "Icom", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -202,7 +202,7 @@ const struct rig_caps ic785x_caps = .max_rit = Hz(9999), .max_xit = Hz(9999), .max_ifshift = Hz(0), - .targetable_vfo = 0, + .targetable_vfo = RIG_TARGETABLE_FREQ|RIG_TARGETABLE_MODE, .vfo_ops = IC785x_VFO_OPS, .scan_ops = IC785x_SCAN_OPS, .transceive = RIG_TRN_RIG, diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 015d89c7..082d8869 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -666,6 +666,8 @@ icom_init(RIG *rig) priv->rx_vfo = RIG_VFO_NONE; rig->state.current_vfo = RIG_VFO_NONE; priv->filter = RIG_PASSBAND_NOCHANGE; + priv->x25cmdfails = 0; + priv->x1cx03cmdfails = 0; rig_debug(RIG_DEBUG_TRACE, "%s: done\n", __func__); @@ -736,7 +738,7 @@ int icom_get_usb_echo_off(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s: USB echo on detected\n", __func__); // we should have a freq response so we'll read it and don't really care // flushing doesn't always work as it depends on timing - read_icom_frame(&rs->rigport,buf,sizeof(buf)); + read_icom_frame(&rs->rigport, buf, sizeof(buf)); } else { @@ -1139,11 +1141,13 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) struct icom_priv_data *priv; struct rig_state *rs; unsigned char freqbuf[MAXFRAMELEN]; + int freqbuf_offset = 1; unsigned char ackbuf[MAXFRAMELEN]; - int freq_len, retval; + int freq_len, retval = -RIG_EINTERNAL; int cmd, subcmd; int ack_len = sizeof(ackbuf); int civ_731_mode = 0; // even these rigs have 5-byte channels + vfo_t vfo_save = rig->state.current_vfo; rig_debug(RIG_DEBUG_VERBOSE, "%s called for %s, curr_vfo=%s\n", __func__, rig_strvfo(vfo), rig_strvfo(rig->state.current_vfo)); @@ -1209,14 +1213,6 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) #endif - retval = set_vfo_curr(rig, vfo, rig->state.current_vfo); - - if (retval != RIG_OK) - { - if (vfo == RIG_VFO_MEM && civ_731_mode) { priv->civ_731_mode = 1; } - - RETURNFUNC(retval); - } #if 0 @@ -1253,7 +1249,7 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) if (rig->state.current_vfo == RIG_VFO_NONE) { - retval = rig_set_vfo(rig, vfo); + retval = rig_set_vfo(rig, RIG_VFO_A); // we default to VFOA if (retval != RIG_OK) { @@ -1262,7 +1258,57 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) } } - retval = icom_transaction(rig, cmd, subcmd, NULL, 0, freqbuf, &freq_len); + // we'll use 0x25 command to get unselected frequency + // we are always assuming we're on VFOA/Main to start with + if (priv->x25cmdfails == 0) + { + int cmd2 = 0x25; + int subcmd2 = 0x00; + vfo_t vfo_unselected = RIG_VFO_B | RIG_VFO_SUB | RIG_VFO_SUB_B | RIG_VFO_MAIN_B; + + // if we ask for unselected but we're not on unselected subcmd2 changes + if ((vfo & vfo_unselected) && !(rig->state.current_vfo & vfo_unselected)) + { + subcmd2 = 0x01; // get unselected VFO + } + + retval = icom_transaction(rig, cmd2, subcmd2, NULL, 0, freqbuf, &freq_len); + + if (retval != RIG_OK) + { + priv->x25cmdfails = 1; + rig_debug(RIG_DEBUG_WARN, + "%s: rig does not support 0x25 CI-V cmd...vfo swapping will occur\n", __func__); + } + + freq_len--; // 0x25 cmd is 1 byte longer than 0x03 cmd + freqbuf_offset = 2; + } + + if (priv->x25cmdfails) // then we're doing this the hard way....swap+read + { + retval = set_vfo_curr(rig, vfo, rig->state.current_vfo); + + if (retval != RIG_OK) + { + if (vfo == RIG_VFO_MEM && civ_731_mode) { priv->civ_731_mode = 1; } + + RETURNFUNC(retval); + } + + retval = icom_transaction(rig, cmd, subcmd, NULL, 0, freqbuf, &freq_len); + set_vfo_curr(rig, vfo_save, rig->state.current_vfo); + } + +#if 0 + else if (!priv->x25cmdfails + && (vfo & (RIG_VFO_A | RIG_VFO_MAIN | RIG_VFO_MAIN_A | RIG_VFO_SUB_A))) + { + // we can use the 0x03 command for the default VFO + retval = icom_transaction(rig, cmd, subcmd, NULL, 0, freqbuf, &freq_len); + } + +#endif if (retval != RIG_OK) { @@ -1307,7 +1353,7 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) /* * from_bcd requires nibble len */ - *freq = from_bcd(freqbuf + 1, freq_len * 2); + *freq = from_bcd(freqbuf + freqbuf_offset, freq_len * 2); if (vfo == RIG_VFO_MEM && civ_731_mode) { priv->civ_731_mode = 1; } @@ -1456,7 +1502,8 @@ pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode) S_MEM_FILT_WDTH; struct icom_priv_data *priv = (struct icom_priv_data *) rig->state.priv; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + rig_debug(RIG_DEBUG_VERBOSE, "%s called, mode=%s\n", __func__, + rig_strrmode(mode)); if (rig_has_get_func(rig, RIG_FUNC_RF) && (mode & (RIG_MODE_RTTY | RIG_MODE_RTTYR))) @@ -1507,6 +1554,8 @@ pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode) { int i; i = (int) from_bcd(resbuf + 2, 2); + rig_debug(RIG_DEBUG_TRACE, "%s: i=%d, [0]=%02x, [1]=%02x, [2]=%02x, [3]=%02x\n", + __func__, i, resbuf[0], resbuf[1], resbuf[2], resbuf[3]); if (mode & RIG_MODE_AM) { @@ -1514,13 +1563,14 @@ pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode) } else if (mode & (RIG_MODE_CW | RIG_MODE_USB | RIG_MODE_LSB | RIG_MODE_RTTY | - RIG_MODE_RTTYR)) + RIG_MODE_RTTYR | RIG_MODE_PKTUSB | RIG_MODE_PKTLSB)) { - return (i < 10 ? (i + 1) * 50 : (i - 4) * 100); + rig_debug(RIG_DEBUG_TRACE, "%s: using width=%d\n", __func__, i); + RETURNFUNC(i < 10 ? (i + 1) * 50 : (i - 4) * 100); } } - return (0); + RETURNFUNC(0); } int icom_set_dsp_flt(RIG *rig, rmode_t mode, pbwidth_t width) @@ -1827,35 +1877,51 @@ int icom_get_mode_with_data(RIG *rig, vfo_t vfo, rmode_t *mode, int data_len, retval; unsigned char dm_sub_cmd = RIG_MODEL_IC7200 == rig->caps->rig_model ? 0x04 : S_MEM_DATA_MODE; + struct rig_state *rs; + struct icom_priv_data *priv; 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); + rs = &rig->state; + priv = (struct icom_priv_data *) rs->priv; + + retval = icom_get_mode(rig, vfo, mode, width); if (retval != RIG_OK) { RETURNFUNC(retval); } + rig_debug(RIG_DEBUG_VERBOSE, "%s mode=%d\n", __func__, (int)*mode); + switch (*mode) { case RIG_MODE_USB: case RIG_MODE_LSB: case RIG_MODE_AM: case RIG_MODE_FM: + /* * fetch data mode on/off */ - retval = - icom_transaction(rig, C_CTL_MEM, dm_sub_cmd, 0, 0, databuf, - &data_len); - - if (retval != RIG_OK) + if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) { - rig_debug(RIG_DEBUG_ERR, "%s: protocol error (%#.2x), len=%d\n", - __func__, databuf[0], data_len); - RETURNFUNC(-RIG_ERJCTED); + // then we already got data mode so we fake the databuf answer + databuf[2] = priv->datamode; + data_len = 3; + } + else + { + retval = + icom_transaction(rig, C_CTL_MEM, dm_sub_cmd, 0, 0, databuf, + &data_len); + + if (retval != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: protocol error (%#.2x), len=%d\n", + __func__, databuf[0], data_len); + RETURNFUNC(-RIG_ERJCTED); + } } /* @@ -1932,7 +1998,37 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) 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); + *width = 0; + + if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) + { + int vfosel = 0x00; + + if (vfo & (RIG_VFO_B | RIG_VFO_SUB | RIG_VFO_SUB_B | RIG_VFO_MAIN_B)) { vfosel = 0x01; } + + // use cache for the non-selected VFO -- can't get it by VFO + // this avoids vfo swapping but accurate answers for these rigs + *width = rig->state.cache.widthMainB; + + if (vfo == RIG_VFO_SUB_B) { *width = rig->state.cache.widthSubB; } + + // then get non-selected VFO mode/width + retval = icom_transaction(rig, 0x26, vfosel, NULL, 0, modebuf, &mode_len); + rig_debug(RIG_DEBUG_TRACE, + "%s: mode_len=%d, modebuf=%02x %02x %02x %02x %02x\n", __func__, mode_len, + modebuf[0], modebuf[1], modebuf[2], modebuf[3], modebuf[4]); + // mode_len=5, modebuf=26 01 01 01 01 + // last 3 bytes are mode, datamode, filter (1-3) + priv_data->datamode = modebuf[3]; + priv_data->filter = modebuf[4]; + modebuf[1] = modebuf[2]; // copy mode to 2-byte format + modebuf[2] = modebuf[4]; // copy filter to 2-byte format + mode_len = 2; + } + else + { + retval = icom_transaction(rig, C_RD_MODE, -1, NULL, 0, modebuf, &mode_len); + } if (--mode_len == 3) { @@ -1998,19 +2094,61 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) * Lets check for dsp filters */ - if (width != NULL && (retval = icom_get_dsp_flt(rig, *mode)) != 0) + // if we already set width we won't update with except during set_vfo or set_mode + // reason is we can't get width without swapping vfos -- yuck!! + if (width != NULL) { - *width = retval; - rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s returning mode=%s, width=%d\n", __func__, - rig_strvfo(vfo), rig_strrmode(*mode), (int)*width); - } - else - { - rig_debug(RIG_DEBUG_TRACE, - "%s: vfo=%s returning mode=%s, width not available\n", __func__, - rig_strvfo(vfo), rig_strrmode(*mode)); + if (vfo & (RIG_VFO_A | RIG_VFO_MAIN | RIG_VFO_SUB_A | RIG_VFO_MAIN_A)) + { + // then we get our current vfo..i.e. VFOA + if (rig->state.current_vfo != RIG_VFO_A) + { + rig_debug(RIG_DEBUG_TRACE, "%s(%d): forcing default VFO_A\n", __func__, + __LINE__); + rig_set_vfo(rig, RIG_VFO_A); // force VFOA + } + + retval = icom_get_dsp_flt(rig, *mode); + *width = retval; + + if (retval == 0) + { + rig_debug(RIG_DEBUG_TRACE, + "%s: vfo=%s returning mode=%s, width not available\n", __func__, + rig_strvfo(vfo), rig_strrmode(*mode)); + } + } + else if (rig->state.cache.widthMainB == 0) + { + // we need to swap vfos to get the bandwidth -- yuck + // so we read it once and will let set_mode and transceive capability (4.3 hamlib) update it + vfo_t vfosave = rig->state.current_vfo; + + if (vfosave != vfo) + { + // right now forcing VFOA/B arrangement -- reverse not supported yet + rig_set_vfo(rig, RIG_VFO_B); + retval = icom_get_dsp_flt(rig, *mode); + *width = retval; + // dont' really care about cache time here + // this is just to prevent vfo swapping while getting width + rig->state.cache.widthMainB = retval; + rig_debug(RIG_DEBUG_TRACE, "%s(%d): vfosave=%s, currvfo=%s\n", __func__, + __LINE__, rig_strvfo(vfo), rig_strvfo(rig->state.current_vfo)); + rig_set_vfo(rig, RIG_VFO_A); + rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s returning mode=%s, width=%d\n", __func__, + rig_strvfo(vfo), rig_strrmode(*mode), (int)*width); + } + else + { + rig_debug(RIG_DEBUG_WARN, + "%s: vfo arrangement not supported yet, vfo=%s, currvfo=%s\n", __func__, + rig_strvfo(vfo), rig_strvfo(vfosave)); + } + } } + RETURNFUNC(RIG_OK); } @@ -2102,18 +2240,20 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) { // If we're being asked for A/Main but we are a MainA/MainB rig change it vfo = RIG_VFO_MAIN_A; - } + } else if ((vfo == RIG_VFO_B || vfo == RIG_VFO_SUB) && VFO_HAS_DUAL) { // If we're being asked for B/Sub but we are a MainA/MainB rig change it vfo = RIG_VFO_MAIN_B; + // If we're in satmode for rigs like IC9700 we want the 2nd VFO if (rig->state.cache.satmode) { vfo = RIG_VFO_SUB_A; } } - else if ((vfo == RIG_VFO_A || vfo == RIG_VFO_B) && !VFO_HAS_A_B && VFO_HAS_MAIN_SUB) + else if ((vfo == RIG_VFO_A || vfo == RIG_VFO_B) && !VFO_HAS_A_B + && VFO_HAS_MAIN_SUB) { // If we're being asked for A/B but we are a Main/Sub rig change it vfo_t vfo_old = vfo; @@ -5626,7 +5766,8 @@ int icom_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) fct_sc = S_MEM_SATMODE; } - priv->x25cmdfails = status; // we reset this to current status -- fails in SATMODE + priv->x25cmdfails = + status; // we reset this to current status -- fails in SATMODE priv->x1cx03cmdfails = 0; // we reset this to try it again rig->state.cache.satmode = status; @@ -5836,6 +5977,7 @@ int icom_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) fct_cn = C_CTL_FUNC; fct_sc = S_MEM_SATMODE; } + break; @@ -5867,6 +6009,7 @@ int icom_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) else { *status = ackbuf[2] == 2 ? 1 : 0; + if (func == RIG_FUNC_SATMODE) { struct rig_state *rs = &rig->state; diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index dc1cc394..c43fc484 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -30,7 +30,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20210322" +#define BACKEND_VER "20210326" /* * defines used by comp_cal_str in rig.c @@ -204,6 +204,7 @@ struct icom_priv_data 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 unsigned char filter; // Current filter selected + unsigned char datamode; // Current datamode }; extern const struct ts_sc_list r8500_ts_sc_list[]; diff --git a/src/rig.c b/src/rig.c index 9011d472..ffa9560e 100644 --- a/src/rig.c +++ b/src/rig.c @@ -350,6 +350,18 @@ int rig_check_rig_caps() return rc; } +static void cache_show(RIG *rig, const char *func, int line) +{ + rig_debug(RIG_DEBUG_CACHE, + "%s(%d): freqMainA=%.0f, modeMainA=%s, widthMainA=%d\n", func, line, + rig->state.cache.freqMainA, rig_strrmode(rig->state.cache.modeMainA), + (int)rig->state.cache.widthMainA); + rig_debug(RIG_DEBUG_CACHE, + "%s(%d): freqMainB=%.0f, modeMainB=%s, widthMainB=%d\n", func, line, + rig->state.cache.freqMainB, rig_strrmode(rig->state.cache.modeMainB), + (int)rig->state.cache.widthMainB); +} + /** * \brief allocate a new RIG handle * \param rig_model The rig model for this new handle @@ -1331,6 +1343,8 @@ static int set_cache_mode(RIG *rig, vfo_t vfo, mode_t mode, pbwidth_t width) { ENTERFUNC; + cache_show(rig, __func__, __LINE__); + if (vfo == RIG_VFO_CURR) { // if CURR then update this before we figure out the real VFO @@ -1390,6 +1404,7 @@ static int set_cache_mode(RIG *rig, vfo_t vfo, mode_t mode, pbwidth_t width) RETURNFUNC(-RIG_EINTERNAL); } + cache_show(rig, __func__, __LINE__); RETURNFUNC(RIG_OK); } @@ -1400,6 +1415,7 @@ static int set_cache_freq(RIG *rig, vfo_t vfo, freq_t freq) ENTERFUNC; rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s, current_vfo=%s\n", __func__, rig_strvfo(vfo), rig_strvfo(rig->state.current_vfo)); + cache_show(rig, __func__, __LINE__); if (vfo == RIG_VFO_CURR) { @@ -1485,6 +1501,7 @@ static int set_cache_freq(RIG *rig, vfo_t vfo, freq_t freq) RETURNFUNC(-RIG_EINVAL); } + cache_show(rig, __func__, __LINE__); RETURNFUNC(RIG_OK); } @@ -1503,7 +1520,6 @@ int rig_get_cache(RIG *rig, vfo_t vfo, freq_t *freq, int *cache_ms_freq, // If we're in satmode we map SUB to SUB_A if (vfo == RIG_VFO_SUB && rig->state.cache.satmode) { vfo = RIG_VFO_SUB_A; }; - // VFO_C to be implemented switch (vfo) { case RIG_VFO_A: @@ -1726,6 +1742,7 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) set_cache_freq(rig, vfo, (freq_t)0); #if 0 // this verification seems to be causing bad behavior on some reigs + if (caps->get_freq) { retcode = rig_get_freq(rig, vfo, &tfreq); @@ -1744,6 +1761,7 @@ int HAMLIB_API rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) } } else { retry = 0; } + #else tfreq = freq; #endif @@ -1866,6 +1884,7 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) pbwidth_t width; rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s\n", __func__, rig_strvfo(vfo)); + cache_show(rig, __func__, __LINE__); #if 0 // don't think we really need this check @@ -1897,6 +1916,8 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) RETURNFUNC(RIG_OK); } + cache_show(rig, __func__, __LINE__); + // there are some rigs that can't get VFOA freq while VFOB is transmitting // so we'll return the cached VFOA freq for them // should we use the cached ptt maybe? No -- we have to be 100% sure we're in PTT to ignore this request @@ -1929,6 +1950,8 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) rig_debug(RIG_DEBUG_TRACE, "%s: cache check1 age=%dms\n", __func__, cache_ms_freq); + cache_show(rig, __func__, __LINE__); + if (freq != 0 && cache_ms_freq < rig->state.cache.timeout_ms) { rig_debug(RIG_DEBUG_TRACE, "%s: %s cache hit age=%dms, freq=%.0f\n", __func__, @@ -1965,6 +1988,8 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) retcode = caps->get_freq(rig, vfo, freq); + cache_show(rig, __func__, __LINE__); + // sometimes a network rig like FLRig will return freq=0 // so we'll just reuse the cache for that condition if (*freq == 0) @@ -1978,6 +2003,7 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) if (retcode == RIG_OK) { set_cache_freq(rig, vfo, *freq); + cache_show(rig, __func__, __LINE__); } } else @@ -1996,13 +2022,17 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) RETURNFUNC(retcode); } + cache_show(rig, __func__, __LINE__); + retcode = caps->get_freq(rig, vfo, freq); /* try and revert even if we had an error above */ rc2 = caps->set_vfo(rig, curr_vfo); if (RIG_OK == retcode) { + cache_show(rig, __func__, __LINE__); set_cache_freq(rig, vfo, *freq); + cache_show(rig, __func__, __LINE__); /* return the first error code */ retcode = rc2; } @@ -2025,7 +2055,9 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) *freq += rig->state.lo_freq; } + cache_show(rig, __func__, __LINE__); set_cache_freq(rig, vfo, *freq); + cache_show(rig, __func__, __LINE__); RETURNFUNC(retcode); } @@ -2141,8 +2173,7 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) RETURNFUNC(retcode); } - -/** +/* * \brief get the mode of the target VFO * \param rig The rig handle * \param vfo The target VFO @@ -2184,14 +2215,18 @@ int HAMLIB_API rig_get_mode(RIG *rig, RETURNFUNC(-RIG_ENAVAIL); } + *mode = RIG_MODE_NONE; + cache_show(rig, __func__, __LINE__); int cache_ms_freq, cache_ms_mode, cache_ms_width; rig_get_cache(rig, vfo, &freq, &cache_ms_freq, mode, &cache_ms_mode, width, &cache_ms_width); rig_debug(RIG_DEBUG_TRACE, "%s: %s cache check age=%dms\n", __func__, rig_strvfo(vfo), cache_ms_freq); - if (cache_ms_mode < rig->state.cache.timeout_ms - || cache_ms_width < rig->state.cache.timeout_ms) + cache_show(rig, __func__, __LINE__); + + if ((*mode != RIG_MODE_NONE && cache_ms_mode < rig->state.cache.timeout_ms) + && cache_ms_width < rig->state.cache.timeout_ms) { rig_debug(RIG_DEBUG_TRACE, "%s: cache hit age mode=%dms, width=%dms\n", __func__, cache_ms_mode, cache_ms_width); @@ -2211,12 +2246,12 @@ int HAMLIB_API rig_get_mode(RIG *rig, retcode = caps->get_mode(rig, vfo, mode, width); rig_debug(RIG_DEBUG_TRACE, "%s: retcode after get_mode=%d\n", __func__, retcode); + cache_show(rig, __func__, __LINE__); } else { int rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_TRACE, "%s(%d): debug\n", __func__, __LINE__); if (!caps->set_vfo) { @@ -2224,7 +2259,11 @@ int HAMLIB_API rig_get_mode(RIG *rig, } curr_vfo = rig->state.current_vfo; - retcode = caps->set_vfo(rig, vfo); + rig_debug(RIG_DEBUG_TRACE, "%s(%d): vfo=%s, curr_vfo=%s\n", __func__, __LINE__, + rig_strvfo(vfo), rig_strvfo(curr_vfo)); + retcode = caps->set_vfo(rig, vfo == RIG_VFO_CURR ? RIG_VFO_A : vfo); + + cache_show(rig, __func__, __LINE__); if (retcode != RIG_OK) { @@ -2248,6 +2287,7 @@ int HAMLIB_API rig_get_mode(RIG *rig, rig_debug(RIG_DEBUG_TRACE, "%s(%d): debug\n", __func__, __LINE__); rig->state.current_mode = *mode; rig->state.current_width = *width; + cache_show(rig, __func__, __LINE__); } if (*width == RIG_PASSBAND_NORMAL && *mode != RIG_MODE_NONE) @@ -2257,6 +2297,7 @@ int HAMLIB_API rig_get_mode(RIG *rig, } set_cache_mode(rig, vfo, *mode, *width); + cache_show(rig, __func__, __LINE__); RETURNFUNC(retcode); } @@ -2478,6 +2519,7 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo) { rig->state.current_vfo = vfo; rig->state.cache.vfo = vfo; + elapsed_ms(&rig->state.cache.time_vfo, HAMLIB_ELAPSED_SET); rig_debug(RIG_DEBUG_TRACE, "%s: rig->state.current_vfo=%s\n", __func__, rig_strvfo(vfo)); } @@ -2491,7 +2533,7 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo) // we only get the freq if we set the vfo OK if (retcode == RIG_OK && caps->get_freq) { - retcode = caps->get_freq(rig, RIG_VFO_CURR, &curr_freq); + retcode = caps->get_freq(rig, vfo, &curr_freq); rig_debug(RIG_DEBUG_TRACE, "%s: retcode from rig_get_freq = %.10000s\n", __func__, rigerror(retcode)); @@ -2502,6 +2544,7 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo) set_cache_freq(rig, RIG_VFO_ALL, (freq_t)0); } +#if 0 // with new cache should not have to expire here anymore // expire several cached items when we switch VFOs elapsed_ms(&rig->state.cache.time_vfo, HAMLIB_ELAPSED_INVALIDATE); elapsed_ms(&rig->state.cache.time_modeMainA, HAMLIB_ELAPSED_INVALIDATE); @@ -2510,6 +2553,7 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo) elapsed_ms(&rig->state.cache.time_widthMainA, HAMLIB_ELAPSED_INVALIDATE); elapsed_ms(&rig->state.cache.time_widthMainB, HAMLIB_ELAPSED_INVALIDATE); elapsed_ms(&rig->state.cache.time_widthMainC, HAMLIB_ELAPSED_INVALIDATE); +#endif rig_debug(RIG_DEBUG_TRACE, "%s: return %d, vfo=%s\n", __func__, retcode, rig_strvfo(vfo)); @@ -2665,7 +2709,9 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) rigerror(retcode)); retcode = RIG_OK; // fake the retcode so we retry } + if (tptt != ptt) { rig_debug(RIG_DEBUG_WARN, "%s: failed, retry=%d\n", __func__, retry); } + #else tptt = ptt; #endif @@ -2700,6 +2746,7 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) retcode = rig_get_ptt(rig, vfo, &tptt); if (tptt != ptt) { rig_debug(RIG_DEBUG_WARN, "%s: failed, retry=%d\n", __func__, retry); } + #else tptt = ptt; #endif @@ -3559,6 +3606,7 @@ int HAMLIB_API rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) do { #if 0 // this verification seems to be causing bad behavior on some reigs + if (caps->set_split_freq) { retcode = caps->set_split_freq(rig, vfo, tx_freq); @@ -3569,6 +3617,7 @@ int HAMLIB_API rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) retcode = rig_set_freq(rig, RIG_VFO_CURR, tx_freq); rig_get_freq(rig, vfo, &tfreq); } + #else tfreq = tx_freq; #endif @@ -4001,6 +4050,7 @@ int HAMLIB_API rig_set_split_freq_mode(RIG *rig, retcode = caps->set_split_freq_mode(rig, vfo, tx_freq, tx_mode, tx_width); #if 0 // this verification seems to be causing bad behavior on some reigs + // we query freq after set to ensure it really gets done do { @@ -4014,6 +4064,7 @@ int HAMLIB_API rig_set_split_freq_mode(RIG *rig, tfreq, retry, retcode, retcode2); hl_usleep(50 * 1000); // 50ms sleep may help here } + tfreq = tx_freq; retcode2 = RIG_OK; } @@ -4021,6 +4072,7 @@ int HAMLIB_API rig_set_split_freq_mode(RIG *rig, && retcode2 == RIG_OK); if (tfreq != tx_freq) { retcode = -RIG_EPROTO; } + #endif RETURNFUNC(retcode); @@ -5939,7 +5991,7 @@ int HAMLIB_API rig_get_vfo_info(RIG *rig, vfo_t vfo, freq_t *freq, RETURNFUNC(-RIG_EINVAL); } - if (vfo == RIG_VFO_CURR) { vfo = rig->state.current_vfo; } + //if (vfo == RIG_VFO_CURR) { vfo = rig->state.current_vfo; } // we can't use the cached values as some clients may only call this function // like Log4OM which mostly does polling @@ -5951,7 +6003,8 @@ int HAMLIB_API rig_get_vfo_info(RIG *rig, vfo_t vfo, freq_t *freq, if (retval != RIG_OK) { RETURNFUNC(retval); } - retval = rig_get_split(rig, vfo, split); + // we should only need to ask for VFO_CURR to minimize display swapping + retval = rig_get_split(rig, RIG_VFO_CURR, split); if (retval != RIG_OK) { RETURNFUNC(retval); } commit 7a4190d7ab2a7b388868b6a065699f48efdb2ab6 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Mar 26 10:40:05 2021 -0500 Add .gdbinit to .gitignore diff --git a/.gitignore b/.gitignore index 7c6300dc..3a47008c 100644 --- a/.gitignore +++ b/.gitignore @@ -58,4 +58,5 @@ tests/rigswr tests/rotctl tests/rotctld src/hamlibdatetime.h +.gdbinit build/ commit db4f164427bf30318f3e08b6165c95dcf6bbd843 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Mar 26 10:38:48 2021 -0500 Move hamlibdatetime.h .gitignore location diff --git a/.gitignore b/.gitignore index db8e972a..7c6300dc 100644 --- a/.gitignore +++ b/.gitignore @@ -57,5 +57,5 @@ tests/rigsmtr tests/rigswr tests/rotctl tests/rotctld -tests/hamlibdatetime.h +src/hamlibdatetime.h build/ commit 33e9839080bc7c2216057e0e1f873c0db8c7f50b Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Mar 26 10:31:59 2021 -0500 Add vfo list printout to testrig.c diff --git a/tests/testrig.c b/tests/testrig.c index 4c10582e..efe06937 100644 --- a/tests/testrig.c +++ b/tests/testrig.c @@ -488,5 +488,11 @@ int main(int argc, char *argv[]) printf("port %s closed ok \n", SERIAL_PORT); + for(unsigned long i=1;i<0x80000000;i=i<<1) + { + const char *vfostr = rig_strvfo(i); + if (strlen(vfostr)>0) printf("0x%08lx=%s\n", i, vfostr); + } + return 0; } ----------------------------------------------------------------------- Summary of changes: .gitignore | 3 +- include/hamlib/rig.h | 6 +- rigs/dummy/netrigctl.c | 9 +- rigs/icom/frame.c | 1 + rigs/icom/ic7300.c | 8 +- rigs/icom/ic7610.c | 4 +- rigs/icom/ic7800.c | 4 +- rigs/icom/ic785x.c | 4 +- rigs/icom/icom.c | 225 ++++++++++++++++++++++++++++++++++++++++--------- rigs/icom/icom.h | 3 +- rigs/yaesu/ft1000mp.c | 2 +- src/rig.c | 73 +++++++++++++--- tests/rigctl_parse.c | 6 +- tests/testrig.c | 7 ++ 14 files changed, 284 insertions(+), 71 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2021-03-24 13:37: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 377bea198c178ab5662a69f6bad4c2ee686f2339 (commit) from f84b704c136ff60030968184ad75d821de7431fc (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 377bea198c178ab5662a69f6bad4c2ee686f2339 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Mar 24 08:36:19 2021 -0500 Change BACKEND_IMPEXP to HAMLIB_CPP_IMPEXP in C++ includes to avoid potential collisions diff --git a/include/hamlib/ampclass.h b/include/hamlib/ampclass.h index cf66ca46..a626ef21 100644 --- a/include/hamlib/ampclass.h +++ b/include/hamlib/ampclass.h @@ -27,7 +27,7 @@ //! @cond Doxygen_Suppress -class BACKEND_IMPEXP Amplifier +class HAMLIB_CPP_IMPEXP Amplifier { private: AMP *theAmp; // Global ref. to the amp diff --git a/include/hamlib/rig_dll.h b/include/hamlib/rig_dll.h index 78127941..a2e1d247 100644 --- a/include/hamlib/rig_dll.h +++ b/include/hamlib/rig_dll.h @@ -32,7 +32,7 @@ #if defined(_WIN32) && !defined(__CYGWIN__) # undef HAMLIB_IMPEXP -# undef BACKEND_IMPEXP +# undef HAMLIB_CPP_IMPEXP # undef HAMLIB_API # undef HAMLIB_EXPORT # undef HAMLIB_EXPORT_VAR @@ -53,15 +53,15 @@ /* HAMLIB_API may be set to __stdcall for VB, .. */ # define HAMLIB_API __cdecl # ifdef IN_HAMLIB -# define BACKEND_IMPEXP HAMLIB_DLL_EXPORT +# define HAMLIB_CPP_IMPEXP HAMLIB_DLL_EXPORT # define HAMLIB_IMPEXP HAMLIB_DLL_EXPORT # else -# define BACKEND_IMPEXP HAMLIB_DLL_IMPORT +# define HAMLIB_CPP_IMPEXP HAMLIB_DLL_IMPORT # define HAMLIB_IMPEXP HAMLIB_DLL_IMPORT # endif # else /* static build, only export the backend entry points for lt_dlsym */ -# define BACKEND_IMPEXP HAMLIB_DLL_EXPORT +# define HAMLIB_CPP_IMPEXP HAMLIB_DLL_EXPORT # endif #endif @@ -70,8 +70,8 @@ #if !defined(HAMLIB_IMPEXP) # define HAMLIB_IMPEXP #endif -#if !defined(BACKEND_IMPEXP) -# define BACKEND_IMPEXP +#if !defined(HAMLIB_CPP_IMPEXP) +# define HAMLIB_CPP_IMPEXP #endif #if !defined(HAMLIB_API) # define HAMLIB_API @@ -83,8 +83,8 @@ # define HAMLIB_EXPORT_VAR(type) HAMLIB_IMPEXP type #endif #if !defined(BACKEND_EXPORT) -# define BACKEND_EXPORT(type) BACKEND_IMPEXP type HAMLIB_API +# define BACKEND_EXPORT(type) HAMLIB_CPP_IMPEXP type HAMLIB_API #endif #if !defined(BACKEND_EXPORT_VAR) -# define BACKEND_EXPORT_VAR(type) BACKEND_IMPEXP type +# define BACKEND_EXPORT_VAR(type) HAMLIB_CPP_IMPEXP type #endif diff --git a/include/hamlib/rigclass.h b/include/hamlib/rigclass.h index c5aca8e6..26d4a0d6 100644 --- a/include/hamlib/rigclass.h +++ b/include/hamlib/rigclass.h @@ -27,7 +27,7 @@ //! @cond Doxygen_Suppress -class BACKEND_IMPEXP Rig +class HAMLIB_CPP_IMPEXP Rig { private: RIG *theRig; // Global ref. to the rig @@ -251,7 +251,7 @@ extern "C" void exit(int); //! @cond Doxygen_Suppress // Forward Declarations -class BACKEND_IMPEXP RigException +class HAMLIB_CPP_IMPEXP RigException { public: const char *message; diff --git a/include/hamlib/rotclass.h b/include/hamlib/rotclass.h index 6b219495..5f62eb37 100644 --- a/include/hamlib/rotclass.h +++ b/include/hamlib/rotclass.h @@ -27,7 +27,7 @@ //! @cond Doxygen_Suppress -class BACKEND_IMPEXP Rotator +class HAMLIB_CPP_IMPEXP Rotator { private: ROT *theRot; // Global ref. to the rot ----------------------------------------------------------------------- Summary of changes: include/hamlib/ampclass.h | 2 +- include/hamlib/rig_dll.h | 16 ++++++++-------- include/hamlib/rigclass.h | 4 ++-- include/hamlib/rotclass.h | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |