hamlib-cvs-digest Mailing List for Ham Radio Control Libraries (Page 6)
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
(11) |
Sep
|
Oct
|
Nov
|
Dec
|
From: n0nb <n0...@us...> - 2024-12-04 20:21:23
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via 46711b1db4b4f737964f700941c1184db81d5bf1 (commit) via 941e69eda5b5516e5614f1b69b23fbd69ca74430 (commit) via dd15ffc7bd47a6ba481e42d6211a0f50c908d6c7 (commit) via 8f0e9909da7c3f93cc68515b58ce6f199cc61425 (commit) via 3e0a9eeae703765f932ffa3dc95e8ed65ec9540d (commit) from d1d4964a193217da42f57ef7bdeb59796ea7acc2 (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 46711b1db4b4f737964f700941c1184db81d5bf1 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 4 10:00:41 2024 -0600 Fix FLRig STRENGTH reading to use rig.get_DBM instead of rig.get_smeter -- much better representation diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index bfabc388b..e739acf81 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -143,7 +143,7 @@ struct rig_caps flrig_caps = RIG_MODEL(RIG_MODEL_FLRIG), .model_name = "", .mfg_name = "FLRig", - .version = "20241110.0", + .version = "20241204.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -2332,7 +2332,7 @@ static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_MICGAIN: cmd = "rig.get_micgain"; break; - case RIG_LEVEL_STRENGTH: cmd = "rig.get_smeter"; break; + case RIG_LEVEL_STRENGTH: cmd = "rig.get_DBM"; break; case RIG_LEVEL_SWR: cmd = "rig.get_swrmeter"; @@ -2386,7 +2386,7 @@ static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } case RIG_LEVEL_STRENGTH: - val->i = atoi(value) - 54; + val->i = atoi(value); //if (val->i > 0) val->i /= 10; rig_debug(RIG_DEBUG_TRACE, "%s: val.i='%s'(%d)\n", __func__, value, val->i); break; commit 941e69eda5b5516e5614f1b69b23fbd69ca74430 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Dec 3 23:19:16 2024 -0600 Fix set_mode on rigctlcom diff --git a/tests/rigctlcom.c b/tests/rigctlcom.c index 4bf136ec3..fca7aaabd 100644 --- a/tests/rigctlcom.c +++ b/tests/rigctlcom.c @@ -1604,7 +1604,7 @@ static int handle_ts2000(void *arg) } else if (strncmp(arg, "MD", 2) == 0) { - char response[32]; + //char response[32]; mode_t mode = 0; int imode = 0; @@ -1632,9 +1632,11 @@ static int handle_ts2000(void *arg) case 9: mode = RIG_MODE_RTTYR; break; } - + rig_set_mode(my_rig, RIG_VFO_A, mode, -1); +#if 0 SNPRINTF(response, sizeof(response), "MD%c;", mode + '0'); return write_block2((void *)__func__, &my_com, response, strlen(response)); +#endif } else if (strcmp(arg, "PS1;") == 0) { commit dd15ffc7bd47a6ba481e42d6211a0f50c908d6c7 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Dec 3 23:18:48 2024 -0600 Add KY command to simts590 diff --git a/simulators/simts590.c b/simulators/simts590.c index ee2db59b6..759283a9c 100644 --- a/simulators/simts590.c +++ b/simulators/simts590.c @@ -431,6 +431,11 @@ int main(int argc, char *argv[]) SNPRINTF(buf, sizeof(buf), "SL%02d;", width_low); WRITE(fd, buf, strlen(buf)); } + else if (strcmp(buf, "KY;") == 0) + { + SNPRINTF(buf, sizeof(buf), "KY0;"); + WRITE(fd, buf, strlen(buf)); + } else if (strlen(buf) > 0) { commit 8f0e9909da7c3f93cc68515b58ce6f199cc61425 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Dec 3 15:32:08 2024 -0600 astyle icom.h and update icom date diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 8045d8890..0e651af5b 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2110,7 +2110,9 @@ pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode) RIG_MODE_RTTYR | RIG_MODE_PKTUSB | RIG_MODE_PKTLSB)) { rig_debug(RIG_DEBUG_TRACE, "%s: using filtericom width=%d\n", __func__, i); - if (i > sizeof(filtericom)/sizeof(int)) i = 40; + + if (i > sizeof(filtericom) / sizeof(int)) { i = 40; } + RETURNFUNC2(filtericom[i]); } } @@ -2181,7 +2183,8 @@ int icom_set_dsp_flt(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) } flt_idx = width <= 500 ? ((width + 49) / 50) - 1 : ((width + 99) / 100) + 4; - if (flt_idx > 40) flt_idx = 40; + + if (flt_idx > 40) { flt_idx = 40; } } else { @@ -2684,8 +2687,9 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (width <= 3) { rig_debug(RIG_DEBUG_TRACE, "%s: setting filter=%d\n", __func__, (int)width); - return RIG_OK; + return RIG_OK; } + if (((width != RIG_PASSBAND_NOCHANGE) && (width != current_width)) || (priv->filter_usbd > 0 || priv->filter_usb > 0 || priv->filter_cw > 0 || priv->filter_fm > 0)) diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index faf004030..c78c64e55 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20241127" +#define BACKEND_VER "20241203" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit 3e0a9eeae703765f932ffa3dc95e8ed65ec9540d Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Dec 3 15:31:16 2024 -0600 Fix icom filter selection and bandwidth limits diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 363772cc2..8045d8890 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2110,6 +2110,7 @@ pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode) RIG_MODE_RTTYR | RIG_MODE_PKTUSB | RIG_MODE_PKTLSB)) { rig_debug(RIG_DEBUG_TRACE, "%s: using filtericom width=%d\n", __func__, i); + if (i > sizeof(filtericom)/sizeof(int)) i = 40; RETURNFUNC2(filtericom[i]); } } @@ -2179,8 +2180,8 @@ int icom_set_dsp_flt(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) width = 1; } - flt_idx = - width <= 500 ? ((width + 49) / 50) - 1 : ((width + 99) / 100) + 4; + flt_idx = width <= 500 ? ((width + 49) / 50) - 1 : ((width + 99) / 100) + 4; + if (flt_idx > 40) flt_idx = 40; } else { @@ -2679,6 +2680,12 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) } } + // no change and not setting filter number either + if (width <= 3) + { + rig_debug(RIG_DEBUG_TRACE, "%s: setting filter=%d\n", __func__, (int)width); + return RIG_OK; + } if (((width != RIG_PASSBAND_NOCHANGE) && (width != current_width)) || (priv->filter_usbd > 0 || priv->filter_usb > 0 || priv->filter_cw > 0 || priv->filter_fm > 0)) ----------------------------------------------------------------------- Summary of changes: rigs/dummy/flrig.c | 6 +++--- rigs/icom/icom.c | 15 +++++++++++++-- rigs/icom/icom.h | 2 +- simulators/simts590.c | 5 +++++ tests/rigctlcom.c | 6 ++++-- 5 files changed, 26 insertions(+), 8 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2024-12-03 13:24:07
|
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 d1d4964a193217da42f57ef7bdeb59796ea7acc2 (commit) via cf61b9a178b2ce48eeeaba01b677a31d8ef92e0a (commit) via abe40e6e8b6322b7811a4466d2a9c4f29440a249 (commit) via 558234897807c793baa2874e351007a6c827ab37 (commit) via 806b08729356d1515b7c2994b032fb79e187f772 (commit) via bdbe66dfa06114974331e42f1072fef78bfa2f1e (commit) via 8bd74aa3bcdfec900955c15ef1cc754bfb93d6df (commit) via 65832ecf53b3788ae3adc1eefe697b7e0112ac7c (commit) via 890ed18c43132c3b0d1b96eff6a2b5d6a96d57ba (commit) via 711a35135326af3f949bd69b227bd3e31d67c6ae (commit) via 5219ef2b26fa657e9370fefbdfa6396ecda7faa3 (commit) via 7b679afa1d851a3d0962f5f3d18ad4ad4088d2b1 (commit) via e480bc74796ad6206ae882251db0575127663aad (commit) via 71698e44325c26c92efd09b027e54cf22f0f18a8 (commit) via 4a34d4c27f5ae9305e689fccbc3ca496223b5309 (commit) via 5abc606e13903e821c0ac88a2768f6549c5b8704 (commit) via ab2b5fb9e9d9f8bcf48bac5190b8fa17ce33c04c (commit) via dc7bbeca34cd91bd021bcd60dfa936fbd1f242de (commit) via d86f0db383cd51c3640aab17de91168351744ec3 (commit) via 3f90a9323eb3b477fbc92308dee131221a7cac90 (commit) via 610581ca95686a9eb8e407c399816b421e720aa9 (commit) via 8ee3c9fa64fdebf70aa18b5b1ccbc313a5442a53 (commit) via a94e2948f550f2e040a24d5c965a62be4628f2ea (commit) via fbdb6656209306df75aaa2f541122f325f90a818 (commit) via dcc7b3743215e6a47a70863125c02d6e9d19c750 (commit) via 2447cb204ecaa5119d3d09e93e6b183791885446 (commit) via aae8109d4e63ce812f302fa9db6534ae069361ca (commit) via 6adfce0305ebfd26a88fc08c99cd4007053d0986 (commit) via 6036a65d2e075393664f27d639fa4c6a312c6e1f (commit) via 82c8a0795e5eaab6bdd27a56bbb684a77ca915db (commit) via 4811ebe3bc72f98a4ed688be03040f442dab5c89 (commit) via 5b277e460047270c8ec85274d112d939fefedcdc (commit) from 4b77f9b6b67afc4bf26e4aeaa4774cb842d48d8b (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 d1d4964a193217da42f57ef7bdeb59796ea7acc2 Merge: abe40e6e8 cf61b9a17 Author: Michael Black <mdb...@ya...> Date: Tue Dec 3 07:05:22 2024 -0600 Merge pull request #1636 from GeoBaltz/fix24 Change Kenwood _send_morse() for TS-890/990 commit cf61b9a178b2ce48eeeaba01b677a31d8ef92e0a Merge: 806b08729 abe40e6e8 Author: Michael Black <mdb...@ya...> Date: Tue Dec 3 06:57:15 2024 -0600 Merge branch 'master' into fix24 diff --cc rigs/kenwood/kenwood.c index 3222a69a7,ae6a8e109..38a87600a --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@@ -5553,31 -5551,19 +5553,29 @@@ int kenwood_send_morse(RIG *rig, vfo_t SNPRINTF(morsebuf, sizeof(morsebuf), "KY %s", m2); break; - case RIG_MODEL_TS590S: + case RIG_MODEL_TS890S: + SNPRINTF(morsebuf, sizeof morsebuf, "KY2%s", m2); + break; + + case RIG_MODEL_TS990S: + // Variable message length only on newer firmware + priv = STATE(rig)->priv; + if (priv->fw_rev_uint >= 110) + { + SNPRINTF(morsebuf, sizeof morsebuf, "KY2%s", m2); + break; + } + /* FALL THROUGH */ + ++ case RIG_MODEL_TS590S: + /* the command must consist of 28 bytes right aligned */ - SNPRINTF(morsebuf, sizeof(morsebuf), "KY %24s", m2); - break; ++ SNPRINTF(morsebuf, sizeof(morsebuf), "KY %24s", m2); ++ break; + default: /* the command must consist of 28 bytes 0x20 padded */ SNPRINTF(morsebuf, sizeof(morsebuf), "KY %-24s", m2); - #if 0 // Why is this here?? 0x20 == ' ' - int i; -- for (i = strlen(morsebuf) - 1; i > 0 && morsebuf[i] == ' '; --i) -- { -- morsebuf[i] = 0x20; -- } - #endif } retval = kenwood_transaction(rig, morsebuf, NULL, 0); commit abe40e6e8b6322b7811a4466d2a9c4f29440a249 Merge: 65832ecf5 558234897 Author: Michael Black <mdb...@ya...> Date: Tue Dec 3 06:45:02 2024 -0600 Merge pull request #1637 from dl1jbe/ts590_fix_kenwood_send_morse Drop addional unwanted space after message commit 558234897807c793baa2874e351007a6c827ab37 Author: Thomas Beierlein <to...@ge...> Date: Tue Dec 3 12:34:32 2024 +0100 Drop addional unwanted space after message Kenwood_send_morse adds an unwanted space after each transmission on TS-590S model (see issue 1634). Tests showed that all space before any message gets ignored and all trailing spaces (if any) were compressed to exactly one space. The patch changes the alignment to the right. diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index e0bad2505..ae6a8e109 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -5551,6 +5551,11 @@ int kenwood_send_morse(RIG *rig, vfo_t vfo, const char *msg) SNPRINTF(morsebuf, sizeof(morsebuf), "KY %s", m2); break; + case RIG_MODEL_TS590S: + /* the command must consist of 28 bytes right aligned */ + SNPRINTF(morsebuf, sizeof(morsebuf), "KY %24s", m2); + break; + default: /* the command must consist of 28 bytes 0x20 padded */ SNPRINTF(morsebuf, sizeof(morsebuf), "KY %-24s", m2); commit 806b08729356d1515b7c2994b032fb79e187f772 Author: George Baltz N3GB <Geo...@gm...> Date: Tue Dec 3 05:06:10 2024 -0500 Fix porting unneeded code diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index da75b19f8..3222a69a7 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -5572,7 +5572,8 @@ int kenwood_send_morse(RIG *rig, vfo_t vfo, const char *msg) SNPRINTF(morsebuf, sizeof(morsebuf), "KY %-24s", m2); #if 0 // Why is this here?? 0x20 == ' ' - for (int i = strlen(morsebuf) - 1; i > 0 && morsebuf[i] == ' '; --i) + int i; + for (i = strlen(morsebuf) - 1; i > 0 && morsebuf[i] == ' '; --i) { morsebuf[i] = 0x20; } commit bdbe66dfa06114974331e42f1072fef78bfa2f1e Author: George Baltz N3GB <Geo...@gm...> Date: Sat Nov 30 04:17:01 2024 -0500 Use short (i.e., variable length) messages in kenwood_send_morse() Enabled for TS-890S & TS-990S(if firmware capable) Kludge the kludges in kenwood_transaction() for KY->KY2 change. diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index e0bad2505..da75b19f8 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -375,6 +375,7 @@ transaction_write: skip |= strncmp(cmdstr, "RD", 2) == 0; skip |= strncmp(cmdstr, "KYW", 3) == 0; skip |= strncmp(cmdstr, "KY ", 3) == 0; + skip |= strncmp(cmdstr, "KY2", 3) == 0; skip |= strncmp(cmdstr, "PS1", 3) == 0; skip |= strncmp(cmdstr, "PS0", 3) == 0; skip |= strncmp(cmdstr, "K22", 3) == 0; @@ -382,7 +383,7 @@ transaction_write: if (skip) { // most command we give them a little time -- but not KY - if (strncmp(cmdstr, "KY ", 3) != 0) + if (strncmp(cmdstr, "KY ", 3) != 0 && strncmp(cmdstr, "KY2", 3) != 0) { hl_usleep(200 * 1000); // give little settle time for these commands } @@ -958,7 +959,7 @@ int kenwood_open(RIG *rig) priv->has_rit2 = 1; } - if (RIG_IS_TS590S) + if (RIG_IS_TS590S || RIG_IS_TS990S) { /* we need the firmware version for these rigs to deal with f/w defects */ static char fw_version[7]; @@ -992,7 +993,7 @@ int kenwood_open(RIG *rig) } } - rig_debug(RIG_DEBUG_TRACE, "%s: found f/w version %.1f\n", __func__, + rig_debug(RIG_DEBUG_TRACE, "%s: found f/w version %.2f\n", __func__, priv->fw_rev_uint / 100.0); } @@ -5486,8 +5487,9 @@ int kenwood_reset(RIG *rig, reset_t reset) int kenwood_send_morse(RIG *rig, vfo_t vfo, const char *msg) { char morsebuf[40], m2[30]; - int msg_len, retval, i; + int msg_len, retval; const char *p; + struct kenwood_priv_data *priv; ENTERFUNC; @@ -5551,14 +5553,30 @@ int kenwood_send_morse(RIG *rig, vfo_t vfo, const char *msg) SNPRINTF(morsebuf, sizeof(morsebuf), "KY %s", m2); break; + case RIG_MODEL_TS890S: + SNPRINTF(morsebuf, sizeof morsebuf, "KY2%s", m2); + break; + + case RIG_MODEL_TS990S: + // Variable message length only on newer firmware + priv = STATE(rig)->priv; + if (priv->fw_rev_uint >= 110) + { + SNPRINTF(morsebuf, sizeof morsebuf, "KY2%s", m2); + break; + } + /* FALL THROUGH */ + default: /* the command must consist of 28 bytes 0x20 padded */ SNPRINTF(morsebuf, sizeof(morsebuf), "KY %-24s", m2); - for (i = strlen(morsebuf) - 1; i > 0 && morsebuf[i] == ' '; --i) +#if 0 // Why is this here?? 0x20 == ' ' + for (int i = strlen(morsebuf) - 1; i > 0 && morsebuf[i] == ' '; --i) { morsebuf[i] = 0x20; } +#endif } retval = kenwood_transaction(rig, morsebuf, NULL, 0); commit 8bd74aa3bcdfec900955c15ef1cc754bfb93d6df Author: George Baltz N3GB <Geo...@gm...> Date: Fri Nov 29 15:10:46 2024 -0500 Minimal support for KY commands in simts890.c diff --git a/simulators/simts890.c b/simulators/simts890.c index 6ebc0f264..b1d4158ae 100644 --- a/simulators/simts890.c +++ b/simulators/simts890.c @@ -927,6 +927,24 @@ int main(int argc, char *argv[]) { sscanf(buf, "KS%03d", &keyspd); } + else if (strncmp(buf, "KY", 2) == 0) + { // CW Keying + if (buf[2] == ';') + { + // Checking status - we always have room + OUTPUT("KY0;"); + } + else if (buf[3] == ';') + { + // Stop sending(?) + if (buf[2] != '0') {cmd_err = 1; } + } + else + { + // Send the message + //printf("CW mesg: %s\n", buf + 2); + } + } else if (strncmp(buf, "OM", 2) == 0) { // Operating Mode commit 65832ecf53b3788ae3adc1eefe697b7e0112ac7c Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Dec 2 07:24:00 2024 -0600 Fix compile warnings diff --git a/src/rig.c b/src/rig.c index cd315ab1f..dc9a7a5de 100644 --- a/src/rig.c +++ b/src/rig.c @@ -997,7 +997,7 @@ int HAMLIB_API rig_open(RIG *rig) else { rig_debug(RIG_DEBUG_VERBOSE, "%s: cwd=%s\n", __func__, cwd); - char *path = calloc(1, 4096); + char *path = calloc(1, 8192); extern char settings_file[4096]; const char *xdgpath = getenv("XDG_CONFIG_HOME"); commit 890ed18c43132c3b0d1b96eff6a2b5d6a96d57ba Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Dec 2 07:20:42 2024 -0600 Change morse_data_handler from LOCK to rig_lock as it needs to always use it diff --git a/src/rig.c b/src/rig.c index d886d6ecb..cd315ab1f 100644 --- a/src/rig.c +++ b/src/rig.c @@ -169,6 +169,10 @@ const char hamlib_copyright[231] = /* hamlib 1.2 ABI specifies 231 bytes */ #define CHECK_RIG_ARG(r) (!(r) || !(r)->caps || !STATE((r))->comm_state) #define CHECK_RIG_CAPS(r) (!(r) || !(r)->caps) +// The LOCK macro is for the primary thread calling the rig functions +// For a separate thread use rig_lock directly +// The purpose here is to avoid deadlock during recursion +// Any other thread should grab the mutex itself via rig_lock #define LOCK(n) if (STATE(rig)->depth == 1) { rig_debug(RIG_DEBUG_CACHE, "%s: %s\n", n?"lock":"unlock", __func__); rig_lock(rig,n); } MUTEX(morse_mutex); @@ -8760,9 +8764,9 @@ void *morse_data_handler(void *arg) if (strlen(c) > 0) { int nloops = 10; - MUTEX_LOCK(morse_mutex); + MUTEX_LOCK(morse_mutex); // wait until the write is idle - LOCK(1); + rig_lock(rig, 1); do { result = rig->caps->send_morse(rig, RIG_VFO_CURR, c); @@ -8786,7 +8790,7 @@ void *morse_data_handler(void *arg) } while (result != RIG_OK && STATE(rig)->fifo_morse->flush == 0 && --nloops > 0); - LOCK(0); + rig_lock(rig,0); MUTEX_UNLOCK(morse_mutex); commit 711a35135326af3f949bd69b227bd3e31d67c6ae Merge: 5219ef2b2 7b679afa1 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 1 22:41:04 2024 -0600 Merge branch 'master' of github.com:Hamlib/Hamlib commit 5219ef2b26fa657e9370fefbdfa6396ecda7faa3 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 1 16:44:22 2024 -0600 Put a heavier LOCK around send_morse when clearing the buffer diff --git a/src/rig.c b/src/rig.c index e47105e6c..c755fefd6 100644 --- a/src/rig.c +++ b/src/rig.c @@ -8762,6 +8762,7 @@ void *morse_data_handler(void *arg) int nloops = 10; MUTEX_LOCK(morse_mutex); + LOCK(1); do { result = rig->caps->send_morse(rig, RIG_VFO_CURR, c); @@ -8785,6 +8786,7 @@ void *morse_data_handler(void *arg) } while (result != RIG_OK && STATE(rig)->fifo_morse->flush == 0 && --nloops > 0); + LOCK(0); MUTEX_UNLOCK(morse_mutex); commit 7b679afa1d851a3d0962f5f3d18ad4ad4088d2b1 Merge: 71698e443 e480bc747 Author: Nate Bargmann <n0...@n0...> Date: Sun Dec 1 16:06:16 2024 -0600 Merge pull request #1635 from dforsi/fix/typos Fix typos commit e480bc74796ad6206ae882251db0575127663aad Author: Daniele Forsi IU5HKX <iu...@gm...> Date: Sun Dec 1 21:52:34 2024 +0100 Fix typos diff --git a/NEWS b/NEWS index d9b04777f..37ec46881 100644 --- a/NEWS +++ b/NEWS @@ -13,7 +13,7 @@ Version 5.x -- future * Change FT1000MP Mark V model names to align with FT1000MP Version 4.6 - * send_raw can now take hex digits as colon-seperated -- e.g. send_raw icom xfe:xfe:x94:xe0:03:xfd + * send_raw can now take hex digits as colon-separated -- e.g. send_raw icom xfe:xfe:x94:xe0:03:xfd * Add IC7760 * IC7300 Mode filter can now be set by # (i.e. 1,2,3) * Fixed AF6SA WRC rotor controller @@ -44,7 +44,7 @@ Version 4.6 * Added Thetis entry -- derived from FlexRadio/Apache PowerSDR * Added VOICE/CW memory capability to many rigs -- thanks to David Balharrie M0DGB/G8FKH * Add -# --skip_init option to rigctl to skip rig initialization -- useful for executing commands quickly - * rig_caps is no longer constant -- this may break some 3rd party relying on the "const" declaration. Here's an example of how to handle compatiblity. + * rig_caps is no longer constant -- this may break some 3rd party relying on the "const" declaration. Here's an example of how to handle compatibility. #ifdef RIGCAPS_NOT_CONST static int add_to_list(struct rig_caps* rc, void*) #else @@ -66,7 +66,7 @@ static int add_to_list(const struct rig_caps* rc, void*) * Added rig_cm108_get/set_bit to API and get/set_gpio to rigctl(d) for GPIO1,2,3,4 access on CM108 * Added BG2FX FX4/C/CR/L * Fixed IC7610 to use new 0x25 0x26 command added in latest firmware - * Fix W command in rigctld to work propery -- can take terminating char or # of bytes to expect + * Fix W command in rigctld to work properly -- can take terminating char or # of bytes to expect * Add rig_set_debug_filename so Python can redirect debug stream * Fix Yaesu LBL_NR to use proper values * Add IC-905 diff --git a/bindings/csharp/multicast/README.txt b/bindings/csharp/multicast/README.txt index fbb130f50..f87c199a1 100644 --- a/bindings/csharp/multicast/README.txt +++ b/bindings/csharp/multicast/README.txt @@ -22,7 +22,7 @@ You should then be able to run ./bin/Debug/net6.0/multicast ====================================================== -Waiting for Net 7.0/8.0 to be in Ubunut main packages +Waiting for Net 7.0/8.0 to be in Ubuntu main packages Following did not work sudo apt remove 'dotnet*' 'aspnet*' 'netstandard*' diff --git a/rigs/icom/ic821h.c b/rigs/icom/ic821h.c index 1d0938eba..8e9dacb06 100644 --- a/rigs/icom/ic821h.c +++ b/rigs/icom/ic821h.c @@ -181,8 +181,8 @@ struct rig_caps ic821h_caps = }, /* mode/filter list, remember: order matters! */ .filters = { - {RIG_MODE_CW | RIG_MODE_SSB, kHz(2.3)}, /* buildin */ - {RIG_MODE_FM, kHz(15)}, /* buildin */ + {RIG_MODE_CW | RIG_MODE_SSB, kHz(2.3)}, /* built-in */ + {RIG_MODE_FM, kHz(15)}, /* built-in */ RIG_FLT_END, }, diff --git a/rigs/kenwood/thf6a.c b/rigs/kenwood/thf6a.c index 7b1bdacf8..0f2b80a6e 100644 --- a/rigs/kenwood/thf6a.c +++ b/rigs/kenwood/thf6a.c @@ -5,7 +5,7 @@ * * 10-03-2010 * Ported from Stephane Fillod's thf7.c - * Changed TH-F7E perameters to reflect TH-F6A + * Changed TH-F7E parameters to reflect TH-F6A * Changed RIG_ITU_REGION from 1 to 2 * * diff --git a/rigs/kenwood/ts590.c b/rigs/kenwood/ts590.c index 73e5b3997..95a9779dd 100644 --- a/rigs/kenwood/ts590.c +++ b/rigs/kenwood/ts590.c @@ -400,7 +400,7 @@ static int ts590_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) const int ssb_htable[] = { 1000, 1200, 1400, 1600, 1800, 2000, 2200, 2400, 2600, 2800, 3000, 3400, 4000, 5000 }; const int ssb_ltable[] = { 0, 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000 }; *width = ssb_htable[hwidth]; - // we dont' do anything with shift yet which will be just the hwidth value + // we don't do anything with shift yet which will be just the hwidth value shift = ssb_ltable[lwidth]; } else if (*mode == RIG_MODE_AM || *mode == RIG_MODE_PKTAM) diff --git a/rigs/yaesu/README.ft920 b/rigs/yaesu/README.ft920 index 76fd5acec..e58eddfac 100644 --- a/rigs/yaesu/README.ft920 +++ b/rigs/yaesu/README.ft920 @@ -97,7 +97,7 @@ rig_get_split_mode and set "proper" VFO? rig_set_rit - * Hamlib specificies that passing 0 as the RIT frequency disables + * Hamlib specifies that passing 0 as the RIT frequency disables RIT. Thus there is no way to meet the spec and mimic the front panel RIT off function whilst keeping the RIT offset on the display. The Hamlib spec causes behavior analogous to shutting @@ -112,7 +112,7 @@ rig_get_rit * vfo is honored and stored RIT is returned. rig_set_xit - * Hamlib specificies that passing 0 as the XIT frequency disables + * Hamlib specifies that passing 0 as the XIT frequency disables XIT. Thus there is no way to meet the spec and mimic the front panel XIT off function whilst keeping the XIT offset on the display. The Hamlib spec causes behavior analogous to shutting diff --git a/rotators/easycomm/easycomm.txt b/rotators/easycomm/easycomm.txt index c62795778..fe33fed92 100644 --- a/rotators/easycomm/easycomm.txt +++ b/rotators/easycomm/easycomm.txt @@ -34,7 +34,7 @@ may only decode the rotator control commands. The Host PC can issue the following commands -: -Command Meaning Perameters +Command Meaning Parameters ------- ------- ---------- AZ Azimuth number - 1 decimal place [deg] @@ -88,7 +88,7 @@ EASYCOMM III Standard The EasyComm 3 standard is an extension of the version 2 with the additional features: -Command Meaning Perameters Hamlib Config Token +Command Meaning Parameters Hamlib Config Token ------- ------- ---------- ------------------- VL Velocity Left number [mdeg/s] VR Velocity Right number [mdeg/s] diff --git a/simulators/simts890.c b/simulators/simts890.c index a3c513d21..6ebc0f264 100644 --- a/simulators/simts890.c +++ b/simulators/simts890.c @@ -328,7 +328,7 @@ int main(int argc, char *argv[]) if (strcmp(buf, "IF;") == 0) { - // Reads the tranceiver status + // Reads the transceiver status #if defined(LEGACY) char ifbuf[256]; hl_usleep(mysleep * 1000); @@ -1322,7 +1322,7 @@ int main(int argc, char *argv[]) case '3': // Bandscope Span case '4': // Bandscope Span case '5': // Bandscope Scope Range (Fixed Mode) - case '6': // Bandscope Dispaly Pause + case '6': // Bandscope Display Pause case '7': // Bandscope Marker case '8': // Bandscope Attenuator case '9': // Bandscope Max Hold @@ -1371,7 +1371,7 @@ int main(int argc, char *argv[]) case '0': // Registration of CW Message (Paddle Input) case '1': // Play/Stop the CW Message case '2': // Register State of CW Message (Paddle Input) - case '3': // Clear the CW Message (Paddle Inut) + case '3': // Clear the CW Message (Paddle Input) case '4': // CW Message Memory Name (Paddle Input) case '5': // Registering the CW Message Memory (Text Input) case '6': // CW Message Channel Repeat @@ -1454,7 +1454,7 @@ int main(int argc, char *argv[]) case '2': // Memory Channel (Channel Name) case '3': // Memory Channel (Scan Lockout) case '4': // Memory Channel (Channel Copy) - case '5': // Memory Channle (Channel Deletion) + case '5': // Memory Channel (Channel Deletion) case '6': // Programmable VFO End Frequency case '7': // Memory Channel (Temporary Change Frequency) break; diff --git a/src/microham.c b/src/microham.c index c47a0bb0f..f6482c782 100644 --- a/src/microham.c +++ b/src/microham.c @@ -721,7 +721,7 @@ static void writeControl(const unsigned char *data, int len) // // send a heartbeat and record time // The "last heartbeat" time is recorded in a global variable -// such that the service thread can decice whether a new +// such that the service thread can decide whether a new // heartbeat is due. // static void heartbeat() diff --git a/src/rig.c b/src/rig.c index e47105e6c..24be4ca1a 100644 --- a/src/rig.c +++ b/src/rig.c @@ -7547,7 +7547,7 @@ int HAMLIB_API rig_stop_morse(RIG *rig, vfo_t vfo) /* * wait_morse_ptt * generic routine to wait for ptt=0 - * should work on any full breakin CW morse send + * should work on any full break-in CW morse send * Assumes rig!=NULL, msg!=NULL */ static int wait_morse_ptt(RIG *rig, vfo_t vfo) diff --git a/src/sleep.c b/src/sleep.c index c3cc6c162..00a29e2d0 100644 --- a/src/sleep.c +++ b/src/sleep.c @@ -116,7 +116,7 @@ int hl_usleep(rig_useconds_t usec) int retval = 0; rig_debug(RIG_DEBUG_ERR, "%s: usec=%ld\n", __func__, usec); - if (usec <= 1000) { return 0; } // dont' sleep if only 1ms is requested -- speeds things up on Windows + if (usec <= 1000) { return 0; } // don't sleep if only 1ms is requested -- speeds things up on Windows while (usec > 1000000) { commit 71698e44325c26c92efd09b027e54cf22f0f18a8 Merge: 4a34d4c27 5abc606e1 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 1 11:25:36 2024 -0600 Merge branch 'master' of github.com:Hamlib/Hamlib commit 4a34d4c27f5ae9305e689fccbc3ca496223b5309 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 1 11:23:13 2024 -0600 Add new semi-colon separated hex values for send_raw icom https://github.com/Hamlib/Hamlib/issues/1632 diff --git a/NEWS b/NEWS index 2cef16957..d9b04777f 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ Version 5.x -- future * Change FT1000MP Mark V model names to align with FT1000MP Version 4.6 + * send_raw can now take hex digits as colon-seperated -- e.g. send_raw icom xfe:xfe:x94:xe0:03:xfd * Add IC7760 * IC7300 Mode filter can now be set by # (i.e. 1,2,3) * Fixed AF6SA WRC rotor controller diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index cb8ba8a89..9a1b6d44e 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -1398,13 +1398,26 @@ Returns current lock mode status 1=On, 2=Off (only useful when using rigctld) .TP .BR send_raw " \(aq" \fITerminator\fP "\(aq \(aq" \fIString\fP \(aq .EX -Can send ASCII string or 0xnn values -- there can be no spaces in the command string. +Can send ASCII string or 0xnn values or xnn values -- there can be no spaces in the command string. Possible terminator values are CR, LF, ;, ICOM, 0-100 (bytes to read), or -1 meaning unknown (will timeout on read) -Examples: - send_raw ; FA;MD; +Examples (note that a ; must be escaped in Unix/Linux): +For Windows & Unix/Linux we have a new colon-separated format for hex digits + send_raw icom 0xFE:0xFE:0x94:0x03:0xFD Note: colon-separated does not have to be escaped on Unix/Linux + send_raw -1 0xFE:0xFE:0x94:0x03:0xFD + send_raw 14 0xFE:0xFE:0x94:0x03:0xFD + Note that ASCII commands still require escaping the semicolon on Unix/Linux + send_raw \; FA\;MD\; + +For Windows: send_raw icom 0xFE;0xFE;0x94;0x03;0xFD send_raw -1 0xFE;0xFE;0x94;0x03;0xFD send_raw 14 0xFE;0xFE;0x94;0x03;0xFD + + For Unix/Linux + send_raw icom 0xFE\;0xFE\;0x94\;0x03\;0xFD + send_raw \; FA\;MD\; + send_raw -1 0xFE\;0xFE\;0x94\;0x03\;0xFD + send_raw 14 0xFE\;0xFE\;0x94\;0x03\;0xFD . .TP .BR client_version " \(aq" \fIString\fP "\(aq diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 4b305a281..5c52ad408 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -5793,14 +5793,26 @@ static int parse_hex(const char *s, unsigned char *buf, int len) int i = 0; buf[0] = 0; char *s2 = strdup(s); - char *p = strtok(s2, ";"); + char *p = strtok(s2, ";:"); while (p) { unsigned int val; - sscanf(p, "0x%x", &val); + int n; + + if ((n = sscanf(p, "0x%2x", &val)) != 1) + { + n = sscanf(p, "x%2x", &val); + } + + if (n == 0) + { + rig_debug(RIG_DEBUG_ERR, "%s: unable to parse 0x??; or x??; from '%s'\n", + __func__, s); + } + buf[i++] = val; - p = strtok(NULL, ";"); + p = strtok(NULL, ";:"); } free(s2); @@ -5863,7 +5875,7 @@ declare_proto_rig(send_raw) return -RIG_EINVAL; } - if (strncmp(arg2, "0x", 2) == 0) + if (strncmp(arg2, "0x", 2) == 0 || arg2[0] == 'x') { arg2_len = parse_hex(arg2, send, sizeof(send)); sendp = send; commit 5abc606e13903e821c0ac88a2768f6549c5b8704 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 1 11:23:13 2024 -0600 Add new semi-colon separated hex values for send_raw icom diff --git a/NEWS b/NEWS index 2cef16957..d9b04777f 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ Version 5.x -- future * Change FT1000MP Mark V model names to align with FT1000MP Version 4.6 + * send_raw can now take hex digits as colon-seperated -- e.g. send_raw icom xfe:xfe:x94:xe0:03:xfd * Add IC7760 * IC7300 Mode filter can now be set by # (i.e. 1,2,3) * Fixed AF6SA WRC rotor controller diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index cb8ba8a89..9a1b6d44e 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -1398,13 +1398,26 @@ Returns current lock mode status 1=On, 2=Off (only useful when using rigctld) .TP .BR send_raw " \(aq" \fITerminator\fP "\(aq \(aq" \fIString\fP \(aq .EX -Can send ASCII string or 0xnn values -- there can be no spaces in the command string. +Can send ASCII string or 0xnn values or xnn values -- there can be no spaces in the command string. Possible terminator values are CR, LF, ;, ICOM, 0-100 (bytes to read), or -1 meaning unknown (will timeout on read) -Examples: - send_raw ; FA;MD; +Examples (note that a ; must be escaped in Unix/Linux): +For Windows & Unix/Linux we have a new colon-separated format for hex digits + send_raw icom 0xFE:0xFE:0x94:0x03:0xFD Note: colon-separated does not have to be escaped on Unix/Linux + send_raw -1 0xFE:0xFE:0x94:0x03:0xFD + send_raw 14 0xFE:0xFE:0x94:0x03:0xFD + Note that ASCII commands still require escaping the semicolon on Unix/Linux + send_raw \; FA\;MD\; + +For Windows: send_raw icom 0xFE;0xFE;0x94;0x03;0xFD send_raw -1 0xFE;0xFE;0x94;0x03;0xFD send_raw 14 0xFE;0xFE;0x94;0x03;0xFD + + For Unix/Linux + send_raw icom 0xFE\;0xFE\;0x94\;0x03\;0xFD + send_raw \; FA\;MD\; + send_raw -1 0xFE\;0xFE\;0x94\;0x03\;0xFD + send_raw 14 0xFE\;0xFE\;0x94\;0x03\;0xFD . .TP .BR client_version " \(aq" \fIString\fP "\(aq diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 4b305a281..5c52ad408 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -5793,14 +5793,26 @@ static int parse_hex(const char *s, unsigned char *buf, int len) int i = 0; buf[0] = 0; char *s2 = strdup(s); - char *p = strtok(s2, ";"); + char *p = strtok(s2, ";:"); while (p) { unsigned int val; - sscanf(p, "0x%x", &val); + int n; + + if ((n = sscanf(p, "0x%2x", &val)) != 1) + { + n = sscanf(p, "x%2x", &val); + } + + if (n == 0) + { + rig_debug(RIG_DEBUG_ERR, "%s: unable to parse 0x??; or x??; from '%s'\n", + __func__, s); + } + buf[i++] = val; - p = strtok(NULL, ";"); + p = strtok(NULL, ";:"); } free(s2); @@ -5863,7 +5875,7 @@ declare_proto_rig(send_raw) return -RIG_EINVAL; } - if (strncmp(arg2, "0x", 2) == 0) + if (strncmp(arg2, "0x", 2) == 0 || arg2[0] == 'x') { arg2_len = parse_hex(arg2, send, sizeof(send)); sendp = send; commit ab2b5fb9e9d9f8bcf48bac5190b8fa17ce33c04c Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Nov 27 12:30:27 2024 -0600 Fix IC7760 civ address diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 85edeb01d..363772cc2 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -678,7 +678,7 @@ static const struct icom_addr icom_addr_list[] = {RIG_MODEL_IC7300, 0x94}, {RIG_MODEL_IC7610, 0x98}, {RIG_MODEL_IC7700, 0x74}, - {RIG_MODEL_IC7760, 0xB1}, + {RIG_MODEL_IC7760, 0xB2}, {RIG_MODEL_PERSEUS, 0xE1}, {RIG_MODEL_X108G, 0x70}, {RIG_MODEL_X6100, 0x70}, commit dc7bbeca34cd91bd021bcd60dfa936fbd1f242de Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Nov 27 12:28:59 2024 -0600 Fix civ address for IC7760 diff --git a/rigs/icom/ic7760.c b/rigs/icom/ic7760.c index 438ae191f..c20f46d74 100644 --- a/rigs/icom/ic7760.c +++ b/rigs/icom/ic7760.c @@ -118,7 +118,7 @@ int ic7760_ext_tokens[] = */ static const struct icom_priv_caps ic7760_priv_caps = { - 0xb1, /* default address */ + 0xb2, /* default address */ 0, /* 731 mode */ 0, /* no XCHG */ ic756pro_ts_sc_list, commit d86f0db383cd51c3640aab17de91168351744ec3 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Nov 27 12:10:48 2024 -0600 Fix 10GHz power watts for IC9700 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 082d846b4..85edeb01d 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -4550,11 +4550,6 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) rig_raw2val_float(icom_val, &rig->caps->rfpower_meter_cal) * 0.01; } - if (RIG_IS_IC9700 && CACHE(rig)->freqMainA >= 1e9) - { - val->f /= 10; // power scale is different for 10GHz - } - break; case RIG_LEVEL_RFPOWER_METER_WATTS: @@ -4578,6 +4573,11 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->f); } + if (RIG_IS_IC9700 && CACHE(rig)->freqMainA >= 1e9) + { + val->f /= 10; // power scale is different for 10GHz + } + rig_get_range(&range_list, STATE(rig)->current_freq, STATE(rig)->current_mode); rig_debug(RIG_DEBUG_VERBOSE, "%s: maxpower=%d\n", __func__, range_list.high_power); diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index b1f3812b7..faf004030 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20241121" +#define BACKEND_VER "20241127" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit 3f90a9323eb3b477fbc92308dee131221a7cac90 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Nov 27 12:07:03 2024 -0600 Update POWER_METER values for IC7700 and IC7760 diff --git a/rigs/icom/ic7700.c b/rigs/icom/ic7700.c index 700da9a4e..3d1a2f576 100644 --- a/rigs/icom/ic7700.c +++ b/rigs/icom/ic7700.c @@ -72,21 +72,12 @@ { 120, 1.0f } \ } } -#define IC7700_RFPOWER_METER_CAL { 13, \ +#define IC7700_RFPOWER_METER_CAL { 4, \ { \ { 0, 0.0f }, \ - { 21, 5.0f }, \ - { 43, 10.0f }, \ - { 65, 15.0f }, \ - { 83, 20.0f }, \ - { 95, 25.0f }, \ - { 105, 30.0f }, \ - { 114, 35.0f }, \ - { 124, 40.0f }, \ - { 143, 50.0f }, \ - { 183, 75.0f }, \ - { 213, 100.0f }, \ - { 255, 120.0f } \ + { 143, 100.0f }, \ + { 212, 200.0f }, \ + { 255, 250.0f }, \ } } @@ -277,7 +268,7 @@ struct rig_caps ic7700_caps = RIG_MODEL(RIG_MODEL_IC7700), .model_name = "IC-7700", .mfg_name = "Icom", - .version = BACKEND_VER ".5", + .version = BACKEND_VER ".6", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, diff --git a/rigs/icom/ic7760.c b/rigs/icom/ic7760.c index dd03adf8b..438ae191f 100644 --- a/rigs/icom/ic7760.c +++ b/rigs/icom/ic7760.c @@ -49,7 +49,7 @@ #define IC7760_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3|RIG_ANT_4) -// IC-7760 S-meter calibration data based on manual +// IC-7760 calibration data based on manual #define IC7760_STR_CAL { 3, \ { \ { 0,-54 }, \ @@ -72,24 +72,14 @@ { 120, 1.0f } \ } } -#define IC7760_RFPOWER_METER_CAL { 13, \ +#define IC7760_RFPOWER_METER_CAL { 4, \ { \ { 0, 0.0f }, \ - { 21, 5.0f }, \ - { 43, 10.0f }, \ - { 65, 15.0f }, \ - { 83, 20.0f }, \ - { 95, 25.0f }, \ - { 105, 30.0f }, \ - { 114, 35.0f }, \ - { 124, 40.0f }, \ - { 143, 50.0f }, \ - { 183, 75.0f }, \ - { 213, 100.0f }, \ - { 255, 120.0f } \ + { 143, 100.0f }, \ + { 212, 200.0f }, \ + { 255, 250.0f }, \ } } - #define IC7760_COMP_METER_CAL { 3, \ { \ { 0, 0.0f }, \ commit 610581ca95686a9eb8e407c399816b421e720aa9 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Nov 27 10:47:34 2024 -0600 Some updates to IC7760 diff --git a/rigs/icom/ic7760.c b/rigs/icom/ic7760.c index f101e9726..dd03adf8b 100644 --- a/rigs/icom/ic7760.c +++ b/rigs/icom/ic7760.c @@ -343,10 +343,10 @@ struct rig_caps ic7760_caps = RIG_FRNG_END, }, .tx_range_list1 = { - FRQ_RNG_HF(1, IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS), - FRQ_RNG_6m(1, IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS), - FRQ_RNG_HF(1, IC7760_AM_TX_MODES, W(5), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */ - FRQ_RNG_6m(1, IC7760_AM_TX_MODES, W(5), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */ + FRQ_RNG_HF(1, IC7760_OTHER_TX_MODES, W(1), W(200), IC7760_VFOS, IC7760_ANTS), + FRQ_RNG_6m(1, IC7760_OTHER_TX_MODES, W(1), W(200), IC7760_VFOS, IC7760_ANTS), + FRQ_RNG_HF(1, IC7760_AM_TX_MODES, W(.25), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */ + FRQ_RNG_6m(1, IC7760_AM_TX_MODES, W(.25), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */ RIG_FRNG_END, }, @@ -354,16 +354,16 @@ struct rig_caps ic7760_caps = RIG_FRNG_END, }, .tx_range_list2 = { - FRQ_RNG_HF(2, IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS), - FRQ_RNG_6m(2, IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS), - FRQ_RNG_HF(2, IC7760_AM_TX_MODES, W(5), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */ - FRQ_RNG_6m(2, IC7760_AM_TX_MODES, W(5), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */ + FRQ_RNG_HF(2, IC7760_OTHER_TX_MODES, W(1), W(200), IC7760_VFOS, IC7760_ANTS), + FRQ_RNG_6m(2, IC7760_OTHER_TX_MODES, W(1), W(200), IC7760_VFOS, IC7760_ANTS), + FRQ_RNG_HF(2, IC7760_AM_TX_MODES, W(.25), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */ + FRQ_RNG_6m(2, IC7760_AM_TX_MODES, W(.251), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */ /* USA only, TBC: end of range and modes */ - {MHz(5.33050), MHz(5.33350), IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */ - {MHz(5.34650), MHz(5.34950), IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */ - {MHz(5.36650), MHz(5.36950), IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */ - {MHz(5.37150), MHz(5.37450), IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */ - {MHz(5.40350), MHz(5.40650), IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */ + {MHz(5.33050), MHz(5.33350), IC7760_OTHER_TX_MODES, W(1), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */ + {MHz(5.34650), MHz(5.34950), IC7760_OTHER_TX_MODES, W(1), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */ + {MHz(5.36650), MHz(5.36950), IC7760_OTHER_TX_MODES, W(1), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */ + {MHz(5.37150), MHz(5.37450), IC7760_OTHER_TX_MODES, W(1), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */ + {MHz(5.40350), MHz(5.40650), IC7760_OTHER_TX_MODES, W(1), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */ RIG_FRNG_END, }, commit 8ee3c9fa64fdebf70aa18b5b1ccbc313a5442a53 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Nov 26 23:44:45 2024 -0600 Add ic7760.c diff --git a/rigs/icom/ic7760.c b/rigs/icom/ic7760.c new file mode 100644 index 000000000..f101e9726 --- /dev/null +++ b/rigs/icom/ic7760.c @@ -0,0 +1,466 @@ +/* + * Hamlib CI-V backend - description of IC-7760 and variations + * Copyright (c) 2009-2010 by Stephane Fillod + * + * + * 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 Stre<et, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include <stdlib.h> + +#include <hamlib/rig.h> +#include "token.h" +#include "tones.h" +#include "idx_builtin.h" + +#include "icom.h" +#include "icom_defs.h" +#include "bandplan.h" +#include "frame.h" +#include "misc.h" + +#define IC7760_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_FM|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|RIG_MODE_PSK|RIG_MODE_PSKR) +#define IC7760_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_PKTAM) +#define IC7760_ALL_RX_MODES IC7760_OTHER_TX_MODES | IC7760_AM_TX_MODES +#define IC7760_1HZ_TS_MODES IC7760_ALL_RX_MODES + +#define IC7760_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_VSC|RIG_FUNC_LOCK|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER|RIG_FUNC_APF) + +#define IC7760_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|RIG_LEVEL_BALANCE|RIG_LEVEL_NR|RIG_LEVEL_PBT_IN|RIG_LEVEL_PBT_OUT|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_NOTCHF_RAW|RIG_LEVEL_SQL|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_APF|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_AGC_TIME) + +#define IC7760_VFOS (RIG_VFO_MAIN|RIG_VFO_SUB|RIG_VFO_MEM) +#define IC7760_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT) + +#define IC7760_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL|RIG_OP_TUNE) +#define IC7760_SCAN_OPS (RIG_SCAN_MEM|RIG_SCAN_VFO|RIG_SCAN_PROG|RIG_SCAN_DELTA|RIG_SCAN_PRIO) + +#define IC7760_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3|RIG_ANT_4) + +// IC-7760 S-meter calibration data based on manual +#define IC7760_STR_CAL { 3, \ + { \ + { 0,-54 }, \ + { 120, 0 }, \ + { 241, 60 } \ + } } + +#define IC7760_SWR_CAL { 5, \ + { \ + { 0, 1.0f }, \ + { 48, 1.5f }, \ + { 80, 2.0f }, \ + { 120, 3.0f }, \ + { 240, 6.0f } \ + } } + +#define IC7760_ALC_CAL { 2, \ + { \ + { 0, 0.0f }, \ + { 120, 1.0f } \ + } } + +#define IC7760_RFPOWER_METER_CAL { 13, \ + { \ + { 0, 0.0f }, \ + { 21, 5.0f }, \ + { 43, 10.0f }, \ + { 65, 15.0f }, \ + { 83, 20.0f }, \ + { 95, 25.0f }, \ + { 105, 30.0f }, \ + { 114, 35.0f }, \ + { 124, 40.0f }, \ + { 143, 50.0f }, \ + { 183, 75.0f }, \ + { 213, 100.0f }, \ + { 255, 120.0f } \ + } } + + +#define IC7760_COMP_METER_CAL { 3, \ + { \ + { 0, 0.0f }, \ + { 130, 15.0f }, \ + { 241, 30.0f } \ + } } + +#define IC7760_VD_METER_CAL { 4, \ + { \ + { 0, 0.0f }, \ + { 151, 44.0f }, \ + { 180, 48.0f }, \ + { 211, 52.0f } \ + } } + +#define IC7760_ID_METER_CAL { 3, \ + { \ + { 0, 0.0f }, \ + { 165, 10.0f }, \ + { 241, 15.0f } \ + } } + +struct cmdparams ic7760_extcmds[] = +{ + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x82}, CMD_DAT_INT, 1 }, + { { 0 } } +}; + +int ic7760_ext_tokens[] = +{ + TOK_DRIVE_GAIN, TOK_DIGI_SEL_FUNC, TOK_DIGI_SEL_LEVEL, TOK_BACKEND_NONE +}; + +/* + * IC-7760 rig capabilities. + */ +static const struct icom_priv_caps ic7760_priv_caps = +{ + 0xb1, /* default address */ + 0, /* 731 mode */ + 0, /* no XCHG */ + ic756pro_ts_sc_list, + .antack_len = 4, + .ant_count = 4, + .agc_levels_present = 1, + .agc_levels = { + { .level = RIG_AGC_OFF, .icom_level = 0 }, + { .level = RIG_AGC_FAST, .icom_level = 1 }, + { .level = RIG_AGC_MEDIUM, .icom_level = 2 }, + { .level = RIG_AGC_SLOW, .icom_level = 3 }, + { .level = RIG_AGC_LAST, .icom_level = -1 }, + }, + .extcmds = ic7760_extcmds, + .x25x26_always = 1, + .x25x26_possibly = 1, + .x1cx03_always = 1, + .x1cx03_possibly = 1, + .x1ax03_supported = 1, + .mode_with_filter = 1, + .data_mode_supported = 1 +}; + +// if hour < 0 then only date will be set +int ic7760_set_clock(RIG *rig, int year, int month, int day, int hour, int min, + int sec, double msec, int utc_offset) +{ + int cmd = 0x1a; + int subcmd = 0x05; + int retval = RIG_OK; + unsigned char prmbuf[MAXFRAMELEN]; + + if (year >= 0) + { + prmbuf[0] = 0x02; + prmbuf[1] = 0x05; + to_bcd(&prmbuf[2], year / 100, 2); + to_bcd(&prmbuf[3], year % 100, 2); + to_bcd(&prmbuf[4], month, 2); + to_bcd(&prmbuf[5], day, 2); + retval = icom_transaction(rig, cmd, subcmd, prmbuf, 6, NULL, NULL); + + if (retval != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\b", __func__, __LINE__, rigerror(retval)); + } + } + + if (hour >= 0) + { + prmbuf[0] = 0x02; + prmbuf[1] = 0x06; + to_bcd(&prmbuf[2], hour, 2); + to_bcd(&prmbuf[3], min, 2); + retval = icom_transaction(rig, cmd, subcmd, prmbuf, 4, NULL, NULL); + + if (retval != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\b", __func__, __LINE__, rigerror(retval)); + } + + prmbuf[0] = 0x02; + prmbuf[1] = 0x04; + rig_debug(RIG_DEBUG_ERR, "%s: utc_offset=%d\n", __func__, utc_offset); + to_bcd(&prmbuf[2], abs(utc_offset) / 100, 2); + to_bcd(&prmbuf[3], abs(utc_offset) % 100, 2); + to_bcd(&prmbuf[4], utc_offset >= 0 ? 0 : 1, 2); + retval = icom_transaction(rig, cmd, subcmd, prmbuf, 5, NULL, NULL); + + if (retval != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s(%d): %s\b", __func__, __LINE__, rigerror(retval)); + } + } + + return retval; +} + +int ic7760_get_clock(RIG *rig, int *year, int *month, int *day, int *hour, + int *min, int *sec, double *msec, int *utc_offset) +{ + int cmd = 0x1a; + int subcmd = 0x05; + int retval = RIG_OK; + int resplen; + unsigned char prmbuf[MAXFRAMELEN]; + unsigned char respbuf[MAXFRAMELEN]; + + prmbuf[0] = 0x00; + prmbuf[1] = 0x58; + resplen = sizeof(respbuf); + retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen); + *year = from_bcd(&respbuf[4], 2) * 100 + from_bcd(&respbuf[5], 2); + *month = from_bcd(&respbuf[6], 2); + *day = from_bcd(&respbuf[7], 2); + + if (hour != NULL) + { + prmbuf[0] = 0x00; + prmbuf[1] = 0x59; + retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen); + + if (retval != RIG_OK) + { + return retval; + } + + *hour = from_bcd(&respbuf[4], 2); + *min = from_bcd(&respbuf[5], 2); + *sec = 0; + *msec = 0; + + prmbuf[0] = 0x00; + prmbuf[1] = 0x61; + retval = icom_transaction(rig, cmd, subcmd, prmbuf, 2, respbuf, &resplen); + + if (retval != RIG_OK) + { + return retval; + } + + *utc_offset = from_bcd(&respbuf[4], 2) * 100; + *utc_offset += from_bcd(&respbuf[5], 2); + + if (respbuf[6] != 0x00) { *utc_offset *= -1; } + + //rig_debug(RIG_DEBUG_VERBOSE, + // "%s: %02d-%02d-%02dT%02d:%02d:%06.3lf%s%04d\n'", + // __func__, *year, *month, *day, *hour, *min, *sec + *msec / 1000, + // *utc_offset >= 0 ? "+" : "-", (unsigned)abs(*utc_offset)); + } + + return retval; +} + +static int ic7760_rig_open(RIG *rig) +{ + rig_debug(RIG_DEBUG_VERBOSE, "%s: enter\n", __func__); + return icom_rig_open(rig); +} + +struct rig_caps ic7760_caps = +{ + RIG_MODEL(RIG_MODEL_IC7760), + .model_name = "IC-7760", + .mfg_name = "Icom", + .version = BACKEND_VER ".0", + .copyright = "LGPL", + .status = RIG_STATUS_ALPHA, + .rig_type = RIG_TYPE_TRANSCEIVER, + .ptt_type = RIG_PTT_RIG, + .dcd_type = RIG_DCD_RIG, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 300, // the manual does not show serial speeds + .serial_rate_max = 19200, + .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 = 1000, + .retry = 3, + .has_get_func = IC7760_FUNCS, + .has_set_func = IC7760_FUNCS, + .has_get_level = IC7760_LEVELS, + .has_set_level = RIG_LEVEL_SET(IC7760_LEVELS), + .has_get_parm = IC7760_PARMS, + .has_set_parm = RIG_PARM_SET(IC7760_PARMS), /* FIXME: parms */ + .level_gran = + { +#define NO_LVL_KEYSPD +#define NO_LVL_CWPITCH +#include "level_gran_icom.h" +#undef NO_LVL_KEYSPD +#undef NO_LVL_CWPITCH + [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, + [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 1 } }, + }, + .parm_gran = { + [PARM_BACKLIGHT] = {.min = {.f = 0.0f}, .max = {.f = 1.0f}, .step = {.f = 1.0f / 255.0f}}, + [PARM_BANDSELECT] = {.step = {.s = "BANDUNUSED,BAND160M,BAND80M,BAND40M,BAND30M,BAND20M,BAND17M,BAND15M,BAND12M,BAND10M,BAND6M,BANDGEN"}}, + [PARM_ANN] = {.min = {.i = 0}, .max = {.i = 2}, .step = {.i = 1}}, + }, + + .ext_tokens = ic7760_ext_tokens, + .ctcss_list = common_ctcss_list, + .dcs_list = NULL, + .preamp = { 10, 20, RIG_DBLST_END, }, /* FIXME: TBC */ + .attenuator = { 6, 12, 18, RIG_DBLST_END, }, + .max_rit = Hz(9999), + .max_xit = Hz(9999), + .max_ifshift = Hz(0), + .agc_level_count = 4, + .agc_levels = { RIG_AGC_OFF, RIG_AGC_FAST, RIG_AGC_MEDIUM, RIG_AGC_SLOW }, + // ?? 7700 can have a different mode on VFOB but requires VFO swap + .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, + .vfo_ops = IC7760_VFO_OPS, + .scan_ops = IC7760_SCAN_OPS, + .transceive = RIG_TRN_RIG, + .bank_qty = 0, + .chan_desc_sz = 0, + + .chan_list = { + { 1, 99, RIG_MTYPE_MEM }, + { 100, 101, RIG_MTYPE_EDGE }, /* two by two */ + { 1, 4, RIG_MTYPE_MORSE }, + RIG_CHAN_END, + }, + + .rx_range_list1 = { {kHz(30), MHz(60), IC7760_ALL_RX_MODES, -1, -1, IC7760_VFOS, IC7760_ANTS}, + RIG_FRNG_END, + }, + .tx_range_list1 = { + FRQ_RNG_HF(1, IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS), + FRQ_RNG_6m(1, IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS), + FRQ_RNG_HF(1, IC7760_AM_TX_MODES, W(5), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */ + FRQ_RNG_6m(1, IC7760_AM_TX_MODES, W(5), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */ + RIG_FRNG_END, + }, + + .rx_range_list2 = { {kHz(30), MHz(60), IC7760_ALL_RX_MODES, -1, -1, IC7760_VFOS, IC7760_ANTS}, + RIG_FRNG_END, + }, + .tx_range_list2 = { + FRQ_RNG_HF(2, IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS), + FRQ_RNG_6m(2, IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS), + FRQ_RNG_HF(2, IC7760_AM_TX_MODES, W(5), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */ + FRQ_RNG_6m(2, IC7760_AM_TX_MODES, W(5), W(50), IC7760_VFOS, IC7760_ANTS), /* AM class */ + /* USA only, TBC: end of range and modes */ + {MHz(5.33050), MHz(5.33350), IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */ + {MHz(5.34650), MHz(5.34950), IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */ + {MHz(5.36650), MHz(5.36950), IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */ + {MHz(5.37150), MHz(5.37450), IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */ + {MHz(5.40350), MHz(5.40650), IC7760_OTHER_TX_MODES, W(5), W(200), IC7760_VFOS, IC7760_ANTS}, /* USA only */ + RIG_FRNG_END, + }, + + .tuning_steps = { + {IC7760_1HZ_TS_MODES, 1}, + {IC7760_ALL_RX_MODES, Hz(100)}, + {IC7760_ALL_RX_MODES, kHz(1)}, + {IC7760_ALL_RX_MODES, kHz(5)}, + {IC7760_ALL_RX_MODES, kHz(9)}, + {IC7760_ALL_RX_MODES, kHz(10)}, + {IC7760_ALL_RX_MODES, kHz(12.5)}, + {IC7760_ALL_RX_MODES, kHz(20)}, + {IC7760_ALL_RX_MODES, kHz(25)}, + RIG_TS_END, + }, + /* mode/filter list, remember: order matters! */ + .filters = { + {RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(2.4)}, + {RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(1.8)}, + {RIG_MODE_SSB | RIG_MODE_PKTLSB | RIG_MODE_PKTUSB, kHz(3)}, + {RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_PSK | RIG_MODE_PSKR, Hz(400)}, + {RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR | RIG_MODE_PSK | RIG_MODE_PSKR, Hz(50)}, + {RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_PSK | RIG_MODE_PSKR, kHz(1.0)}, + {RIG_MODE_RTTY | RIG_MODE_RTTYR, kHz(2.4)}, + {RIG_MODE_AM | RIG_MODE_PKTAM, kHz(6)}, + {RIG_MODE_AM | RIG_MODE_PKTAM, kHz(3)}, + {RIG_MODE_AM | RIG_MODE_PKTAM, kHz(9)}, + {RIG_MODE_FM | RIG_MODE_PKTFM, kHz(12)}, + {RIG_MODE_FM | RIG_MODE_PKTFM, kHz(8)}, + {RIG_MODE_FM | RIG_MODE_PKTFM, kHz(15)}, + RIG_FLT_END, + }, + .str_cal = IC7760_STR_CAL, + .swr_cal = IC7760_SWR_CAL, + .alc_cal = IC7760_ALC_CAL, + .rfpower_meter_cal = IC7760_RFPOWER_METER_CAL, + .comp_meter_cal = IC7760_COMP_METER_CAL, + .vd_meter_cal = IC7760_VD_METER_CAL, + .id_meter_cal = IC7760_ID_METER_CAL, + + .cfgparams = icom_cfg_params, + .set_conf = icom_set_conf, + .get_conf = icom_get_conf, + + .priv = (void *)& ic7760_priv_caps, + .rig_init = icom_init, + .rig_cleanup = icom_cleanup, + .rig_open = ic7760_rig_open, + .rig_close = icom_rig_close, + + .set_freq = icom_set_freq, + .get_freq = icom_get_freq, + .set_mode = icom_set_mode, + .get_mode = icom_get_mode, + .set_vfo = icom_set_vfo, +// .get_vfo = icom_get_vfo, + .set_ant = icom_set_ant, + .get_ant = icom_get_ant, + + .set_rit = icom_set_rit_new, + .get_rit = icom_get_rit_new, + .get_xit = icom_get_rit_new, + .set_xit = icom_set_xit_new, + + .decode_event = icom_decode_event, + .set_level = icom_set_level, + .get_level = icom_get_level, + .set_ext_level = icom_set_ext_level, + .get_ext_level = icom_get_ext_level, + .set_func = icom_set_func, + .get_func = icom_get_func, + .set_parm = icom_set_parm, + .get_parm = icom_get_parm, + .set_mem = icom_set_mem, + .vfo_op = icom_vfo_op, + .scan = icom_scan, + .set_ptt = icom_set_ptt, + .get_ptt = icom_get_ptt, + .get_dcd = icom_get_dcd, + .set_ts = icom_set_ts, + .get_ts = icom_get_ts, + .set_ctcss_tone = icom_set_ctcss_tone, + .get_ctcss_tone = icom_get_ctcss_tone, + .set_ctcss_sql = icom_set_ctcss_sql, + .get_ctcss_sql = icom_get_ctcss_sql, + .set_split_freq = icom_set_split_freq, + .get_split_freq = icom_get_split_freq, + .set_split_mode = icom_set_split_mode, + .get_split_mode = icom_get_split_mode, + .set_split_vfo = icom_set_split_vfo, + .get_split_vfo = icom_get_split_vfo, + .set_powerstat = icom_set_powerstat, + .get_powerstat = icom_get_powerstat, + .send_morse = icom_send_morse, + .stop_morse = icom_stop_morse, + .wait_morse = rig_wait_morse, + .set_clock = ic7760_set_clock, + .get_clock = ic7760_get_clock, + .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS +}; commit a94e2948f550f2e040a24d5c965a62be4628f2ea Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Nov 26 23:38:19 2024 -0600 Add IC7760 Alpha diff --git a/NEWS b/NEWS index 32e029f7b..2cef16957 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ Version 5.x -- future * Change FT1000MP Mark V model names to align with FT1000MP Version 4.6 + * Add IC7760 * IC7300 Mode filter can now be set by # (i.e. 1,2,3) * Fixed AF6SA WRC rotor controller * Added Rhode&Schwarz XK852 diff --git a/include/hamlib/riglist.h b/include/hamlib/riglist.h index 8b1abb743..7b1579e23 100644 --- a/include/hamlib/riglist.h +++ b/include/hamlib/riglist.h @@ -297,6 +297,7 @@ #define RIG_MODEL_X5105 RIG_MAKE_MODEL(RIG_ICOM, 89) /* Xiegu X5105 -- G90 compatible */ #define RIG_MODEL_IC905 RIG_MAKE_MODEL(RIG_ICOM, 90) #define RIG_MODEL_X6200 RIG_MAKE_MODEL(RIG_ICOM, 91) /* Xiegu X6200 */ +#define RIG_MODEL_IC7760 RIG_MAKE_MODEL(RIG_ICOM, 92) /* * Optoelectronics (CI-V) diff --git a/rigs/icom/Makefile.am b/rigs/icom/Makefile.am index ae35b5139..b295fe8d1 100644 --- a/rigs/icom/Makefile.am +++ b/rigs/icom/Makefile.am @@ -8,7 +8,7 @@ ICOMSRC = icom.c icom.h icom_defs.h frame.c frame.h ic706.c icr8500.c ic735.c ic id1.c id31.c id51.c id4100.c id5100.c perseus.c ic2730.c \ ic707.c ic728.c ic751.c ic761.c \ ic78.c ic7800.c ic785x.c \ - ic7000.c ic7100.c ic7200.c ic7300.c ic7600.c ic7610.c ic7700.c icf8101.c \ + ic7000.c ic7100.c ic7200.c ic7300.c ic7600.c ic7610.c ic7700.c ic7760.c icf8101.c \ ic7300.h optoscan.c optoscan.h xiegu.c level_gran_icom.h noinst_LTLIBRARIES = libhamlib-icom.la diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 5eaec5dde..082d846b4 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -668,15 +668,17 @@ static const struct icom_addr icom_addr_list[] = {RIG_MODEL_ICR8500, 0x4a}, {RIG_MODEL_ICR9000, 0x2a}, {RIG_MODEL_ICR9500, 0x72}, - {RIG_MODEL_MINISCOUT, 0x94}, +// {RIG_MODEL_MINISCOUT, 0x94}, // ic7300 took this one {RIG_MODEL_IC718, 0x5e}, {RIG_MODEL_OS535, 0x80}, /* same address as IC-7410 */ {RIG_MODEL_ICID1, 0x01}, {RIG_MODEL_IC7000, 0x70}, {RIG_MODEL_IC7100, 0x88}, {RIG_MODEL_IC7200, 0x76}, + {RIG_MODEL_IC7300, 0x94}, {RIG_MODEL_IC7610, 0x98}, {RIG_MODEL_IC7700, 0x74}, + {RIG_MODEL_IC7760, 0xB1}, {RIG_MODEL_PERSEUS, 0xE1}, {RIG_MODEL_X108G, 0x70}, {RIG_MODEL_X6100, 0x70}, @@ -10043,6 +10045,7 @@ DECLARE_INITRIG_BACKEND(icom) rig_register(&ic7200_caps); rig_register(&ic7300_caps); rig_register(&ic7610_caps); + rig_register(&ic7760_caps); rig_register(&ic781_caps); rig_register(&ic707_caps); rig_register(&ic728_caps); diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 11d6e7214..b1f3812b7 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -497,6 +497,7 @@ extern struct rig_caps ic475_caps; extern struct rig_caps ic575_caps; extern struct rig_caps ic1275_caps; extern struct rig_caps icf8101_caps; +extern struct rig_caps ic7760_caps; extern struct rig_caps omnivip_caps; extern struct rig_caps delta2_caps; commit fbdb6656209306df75aaa2f541122f325f90a818 Merge: dcc7b3743 2447cb204 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Nov 24 22:30:38 2024 -0600 Merge branch 'master' of https://github.com/Hamlib/Hamlib diff --cc doc/man1/rigctlsync.1 index c84ea9ef7,d07dc83b4..d35dd41eb --- a/doc/man1/rigctlsync.1 +++ b/doc/man1/rigctlsync.1 @@@ -29,7 -29,7 +29,7 @@@ rigctlsync \- synchronize a rig to SDR .YS . .SH DESCRIPTION - Allows you to synchronize frequence from a rig to SDR#. -Allows you to synchornize frequency from a rig to SDR#. ++Allows you to synchronize frequency from a rig to SDR#. Best when used with rigctld, FlRig, or a multiport radio. . .PP diff --cc rigs/icom/icom.h index 2cf9259c0,2cf9259c0..11d6e7214 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@@ -35,7 -35,7 +35,7 @@@ #include <sys/time.h> #endif --#define BACKEND_VER "20241111" ++#define BACKEND_VER "20241121" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) diff --cc rigs/kenwood/flex6xxx.c index 76da92547,76da92547..dd145a368 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@@ -1331,6 -1331,6 +1331,9 @@@ int powersdr_get_parm(RIG *rig, setting RETURNFUNC(RIG_OK); } ++#define NO_LVL_KEYSPD ++#define NO_LVL_SLOPE_LOW ++#define NO_LVL_SLOPE_HIGH /* * F6K rig capabilities. @@@ -1360,13 -1360,13 +1363,7 @@@ struct rig_caps f6k_caps .has_set_level = F6K_LEVEL_ALL, .has_get_parm = RIG_P... [truncated message content] |
From: n0nb <n0...@us...> - 2024-11-22 22:03:30
|
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 4b77f9b6b67afc4bf26e4aeaa4774cb842d48d8b (commit) via 11acef5d3bc4645ad70881759b2aeaf0de443cfe (commit) via c080ba7b829e0d1427edd066ff39a1a4f88b8fb5 (commit) via 238344b0ce3db6d50b8647c54de7d56355a37f64 (commit) via d640511b206b466892ce37085b2e0bd35ef59b71 (commit) via 3f526117097b08d075134309cb94e76c8cfdba5f (commit) via 48aa284152ff5c6e031eecff261bbe9b3d809c01 (commit) from d444fe43c61477ea823009ab5de24c69cf4de817 (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 4b77f9b6b67afc4bf26e4aeaa4774cb842d48d8b Merge: d640511b2 11acef5d3 Author: Michael Black <mdb...@ya...> Date: Fri Nov 22 15:07:51 2024 -0600 Merge pull request #1630 from GeoBaltz/fix23 Fix23 commit 11acef5d3bc4645ad70881759b2aeaf0de443cfe Author: George Baltz N3GB <Geo...@gm...> Date: Thu Nov 21 19:21:41 2024 -0500 MACROize new code. diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 58b6e8692..bfabc388b 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -853,7 +853,7 @@ static int flrig_open(RIG *rig) char model_name[256]; snprintf(model_name,sizeof(model_name), "%.248s(%s)", value, "FLRig"); rig->caps->model_name = strdup(model_name); - rig->state.model_name = strdup(model_name); + STATE(rig)->model_name = strdup(model_name); /* see if get_pwrmeter_scale is available */ retval = flrig_transaction(rig, "rig.get_pwrmeter_scale", NULL, value, diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index 9a6db6b78..d134c2b3a 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -945,7 +945,7 @@ static int ft1000mp_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) RETURNFUNC(retval); } - priv = (struct ft1000mp_priv_data *)rig->state.priv; + priv = (struct ft1000mp_priv_data *)STATE(rig)->priv; if (vfo == RIG_VFO_B) { diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index 68a28bf73..301e0e44f 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -1711,7 +1711,7 @@ static int ft817_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) // check if we're already in the mode and return if so // the memory check was failing when in FM mode -- still showing digmode - if (rig->state.current_mode == mode) + if (STATE(rig)->current_mode == mode) { if (digmode[0] == 0x00 && mode == RIG_MODE_RTTY) { return RIG_OK; } else if (digmode[0] == 0x01 && mode == RIG_MODE_PSKR) { return RIG_OK; } diff --git a/src/rig.c b/src/rig.c index a6cd5f2f3..bf233f360 100644 --- a/src/rig.c +++ b/src/rig.c @@ -7979,7 +7979,7 @@ int HAMLIB_API rig_get_rig_info(RIG *rig, char *response, int max_response_len) "VFO=%s Freq=%.0f Mode=%s Width=%d RX=%d TX=%d\nVFO=%s Freq=%.0f Mode=%s Width=%d RX=%d TX=%d\nSplit=%d SatMode=%d\nRig=%s\nApp=%s\nVersion=20241103 1.1.0\nModel=%u\n", rig_strvfo(vfoA), freqA, modeAstr, (int)widthA, rxa, txa, rig_strvfo(vfoB), freqB, modeBstr, (int)widthB, rxb, txb, split, satmode, rig->caps->model_name, - rig->state.client_version, rig->caps->rig_model); + STATE(rig)->client_version, rig->caps->rig_model); unsigned long crc = CRC32_function((unsigned char *)response, strlen(response)); char tmpstr[32]; SNPRINTF(tmpstr, sizeof(tmpstr), "CRC=0x%08lx\n", crc); commit c080ba7b829e0d1427edd066ff39a1a4f88b8fb5 Author: George Baltz N3GB <Geo...@gm...> Date: Wed Nov 20 16:35:15 2024 -0500 Factor out TS-890S and TS-990S from kenwood_get_split_vfo_if() Fix TS-890S to return correct VFO More of issue #1380 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 9d37c46ff..e0bad2505 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -1675,7 +1675,7 @@ int kenwood_set_split(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo) } -/* IF TB +/* IF * Gets split VFO status from kenwood_get_if() * */ @@ -1694,30 +1694,6 @@ int kenwood_get_split_vfo_if(RIG *rig, vfo_t rxvfo, split_t *split, RETURNFUNC(-RIG_EINVAL); } - if (RIG_IS_TS990S || RIG_IS_TS890S) - { - char buf[4]; - - if (RIG_OK == (retval = kenwood_safe_transaction(rig, "TB", buf, sizeof(buf), - 3))) - { - if ('1' == buf[2]) - { - *split = RIG_SPLIT_ON; - *txvfo = RIG_VFO_SUB; - priv->tx_vfo = rs->tx_vfo = *txvfo; - } - else - { - *split = RIG_SPLIT_OFF; - *txvfo = RIG_VFO_MAIN; - priv->tx_vfo = rs->tx_vfo = *txvfo; - } - } - - RETURNFUNC(retval); - } - retval = kenwood_get_if(rig); if (retval != RIG_OK) diff --git a/rigs/kenwood/ts890s.c b/rigs/kenwood/ts890s.c index ec71d0a9f..c5906f6dc 100644 --- a/rigs/kenwood/ts890s.c +++ b/rigs/kenwood/ts890s.c @@ -466,6 +466,50 @@ static int ts890_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) return RIG_OK; } +/* + * Gets split VFO status + * + */ +static int ts890s_get_split_vfo(RIG *rig, vfo_t rxvfo, split_t *split, + vfo_t *txvfo) +{ + char buf[4]; + int retval; + vfo_t tvfo; + struct rig_state *rs = STATE(rig); + struct kenwood_priv_data *priv = rs->priv; + + if (RIG_OK == (retval = kenwood_safe_transaction(rig, "FT", buf, sizeof(buf), + 3))) + { + if ('0' == buf[2]) + { + tvfo = RIG_VFO_A; + } + else if ('1' == buf[2]) + { + tvfo = RIG_VFO_B; + } + else if ('3' == buf[2]) + { + tvfo = RIG_VFO_MEM; + } + else + { + rig_debug(RIG_DEBUG_ERR, "%s: Unknown VFO - %s\n", __func__, buf); + return -RIG_EPROTO; + } + + *txvfo = priv->tx_vfo = rs->tx_vfo = tvfo; + // Now get split status + retval = kenwood_safe_transaction(rig, "TB", buf, sizeof buf, 3); + if (RIG_OK != retval) {return retval;} + *split = priv->split = buf[2] == '1'; + } + + return retval; +} + static struct kenwood_priv_caps ts890s_priv_caps = { @@ -626,7 +670,7 @@ struct rig_caps ts890s_caps = .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_split_vfo = ts890s_get_split_vfo, .set_ctcss_tone = kenwood_set_ctcss_tone_tn, .get_ctcss_tone = kenwood_get_ctcss_tone, .set_ctcss_sql = kenwood_set_ctcss_sql, diff --git a/rigs/kenwood/ts990s.c b/rigs/kenwood/ts990s.c index 4c8d97a2e..0deda6bed 100644 --- a/rigs/kenwood/ts990s.c +++ b/rigs/kenwood/ts990s.c @@ -88,6 +88,7 @@ /* prototypes */ static int ts990s_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); +static int ts990s_get_split_vfo(RIG *rig, vfo_t rxvfo, split_t *split, vfo_t *txvfo); static rmode_t ts990s_mode_table[KENWOOD_MODE_TABLE_MAX] = { @@ -352,7 +353,7 @@ struct rig_caps ts990s_caps = .set_vfo = kenwood_set_vfo_main_sub, .get_vfo = kenwood_get_vfo_main_sub, .set_split_vfo = kenwood_set_split_vfo, - .get_split_vfo = kenwood_get_split_vfo_if, + .get_split_vfo = ts990s_get_split_vfo, .set_ctcss_tone = kenwood_set_ctcss_tone_tn, .get_ctcss_tone = kenwood_get_ctcss_tone, .set_ctcss_sql = kenwood_set_ctcss_sql, @@ -761,3 +762,34 @@ int ts990s_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return retval; } + +/* + * Gets split VFO status + * + */ +static int ts990s_get_split_vfo(RIG *rig, vfo_t rxvfo, split_t *split, + vfo_t *txvfo) +{ + char buf[4]; + int retval; + struct rig_state *rs = STATE(rig); + struct kenwood_priv_data *priv = rs->priv; + + if (RIG_OK == (retval = kenwood_safe_transaction(rig, "TB", buf, sizeof(buf), + 3))) + { + if ('1' == buf[2]) + { + *split = RIG_SPLIT_ON; + *txvfo = RIG_VFO_SUB; + } + else + { + *split = RIG_SPLIT_OFF; + *txvfo = RIG_VFO_MAIN; + } + priv->tx_vfo = rs->tx_vfo = *txvfo; + } + + return retval; +} commit 238344b0ce3db6d50b8647c54de7d56355a37f64 Author: George Baltz N3GB <Geo...@gm...> Date: Wed Nov 6 16:47:19 2024 -0500 Update TS-890S and TS-990S RIT/XIT handling Use dedicated commands that make setting much simpler. Replaces usage of deprecated IF command. See issue #1380 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 7fd811422..9d37c46ff 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -1885,7 +1885,6 @@ int kenwood_get_vfo_if(RIG *rig, vfo_t *vfo) RETURNFUNC(RIG_OK); } - /* * kenwood_set_freq */ @@ -2156,6 +2155,29 @@ int kenwood_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) RETURNFUNC(RIG_OK); } +/* RF + * kenwood_get_rit_new (also usable as kenwood_get_xit_new) + * Gets the RIT or XIT value using dedicated command + * and without using IF. + */ +int kenwood_get_rit_new(RIG *rig, vfo_t vfo, shortfreq_t *rit) +{ + int retval, tempf; + char rfbuf[10]; + + ENTERFUNC; + if (!rit) { RETURNFUNC(-RIG_EINVAL); } + retval = kenwood_safe_transaction(rig, "RF", rfbuf, sizeof rfbuf, 7); + if (retval != RIG_OK) {RETURNFUNC(retval); } + tempf = atoi(rfbuf + 3); + if (rfbuf[2] == '1') + { + tempf = -tempf; + } + *rit = tempf; + RETURNFUNC(RIG_OK); +} + /* * rit can only move up/down by 10 Hz, so we use a loop... */ @@ -2252,6 +2274,30 @@ int kenwood_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) RETURNFUNC2(retval); } +/* RU/RD + * Set the RIT/XIT frequency offset + * using dedicated commands (not IF) + */ +int kenwood_set_rit_new(RIG *rig, vfo_t vfo, shortfreq_t rit) +{ + int retval, diff; + shortfreq_t oldrit; + char rdbuf[10]; + + ENTERFUNC; + if (abs(rit) > 9999) { RETURNFUNC(-RIG_EINVAL); } + retval = kenwood_get_rit_new(rig, vfo, &oldrit); + if (retval != RIG_OK) { RETURNFUNC(retval); } + if (rit == oldrit) // if the new value is the same + { + RETURNFUNC(RIG_OK); // Nothing to do + } + diff = rit - oldrit; + SNPRINTF(rdbuf, sizeof rdbuf, "R%c%05d;", diff < 0 ? 'D' : 'U', abs(diff)); + retval = kenwood_transaction(rig, rdbuf, NULL, 0); + RETURNFUNC(retval); +} + /* * rit and xit are the same */ diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 0989f722f..4e363d533 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -223,9 +223,11 @@ int kenwood_set_freq(RIG *rig, vfo_t vfo, freq_t freq); int kenwood_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); int kenwood_get_freq_if(RIG *rig, vfo_t vfo, freq_t *freq); int kenwood_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit); +int kenwood_set_rit_new(RIG *rig, vfo_t vfo, shortfreq_t rit); // Also use this for xit int kenwood_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit); -int kenwood_set_xit(RIG *rig, vfo_t vfo, shortfreq_t rit); -int kenwood_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *rit); +int kenwood_get_rit_new(RIG *rig, vfo_t vfo, shortfreq_t *rit); // Also use this for xit +int kenwood_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit); +int kenwood_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit); int kenwood_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); int kenwood_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); int kenwood_get_mode_if(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); diff --git a/rigs/kenwood/ts890s.c b/rigs/kenwood/ts890s.c index 5ae39970d..ec71d0a9f 100644 --- a/rigs/kenwood/ts890s.c +++ b/rigs/kenwood/ts890s.c @@ -617,10 +617,10 @@ struct rig_caps ts890s_caps = .rig_cleanup = kenwood_cleanup, .set_freq = kenwood_set_freq, .get_freq = kenwood_get_freq, - .set_rit = kenwood_set_rit, - .get_rit = kenwood_get_rit, - .set_xit = kenwood_set_xit, - .get_xit = kenwood_get_xit, + .set_rit = kenwood_set_rit_new, + .get_rit = kenwood_get_rit_new, + .set_xit = kenwood_set_rit_new, // Same routines as for RIT + .get_xit = kenwood_get_rit_new, // Same .set_mode = kenwood_set_mode, .get_mode = kenwood_get_mode, .set_vfo = kenwood_set_vfo, diff --git a/rigs/kenwood/ts990s.c b/rigs/kenwood/ts990s.c index 6933581be..4c8d97a2e 100644 --- a/rigs/kenwood/ts990s.c +++ b/rigs/kenwood/ts990s.c @@ -343,10 +343,10 @@ struct rig_caps ts990s_caps = .rig_cleanup = kenwood_cleanup, .set_freq = kenwood_set_freq, .get_freq = kenwood_get_freq, - .set_rit = kenwood_set_rit, - .get_rit = kenwood_get_rit, - .set_xit = kenwood_set_xit, - .get_xit = kenwood_get_xit, + .set_rit = kenwood_set_rit_new, + .get_rit = kenwood_get_rit_new, + .set_xit = kenwood_set_rit_new, // Use same routines as for rit + .get_xit = kenwood_get_rit_new, // Same .set_mode = kenwood_set_mode, .get_mode = kenwood_get_mode, .set_vfo = kenwood_set_vfo_main_sub, commit d640511b206b466892ce37085b2e0bd35ef59b71 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Nov 21 11:06:52 2024 -0600 astyle icom.c diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index e17c15707..00929c528 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -4547,6 +4547,7 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->f = rig_raw2val_float(icom_val, &rig->caps->rfpower_meter_cal) * 0.01; } + if (RIG_IS_IC9700 && CACHE(rig)->freqMainA >= 1e9) { val->f /= 10; // power scale is different for 10GHz @@ -9134,8 +9135,9 @@ int icom_is_async_frame(RIG *rig, size_t frame_length, /* Spectrum scope data is not CI-V transceive data, but handled the same way as it is pushed by the rig */ // IC-7100 sends 0xe1 for broadcast frame? - return frame[2] == BCASTID || frame[2] == C_SND_MODE || (frame[2] == CTRLID && frame[4] == C_CTL_SCP - && frame[5] == S_SCP_DAT); + return frame[2] == BCASTID || frame[2] == C_SND_MODE || (frame[2] == CTRLID + && frame[4] == C_CTL_SCP + && frame[5] == S_SCP_DAT); } int icom_process_async_frame(RIG *rig, size_t frame_length, @@ -9159,8 +9161,9 @@ int icom_process_async_frame(RIG *rig, size_t frame_length, if (frame[2] != 0x00 || frame[2] == 0x01) { // just ignoring 0x01 for now - // fe fe 01 94 1c 03 00 80 07 07 00 fd - rig_debug(RIG_DEBUG_VERBOSE, "%s: 3rd byte not 0x00 or is 0x01...not async\n", __func__); + // fe fe 01 94 1c 03 00 80 07 07 00 fd + rig_debug(RIG_DEBUG_VERBOSE, "%s: 3rd byte not 0x00 or is 0x01...not async\n", + __func__); RETURNFUNC(RIG_OK); } commit 3f526117097b08d075134309cb94e76c8cfdba5f Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Nov 21 11:06:21 2024 -0600 Fix IC9700 WATTS measurement when freq > 1GHz diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 91771ca81..e17c15707 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -4547,6 +4547,10 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->f = rig_raw2val_float(icom_val, &rig->caps->rfpower_meter_cal) * 0.01; } + if (RIG_IS_IC9700 && CACHE(rig)->freqMainA >= 1e9) + { + val->f /= 10; // power scale is different for 10GHz + } break; commit 48aa284152ff5c6e031eecff261bbe9b3d809c01 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Nov 18 17:26:10 2024 -0600 Ensure tuner is off for FTDX101D/MP for 70cm band -- bug in firmware leaves it on which can cause damage diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 94c306065..8044f532f 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1011,6 +1011,13 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) RETURNFUNC(RIG_OK); /* make it look like we changed */ } + if ((is_ftdx101d || is_ftdx101mp) && (freq >= 70000000 && freq <= 70499999)) + { + // ensure the tuner is off for 70cm -- can cause damage to the rig + newcat_set_func(rig, RIG_VFO_A, RIG_FUNC_TUNER, 0); + hl_usleep(100 * 1000); // give it a chance to turn off + } + switch (vfo) { case RIG_VFO_A: diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index dc1e4669d..b41ffe2cd 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20240922" +#define NEWCAT_VER "20241118" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 ----------------------------------------------------------------------- Summary of changes: rigs/dummy/flrig.c | 2 +- rigs/icom/icom.c | 15 +++++++--- rigs/kenwood/kenwood.c | 74 ++++++++++++++++++++++++++++++++------------------ rigs/kenwood/kenwood.h | 6 ++-- rigs/kenwood/ts890s.c | 54 ++++++++++++++++++++++++++++++++---- rigs/kenwood/ts990s.c | 42 ++++++++++++++++++++++++---- rigs/yaesu/ft1000mp.c | 2 +- rigs/yaesu/ft817.c | 2 +- rigs/yaesu/newcat.c | 7 +++++ rigs/yaesu/newcat.h | 2 +- src/rig.c | 2 +- 11 files changed, 161 insertions(+), 47 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2024-11-18 15:33:44
|
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 d444fe43c61477ea823009ab5de24c69cf4de817 (commit) via eafdf897056165aecd6f67de1950290c5d9b2373 (commit) via b86822064a25abc0d70cfad7129ba4b6850ba9c4 (commit) via 05d7551c22bf568a2e081fb9bd0560b302acd06a (commit) via 92b692bd919434d509ce922204417b7b55fa1caa (commit) via 06bd1fe3e190173ea2ee0e47790bd0d396877975 (commit) via 1d3941d1175bc7da0b5f7d6d3de3efd80c91b268 (commit) via fbcd0f166748648d695e1cd966c0e6fa012f21d0 (commit) via 320daa975a441acae11c44be4dcdd95be498c380 (commit) via 22c00013206b021d95606af67bee01bfb3253c8a (commit) via 3bd462308ceaef956ba0a40564e9529ea0aaa6f8 (commit) via 356776f4bf56098c1afe1d59333c8b5c836513d4 (commit) via 27643a9a0edb147a5fb8aa20b4bb5bfc8bbb2711 (commit) via 7a98365c151b6aa15e1940556575042e18c25d2c (commit) via 473a77406e90db47ff6cfbd8b05038a55e67eb5b (commit) via c22392e5cd8654874b9e18bdc99d80293c0f28a8 (commit) via 32e6b90f4abbea1da9fbf0f3f88327ae624e2a3e (commit) via 6dcd60c2ac68bed9b5129befdac71f06d265cdce (commit) via 84b733d028cd00cdb3210cd12d1e79e3dd558b54 (commit) via 0bd214f2c46131da04ac83ccdbab5bb8a99343df (commit) via ec36b21f5415c57b6135dc3cdd35d047e6a36bff (commit) via 10292fd3383ff28b384ab7c42c63c19733c0e121 (commit) via dd9696cf2dc72d9397d290c3986d6b63a3cf7061 (commit) via d0b19252343ab4c584db3467b39de5dcce701309 (commit) via 27767fcfc1ce18ee06276d76f14decc569ba236c (commit) via 5c269964c28a32876dc04b715095e5d094b76055 (commit) via 7f8f7a0e58ea1ce01c2d63b53a30cc3d0da509e2 (commit) via ad70cc0ba46257ecd45dbe578b5fca2ef737fb6d (commit) via 4e4c82e83ca492aa51a208c1a577a2f45523be39 (commit) via d76da346f560a46bde785a436ca97e82ae25b735 (commit) via 4acfeef26a8cf9a0bbbcc95c5a55d922a7b1a079 (commit) via 5a9deee7d0132b656a15a56835eee758426a0e97 (commit) via 44bb600a01a7a1f4c44e115cc33910032db45eb3 (commit) from ece40e6bc28ee304a806181fc6483adec540c25c (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 d444fe43c61477ea823009ab5de24c69cf4de817 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Nov 18 08:57:17 2024 -0600 Fix compile warnings from gcc 14.2.0 diff --git a/src/rig.c b/src/rig.c index 21948050c..a6cd5f2f3 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1517,7 +1517,7 @@ int HAMLIB_API rig_open(RIG *rig) if (status < 0) { - rig_debug(RIG_DEBUG_ERR, "%s: cw_data_handler_start failed: %s\n", __func__, + rig_debug(RIG_DEBUG_ERR, "%s: cw_data_handler_start failed: %.23000s\n", __func__, rigerror(status)); port_close(rp, rp->type.rig); RETURNFUNC2(status); @@ -1602,7 +1602,7 @@ int HAMLIB_API rig_open(RIG *rig) if (retval != RIG_OK) { - rig_debug(RIG_DEBUG_ERR, "%s: network_multicast_publisher_start failed: %s\n", + rig_debug(RIG_DEBUG_ERR, "%s: network_multicast_publisher_start failed: %.23000s\n", __FILE__, rigerror(retval)); // we will consider this non-fatal for now @@ -1613,7 +1613,7 @@ int HAMLIB_API rig_open(RIG *rig) if (retval != RIG_OK) { - rig_debug(RIG_DEBUG_ERR, "%s: network_multicast_receiver_start failed: %s\n", + rig_debug(RIG_DEBUG_ERR, "%s: network_multicast_receiver_start failed: %.23000s\n", __FILE__, rigerror(retval)); // we will consider this non-fatal for now @@ -1623,7 +1623,7 @@ int HAMLIB_API rig_open(RIG *rig) if (retval != RIG_OK) { - rig_debug(RIG_DEBUG_ERR, "%s: rig_poll_routine_start failed: %s\n", __FILE__, + rig_debug(RIG_DEBUG_ERR, "%s: rig_poll_routine_start failed: %.23000s\n", __FILE__, rigerror(retval)); // we will consider this non-fatal for now } @@ -2287,7 +2287,7 @@ int rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (retcode != RIG_OK) { - rig_debug(RIG_DEBUG_ERR, "%s: set_vfo failed: %s\n", __func__, + rig_debug(RIG_DEBUG_ERR, "%s: set_vfo failed: %.23000s\n", __func__, rigerror(retcode)); } @@ -2913,7 +2913,7 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (retcode != RIG_OK) { - rig_debug(RIG_DEBUG_TRACE, "%s: failed set_mode(%s)=%s\n", + rig_debug(RIG_DEBUG_TRACE, "%s: failed set_mode(%s)=%.23000s\n", __func__, rig_strrmode(mode), rigerror(retcode)); ELAPSED2; LOCK(0); @@ -3328,7 +3328,7 @@ int HAMLIB_API rig_set_vfo(RIG *rig, vfo_t vfo) if (retcode != RIG_OK) { - rig_debug(RIG_DEBUG_WARN, "%s: rig_get_vfo error=%s\n", __func__, + rig_debug(RIG_DEBUG_WARN, "%s: rig_get_vfo error=%.23000s\n", __func__, rigerror(retcode)); } @@ -8768,7 +8768,7 @@ void *morse_data_handler(void *arg) if (result != RIG_OK) { - rig_debug(RIG_DEBUG_ERR, "%s: error: %s\n", __func__, rigerror(result)); + rig_debug(RIG_DEBUG_ERR, "%s: error: %.23971s\n", __func__, rigerror(result)); if (result == -RIG_EINVAL) { commit eafdf897056165aecd6f67de1950290c5d9b2373 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Nov 17 16:54:05 2024 -0600 Fix for FT817 when rig is manually set to non-dig mode and WSJTX then tries digmode Memory was not reflecing non-digmode when FM was selected so we now check to see if mode is changing diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index 859aa9faa..68a28bf73 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -310,7 +310,7 @@ struct rig_caps ft817_caps = RIG_MODEL(RIG_MODEL_FT817), .model_name = "FT-817", .mfg_name = "Yaesu", - .version = "20241112.0", + .version = "20241117.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -460,7 +460,7 @@ struct rig_caps q900_caps = RIG_MODEL(RIG_MODEL_Q900), .model_name = "Q900", .mfg_name = "Guohe", - .version = "20241112.0", + .version = "20241117.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -610,7 +610,7 @@ struct rig_caps ft818_caps = RIG_MODEL(RIG_MODEL_FT818), .model_name = "FT-818", .mfg_name = "Yaesu", - .version = "20221112.0", + .version = "20221117.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1710,11 +1710,15 @@ static int ft817_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) digmode[0] = digmode[0] >> 5; // shift 5 bits // check if we're already in the mode and return if so - if (digmode[0] == 0x00 && mode == RIG_MODE_RTTY) { return RIG_OK; } - else if (digmode[0] == 0x01 && mode == RIG_MODE_PSKR) { return RIG_OK; } - else if (digmode[0] == 0x02 && mode == RIG_MODE_PSK) { return RIG_OK; } - else if (digmode[0] == 0x03 && mode == RIG_MODE_PKTLSB) { return RIG_OK; } - else if (digmode[0] == 0x04 && mode == RIG_MODE_PKTUSB) { return RIG_OK; } + // the memory check was failing when in FM mode -- still showing digmode + if (rig->state.current_mode == mode) + { + if (digmode[0] == 0x00 && mode == RIG_MODE_RTTY) { return RIG_OK; } + else if (digmode[0] == 0x01 && mode == RIG_MODE_PSKR) { return RIG_OK; } + else if (digmode[0] == 0x02 && mode == RIG_MODE_PSK) { return RIG_OK; } + else if (digmode[0] == 0x03 && mode == RIG_MODE_PKTLSB) { return RIG_OK; } + else if (digmode[0] == 0x04 && mode == RIG_MODE_PKTUSB) { return RIG_OK; } + } memcpy(data, ncmd[FT817_NATIVE_CAT_EEPROM_WRITE].nseq, YAESU_CMD_LENGTH); commit b86822064a25abc0d70cfad7129ba4b6850ba9c4 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Nov 14 16:24:39 2024 -0600 Change all Flex-radio to FlexRadio diff --git a/rigs/flexradio/sdr1k.c b/rigs/flexradio/sdr1k.c index e31e2438b..e66de1632 100644 --- a/rigs/flexradio/sdr1k.c +++ b/rigs/flexradio/sdr1k.c @@ -114,7 +114,7 @@ struct rig_caps sdr1k_rig_caps = { RIG_MODEL(RIG_MODEL_SDR1000), .model_name = "SDR-1000", - .mfg_name = "Flex-radio", + .mfg_name = "FlexRadio", .version = "20200323.0", .copyright = "LGPL", .status = RIG_STATUS_BETA, diff --git a/rigs/flexradio/smartsdr_caps.h b/rigs/flexradio/smartsdr_caps.h index 5396f5fde..4736412f2 100644 --- a/rigs/flexradio/smartsdr_caps.h +++ b/rigs/flexradio/smartsdr_caps.h @@ -1,4 +1,4 @@ - .mfg_name = "Flex-radio", + .mfg_name = "FlexRadio", .version = "20240814.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index e2da38baf..76da92547 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -1339,7 +1339,7 @@ struct rig_caps f6k_caps = { RIG_MODEL(RIG_MODEL_F6K), .model_name = "6xxx", - .mfg_name = "Flex-radio", + .mfg_name = "FlexRadio", .version = "20240829.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, @@ -1481,7 +1481,7 @@ struct rig_caps powersdr_caps = { RIG_MODEL(RIG_MODEL_POWERSDR), .model_name = "PowerSDR", - .mfg_name = "Flex-radio/Apache", + .mfg_name = "FlexRadio/Apache", .version = "20231107.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, commit 05d7551c22bf568a2e081fb9bd0560b302acd06a Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Nov 12 16:28:33 2024 -0600 Update msvc 2022 build to use lib instead of link Apparently it got changed diff --git a/scripts/build-w64.sh b/scripts/build-w64.sh index fff9b6241..665dfadf6 100755 --- a/scripts/build-w64.sh +++ b/scripts/build-w64.sh @@ -206,7 +206,7 @@ not appear to be correct to generate a 64 bit libhamlib-4.lib file! For VS 2022: cd lib/msvc -c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\bin\Hostx64\x86\link.exe /lib /machine:i386 /def:libhamlib-4.def +c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\bin\Hostx64\x86\lib.exe /lib /machine:i386 /def:libhamlib-4.def The published Hamlib API may be found at: commit 92b692bd919434d509ce922204417b7b55fa1caa Merge: 06bd1fe3e 1d3941d11 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Nov 12 16:07:58 2024 -0600 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 06bd1fe3e190173ea2ee0e47790bd0d396877975 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Nov 12 16:06:57 2024 -0600 Fix ft817.c DIG/PKT modes https://github.com/Hamlib/Hamlib/issues/1629 diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index d492d46bc..859aa9faa 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -186,8 +186,8 @@ static const yaesu_cmd_set_t ncmd[] = { 1, { 0x04, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main AM */ { 1, { 0x08, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main FM */ { 1, { 0x88, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main FM-N */ - { 1, { 0x0a, 0x00, 0x00, 0x00, 0x0a } }, /* mode set main DIG */ - { 1, { 0x0c, 0x00, 0x00, 0x00, 0x0c } }, /* mode set main PKT */ + { 1, { 0x0a, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main DIG */ + { 1, { 0x0c, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main PKT */ { 1, { 0x00, 0x00, 0x00, 0x00, 0x05 } }, /* clar on */ { 1, { 0x00, 0x00, 0x00, 0x00, 0x85 } }, /* clar off */ { 0, { 0x00, 0x00, 0x00, 0x00, 0xf5 } }, /* set clar freq */ @@ -310,7 +310,7 @@ struct rig_caps ft817_caps = RIG_MODEL(RIG_MODEL_FT817), .model_name = "FT-817", .mfg_name = "Yaesu", - .version = "20241109.0", + .version = "20241112.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -460,7 +460,7 @@ struct rig_caps q900_caps = RIG_MODEL(RIG_MODEL_Q900), .model_name = "Q900", .mfg_name = "Guohe", - .version = "20241109.0", + .version = "20241112.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -610,7 +610,7 @@ struct rig_caps ft818_caps = RIG_MODEL(RIG_MODEL_FT818), .model_name = "FT-818", .mfg_name = "Yaesu", - .version = "20221109.0", + .version = "20221112.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 1d3941d1175bc7da0b5f7d6d3de3efd80c91b268 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Nov 12 16:06:57 2024 -0600 Fix ft817.c DIG/PKT modes diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index d492d46bc..859aa9faa 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -186,8 +186,8 @@ static const yaesu_cmd_set_t ncmd[] = { 1, { 0x04, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main AM */ { 1, { 0x08, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main FM */ { 1, { 0x88, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main FM-N */ - { 1, { 0x0a, 0x00, 0x00, 0x00, 0x0a } }, /* mode set main DIG */ - { 1, { 0x0c, 0x00, 0x00, 0x00, 0x0c } }, /* mode set main PKT */ + { 1, { 0x0a, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main DIG */ + { 1, { 0x0c, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main PKT */ { 1, { 0x00, 0x00, 0x00, 0x00, 0x05 } }, /* clar on */ { 1, { 0x00, 0x00, 0x00, 0x00, 0x85 } }, /* clar off */ { 0, { 0x00, 0x00, 0x00, 0x00, 0xf5 } }, /* set clar freq */ @@ -310,7 +310,7 @@ struct rig_caps ft817_caps = RIG_MODEL(RIG_MODEL_FT817), .model_name = "FT-817", .mfg_name = "Yaesu", - .version = "20241109.0", + .version = "20241112.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -460,7 +460,7 @@ struct rig_caps q900_caps = RIG_MODEL(RIG_MODEL_Q900), .model_name = "Q900", .mfg_name = "Guohe", - .version = "20241109.0", + .version = "20241112.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -610,7 +610,7 @@ struct rig_caps ft818_caps = RIG_MODEL(RIG_MODEL_FT818), .model_name = "FT-818", .mfg_name = "Yaesu", - .version = "20221109.0", + .version = "20221112.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit fbcd0f166748648d695e1cd966c0e6fa012f21d0 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Nov 11 17:20:53 2024 -0600 Update async detection in icom.c diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 7223c3801..91771ca81 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -9130,7 +9130,7 @@ int icom_is_async_frame(RIG *rig, size_t frame_length, /* Spectrum scope data is not CI-V transceive data, but handled the same way as it is pushed by the rig */ // IC-7100 sends 0xe1 for broadcast frame? - return frame[2] == BCASTID || (frame[2] == CTRLID && frame[4] == C_CTL_SCP + return frame[2] == BCASTID || frame[2] == C_SND_MODE || (frame[2] == CTRLID && frame[4] == C_CTL_SCP && frame[5] == S_SCP_DAT); } commit 320daa975a441acae11c44be4dcdd95be498c380 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Nov 11 17:14:56 2024 -0600 Ignore icom fe fe 01 packets diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index e2aef9411..7223c3801 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -9152,9 +9152,11 @@ int icom_process_async_frame(RIG *rig, size_t frame_length, * the rest is data * and don't forget one byte at the end for the EOM */ - if (frame[2] != 0x00) + if (frame[2] != 0x00 || frame[2] == 0x01) { - rig_debug(RIG_DEBUG_VERBOSE, "%s: 3rd byte not 0x00...not async\n", __func__); + // just ignoring 0x01 for now + // fe fe 01 94 1c 03 00 80 07 07 00 fd + rig_debug(RIG_DEBUG_VERBOSE, "%s: 3rd byte not 0x00 or is 0x01...not async\n", __func__); RETURNFUNC(RIG_OK); } commit 22c00013206b021d95606af67bee01bfb3253c8a Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Nov 11 17:01:11 2024 -0600 Another IC-PW2 change diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 35f8cb197..a11a98867 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -347,7 +347,7 @@ again2: } // IC-PW2 was sending fe fe 94 aa 1c 03 - if (buf[3] == 0xaa) + if (buf[3] == 0xaa || buf[2] == 0xaa) { goto again2; } commit 3bd462308ceaef956ba0a40564e9529ea0aaa6f8 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Nov 11 16:55:12 2024 -0600 Another IC-PW2 try diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index aefc23bb9..35f8cb197 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -347,7 +347,12 @@ again2: } // IC-PW2 was sending fe fe 94 aa 1c 03 - if (sendbuf[3] != buf[2] && buf[3] != 0xaa && buf[2] != 0xaa && buf[3] != 0xe0) + if (buf[3] == 0xaa) + { + goto again2; + } + + if (sendbuf[3] != buf[2]) { rig_debug(RIG_DEBUG_VERBOSE, "%s: unknown async? read again\n", __func__); hl_usleep(100); commit 356776f4bf56098c1afe1d59333c8b5c836513d4 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Nov 11 16:48:54 2024 -0600 Another fix for IC-PW2 diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 10e2b6df1..aefc23bb9 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -347,7 +347,7 @@ again2: } // IC-PW2 was sending fe fe 94 aa 1c 03 - if (sendbuf[3] != buf[2] && buf[3] != 0xaa && buf[3] != 0xe0) + if (sendbuf[3] != buf[2] && buf[3] != 0xaa && buf[2] != 0xaa && buf[3] != 0xe0) { rig_debug(RIG_DEBUG_VERBOSE, "%s: unknown async? read again\n", __func__); hl_usleep(100); commit 27643a9a0edb147a5fb8aa20b4bb5bfc8bbb2711 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Nov 11 16:32:04 2024 -0600 Another fix for IC-PW2 diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 6c2bbcea2..10e2b6df1 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -347,7 +347,7 @@ again2: } // IC-PW2 was sending fe fe 94 aa 1c 03 - if (sendbuf[3] != buf[2] && buf[3] != 0xaa) + if (sendbuf[3] != buf[2] && buf[3] != 0xaa && buf[3] != 0xe0) { rig_debug(RIG_DEBUG_VERBOSE, "%s: unknown async? read again\n", __func__); hl_usleep(100); commit 7a98365c151b6aa15e1940556575042e18c25d2c Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Nov 11 16:27:20 2024 -0600 Other file for IC-PW2 fix diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 626724ecf..6c2bbcea2 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -346,7 +346,8 @@ again2: goto again2; } - if (sendbuf[3] != buf[2]) + // IC-PW2 was sending fe fe 94 aa 1c 03 + if (sendbuf[3] != buf[2] && buf[3] != 0xaa) { rig_debug(RIG_DEBUG_VERBOSE, "%s: unknown async? read again\n", __func__); hl_usleep(100); commit 473a77406e90db47ff6cfbd8b05038a55e67eb5b Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Nov 11 16:26:15 2024 -0600 Fix for async packet from IC-PW2 amplifier diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index f7aa3a42c..2cf9259c0 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20241030" +#define BACKEND_VER "20241111" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit c22392e5cd8654874b9e18bdc99d80293c0f28a8 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Nov 10 09:53:35 2024 -0600 Update FLRig's model name with the connected rig in FLRig diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index c026c6aac..58b6e8692 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -143,7 +143,7 @@ struct rig_caps flrig_caps = RIG_MODEL(RIG_MODEL_FLRIG), .model_name = "", .mfg_name = "FLRig", - .version = "20240612.0", + .version = "20241110.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -850,6 +850,10 @@ static int flrig_open(RIG *rig) strncpy(priv->info, value, sizeof(priv->info)); rig_debug(RIG_DEBUG_VERBOSE, "Transceiver=%s\n", value); + char model_name[256]; + snprintf(model_name,sizeof(model_name), "%.248s(%s)", value, "FLRig"); + rig->caps->model_name = strdup(model_name); + rig->state.model_name = strdup(model_name); /* see if get_pwrmeter_scale is available */ retval = flrig_transaction(rig, "rig.get_pwrmeter_scale", NULL, value, commit 32e6b90f4abbea1da9fbf0f3f88327ae624e2a3e Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Nov 9 07:02:04 2024 -0600 Change FT817/FT818/Q900 to use 0x0a for digital mode and 0x0c for packet instead of 0x07 diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index ff15241ff..d492d46bc 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -186,8 +186,8 @@ static const yaesu_cmd_set_t ncmd[] = { 1, { 0x04, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main AM */ { 1, { 0x08, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main FM */ { 1, { 0x88, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main FM-N */ - { 1, { 0x0a, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main DIG */ - { 1, { 0x0c, 0x00, 0x00, 0x00, 0x07 } }, /* mode set main PKT */ + { 1, { 0x0a, 0x00, 0x00, 0x00, 0x0a } }, /* mode set main DIG */ + { 1, { 0x0c, 0x00, 0x00, 0x00, 0x0c } }, /* mode set main PKT */ { 1, { 0x00, 0x00, 0x00, 0x00, 0x05 } }, /* clar on */ { 1, { 0x00, 0x00, 0x00, 0x00, 0x85 } }, /* clar off */ { 0, { 0x00, 0x00, 0x00, 0x00, 0xf5 } }, /* set clar freq */ @@ -310,7 +310,7 @@ struct rig_caps ft817_caps = RIG_MODEL(RIG_MODEL_FT817), .model_name = "FT-817", .mfg_name = "Yaesu", - .version = "20241101.0", + .version = "20241109.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -460,7 +460,7 @@ struct rig_caps q900_caps = RIG_MODEL(RIG_MODEL_Q900), .model_name = "Q900", .mfg_name = "Guohe", - .version = "20241101.0", + .version = "20241109.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -610,7 +610,7 @@ struct rig_caps ft818_caps = RIG_MODEL(RIG_MODEL_FT818), .model_name = "FT-818", .mfg_name = "Yaesu", - .version = "20221101.0", + .version = "20221109.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 6dcd60c2ac68bed9b5129befdac71f06d265cdce Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Nov 8 22:29:29 2024 -0600 Increate FT747GX post_write_delay from 5ms to 10ms Doing two commands at once via rigctld needed a little extra delay diff --git a/rigs/yaesu/ft747.c b/rigs/yaesu/ft747.c index 4c9373092..b8ad27ffa 100644 --- a/rigs/yaesu/ft747.c +++ b/rigs/yaesu/ft747.c @@ -301,7 +301,7 @@ struct rig_caps ft747_caps = RIG_MODEL(RIG_MODEL_FT747), .model_name = "FT-747GX", .mfg_name = "Yaesu", - .version = "20220819.1", + .version = "20241108.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_MOBILE, diff --git a/rigs/yaesu/ft747.h b/rigs/yaesu/ft747.h index 2df6513a1..a17692f8c 100644 --- a/rigs/yaesu/ft747.h +++ b/rigs/yaesu/ft747.h @@ -39,8 +39,9 @@ /* Sequential fast writes confuse my FT747 without this delay */ +/* Node Red combined "F 028074000 M USB 0" needed 10ms */ -#define FT747_POST_WRITE_DELAY 5 +#define FT747_POST_WRITE_DELAY 10 /* commit 84b733d028cd00cdb3210cd12d1e79e3dd558b54 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Nov 7 08:12:46 2024 -0600 Add RIG_OP_TUNE for TS990S diff --git a/rigs/kenwood/ts990s.c b/rigs/kenwood/ts990s.c index e20edd031..6933581be 100644 --- a/rigs/kenwood/ts990s.c +++ b/rigs/kenwood/ts990s.c @@ -42,7 +42,7 @@ #define TS2000_LEVEL_ALL (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_VOXDELAY|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_CWPITCH|RIG_LEVEL_RFPOWER|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_COMP|RIG_LEVEL_AGC|RIG_LEVEL_BKINDL|RIG_LEVEL_METER|RIG_LEVEL_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_SWR) -#define TS990S_VFO_OP (RIG_OP_BAND_UP|RIG_OP_BAND_DOWN) +#define TS990S_VFO_OP (RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|RIG_OP_TUNE) #define TS990S_SCAN_OP (RIG_SCAN_VFO) #define TS990S_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3|RIG_ANT_4) @@ -135,7 +135,7 @@ struct rig_caps ts990s_caps = RIG_MODEL(RIG_MODEL_TS990S), .model_name = "TS-990S", .mfg_name = "Kenwood", - .version = BACKEND_VER ".6", + .version = BACKEND_VER ".7", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 0bd214f2c46131da04ac83ccdbab5bb8a99343df Merge: ec36b21f5 10292fd33 Author: Michael Black <mdb...@ya...> Date: Wed Nov 6 10:46:06 2024 -0600 Merge pull request #1628 from GeoBaltz/fix22 More commands for simts890.c commit ec36b21f5415c57b6135dc3cdd35d047e6a36bff Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Nov 6 09:43:14 2024 -0600 Remove forcine Icom rigs to always set mode. If mode does not change then don't set it https://github.com/Hamlib/Hamlib/issues/1580 diff --git a/src/rig.c b/src/rig.c index beee71652..21948050c 100644 --- a/src/rig.c +++ b/src/rig.c @@ -2824,8 +2824,14 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) retcode = caps->get_mode(rig, vfo, &mode_curr, &width_curr); // For Icom rigs we may need to force the filter so we always set mode +#if 0 + // This should not be necessary anymore with the new filter method for Icom rigs + // Hopefully fixes issue https://github.com/Hamlib/Hamlib/issues/1580 if (retcode == RIG_OK && mode == mode_curr && RIG_ICOM != RIG_BACKEND_NUM(rig->caps->rig_model)) +#else + if (retcode == RIG_OK && mode == mode_curr) +#endif { rig_debug(RIG_DEBUG_VERBOSE, "%s: mode already %s and bw change not requested\n", __func__, commit 10292fd3383ff28b384ab7c42c63c19733c0e121 Author: George Baltz N3GB <Geo...@gm...> Date: Wed Nov 6 10:19:40 2024 -0500 Astyle simts890.c Man, this is ugly! diff --git a/simulators/simts890.c b/simulators/simts890.c index e99107bf7..a3c513d21 100644 --- a/simulators/simts890.c +++ b/simulators/simts890.c @@ -70,7 +70,8 @@ int rl = 0; int is = 0; int sp = 0; // Split OFF/ON int split_op = 0; // Split frequency setting operation in progress -int rit=0, xit=0, rxit=0; // RIT off/on, XIT off/on, Offset freq(-9999<=rxit<=+9999) +int rit = 0, xit = 0, rxit = + 0; // RIT off/on, XIT off/on, Offset freq(-9999<=rxit<=+9999) int fine = 0; // Fine tuning - step size off=10hz, on=1hz // Clock data int autoset = 1; @@ -269,26 +270,26 @@ int main(int argc, char *argv[]) * This description is taken from the TS-590S/SG manual, with values * reflecting a real TS-890S. */ - char IFformat[] = "IF" // Output only - "%011d" // P1 freq(Hz) - " " // P2 ?? - "% 05d" // P3 RIT/XIT freq(Hz) - "%1d" // P4 RIT on/off - "%1d" // P5 XIT on/off - "000" // P6,P7 mem channel - "%1d" // P8 RX/TX - "%1X" // P9 Operating mode (See OM command) - "0" // P10 Function? - "0" // P11 Scan status? - "%1d" // P12 Simplex=0/Split=1 - "0" // P13 Tone/CTCSS (not on TS-890S) - "00" // P14 Tone/CTCSS freq (not on TS-890S) - "0;"; // P15 Always zero + const char IFformat[] = "IF" // Output only + "%011d" // P1 freq(Hz) + " " // P2 ?? + "% 05d" // P3 RIT/XIT freq(Hz) + "%1d" // P4 RIT on/off + "%1d" // P5 XIT on/off + "000" // P6,P7 mem channel + "%1d" // P8 RX/TX + "%1X" // P9 Operating mode (See OM command) + "0" // P10 Function? + "0" // P11 Scan status? + "%1d" // P12 Simplex=0/Split=1 + "0" // P13 Tone/CTCSS (not on TS-890S) + "00" // P14 Tone/CTCSS freq (not on TS-890S) + "0;"; // P15 Always zero #endif - char SFformat[] = "SF" // Input/Output - "%1d" // P1 VFOA/VFOB - "%011d" // P2 Freq(Hz) - "%1X;"; // P3 Mode + const char SFformat[] = "SF" // Input/Output + "%1d" // P1 VFOA/VFOB + "%011d" // P2 Freq(Hz) + "%1X;"; // P3 Mode /* Initialization */ for (int i = 0; i < NBANDS; i++) @@ -326,7 +327,8 @@ int main(int argc, char *argv[]) buf[1] = toupper(buf[1]); if (strcmp(buf, "IF;") == 0) - { // Reads the tranceiver status + { + // Reads the tranceiver status #if defined(LEGACY) char ifbuf[256]; hl_usleep(mysleep * 1000); @@ -958,7 +960,8 @@ int main(int argc, char *argv[]) } } else if (strncmp(buf, "MD", 2) == 0) - { // Sets and reads the operating mode status + { + // Sets and reads the operating mode status #if defined(LEGACY) if (buf[2] == ';') { @@ -969,6 +972,7 @@ int main(int argc, char *argv[]) { sscanf(buf, "MD%1X", &(*vfoLR[0])->mode); } + #else cmd_err = 1; #endif @@ -1128,7 +1132,8 @@ int main(int argc, char *argv[]) sscanf(buf, "RL1%d", &rl); } else if (strncmp(buf, "FS", 2) == 0) - { // FINE Function + { + // FINE Function if (buf[2] == ';') { snprintf(buf, sizeof buf, "FS%d%d;", fine, fine); // For now @@ -1137,19 +1142,22 @@ int main(int argc, char *argv[]) else { if (buf[2] == '0' || buf[2] == '1') - { fine = buf[2] - '0'; } + { fine = buf[2] - '0'; } else - { cmd_err = 1; } + { cmd_err = 1; } } } else if (strcmp(buf, "RC;") == 0) - { // RIT/XIT Frequency Clear + { + // RIT/XIT Frequency Clear rxit = 0; } - else if (buf[0] == 'R' && (buf[1] =='D' || buf[1] == 'U')) // RD/RU - { // RIT/XIT Frequency Up/Down + else if (buf[0] == 'R' && (buf[1] == 'D' || buf[1] == 'U')) // RD/RU + { + // RIT/XIT Frequency Up/Down int dir = buf[1] == 'D' ? -1 : +1; - int tempit; + int tempit; + if (buf[2] == ';') { tempit = rxit + (dir * (fine ? 1 : 10)); @@ -1158,43 +1166,55 @@ int main(int argc, char *argv[]) { tempit = rxit + dir * atoi(buf + 2); } + if (abs(tempit) > 9999) {cmd_err = 1; continue;} + /* Some weird rounding going on here - TBD */ rxit = tempit; } else if (strcmp(buf, "RF;") == 0) - { // RIT/XIT Frequency + { + // RIT/XIT Frequency snprintf(buf, sizeof buf, "RF%1d%04d;", rxit < 0 ? 1 : 0, abs(rxit)); OUTPUT(buf); } else if (strncmp(buf, "RT", 2) == 0) - { // RIT Function State, RIT Shift - switch(buf[2]) { + { + // RIT Function State, RIT Shift + switch (buf[2]) + { case ';': // Read snprintf(buf, sizeof buf, "RT%d;", rit); OUTPUT(buf); break; + case '0': // Set case '1': rit = buf[2] - '0'; break; + case '2': // Shift //TODO: set recv freq to vfo+rxit, clear rxit and rit break; + default: cmd_err = 1; } } else if (strncmp(buf, "XT", 2) == 0) - { // XIT Function State, XIT Shift - switch(buf[2]) { + { + // XIT Function State, XIT Shift + switch (buf[2]) + { case '0': // Set case '1': xit = buf[2] - '0'; break; + case '2': // Shift //TODO: set xmit freq to vfo+rxit(Which vfo?), set split, clear rxit and xit break; + default: cmd_err = 1; } commit dd9696cf2dc72d9397d290c3986d6b63a3cf7061 Author: George Baltz N3GB <Geo...@gm...> Date: Tue Nov 5 17:09:31 2024 -0500 Add RIT/XIT commands (FS, RC, RD/RU, RF, RT, XT) to simts890.c Add RIT/XIT data to IF command. FS probably affects more places, TBD Constify some strings diff --git a/simulators/simts890.c b/simulators/simts890.c index f1ab8f6c3..e99107bf7 100644 --- a/simulators/simts890.c +++ b/simulators/simts890.c @@ -70,6 +70,8 @@ int rl = 0; int is = 0; int sp = 0; // Split OFF/ON int split_op = 0; // Split frequency setting operation in progress +int rit=0, xit=0, rxit=0; // RIT off/on, XIT off/on, Offset freq(-9999<=rxit<=+9999) +int fine = 0; // Fine tuning - step size off=10hz, on=1hz // Clock data int autoset = 1; int tzs[2] = {36, 56}; // 0=primary(EST), 1=auxiliary(UTC) @@ -270,9 +272,9 @@ int main(int argc, char *argv[]) char IFformat[] = "IF" // Output only "%011d" // P1 freq(Hz) " " // P2 ?? - " 0000" // P3 RIT/XIT freq(Hz) - "0" // P4 RIT on/off - "0" // P5 XIT on/off + "% 05d" // P3 RIT/XIT freq(Hz) + "%1d" // P4 RIT on/off + "%1d" // P5 XIT on/off "000" // P6,P7 mem channel "%1d" // P8 RX/TX "%1X" // P9 Operating mode (See OM command) @@ -282,6 +284,7 @@ int main(int argc, char *argv[]) "0" // P13 Tone/CTCSS (not on TS-890S) "00" // P14 Tone/CTCSS freq (not on TS-890S) "0;"; // P15 Always zero +#endif char SFformat[] = "SF" // Input/Output "%1d" // P1 VFOA/VFOB "%011d" // P2 Freq(Hz) @@ -327,8 +330,9 @@ int main(int argc, char *argv[]) #if defined(LEGACY) char ifbuf[256]; hl_usleep(mysleep * 1000); - sprintf(ifbuf, IFformat, (*vfoLR[0])->freq, - (ptt + ptt_mic + ptt_data + ptt_tune) > 0 ? 1 : 0, (*vfoLR[0])->mode, sp); + sprintf(ifbuf, IFformat, (*vfoLR[0])->freq, rxit, rit, xit, + (ptt + ptt_mic + ptt_data + ptt_tune) > 0 ? 1 : 0, + (*vfoLR[0])->mode, sp); OUTPUT(ifbuf); #else cmd_err = 1; @@ -1123,6 +1127,78 @@ int main(int argc, char *argv[]) puts(buf); sscanf(buf, "RL1%d", &rl); } + else if (strncmp(buf, "FS", 2) == 0) + { // FINE Function + if (buf[2] == ';') + { + snprintf(buf, sizeof buf, "FS%d%d;", fine, fine); // For now + OUTPUT(buf); + } + else + { + if (buf[2] == '0' || buf[2] == '1') + { fine = buf[2] - '0'; } + else + { cmd_err = 1; } + } + } + else if (strcmp(buf, "RC;") == 0) + { // RIT/XIT Frequency Clear + rxit = 0; + } + else if (buf[0] == 'R' && (buf[1] =='D' || buf[1] == 'U')) // RD/RU + { // RIT/XIT Frequency Up/Down + int dir = buf[1] == 'D' ? -1 : +1; + int tempit; + if (buf[2] == ';') + { + tempit = rxit + (dir * (fine ? 1 : 10)); + } + else + { + tempit = rxit + dir * atoi(buf + 2); + } + if (abs(tempit) > 9999) {cmd_err = 1; continue;} + /* Some weird rounding going on here - TBD */ + rxit = tempit; + } + else if (strcmp(buf, "RF;") == 0) + { // RIT/XIT Frequency + snprintf(buf, sizeof buf, "RF%1d%04d;", rxit < 0 ? 1 : 0, abs(rxit)); + OUTPUT(buf); + } + else if (strncmp(buf, "RT", 2) == 0) + { // RIT Function State, RIT Shift + switch(buf[2]) { + case ';': // Read + snprintf(buf, sizeof buf, "RT%d;", rit); + OUTPUT(buf); + break; + case '0': // Set + case '1': + rit = buf[2] - '0'; + break; + case '2': // Shift + //TODO: set recv freq to vfo+rxit, clear rxit and rit + break; + default: + cmd_err = 1; + } + } + else if (strncmp(buf, "XT", 2) == 0) + { // XIT Function State, XIT Shift + switch(buf[2]) { + case '0': // Set + case '1': + xit = buf[2] - '0'; + break; + case '2': // Shift + //TODO: set xmit freq to vfo+rxit(Which vfo?), set split, clear rxit and xit + break; + default: + cmd_err = 1; + } + } else if (strncmp(buf, "CK", 2) == 0) { // All the clock functions commit d0b19252343ab4c584db3467b39de5dcce701309 Author: George Baltz N3GB <Geo...@gm...> Date: Mon Nov 4 16:09:24 2024 -0500 Annotate legacy (undocumented) commands in simts890.c Allow them to be disabled Relevant to issues #1380 and #899 diff --git a/simulators/simts890.c b/simulators/simts890.c index 8f41bff99..f1ab8f6c3 100644 --- a/simulators/simts890.c +++ b/simulators/simts890.c @@ -21,7 +21,16 @@ struct ip_mreq #include <time.h> //#include <hamlib/rig.h> +/* Definitions */ +/* The TS-890S has some undocumented commands, left over from older + * Kenwood models. They have newer counterparts with more functionality, + * but are still around for legacy software. If you want to see if your + * app is only using the latest-and-greatest, comment out the next define. + */ +#define LEGACY +// Size of command buffer #define BUFSIZE 256 +// Number of selectable bands #define NBANDS 11 /* Type we're emulating - K=The Americas(default), E=Europe */ #if !defined(TYPE) @@ -30,6 +39,7 @@ struct ip_mreq /* Define a macro for sending response back to the app * This will allow us to reroute output to a buffering routine * Needed to handle multiple commands in a single message + * Also makes it easy to trace */ #if defined(TRACE) #define OUTPUT(s) {printf("Resp:\"%s\"\n", s); write(fd, s, strlen(s)); } @@ -251,6 +261,7 @@ int main(int argc, char *argv[]) kvfop_t *const vfoAB[2] = {&vfoA, &vfoB}; // 0=A, 1=B, fixed kvfop_t *vfoLR[2] = {&vfoA, &vfoB}; // 0=Left, 1=Right, can change +#if defined(LEGACY) /* The IF command is not documented for the TS-890S, and is supposed * to be supplanted by SF. However, it is still there for legacy S/W. * This description is taken from the TS-590S/SG manual, with values @@ -312,12 +323,16 @@ int main(int argc, char *argv[]) buf[1] = toupper(buf[1]); if (strcmp(buf, "IF;") == 0) - { + { // Reads the tranceiver status +#if defined(LEGACY) char ifbuf[256]; hl_usleep(mysleep * 1000); sprintf(ifbuf, IFformat, (*vfoLR[0])->freq, (ptt + ptt_mic + ptt_data + ptt_tune) > 0 ? 1 : 0, (*vfoLR[0])->mode, sp); OUTPUT(ifbuf); +#else + cmd_err = 1; +#endif } else if (strncmp(buf, "AN", 2) == 0) { @@ -938,6 +953,22 @@ int main(int argc, char *argv[]) sscanf(&buf[3], "%1X", &(*vfoLR[idx])->mode); } } + else if (strncmp(buf, "MD", 2) == 0) + { // Sets and reads the operating mode status +#if defined(LEGACY) + if (buf[2] == ';') + { + snprintf(buf, sizeof(buf), "MD%X;", (*vfoLR[0])->mode); + OUTPUT(buf); + } + else + { + sscanf(buf, "MD%1X", &(*vfoLR[0])->mode); + } +#else + cmd_err = 1; +#endif + } else if (strncmp(buf, "RM", 2) == 0) { // Meter commit 27767fcfc1ce18ee06276d76f14decc569ba236c Author: George Baltz N3GB <Geo...@gm...> Date: Fri Nov 1 15:36:16 2024 -0400 Add traffic tracing to simts890.c diff --git a/simulators/simts890.c b/simulators/simts890.c index 58d39557e..8f41bff99 100644 --- a/simulators/simts890.c +++ b/simulators/simts890.c @@ -1,3 +1,4 @@ +//#define TRACE /* Full traffic trace if enabled */ // can run this using rigctl/rigctld and socat pty devices // gcc -o simts890 -l hamlib simts890.c #define _XOPEN_SOURCE 700 @@ -30,7 +31,11 @@ struct ip_mreq * This will allow us to reroute output to a buffering routine * Needed to handle multiple commands in a single message */ +#if defined(TRACE) +#define OUTPUT(s) {printf("Resp:\"%s\"\n", s); write(fd, s, strlen(s)); } +#else #define OUTPUT(s) write(fd, s, strlen(s)) +#endif int mysleep = 20; @@ -296,7 +301,9 @@ int main(int argc, char *argv[]) if (getmyline(fd, buf) > 0) { -// printf("Cmd:\"%s\"\n", buf); +#if defined(TRACE) + printf("Cmd:\"%s\"\n", buf); +#endif } // else { return 0; } commit 5c269964c28a32876dc04b715095e5d094b76055 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Nov 6 08:07:34 2024 -0600 astyle files in preparation for release 4.6 diff --git a/amplifiers/elecraft/kpa.c b/amplifiers/elecraft/kpa.c index e1acfba88..8ffbbe28e 100644 --- a/amplifiers/elecraft/kpa.c +++ b/amplifiers/elecraft/kpa.c @@ -67,7 +67,7 @@ int kpa_init(AMP *amp) } AMPSTATE(amp)->priv = (struct kpa_priv_data *) - calloc(1, sizeof(struct kpa_priv_data)); + calloc(1, sizeof(struct kpa_priv_data)); if (!AMPSTATE(amp)->priv) { diff --git a/amplifiers/expert/expert.c b/amplifiers/expert/expert.c index 48f88c871..7f4080cf8 100644 --- a/amplifiers/expert/expert.c +++ b/amplifiers/expert/expert.c @@ -69,7 +69,7 @@ int expert_init(AMP *amp) } AMPSTATE(amp)->priv = (struct expert_priv_data *) - calloc(1, sizeof(struct expert_priv_data)); + calloc(1, sizeof(struct expert_priv_data)); if (!AMPSTATE(amp)->priv) { diff --git a/amplifiers/gemini/gemini.c b/amplifiers/gemini/gemini.c index 41129fec1..5a154f52c 100644 --- a/amplifiers/gemini/gemini.c +++ b/amplifiers/gemini/gemini.c @@ -46,7 +46,7 @@ int gemini_init(AMP *amp) } AMPSTATE(amp)->priv = (struct gemini_priv_data *) - calloc(1, sizeof(struct gemini_priv_data)); + calloc(1, sizeof(struct gemini_priv_data)); if (!AMPSTATE(amp)->priv) { diff --git a/rigs/barrett/4100.c b/rigs/barrett/4100.c index 99004f6ac..02842e819 100644 --- a/rigs/barrett/4100.c +++ b/rigs/barrett/4100.c @@ -110,7 +110,9 @@ static int barrett4100_open(RIG *rig) ENTERFUNC; retval = barrett_transaction2(rig, "M:REMOTE SENTER2,1", 3, &response); - rig_debug(RIG_DEBUG_ERR, "%s: back from REMOTE SENTER2: got %d\n", __func__, retval); + rig_debug(RIG_DEBUG_ERR, "%s: back from REMOTE SENTER2: got %d\n", __func__, + retval); + if (response[0] != 's') { rig_debug(RIG_DEBUG_ERR, "%s: REMOTE SENTER2 error: got %s\n", __func__, @@ -159,6 +161,7 @@ int barrett4100_set_freq(RIG *rig, vfo_t vfo, freq_t freq) rig_debug(RIG_DEBUG_ERR, "%s: unable to parse s gRF\n", __func__); } } + retval = barrett_transaction2(rig, "M:FF STF%.0f GTF", freq, &response); if (retval != RIG_OK) @@ -196,10 +199,12 @@ int barrett4100_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) else { int n = sscanf(response, "gRF%lf", freq); + //int n = sscanf(response, "gRFA1,%*d,%lf,%*d", freq); if (n != 1) { - rig_debug(RIG_DEBUG_ERR, "%s(%d): unable to parse freq from '%s'\n", __func__, __LINE__, response); + rig_debug(RIG_DEBUG_ERR, "%s(%d): unable to parse freq from '%s'\n", __func__, + __LINE__, response); return -RIG_EPROTO; } } diff --git a/rigs/barrett/barrett.c b/rigs/barrett/barrett.c index 21757143c..17756ebcb 100644 --- a/rigs/barrett/barrett.c +++ b/rigs/barrett/barrett.c @@ -74,11 +74,13 @@ int barrett_transaction2(RIG *rig, char *cmd, int expected, char **result) SNPRINTF(cmd_buf, sizeof(cmd_buf), "%c%s%s", 0x0a, cmd, EOM); barrett_flush(rig); retval = write_block(rp, (unsigned char *) cmd_buf, strlen(cmd_buf)); + if (retval < 0) { rig_debug(RIG_DEBUG_ERR, "%s(%d): error in write_block\n", __func__, __LINE__); return retval; } + retval = read_block(RIGPORT(rig), (unsigned char *) priv->ret_data, expected); if (retval < 0) @@ -86,15 +88,19 @@ int barrett_transaction2(RIG *rig, char *cmd, int expected, char **result) rig_debug(RIG_DEBUG_ERR, "%s(%d): error in read_block\n", __func__, __LINE__); return retval; } - rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): %d bytes read\n", __func__, __LINE__, retval); - if (priv->ret_data[0] == 0x13) // we'll return from the 1st good char - { - *result = &(priv->ret_data[1]); - } - else // some commands like IAL don't give XOFF but XON is there -- is this a bug? - { - *result = &(priv->ret_data[0]); - } + + rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): %d bytes read\n", __func__, __LINE__, + retval); + + if (priv->ret_data[0] == 0x13) // we'll return from the 1st good char + { + *result = &(priv->ret_data[1]); + } + else // some commands like IAL don't give XOFF but XON is there -- is this a bug? + { + *result = &(priv->ret_data[0]); + } + return retval; } @@ -227,7 +233,7 @@ int barrett_init(RIG *rig) rig->caps->version); // cppcheck claims leak here but it's freed in cleanup STATE(rig)->priv = (struct barrett_priv_data *)calloc(1, - sizeof(struct barrett_priv_data)); + sizeof(struct barrett_priv_data)); if (!STATE(rig)->priv) { diff --git a/rigs/codan/codan.c b/rigs/codan/codan.c index 692cb4695..92b146709 100644 --- a/rigs/codan/codan.c +++ b/rigs/codan/codan.c @@ -138,7 +138,7 @@ int codan_init(RIG *rig) rig->caps->version); // cppcheck claims leak here but it's freed in cleanup STATE(rig)->priv = (struct codan_priv_data *)calloc(1, - sizeof(struct codan_priv_data)); + sizeof(struct codan_priv_data)); if (!STATE(rig)->priv) { diff --git a/rigs/commradio/commradio.c b/rigs/commradio/commradio.c index c73c7b6fe..d830e6eda 100644 --- a/rigs/commradio/commradio.c +++ b/rigs/commradio/commradio.c @@ -24,81 +24,86 @@ */ int commradio_transaction(RIG *rig, const unsigned char *cmd, int cmd_len, - unsigned char *data, int *data_len) + unsigned char *data, int *data_len) { - int ret = -RIG_EINTERNAL; - struct rig_state *rs; - hamlib_port_t *rp = RIGPORT(rig); - - ENTERFUNC; - - rs = STATE(rig); - rs->transaction_active = 1; - - /* - * Flush is needed until async mode is done. The CTX-10 sends frames every - * time the VFO changes. - */ - rig_flush(rp); - - int frame_len; - unsigned char frame[3+2*(cmd_len+2)]; - size_t rx_len = CR_FRAMELENGTH; - unsigned char rx[rx_len]; - frame_len = frame_message(frame, cmd, cmd_len); - ret = write_block(rp, frame, frame_len); - if (ret < RIG_OK) - { - goto transaction_quit; - } - - const char stopset[] = { CR_EOF }; - ret = read_string(rp, rx, rx_len-1, stopset, 1, 0, 1); - if (ret < RIG_OK) - { - goto transaction_quit; - } - ret = commradio_unpack_frame(data, rx, ret); - if (ret < RIG_OK) - { - goto transaction_quit; - } - *data_len = ret; - //TODO: check for error response 0x11 + int ret = -RIG_EINTERNAL; + struct rig_state *rs; + hamlib_port_t *rp = RIGPORT(rig); + + ENTERFUNC; + + rs = STATE(rig); + rs->transaction_active = 1; + + /* + * Flush is needed until async mode is done. The CTX-10 sends frames every + * time the VFO changes. + */ + rig_flush(rp); + + int frame_len; + unsigned char frame[3 + 2 * (cmd_len + 2)]; + size_t rx_len = CR_FRAMELENGTH; + unsigned char rx[rx_len]; + frame_len = frame_message(frame, cmd, cmd_len); + ret = write_block(rp, frame, frame_len); + + if (ret < RIG_OK) + { + goto transaction_quit; + } + + const char stopset[] = { CR_EOF }; + ret = read_string(rp, rx, rx_len - 1, stopset, 1, 0, 1); + + if (ret < RIG_OK) + { + goto transaction_quit; + } + + ret = commradio_unpack_frame(data, rx, ret); + + if (ret < RIG_OK) + { + goto transaction_quit; + } + + *data_len = ret; + //TODO: check for error response 0x11 transaction_quit: - rs->transaction_active = 0; - RETURNFUNC(ret); + rs->transaction_active = 0; + RETURNFUNC(ret); } int commradio_init(RIG *rig) { - ENTERFUNC; - // I can't think of anything that goes in here yet. - RETURNFUNC(RIG_OK); + ENTERFUNC; + // I can't think of anything that goes in here yet. + RETURNFUNC(RIG_OK); } int commradio_cleanup(RIG *rig) { - ENTERFUNC; - // dealloc stuff if it gets added to _init - RETURNFUNC(RIG_OK); + ENTERFUNC; + // dealloc stuff if it gets added to _init + RETURNFUNC(RIG_OK); } int commradio_rig_open(RIG *rig) { - ENTERFUNC; - // Possibly check if our serial port is configured right and we are not - // doing bad things to the GPIO lines - RETURNFUNC(RIG_OK); + ENTERFUNC; + // Possibly check if our serial port is configured right and we are not + // doing bad things to the GPIO lines + RETURNFUNC(RIG_OK); } int commradio_rig_close(RIG *rig) { - ENTERFUNC; - // i don't really know - RETURNFUNC(RIG_OK); + ENTERFUNC; + // i don't really know + RETURNFUNC(RIG_OK); } /* @@ -110,73 +115,79 @@ int commradio_rig_close(RIG *rig) int commradio_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) { - const unsigned char cmd[] = {0x32}; // Get frequency request - unsigned char data[CR_FRAMELENGTH]; - int data_len; - int ret = -RIG_EINTERNAL; - - ENTERFUNC; - - ret = commradio_transaction(rig, cmd, 1, data, &data_len); - if(data_len == 5 && (data[0] == 0x33 || data[0] == 0x34)) - { - *freq = (data[1] << 24 | data[2] << 16 | data[3] << 8 | data[4]); - ret = RIG_OK; - } - else - { - rig_debug(RIG_DEBUG_ERR, "%s: Unexpected response to 0x32\n", __func__); - } - RETURNFUNC(ret); + const unsigned char cmd[] = {0x32}; // Get frequency request + unsigned char data[CR_FRAMELENGTH]; + int data_len; + int ret = -RIG_EINTERNAL; + + ENTERFUNC; + + ret = commradio_transaction(rig, cmd, 1, data, &data_len); + + if (data_len == 5 && (data[0] == 0x33 || data[0] == 0x34)) + { + *freq = (data[1] << 24 | data[2] << 16 | data[3] << 8 | data[4]); + ret = RIG_OK; + } + else + { + rig_debug(RIG_DEBUG_ERR, "%s: Unexpected response to 0x32\n", __func__); + } + + RETURNFUNC(ret); } int commradio_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { - unsigned char data[CR_FRAMELENGTH]; - int data_len; - int ret = -RIG_EINTERNAL; - - ENTERFUNC; - - if(freq < 150000 || freq > 30000000) - { - RETURNFUNC(-RIG_EINVAL); - } - uint32_t int_freq = freq; - rig_debug(RIG_DEBUG_VERBOSE, "%s: Got freq=%f, int_freq=%u\n", __func__, - freq, int_freq); - unsigned char cmd[] = - { - 0x30, // Set frequency request - 0xFF & (int_freq >> 24), - 0xFF & (int_freq >> 16), - 0xFF & (int_freq >> 8), - 0xFF & (int_freq) - }; - - ret = commradio_transaction(rig, cmd, 5, data, &data_len); - if(data_len == 5 && (data[0] == 0x31 || data[0] == 0x34)) - { - uint32_t new_freq = (data[1] << 24 | data[2] << 16 | data[3] << 8 | data[4]); - if(int_freq == new_freq) - { - RETURNFUNC(RIG_OK); - } - else - { - RETURNFUNC(-RIG_ERJCTED); - } - } - // CTX-10 returns 11 02 30 00 00 00 01 if we try to go out of its - // general-coverage frequency range 150kHz - 30MHz. I'm not sure why Hamlib - // even tries to do this, since its defined in the caps... - else - { - rig_debug(RIG_DEBUG_ERR, "%s: Unexpected response to 0x30\n", __func__); - ret = -RIG_ERJCTED; - } - RETURNFUNC(ret); + unsigned char data[CR_FRAMELENGTH]; + int data_len; + int ret = -RIG_EINTERNAL; + + ENTERFUNC; + + if (freq < 150000 || freq > 30000000) + { + RETURNFUNC(-RIG_EINVAL); + } + + uint32_t int_freq = freq; + rig_debug(RIG_DEBUG_VERBOSE, "%s: Got freq=%f, int_freq=%u\n", __func__, + freq, int_freq); + unsigned char cmd[] = + { + 0x30, // Set frequency request + 0xFF & (int_freq >> 24), + 0xFF & (int_freq >> 16), + 0xFF & (int_freq >> 8), + 0xFF & (int_freq) + }; + + ret = commradio_transaction(rig, cmd, 5, data, &data_len); + + if (data_len == 5 && (data[0] == 0x31 || data[0] == 0x34)) + { + uint32_t new_freq = (data[1] << 24 | data[2] << 16 | data[3] << 8 | data[4]); + + if (int_freq == new_freq) + { + RETURNFUNC(RIG_OK); + } + else + { + RETURNFUNC(-RIG_ERJCTED); + } + } + // CTX-10 returns 11 02 30 00 00 00 01 if we try to go out of its + // general-coverage frequency range 150kHz - 30MHz. I'm not sure why Hamlib + // even tries to do this, since its defined in the caps... + else + { + rig_debug(RIG_DEBUG_ERR, "%s: Unexpected response to 0x30\n", __func__); + ret = -RIG_ERJCTED; + } + + RETURNFUNC(ret); } /* @@ -184,13 +195,13 @@ int commradio_set_freq(RIG *rig, vfo_t vfo, freq_t freq) */ int commradio_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { - return (RIG_OK); + return (RIG_OK); } int commradio_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) { - *mode = RIG_MODE_NONE; - return (RIG_OK); + *mode = RIG_MODE_NONE; + return (RIG_OK); } /* @@ -199,22 +210,22 @@ int commradio_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) */ int commradio_set_vfo(RIG *rig, vfo_t vfo) { - return (RIG_OK); + return (RIG_OK); } int commradio_get_vfo(RIG *rig, vfo_t *vfo) { - *vfo = RIG_VFO_A; - return (RIG_OK); + *vfo = RIG_VFO_A; + return (RIG_OK); } DECLARE_INITRIG_BACKEND(commradio) { - rig_debug(RIG_DEBUG_VERBOSE, "%s: _init called\n", __func__); - rig_register(&ctx10_caps); + rig_debug(RIG_DEBUG_VERBOSE, "%s: _init called\n", __func__); + rig_register(&ctx10_caps); - return (RIG_OK); + return (RIG_OK); } /* @@ -222,6 +233,6 @@ DECLARE_INITRIG_BACKEND(commradio) */ DECLARE_PROBERIG_BACKEND(commradio) { - return (RIG_MODEL_NONE); + return (RIG_MODEL_NONE); } diff --git a/rigs/commradio/ctx10.c b/rigs/commradio/ctx10.c index fc411ee41..ddaa0e617 100644 --- a/rigs/commradio/ctx10.c +++ b/rigs/commradio/ctx10.c @@ -17,79 +17,79 @@ struct rig_caps ctx10_caps = { - RIG_MODEL(RIG_MODEL_CTX10), - .model_name = "CTX-10", - .mfg_name = "Commradio", - .version = "20240809.0", - .copyright = "LGPL", - .status = RIG_STATUS_STABLE, - .rig_type = RIG_TYPE_TRANSCEIVER, - .ptt_type = RIG_PTT_NONE, - .dcd_type = RIG_DCD_NONE, - .port_type = RIG_PORT_SERIAL, - .serial_rate_min = 3000000, - .serial_rate_max = 3000000, - .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 = 1000, - .retry = 3, - .has_get_func = RIG_FUNC_NONE, - .has_set_func = RIG_FUNC_NONE, - .has_get_level = RIG_LEVEL_NONE, - .has_set_level = RIG_LEVEL_NONE, - .has_get_parm = RIG_PARM_NONE, - .has_set_parm = RIG_PARM_NONE, -// .level_gran = {}, -// .parm_gran = {}, - .ctcss_list = NULL, - .dcs_list = NULL, -// .preamp = { RIG_DBLST_END, }, -// .attenuator = { RIG_DBLST_END, }, -// .max_rit = Hz(0), -// .max_xit = Hz(0), -// .max_ifshift = Hz(0), - .targetable_vfo = 0, - .vfo_ops = (RIG_OP_FROM_VFO|RIG_OP_TO_VFO), - .scan_ops = RIG_SCAN_NONE, - .transceive = RIG_TRN_OFF, - .bank_qty = 0, - .chan_desc_sz = 0, - .chan_list = { RIG_CHAN_END, }, - .rx_range_list1 = { - {kHz(150), MHz(30), CTX10_RX_MODES, -1, -1, CTX10_VFO, 0}, - RIG_FRNG_END, - }, - .tx_range_list1 = { - FRQ_RNG_80m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), - FRQ_RNG_60m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), - FRQ_RNG_40m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), - FRQ_RNG_30m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), - FRQ_RNG_20m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), - FRQ_RNG_17m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), - FRQ_RNG_15m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), - FRQ_RNG_12m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), - FRQ_RNG_10m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), - }, - .tuning_steps = { - {CTX10_RX_MODES, 10}, - RIG_TS_END, - }, -// .async_data_supported = 1, //TODO: R... [truncated message content] |
From: n0nb <n0...@us...> - 2024-11-02 11: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 ece40e6bc28ee304a806181fc6483adec540c25c (commit) via 88cae85ab27e9cd59b4a37502e4fb2cd9c254541 (commit) via 49e870cfb8cb9a7dd119c8fee75de912936993ab (commit) from be44ddc83055418110984c009dd6cf923136cc86 (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 ece40e6bc28ee304a806181fc6483adec540c25c Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Oct 30 17:05:44 2024 -0500 Hopefully clean up clang warning on compile diff --git a/tests/testrig.c b/tests/testrig.c index e73a4cd79..b7a5b1abd 100644 --- a/tests/testrig.c +++ b/tests/testrig.c @@ -80,8 +80,8 @@ int main(int argc, const char *argv[]) uint64_t levels = rig_get_caps_int(my_rig->caps->rig_model, RIG_CAPS_HAS_GET_LEVEL); - printf("HAS_GET_LEVEL=0x%8lx, SWR=%8llx,true=%d\n", levels, - levels & RIG_LEVEL_SWR, (levels & RIG_LEVEL_SWR) == RIG_LEVEL_SWR); + printf("HAS_GET_LEVEL=0x%8llx, SWR=%8llx,true=%d\n", (unsigned long long)levels, + (unsigned long long)(levels & RIG_LEVEL_SWR), (levels & RIG_LEVEL_SWR) == RIG_LEVEL_SWR); char val[256]; retcode = rig_get_conf2(my_rig, rig_token_lookup(my_rig, "write_delay"), val, commit 88cae85ab27e9cd59b4a37502e4fb2cd9c254541 Merge: 49e870cfb be44ddc83 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Oct 30 16:42:26 2024 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 49e870cfb8cb9a7dd119c8fee75de912936993ab Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Oct 30 16:41:29 2024 -0500 Remove collision_retry=0 in icom/frame.c -- was causing a loop when random data received https://github.com/Hamlib/Hamlib/issues/1604 diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 50e962517..985df2613 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -329,7 +329,12 @@ again2: // https://github.com/Hamlib/Hamlib/issues/1575 // these types of async can interrupt the cmd we sent // if our host number changes must not be for us - collision_retry = 0; + if (icom_is_async_frame(rig, frm_len, buf)) + { + icom_process_async_frame(rig, frm_len, buf); + goto again2; + } + if (sendbuf[3] != buf[2]) { rig_debug(RIG_DEBUG_VERBOSE, "%s: unknown async? read again\n", __func__); @@ -341,12 +346,6 @@ again2: } - if (icom_is_async_frame(rig, frm_len, buf)) - { - icom_process_async_frame(rig, frm_len, buf); - goto again2; - } - #if 0 // this was causing rigctld to fail on IC706 and WSJT-X ----------------------------------------------------------------------- Summary of changes: rigs/icom/frame.c | 13 ++++++------- tests/testrig.c | 4 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2024-10-30 21:33: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 be44ddc83055418110984c009dd6cf923136cc86 (commit) via ab883be8504c61568ef383e1aa3061e99199d0d6 (commit) via da5e490b2406676a27afc5157390de896c5b1533 (commit) via eead7a572ab579b68ef884d37fb870056cfa0e3b (commit) via 671d45f33775851bbcf4bf8bcf951a0be8fee2b2 (commit) via 3445d94c8d9bff1f57473d275135b46e744da15c (commit) via d209c655b0bb32706d2e1b96907ada54fa3205eb (commit) via 8bbf60d5c87f556a2093b7088b5cc14203c292e0 (commit) via 7aa739a97d5b5f3803a0940ac74f6955d77b26ed (commit) via ddf51e6b52361c870a377de43a3dd4be0a76a32d (commit) via 2b99b9d2ef04867166b9682709e8b508e168e3ec (commit) via ebe685125e5d728969113dbaf35a0f76138a7b93 (commit) via 5b1df09ad00d0cb1ef7faf66dda561ed76133745 (commit) via 3e34acc1e036ca13de01ee4c2dd43d49c79a56c1 (commit) via 65ae33845461e24f667d5acdc8d0bdbdf790da4b (commit) via 536cf13c698489bb112f93002f3235a40306fa3a (commit) via aa6d028b73934a307aae3b6d8a0cb7ca11f554ef (commit) from e3b067307a93bebd3eab6c5d11687f6adc482d27 (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 be44ddc83055418110984c009dd6cf923136cc86 Merge: 5b1df09ad ab883be85 Author: Michael Black <mdb...@ya...> Date: Wed Oct 30 12:13:58 2024 -0500 Merge pull request #1626 from GeoBaltz/fix21 Loads of code for simts890.c commit ab883be8504c61568ef383e1aa3061e99199d0d6 Author: George Baltz N3GB <Geo...@gm...> Date: Tue Oct 29 14:38:19 2024 -0400 Make FR & FT commands aware of new vfo structs. Get rid of vfo_rx & vfo_tx; find both thru vfoLR. diff --git a/simulators/simts890.c b/simulators/simts890.c index 34af7d616..55224df45 100644 --- a/simulators/simts890.c +++ b/simulators/simts890.c @@ -36,7 +36,7 @@ int mysleep = 20; int filternum1 = 7; int filternum2 = 8; -int vfo_rx, vfo_tx, ptt, ptt_data, ptt_mic, ptt_tune; +int ptt, ptt_data, ptt_mic, ptt_tune; int keyspd = 20; int sl=3, sh=3; int nr=0; @@ -434,7 +434,7 @@ int main(int argc, char *argv[]) { int temp = -1; sscanf(buf + 8, "%3d", &temp); - if (temp < 2 && temp >= 0) + if (temp <= 2 && temp >= 0) { nummems = temp * 2 + 1; } else { cmd_err = 1; } @@ -535,26 +535,48 @@ int main(int argc, char *argv[]) *vfoAB[tmpvfo] = nvfo; printf("modeA=%X, modeB=%X\n", vfoA->mode, vfoB->mode); } - else if (strcmp(buf, "FR;") == 0) - { - snprintf(buf, sizeof(buf), "FR%d;", vfo_rx); - OUTPUT(buf); - } else if (strncmp(buf, "FR", 2) == 0) - { - sscanf(buf, "FR%d", &vfo_rx); - } - else if (strcmp(buf, "FT;") == 0) - { - snprintf(buf, sizeof(buf), "FT%d;", vfo_tx); - OUTPUT(buf); + { // Receiver Function (VFO A / VFO B / Memory channel) + int idx; + + if (buf[2] == ';') + { // Read + idx = sp && tfset; + snprintf(buf, sizeof(buf), "FR%d;", (*vfoLR[idx])->vfo); + OUTPUT(buf); + } + else + { // Set + idx = buf[2] - '0'; + if (idx == 3) + { //TODO: Memory channels are a long way off + puts("Memory channels not implemented.\n"); + cmd_err = 3; + continue; + } + if (idx < 0 || idx > 1) {cmd_err = 1; continue; } + sp = 0; // Turn off split + if ((*vfoLR[0])->vfo != idx) // If the selected vfo is not the operational one + { + swapvfos(vfoLR); // Make it so + } + } } else if (strncmp(buf, "FT", 2) == 0) - { - sscanf(buf, "FT%d", &vfo_tx); - if (vfo_tx != vfo_rx) - { - sp = 1; + { // Transmitter Function ( VFO A / VFO B ) + int idx; + + if (buf[2] == ';') + { // Read + idx = sp && !tfset; + snprintf(buf, sizeof(buf), "FT%d;", (*vfoLR[idx])->vfo); + OUTPUT(buf); + } + else + { // Set + idx = buf[2] - '0'; + if (idx < 0 || idx > 1) {cmd_err = 1; continue; } + sp = idx != (*vfoLR[0])->vfo; // Turn split on if vfos differ, else off } } else if (buf[0] == 'B' && (buf[1] == 'D' || buf[1] == 'U')) // BU/BD @@ -678,7 +700,7 @@ int main(int argc, char *argv[]) /* This section needs a lot of work, and a lot * of cooperation from other commands. * AFAICT the split freq can be set by spinning - * the big knob, or by other means. When oper=1 + * the big knob, or by other means. When oper=0 * is sent, the current freq is used as the split * value. See page 5-1 of the IM, blinking SPLIT */ commit da5e490b2406676a27afc5157390de896c5b1533 Author: George Baltz N3GB <Geo...@gm...> Date: Fri Oct 25 17:05:26 2024 -0400 Clean up Fix up NB commands. Update VFO in case copy caused a band change. Change MODEL to TYPE to match Kenwood nomenclature, make it easier to change via cli. Comments diff --git a/simulators/simts890.c b/simulators/simts890.c index e1a2545dc..34af7d616 100644 --- a/simulators/simts890.c +++ b/simulators/simts890.c @@ -22,8 +22,10 @@ struct ip_mreq #define BUFSIZE 256 #define NBANDS 11 -/* Model we're emulating - K=The Americas, E=Europe */ -#define MODEL K +/* Type we're emulating - K=The Americas(default), E=Europe */ +#if !defined(TYPE) +#define TYPE K +#endif /* Define a macro for sending response back to the app * This will allow us to reroute output to a buffering routine * Needed to handle multiple commands in a single message @@ -44,7 +46,7 @@ int sm = 35; int nt = 0; int ag = 100; int ac = 0; -int nb1=0,nb2=0; +int nb[2] = {0, 0}; // NB1/NB2 OFF/ON int sq=0; int rg=0; int mg=0; @@ -90,7 +92,7 @@ int bandslot[2][NBANDS]; // 0-based band memory: ((bandslot[i] + 1) % nummems) * selection is by BD/BU command */ struct kvfo band_mem[2][NBANDS][5] = { { -#if MODEL==K +#if TYPE==K /* 160M */ { { 1800000, 3}, { 1810000, 3}, { 1820000, 3}, { 1830000, 3}, { 1840000, 3} }, /* 80M */ { { 3500000, 1}, { 3600000, 1}, { 3700000, 1}, { 3800000, 1}, { 3900000, 1} }, /* 40M */ { { 7000000, 1}, { 7050000, 1}, { 7100000, 1}, { 7150000, 1}, { 7200000, 1} }, @@ -102,7 +104,7 @@ struct kvfo band_mem[2][NBANDS][5] = { { /* 10M */ { {28000000, 2}, {28300000, 2}, {28500000, 2}, {29000000, 4}, {29300000, 4} }, /* 6M */ { {50000000, 2}, {50125000, 2}, {50200000, 2}, {51000000, 4}, {52000000, 4} }, /* GENE */ { { 135700, 3}, { 472000, 3}, { 1000000, 5}, { 5305500, 2}, { 5403500, 2} } -#else // MODEL==E +#else // TYPE==E /* 160M */ { { 1830000, 3}, { 1840000, 3}, { 1850000, 3}, { 1810000, 3}, { 1820000, 3} }, /* 80M */ { { 3500000, 1}, { 3550000, 1}, { 3600000, 1}, { 3650000, 1}, { 3700000, 1} }, /* 40M */ { { 7000000, 1}, { 7050000, 1}, { 7100000, 1}, { 7150000, 1}, { 7200000, 1} }, @@ -125,7 +127,7 @@ struct band_def { int high; }; const struct band_def band_limits[NBANDS] = { -#if MODEL == K +#if TYPE == K { 1800000, 2000000}, { 3500000, 4000000}, { 7000000, 7300000}, {10100000, 10150000}, {14000000, 14350000}, {18068000, 18168000}, {21000000, 21450000}, {24890000, 24990000}, {28000000, 29700000}, @@ -253,7 +255,7 @@ int main(int argc, char *argv[]) "%1X" // P9 Operating mode (See OM command) "0" // P10 Function? "0" // P11 Scan status? - "%1d" // P12 Simplex/Split + "%1d" // P12 Simplex=0/Split=1 "0" // P13 Tone/CTCSS (not on TS-890S) "00" // P14 Tone/CTCSS freq (not on TS-890S) "0;"; // P15 Always zero @@ -324,27 +326,31 @@ int main(int argc, char *argv[]) if (buf[5] != '9') antout = buf[5]; } } - else if (strcmp(buf, "NB1;") == 0) - { - hl_usleep(mysleep * 20); - sprintf(buf, "NB1%d;", nb1); - OUTPUT(buf); - } - else if (strncmp(buf, "NB1", 3) == 0) - { - puts(buf); - sscanf(buf, "NB1%d", &nb1); - } - else if (strcmp(buf, "NB2;") == 0) - { - hl_usleep(mysleep * 20); - sprintf(buf, "NB2%d;", nb2); - OUTPUT(buf); - } - else if (strncmp(buf, "NB2", 3) == 0) - { - puts(buf); - sscanf(buf, "NB2%d", &nb2); + else if (strncmp(buf, "NB", 2) == 0) + { // Noise Blanker settings + int idx; + switch (toupper(buf[2])) { + case '1': // Noise Blanker 1 + case '2': // Noise Blanker 2 + idx = buf[2] - '1'; + if (buf[3] == ';') + { // Read + hl_usleep(mysleep * 20); + sprintf(buf, "NB%d%d;", idx + 1, nb[idx]); + OUTPUT(buf); + } + else + { // Set + nb[idx] = buf[3] - '0'; + } + break; + case 'D': // Noise Blanker 2, type B Depth + case 'T': // Noise Blanker 2 Type + case 'W': // Noise Blanker 2, type B Width + break; + default: + cmd_err = 1; + } } else if (strcmp(buf, "RA;") == 0) { @@ -756,13 +762,14 @@ int main(int argc, char *argv[]) { // VFO A to VFO B Copy ([A=B] Operation) /* Akin to the EC command above, this isn't really a "VFO A to VFO B" * copy, but an "Operational VFO to Secondary VFO" copy. It also - * mimics the front panel [A=B] button. + * mimics the front panel [A=B] action. */ kvfop_t ovfo, svfo; ovfo = *vfoLR[0]; svfo = newvfo(*vfoLR[1], ovfo->band); // Get appropriate vfo for new freq svfo->freq = ovfo->freq; svfo->mode = ovfo->mode; + *vfoLR[1] = svfo; } else if (strncmp(buf, "KS;", 3) == 0) { @@ -804,7 +811,7 @@ int main(int argc, char *argv[]) } } else if (strncmp(buf, "RM", 2) == 0) - { // Meter control/readout + { // Meter if (buf[2] == ';') { // Read all enabled meters char tbuf[8]; commit eead7a572ab579b68ef884d37fb870056cfa0e3b Author: George Baltz N3GB <Geo...@gm...> Date: Thu Oct 24 16:20:35 2024 -0400 Correct some split problems and connect VFO ops Fix SP command to match real rig. Still needs work. Add split status to IF response. Add EC and VV commands, and explain that they are not what they're described to be. diff --git a/simulators/simts890.c b/simulators/simts890.c index df8652f0c..e1a2545dc 100644 --- a/simulators/simts890.c +++ b/simulators/simts890.c @@ -35,7 +35,6 @@ int mysleep = 20; int filternum1 = 7; int filternum2 = 8; int vfo_rx, vfo_tx, ptt, ptt_data, ptt_mic, ptt_tune; -int split = 0; int keyspd = 20; int sl=3, sh=3; int nr=0; @@ -52,7 +51,8 @@ int mg=0; int ra=0; int rl=0; int is=0; -int sp=0; +int sp=0; // Split OFF/ON +int split_op = 0; // Split frequency setting operation in progress // Clock data int autoset = 1; int tzs[2] = {36, 56}; // 0=primary(EST), 1=auxiliary(UTC) @@ -103,7 +103,7 @@ struct kvfo band_mem[2][NBANDS][5] = { { /* 6M */ { {50000000, 2}, {50125000, 2}, {50200000, 2}, {51000000, 4}, {52000000, 4} }, /* GENE */ { { 135700, 3}, { 472000, 3}, { 1000000, 5}, { 5305500, 2}, { 5403500, 2} } #else // MODEL==E - /* 160M */ { { 1830000, 3}, { 1840000, 3}, { 1850000, 3}, { 1820000, 3}, { 1820000, 3} }, + /* 160M */ { { 1830000, 3}, { 1840000, 3}, { 1850000, 3}, { 1810000, 3}, { 1820000, 3} }, /* 80M */ { { 3500000, 1}, { 3550000, 1}, { 3600000, 1}, { 3650000, 1}, { 3700000, 1} }, /* 40M */ { { 7000000, 1}, { 7050000, 1}, { 7100000, 1}, { 7150000, 1}, { 7200000, 1} }, /* 30M */ { {10100000, 3}, {10110000, 3}, {10120000, 3}, {10130000, 3}, {10140000, 3} }, @@ -124,7 +124,7 @@ struct band_def { int low; int high; }; -struct band_def band_limits[NBANDS] = { +const struct band_def band_limits[NBANDS] = { #if MODEL == K { 1800000, 2000000}, { 3500000, 4000000}, { 7000000, 7300000}, {10100000, 10150000}, {14000000, 14350000}, {18068000, 18168000}, @@ -144,8 +144,8 @@ struct band_def band_limits[NBANDS] = { * 2 = FM * 3 = AM */ -int mode2classtab[16] = { -1, 0, 0, 1, 2, 3, 1, 1, -1, 1, 1, 1, 0, 0, 2, 3}; -int stepvalues[4][10] = { // Step sizes in Hz +const int mode2classtab[16] = { -1, 0, 0, 1, 2, 3, 1, 1, -1, 1, 1, 1, 0, 0, 2, 3}; +const int stepvalues[4][10] = { // Step sizes in Hz /* SSB */ { 500, 1000, 2500, 5000, 10000, 0, 0, 0, 0, 0}, /* CW/FSK/PSK */ { 500, 1000, 2500, 5000, 10000, 0, 0, 0, 0, 0}, /* FM */ { 5000, 6250, 10000, 12500, 15000, 20000, 25000, 30000, 50000, 100000}, @@ -156,6 +156,7 @@ int stepsize[4] = { 1000, 500, 10000, 5000}; // Defaults by modeclass /* Function prototypes */ int freq2band(int freq); kvfop_t newvfo(kvfop_t ovfo, int band); +void swapvfos(kvfop_t *vfoset[]); // Extracted from rig.h int hl_usleep(unsigned long usec); // Until it's replaced @@ -252,7 +253,7 @@ int main(int argc, char *argv[]) "%1X" // P9 Operating mode (See OM command) "0" // P10 Function? "0" // P11 Scan status? - "0" // P12 Simplex/Split + "%1d" // P12 Simplex/Split "0" // P13 Tone/CTCSS (not on TS-890S) "00" // P14 Tone/CTCSS freq (not on TS-890S) "0;"; // P15 Always zero @@ -299,7 +300,7 @@ int main(int argc, char *argv[]) char ifbuf[256]; hl_usleep(mysleep * 1000); sprintf(ifbuf, IFformat, (*vfoLR[0])->freq, - (ptt + ptt_mic + ptt_data + ptt_tune) > 0 ? 1 : 0, (*vfoLR[0])->mode); + (ptt + ptt_mic + ptt_data + ptt_tune) > 0 ? 1 : 0, (*vfoLR[0])->mode, sp); OUTPUT(ifbuf); } else if (strncmp(buf, "AN", 2) == 0) @@ -547,7 +548,7 @@ int main(int argc, char *argv[]) sscanf(buf, "FT%d", &vfo_tx); if (vfo_tx != vfo_rx) { - split = 1; + sp = 1; } } else if (buf[0] == 'B' && (buf[1] == 'D' || buf[1] == 'U')) // BU/BD @@ -659,14 +660,68 @@ int main(int argc, char *argv[]) break; } } + else if (strncmp(buf, "SP", 2) == 0) + { // Split Operation Frequency Setting + if (buf[2] == ';') + { // Read + snprintf(buf + 2, sizeof(buf) -2, "%1d;", split_op); + OUTPUT(buf); + } + else if (buf[3] == ';') + { // Set 1 + /* This section needs a lot of work, and a lot + * of cooperation from other commands. + * AFAICT the split freq can be set by spinning + * the big knob, or by other means. When oper=1 + * is sent, the current freq is used as the split + * value. See page 5-1 of the IM, blinking SPLIT + */ + switch (buf[2]) { + case '0': + // Operation complete + if (split_op) // If a split setup was in progress, + { + sp = 1; // split operation is enabled + } + //TODO: Set split freq VFO + split_op = 0; + break; + case '1': + // Start split frequency setup + split_op = 1; + break; + case '2': + // Cancel op + split_op = 0; + break; + default: + cmd_err = 1; + } + } + else + { // Set 2 + int dir, split, spfreq, band; + kvfop_t ovfo, svfo; + sscanf(buf, "SP%1d%1d%1d", &sp, &dir, &split); + dir = dir == 0 ? +1 : -1; + split = dir * 1000 * split; // Convert kHz to +/- Hz + ovfo = *vfoLR[0]; // Operational VFO + spfreq = ovfo->freq + split; + band = freq2band(spfreq); + svfo = newvfo(*vfoLR[1], band); // Other VFO + svfo->freq = spfreq; + *vfoLR[1] = svfo; + sp = 1; // Turn On Split + } + } else if (strncmp(buf, "TB;", 3) == 0) { // Split - sprintf(buf, "TB%d;", split); + sprintf(buf, "TB%d;", sp); OUTPUT(buf); } else if (strncmp(buf, "TB", 2) == 0) { - sscanf(buf, "TB%d", &split); + sscanf(buf, "TB%d", &sp); } else if (strncmp(buf, "TS", 2) == 0) { // TF-SET @@ -677,6 +732,10 @@ int main(int argc, char *argv[]) } else if (buf[2] >= '0' && buf[2] < '2') { + if (sp && (tfset != buf[2] - '0')) + { // Split is set and we're changing state of TF-SET + swapvfos(vfoLR); // Reverse vfo functions + } tfset = buf[2] - '0'; } else @@ -684,6 +743,27 @@ int main(int argc, char *argv[]) cmd_err = 1; } } + else if (strcmp(buf, "EC;") == 0) + { // VFO A and VFO B Frequency Information Exchange + /* No matter what the title says above, the TS-890S does not + * have a frequency swap command. It does, however, have a VFO + * function exchange - just by swapping the left and right displays. + * This command is the same as the "A/B" button on the front panel. + */ + swapvfos(vfoLR); + } + else if (strcmp(buf, "VV;") == 0) + { // VFO A to VFO B Copy ([A=B] Operation) + /* Akin to the EC command above, this isn't really a "VFO A to VFO B" + * copy, but an "Operational VFO to Secondary VFO" copy. It also + * mimics the front panel [A=B] button. + */ + kvfop_t ovfo, svfo; + ovfo = *vfoLR[0]; + svfo = newvfo(*vfoLR[1], ovfo->band); // Get appropriate vfo for new freq + svfo->freq = ovfo->freq; + svfo->mode = ovfo->mode; + } else if (strncmp(buf, "KS;", 3) == 0) { sprintf(buf, "KS%03d;", keyspd); @@ -694,7 +774,7 @@ int main(int argc, char *argv[]) sscanf(buf, "KS%03d", &keyspd); } else if (strncmp(buf, "OM", 2) == 0) - { + { // Operating Mode /* The TS-890S displays two frequencies and modes - left and right, * along with arrows that show which is VFO A and which is VFO B. * In almost all cases, the left VFO is the receive freq. The right @@ -719,7 +799,7 @@ int main(int argc, char *argv[]) * which is always the left VFO unless split is active and * we are transmitting. */ - int idx = split && ((ptt + ptt_mic + ptt_data + ptt_tune) > 0); + int idx = sp && ((ptt + ptt_mic + ptt_data + ptt_tune) > 0); sscanf(&buf[3], "%1X", &(*vfoLR[idx])->mode); } } @@ -870,15 +950,6 @@ int main(int argc, char *argv[]) puts(buf); sscanf(buf,"RL1%d", &rl); } - else if (strcmp(buf, "SP;") == 0) - { - sprintf(buf,"SP%d;", sp); - OUTPUT(buf); - } - else if (strncmp(buf, "SP", 2) == 0) - { - sscanf(buf,"SP%d", &sp); - } else if (strncmp(buf, "CK", 2) == 0) { // All the clock functions switch (buf[2]) { @@ -989,6 +1060,20 @@ int main(int argc, char *argv[]) cmd_err = 1; } } + else if (strncmp(buf, "CD", 2) == 0) + { // CW Communications + switch (buf[2]) { + case '0': // CW Communication Screen Display + case '1': // CW Morse Decoding Threshold Level + case '2': // Decoded CW Morse Character Output + case '3': // CW Communication Screen (Decode Filter) + case '4': // CW Communication Screen (Quick Mode) + case '5': // CW Decode + break; + default: + cmd_err = 1; + } + } else if (strncmp(buf, "CM", 2) == 0) { // CW Message Memory switch (buf[2]) { @@ -1147,3 +1232,17 @@ kvfop_t newvfo(kvfop_t ovfo, int band) return &band_mem[vfonum][band][slot]; } + +/* Reverse the function of vfoA and vfoB + * No status returned + */ +void swapvfos(kvfop_t *vfoset[]) +{ + kvfop_t *temp; + + temp = vfoset[0]; + vfoset[0] = vfoset[1]; + vfoset[1] = temp; + + return; +} commit 671d45f33775851bbcf4bf8bcf951a0be8fee2b2 Author: George Baltz N3GB <Geo...@gm...> Date: Fri Oct 18 15:50:49 2024 -0400 Add DN/UP, FC, and UD commands to simts890.c Yet more ways to apply a delta to a VFO diff --git a/simulators/simts890.c b/simulators/simts890.c index 295de5fe4..df8652f0c 100644 --- a/simulators/simts890.c +++ b/simulators/simts890.c @@ -590,6 +590,56 @@ int main(int argc, char *argv[]) cmd_err = 1; } } + else if ( (strncmp(buf, "DN", 2) == 0) || (strncmp(buf, "UP", 2) == 0) ) + { // Microphone UP/DOWN Switch Operation + int dir = buf[0] == 'D' ? -1 : +1; + int steps = -1; + kvfop_t ovfo = *vfoLR[0]; // Modify the current operational VFO + + if (buf[2] == ';') + { + steps= 1; + } + else if (buf[4] == ';') + { + steps = atoi(buf + 2); + } + if (steps < 0 || steps > 99) {cmd_err = 1; continue;} + ovfo->freq += dir * steps * stepsize[mode2classtab[ovfo->mode]]; + } + else if (strncmp(buf, "FC", 2) == 0) + { // Change the Frequency (Tuning Control) + static const int fc_steps[6] = { 1, 2, 5, 10, 50, 100}; + int dir = buf[2] == '0' ? +1 : -1; + int stepidx = buf[3] - '0'; + int delta; + kvfop_t ovfo = *vfoLR[0]; + + if (stepidx < 0 || stepidx > 5) {cmd_err = 1; continue;} + delta = dir * fc_steps[stepidx] * stepsize[mode2classtab[ovfo->mode]]; + //TODO: This really needs a sanity check here + ovfo->freq += delta; + } + else if (strncmp(buf, "UD", 2) == 0) + { // VFO Frequency UP/DOWN + int idx = buf[2] - '0'; + int dir = buf[3] == '0' ? +1 : -1; + int steps = -1; + kvfop_t nvfo; + + if (idx < 0 || idx > 1 || tfset != 0) {cmd_err = 1; continue;} + nvfo = *vfoAB[idx]; + if (buf[4] == ';') + { + steps = 1; + } + else if (buf[6] == ';') + { + steps = atoi(buf + 4); + } + if (steps < 0 || steps > 99) {cmd_err = 1; continue; } + nvfo->freq += dir * steps * stepsize[mode2classtab[nvfo->mode]]; + } else if (strcmp(buf, "RX;") == 0) { // Receive Function State ptt = ptt_mic = ptt_data = ptt_tune = 0; commit 3445d94c8d9bff1f57473d275135b46e744da15c Author: George Baltz N3GB <Geo...@gm...> Date: Fri Oct 18 05:04:31 2024 -0400 Implement step sizes for some freq changes Add a few more placeholders Disable #include <hamlib/rig.h>; cleanse namespace Typos and formatting diff --git a/simulators/simts890.c b/simulators/simts890.c index a7f7f3e38..295de5fe4 100644 --- a/simulators/simts890.c +++ b/simulators/simts890.c @@ -9,6 +9,7 @@ struct ip_mreq }; #endif +#include "config.h" #include <stdio.h> #include <stdlib.h> #include <fcntl.h> @@ -17,7 +18,7 @@ struct ip_mreq #include <errno.h> #include <ctype.h> #include <time.h> -#include <hamlib/rig.h> +//#include <hamlib/rig.h> #define BUFSIZE 256 #define NBANDS 11 @@ -132,14 +133,31 @@ struct band_def band_limits[NBANDS] = { #else { 1810000, 2000000}, { 3500000, 3800000}, { 7000000, 7200000}, {10100000, 10150000}, {14000000, 14350000}, {18068000, 18168000}, - {21000000, 21450000}, {24890000, 24990000}, {28000000, 29000000}, + {21000000, 21450000}, {24890000, 24990000}, {28000000, 29700000}, {50000000, 52000000}, { 30000, 74800000} #endif }; +/* Table for mode<->emission class conversion + * Claas 0 = SSB + * 1 = CW/FSK/PSK + * 2 = FM + * 3 = AM + */ +int mode2classtab[16] = { -1, 0, 0, 1, 2, 3, 1, 1, -1, 1, 1, 1, 0, 0, 2, 3}; +int stepvalues[4][10] = { // Step sizes in Hz + /* SSB */ { 500, 1000, 2500, 5000, 10000, 0, 0, 0, 0, 0}, + /* CW/FSK/PSK */ { 500, 1000, 2500, 5000, 10000, 0, 0, 0, 0, 0}, + /* FM */ { 5000, 6250, 10000, 12500, 15000, 20000, 25000, 30000, 50000, 100000}, + /* AM */ { 5000, 6250, 10000, 12500, 15000, 20000, 25000, 30000, 50000, 100000} +}; +int stepsize[4] = { 1000, 500, 10000, 5000}; // Defaults by modeclass + /* Function prototypes */ int freq2band(int freq); kvfop_t newvfo(kvfop_t ovfo, int band); +// Extracted from rig.h +int hl_usleep(unsigned long usec); // Until it's replaced #if defined(WIN32) || defined(_WIN32) int openPort(char *comport) // doesn't matter for using pts devices @@ -414,7 +432,33 @@ int main(int argc, char *argv[]) else { cmd_err = 1; } } - } + } + else if (strncmp(buf + 2, "00301", 5) >= 0 && strncmp(buf + 2, "00304", 5) <= 0) + { // [SSB|CW/FSK/PSK|FM|AM] Mode Frequency Step Size (Multi/Channel Control) + int class = buf[6] - '1'; + int i, tmpstep = -1; + if (buf[7] == ';') + { // Read + for (i = 0; i < 10 && stepvalues[class][i] != 0; i++) + { + if (stepsize[class] == stepvalues[class][i]) + { + tmpstep = i; + break; + } + } + if (tmpstep < 0) {cmd_err = 3; continue;} // Shouldn't happen + snprintf(buf + 7, sizeof(buf) - 7, " %03d;", tmpstep); + OUTPUT(buf); + } + else + { // Set + tmpstep = atoi(buf + 8); + if (tmpstep < 0 || tmpstep > 9 || stepvalues[class][tmpstep] == 0) + {cmd_err = 1; continue;} + stepsize[class] = stepvalues[class][tmpstep]; + } + } } else if (buf[0] == 'F' && (buf[1] == 'A' || buf[1] == 'B')) // FA/FB { // VFO {A|B} Frequency @@ -462,7 +506,7 @@ int main(int argc, char *argv[]) OUTPUT(buf); } else if (strncmp(buf, "SF", 2) == 0) - { + { // Sets and Reads the VFO (Frequency and Mode) int tmpvfo, tmpfreq, tmpmode, newband; kvfop_t ovfo, nvfo; @@ -484,18 +528,6 @@ int main(int argc, char *argv[]) *vfoAB[tmpvfo] = nvfo; printf("modeA=%X, modeB=%X\n", vfoA->mode, vfoB->mode); } - else if (strncmp(buf, "FL", 2) == 0) - { - switch (buf[2]) { - case '0': // Select the Receive Filter - case '1': // Roofing Filter - case '2': // IF Filter Shape - case '3': // AF Filter Type - continue; // For now - default: - cmd_err = 1; - } - } else if (strcmp(buf, "FR;") == 0) { snprintf(buf, sizeof(buf), "FR%d;", vfo_rx); @@ -526,13 +558,15 @@ int main(int argc, char *argv[]) if (buf[2] == ';') { // Setting 2 - /* The TS-890S doesn't have a real BAND_UP/BAND_DOWN commnd - * This one just does a simple UP/DOWN. As the manual says, just - * like pushing the UP/DOWN button on the mic - */ - newfreq = ovfo->freq + dir * 1000; // Needs to be tracked by mode - // Checking for band edges needs to go here - ovfo->freq = newfreq; + /* The TS-890S doesn't have a real BAND_UP/BAND_DOWN command + * This one just does a simple UP/DOWN. As the manual says, just + * like pushing the UP/DOWN button on the mic + */ + int class = mode2classtab[ovfo->mode]; + if (class < 0 || class > 3) {cmd_err = 3; continue;} // Shouldn't happen + newfreq = ovfo->freq + (dir * stepsize[class]); + //TODO: Checking for band edges needs to go here + ovfo->freq = newfreq; } else if (buf[3] == ';') { // Read @@ -795,38 +829,6 @@ int main(int argc, char *argv[]) { sscanf(buf,"SP%d", &sp); } - else if (strncmp(buf, "BS", 2) == 0) - { // All the Bandscope commands - switch (toupper(buf[2])) { - case '0': // Scope Display ON/OFF - case '1': // Scope Display Type - case '2': // Bandscpoe Operation Mode - case '3': // Bandscope Span - case '4': // Bandscope Span - case '5': // Bandscope Scope Range (Fixed Mode) - case '6': // Bandscope Dispaly Pause - case '7': // Bandscope Marker - case '8': // Bandscope Attenuator - case '9': // Bandscope Max Hold - case 'A': // Bandscope Averaging - case 'B': // Bandscope Waterfall Display Speed - case 'C': // Bandscope Reference Level - case 'D': // Bandscope Waterfall Display Clear - case 'E': // Bandscope Marker Shift / Marker Center - case 'G': // Audio Scope Attenuator - case 'H': // Audio Scope Span - case 'I': // Oscilloscope Level - case 'J': // Oscilloscpoe Sweep Time - case 'K': // Bandscope Shift Position - case 'L': // Bandscope Receive Circuit State - case 'M': // Bandscope Scope Range Lower/Upper Frequency Limit - case 'N': // Audio Scope Display Pause - case 'O': // Expands Spectrum Analysis Range - break; - default: // Unknown - cmd_err = 1; - } - } else if (strncmp(buf, "CK", 2) == 0) { // All the clock functions switch (buf[2]) { @@ -904,7 +906,39 @@ int main(int argc, char *argv[]) default: printf("Bad clock command - %s\n", buf); } - } + } + else if (strncmp(buf, "BS", 2) == 0) + { // All the Bandscope commands + switch (toupper(buf[2])) { + case '0': // Scope Display ON/OFF + case '1': // Scope Display Type + case '2': // Bandscpoe Operation Mode + case '3': // Bandscope Span + case '4': // Bandscope Span + case '5': // Bandscope Scope Range (Fixed Mode) + case '6': // Bandscope Dispaly Pause + case '7': // Bandscope Marker + case '8': // Bandscope Attenuator + case '9': // Bandscope Max Hold + case 'A': // Bandscope Averaging + case 'B': // Bandscope Waterfall Display Speed + case 'C': // Bandscope Reference Level + case 'D': // Bandscope Waterfall Display Clear + case 'E': // Bandscope Marker Shift / Marker Center + case 'G': // Audio Scope Attenuator + case 'H': // Audio Scope Span + case 'I': // Oscilloscope Level + case 'J': // Oscilloscpoe Sweep Time + case 'K': // Bandscope Shift Position + case 'L': // Bandscope Receive Circuit State + case 'M': // Bandscope Scope Range Lower/Upper Frequency Limit + case 'N': // Audio Scope Display Pause + case 'O': // Expands Spectrum Analysis Range + break; + default: // Unknown + cmd_err = 1; + } + } else if (strncmp(buf, "CM", 2) == 0) { // CW Message Memory switch (buf[2]) { @@ -921,6 +955,57 @@ int main(int argc, char *argv[]) cmd_err = 1; // Unknown command } } + else if (strncmp(buf, "FL", 2) == 0) + { + switch (buf[2]) { + case '0': // Select the Receive Filter + case '1': // Roofing Filter + case '2': // IF Filter Shape + case '3': // AF Filter Type + continue; // For now + default: + cmd_err = 1; + } + } + else if (strncmp(buf, "FM", 2) == 0) + { // Frequency Markers + switch (buf[2]) { + case '0': // Frequency Marker Function + case '1': // Frequency Marker List Regiatration + case '2': // Total Number Registered of Frequency Marker List + case '3': // Frequency Marker List Readout + case '4': // Frequency Marker List Delete + break; + default: + cmd_err = 1; + } + } + else if (strncmp(buf, "IP", 2) == 0) + { // Network Config + switch (buf[2]) { + case '0': // DHCP + case '1': // IP Address (Manual Configuration) + case '2': // MAC Address + break; + default: + cmd_err = 1; + } + } + else if (strncmp(buf, "LA", 2) == 0) + { // Linear Amplifier Configuration + switch (buf[2]) { + case '0': // Target Band of Linear Amplifier Menu + case '1': // Linear Amplifier ON/OFF + case '2': // Linear Amplifier Transmission Control + case '3': // Linear Amplifier Transmission Delay ON/OFF + case '4': // Linear Amplifier Transmission Delay Time + case '5': // Linear Amplifier Relay Control + case '6': // Linear Amplifier External ALC Voltage + break; + default: + cmd_err = 1; + } + } else if (strncmp(buf, "MA", 2) == 0) { // Memory Channel Functions switch (buf[2]) { @@ -937,6 +1022,21 @@ int main(int argc, char *argv[]) cmd_err = 1; } } + else if (strncmp(buf, "PB", 2) == 0) + { // Voice Messages + switch (buf[2]) { + case '0': // Voice Message List Display + case '1': // Voice Message Playback, etc. + case '2': // Voice Message Channel Registration State + case '3': // Voice Message Channel Repeat + case '4': // Voice Message Channel Name + case '5': // Voice Message Recording Sound Source + case '6': // Voice Message Recording Total Remaining Time + break; + default: + cmd_err = 1; + } + } else if (strncmp(buf, "SC", 2) == 0) { // Scan functions switch (buf[2]) { commit d209c655b0bb32706d2e1b96907ada54fa3205eb Author: George Baltz N3GB <Geo...@gm...> Date: Tue Oct 15 19:32:37 2024 -0400 Change FA/FB/SF to use band memories Change name of kvfo_t to denote it's a pointer Add routines to convert freq to band and to get a new band's vfo diff --git a/simulators/simts890.c b/simulators/simts890.c index 8fcf91a6a..a7f7f3e38 100644 --- a/simulators/simts890.c +++ b/simulators/simts890.c @@ -77,12 +77,13 @@ typedef struct kvfo { int freq; int mode; short band, vfo; // Redundant, but useful for relative movement -} *kvfo_t; +} *kvfop_t; int nummems = 3; // Default - values = 1, 3, 5 int bandslot[2][NBANDS]; // 0-based band memory: ((bandslot[i] + 1) % nummems) (+1 for display) /* Storage and default data for band memories + * vfoA freq and mode initialized here, vfoB and other items set at startup * 1, 3(default), or 5 memories per band can be used. One is always active on * each band. Manually they are selected by multiple band button pushes; CAT * selection is by BD/BU command @@ -115,6 +116,31 @@ struct kvfo band_mem[2][NBANDS][5] = { { #endif } }; +/* Band definitions + * differ by model + */ +struct band_def { + int low; + int high; +}; +struct band_def band_limits[NBANDS] = { +#if MODEL == K + { 1800000, 2000000}, { 3500000, 4000000}, { 7000000, 7300000}, + {10100000, 10150000}, {14000000, 14350000}, {18068000, 18168000}, + {21000000, 21450000}, {24890000, 24990000}, {28000000, 29700000}, + {50000000, 54000000}, { 30000, 60000000} +#else + { 1810000, 2000000}, { 3500000, 3800000}, { 7000000, 7200000}, + {10100000, 10150000}, {14000000, 14350000}, {18068000, 18168000}, + {21000000, 21450000}, {24890000, 24990000}, {28000000, 29000000}, + {50000000, 52000000}, { 30000, 74800000} +#endif +}; + +/* Function prototypes */ +int freq2band(int freq); +kvfop_t newvfo(kvfop_t ovfo, int band); + #if defined(WIN32) || defined(_WIN32) int openPort(char *comport) // doesn't matter for using pts devices { @@ -189,8 +215,8 @@ int main(int argc, char *argv[]) char *err_txt[] = { "?;", "E;", "O;" }; struct kvfo *vfoA = &band_mem[0][4][0], *vfoB = &band_mem[1][6][0]; - const kvfo_t *vfoAB[2] = {&vfoA, &vfoB}; // 0=A, 1=B, fixed - kvfo_t *vfoLR[2] = {&vfoA, &vfoB}; // 0=Left, 1=Right, can change + kvfop_t * const vfoAB[2] = {&vfoA, &vfoB}; // 0=A, 1=B, fixed + kvfop_t *vfoLR[2] = {&vfoA, &vfoB}; // 0=Left, 1=Right, can change /* The IF command is not documented for the TS-890S, and is supposed * to be supplanted by SF. However, it is still there for legacy S/W. @@ -400,10 +426,15 @@ int main(int argc, char *argv[]) } else { - int tmpfreq; + int tmpfreq, newband; + kvfop_t ovfo, nvfo; sscanf(buf + 2, "%d", &tmpfreq); - // TODO: Check and decode freq. Check band and set vfo to band mem. - (*vfoAB[idx])->freq = tmpfreq; + newband = freq2band(tmpfreq); + if (newband < 0) {cmd_err = 1; continue; } + ovfo = *vfoAB[idx]; + nvfo = newvfo(ovfo, newband); + nvfo->freq = tmpfreq; + *vfoAB[idx] = nvfo; } } else if (strncmp(buf, "AI;", 3) == 0) @@ -432,7 +463,8 @@ int main(int argc, char *argv[]) } else if (strncmp(buf, "SF", 2) == 0) { - int tmpvfo, tmpfreq, tmpmode; + int tmpvfo, tmpfreq, tmpmode, newband; + kvfop_t ovfo, nvfo; if (sscanf(buf, SFformat, &tmpvfo, &tmpfreq, &tmpmode) != 3 || tmpvfo < 0 || tmpvfo > 1) @@ -443,9 +475,13 @@ int main(int argc, char *argv[]) } //printf("tmpvfo=%d, tmpfreq=%d, tmpmode=%d\n", tmpvfo, tmpfreq, tmpmode); - (*vfoAB[tmpvfo])->mode = tmpmode; - (*vfoAB[tmpvfo])->freq = tmpfreq; - + ovfo = *vfoAB[tmpvfo]; + newband = freq2band(tmpfreq); + if (newband < 0) {cmd_err = 1; continue; } + nvfo = newvfo(ovfo, newband); + nvfo->mode = tmpmode; + nvfo->freq = tmpfreq; + *vfoAB[tmpvfo] = nvfo; printf("modeA=%X, modeB=%X\n", vfoA->mode, vfoB->mode); } else if (strncmp(buf, "FL", 2) == 0) @@ -484,9 +520,9 @@ int main(int argc, char *argv[]) } else if (buf[0] == 'B' && (buf[1] == 'D' || buf[1] == 'U')) // BU/BD { // Frequency Band Selection(Setting 1)/[UP}/{DOWN] Operating(Setting 2) - int band, cycle, idx, newfreq; + int band, idx, newfreq; int dir = buf[1] == 'D' ? -1 : +1; - kvfo_t ovfo = *vfoLR[0]; // Current operating VFO + kvfop_t ovfo = *vfoLR[0]; // Current operating VFO if (buf[2] == ';') { // Setting 2 @@ -500,20 +536,20 @@ int main(int argc, char *argv[]) } else if (buf[3] == ';') { // Read - idx = buf[2] - '0'; - if (idx < 0 || idx > 1) {cmd_err = 1; continue;} - snprintf(buf + 3, sizeof(buf) - 3, "%d;", bandslot[idx][ovfo->band]); - OUTPUT(buf); + idx = buf[2] - '0'; + if (idx < 0 || idx > 1) {cmd_err = 1; continue;} + snprintf(buf + 3, sizeof(buf) - 3, "%d;", bandslot[idx][ovfo->band] + 1); + OUTPUT(buf); } else if (buf[5] == ';') { // Setting 1 - band = atoi(buf + 3); - if (band < 0 || band >= NBANDS) {cmd_err = 1; continue;} - if (band == ovfo->band) - { // Same band, just cycle the band memory # + band = atoi(buf + 3); + if (band < 0 || band >= NBANDS) {cmd_err = 1; continue;} + if (band == ovfo->band) + { // Same band, cycle the band memory # bandslot[ovfo->vfo][band] = (bandslot[ovfo->vfo][band] + 1) % nummems; } - *(vfoLR[0]) = &band_mem[ovfo->vfo][band][bandslot[ovfo->vfo][band]]; + *vfoLR[0] = newvfo(ovfo, band); } else { @@ -922,3 +958,42 @@ int main(int argc, char *argv[]) return 0; } + +/* Convert freq to TS-890S band # + * + * Input freq in Hz + * + * Returns band # or negative if invalid input + */ +int freq2band(int freq) +{ + int i, retval = -1; // Assume the worst + + for ( i = 0; i < NBANDS; i++ ) + { + if ( freq >= band_limits[i].low && freq <= band_limits[i].high ) + { + retval = i; + break; + } + } + //printf("%dHz is in band # %d\n", freq, retval); + + return retval; +} + +/* Get appropriate vfo for new frequency + * + * Input: current vfo + * new band + * Return: new vfo pointer + */ +kvfop_t newvfo(kvfop_t ovfo, int band) +{ + int vfonum, slot; + + vfonum = ovfo->vfo; + slot = bandslot[vfonum][band]; + + return &band_mem[vfonum][band][slot]; +} commit 8bbf60d5c87f556a2093b7088b5cc14203c292e0 Author: George Baltz N3GB <Geo...@gm...> Date: Fri Oct 11 16:12:50 2024 -0400 More VFOs as objects. Add band memory objects. Use them to implement BD/BU. Default to Model K; E as compile time option Would have been easier as real OOP objects; C syntax is clunky, and the parentheses look weird. Oh well. Still TODO: tie all the other frequency settings into band memories. May need some storage rearrangement to make functions cleaner. diff --git a/simulators/simts890.c b/simulators/simts890.c index f827f14c0..8fcf91a6a 100644 --- a/simulators/simts890.c +++ b/simulators/simts890.c @@ -20,7 +20,9 @@ struct ip_mreq #include <hamlib/rig.h> #define BUFSIZE 256 - +#define NBANDS 11 +/* Model we're emulating - K=The Americas, E=Europe */ +#define MODEL K /* Define a macro for sending response back to the app * This will allow us to reroute output to a buffering routine * Needed to handle multiple commands in a single message @@ -31,9 +33,7 @@ int mysleep = 20; int filternum1 = 7; int filternum2 = 8; -int datamode = 0; int vfo_rx, vfo_tx, ptt, ptt_data, ptt_mic, ptt_tune; -int operatingband; int split = 0; int keyspd = 20; int sl=3, sh=3; @@ -76,11 +76,44 @@ int tfset = 0; typedef struct kvfo { int freq; int mode; + short band, vfo; // Redundant, but useful for relative movement } *kvfo_t; -struct kvfo temp1 = {14074000, 1}; -struct kvfo temp2 = {14073500, 2}; +int nummems = 3; // Default - values = 1, 3, 5 +int bandslot[2][NBANDS]; // 0-based band memory: ((bandslot[i] + 1) % nummems) (+1 for display) +/* Storage and default data for band memories + * 1, 3(default), or 5 memories per band can be used. One is always active on + * each band. Manually they are selected by multiple band button pushes; CAT + * selection is by BD/BU command + */ +struct kvfo band_mem[2][NBANDS][5] = { { +#if MODEL==K + /* 160M */ { { 1800000, 3}, { 1810000, 3}, { 1820000, 3}, { 1830000, 3}, { 1840000, 3} }, + /* 80M */ { { 3500000, 1}, { 3600000, 1}, { 3700000, 1}, { 3800000, 1}, { 3900000, 1} }, + /* 40M */ { { 7000000, 1}, { 7050000, 1}, { 7100000, 1}, { 7150000, 1}, { 7200000, 1} }, + /* 30M */ { {10100000, 3}, {10110000, 3}, {10120000, 3}, {10130000, 3}, {10140000, 3} }, + /* 20M */ { {14000000, 2}, {14100000, 2}, {14150000, 2}, {14200000, 2}, {14250000, 2} }, + /* 17M */ { {18068000, 2}, {18100000, 2}, {18110000, 2}, {18150000, 2}, {18160000, 2} }, + /* 15M */ { {21000000, 2}, {21100000, 2}, {21150000, 2}, {21200000, 2}, {21300000, 2} }, + /* 12M */ { {24890000, 2}, {24920000, 2}, {24940000, 2}, {24960000, 2}, {24980000, 2} }, + /* 10M */ { {28000000, 2}, {28300000, 2}, {28500000, 2}, {29000000, 4}, {29300000, 4} }, + /* 6M */ { {50000000, 2}, {50125000, 2}, {50200000, 2}, {51000000, 4}, {52000000, 4} }, + /* GENE */ { { 135700, 3}, { 472000, 3}, { 1000000, 5}, { 5305500, 2}, { 5403500, 2} } +#else // MODEL==E + /* 160M */ { { 1830000, 3}, { 1840000, 3}, { 1850000, 3}, { 1820000, 3}, { 1820000, 3} }, + /* 80M */ { { 3500000, 1}, { 3550000, 1}, { 3600000, 1}, { 3650000, 1}, { 3700000, 1} }, + /* 40M */ { { 7000000, 1}, { 7050000, 1}, { 7100000, 1}, { 7150000, 1}, { 7200000, 1} }, + /* 30M */ { {10100000, 3}, {10110000, 3}, {10120000, 3}, {10130000, 3}, {10140000, 3} }, + /* 20M */ { {14000000, 2}, {14100000, 2}, {14150000, 2}, {14200000, 2}, {14250000, 2} }, + /* 17M */ { {18068000, 2}, {18100000, 2}, {18110000, 2}, {18150000, 2}, {18160000, 2} }, + /* 15M */ { {21000000, 2}, {21100000, 2}, {21150000, 2}, {21200000, 2}, {21300000, 2} }, + /* 12M */ { {24890000, 2}, {24920000, 2}, {24940000, 2}, {24960000, 2}, {24980000, 2} }, + /* 10M */ { {28000000, 2}, {28300000, 2}, {28500000, 2}, {29000000, 4}, {29300000, 4} }, + /* 6M */ { {50000000, 2}, {50125000, 2}, {50200000, 2}, {51000000, 4}, {52000000, 4} }, + /* GENE */ { {70100000, 2}, { 135700, 3}, { 472000, 5}, { 999000, 5}, { 5258500, 2} } +#endif +} }; #if defined(WIN32) || defined(_WIN32) int openPort(char *comport) // doesn't matter for using pts devices @@ -155,9 +188,9 @@ int main(int argc, char *argv[]) int cmd_err = 0; char *err_txt[] = { "?;", "E;", "O;" }; - struct kvfo *vfoA = &temp1, *vfoB = &temp2; - const kvfo_t vfoAB[2] = {vfoA, vfoB}; // 0=A, 1=B, fixed - kvfo_t vfoLR[2] = {vfoA, vfoB}; // 0=Left, 1=Right, can change + struct kvfo *vfoA = &band_mem[0][4][0], *vfoB = &band_mem[1][6][0]; + const kvfo_t *vfoAB[2] = {&vfoA, &vfoB}; // 0=A, 1=B, fixed + kvfo_t *vfoLR[2] = {&vfoA, &vfoB}; // 0=Left, 1=Right, can change /* The IF command is not documented for the TS-890S, and is supposed * to be supplanted by SF. However, it is still there for legacy S/W. @@ -184,6 +217,17 @@ int main(int argc, char *argv[]) "%011d" // P2 Freq(Hz) "%1X;"; // P3 Mode + /* Initialization */ + for (int i = 0; i < NBANDS; i++) + { + for (int j = 0; j < 5; j++) + { + band_mem[1][i][j] = band_mem[0][i][j]; + band_mem[1][i][j].vfo = 1; + band_mem[0][i][j].band = band_mem[1][i][j].band = i; + } + } + while (1) { hl_usleep(10); @@ -201,15 +245,17 @@ int main(int argc, char *argv[]) // printf("Cmd:\"%s\"\n", buf); } - // else { return 0; } + buf[0] = toupper(buf[0]); + buf[1] = toupper(buf[1]); + if (strcmp(buf, "IF;") == 0) { char ifbuf[256]; hl_usleep(mysleep * 1000); - sprintf(ifbuf, IFformat, vfoLR[0]->freq, - (ptt + ptt_mic + ptt_data + ptt_tune) > 0 ? 1 : 0, vfoLR[0]->mode); + sprintf(ifbuf, IFformat, (*vfoLR[0])->freq, + (ptt + ptt_mic + ptt_data + ptt_tune) > 0 ? 1 : 0, (*vfoLR[0])->mode); OUTPUT(ifbuf); } else if (strncmp(buf, "AN", 2) == 0) @@ -319,32 +365,46 @@ int main(int argc, char *argv[]) snprintf(buf, sizeof(buf), "ID%03d;", id); OUTPUT(buf); } - else if (strcmp(buf, "EX00011;") == 0) - { - pbuf = "EX00011 001;"; - OUTPUT(pbuf); - } else if (strncmp(buf, "EX", 2) == 0) - { - continue; - } - else if (strcmp(buf, "FA;") == 0) - { - snprintf(buf, sizeof(buf), "FA%011d;", vfoA->freq); - OUTPUT(buf); - } - else if (strcmp(buf, "FB;") == 0) - { - snprintf(buf, sizeof(buf), "FB%011d;", vfoB->freq); - OUTPUT(buf); - } - else if (strncmp(buf, "FA", 2) == 0) - { - sscanf(buf, "FA%d", &vfoA->freq); + { // Menu Setting + if (strcmp(buf + 2, "00011;") == 0) + { // S-Meter Scale + pbuf = "EX00011 001;"; + OUTPUT(pbuf); + } + else if (strncmp(buf + 2, "00311", 5) == 0) + { // Number of Band Memories + if(buf[7] == ';') + { + snprintf(buf, sizeof buf, "EX00311 %03d;", nummems / 2); // Rounds down + OUTPUT(buf); + } + else + { + int temp = -1; + sscanf(buf + 8, "%3d", &temp); + if (temp < 2 && temp >= 0) + { nummems = temp * 2 + 1; } + else + { cmd_err = 1; } + } + } } - else if (strncmp(buf, "FB", 2) == 0) - { - sscanf(buf, "FB%d", &vfoB->freq); + else if (buf[0] == 'F' && (buf[1] == 'A' || buf[1] == 'B')) // FA/FB + { // VFO {A|B} Frequency + int idx = buf[1] - 'A'; + if (buf[2] == ';') + { + snprintf(buf + 2, sizeof(buf) - 2, "%011d;", (*vfoAB[idx])->freq); + OUTPUT(buf); + } + else + { + int tmpfreq; + sscanf(buf + 2, "%d", &tmpfreq); + // TODO: Check and decode freq. Check band and set vfo to band mem. + (*vfoAB[idx])->freq = tmpfreq; + } } else if (strncmp(buf, "AI;", 3) == 0) { @@ -366,7 +426,7 @@ int main(int argc, char *argv[]) continue; } snprintf(buf, sizeof(buf), SFformat, tmpvfo, - vfoAB[tmpvfo]->freq, vfoAB[tmpvfo]->mode); + (*vfoAB[tmpvfo])->freq, (*vfoAB[tmpvfo])->mode); //printf("SF buf=%s\n", buf); OUTPUT(buf); } @@ -383,8 +443,8 @@ int main(int argc, char *argv[]) } //printf("tmpvfo=%d, tmpfreq=%d, tmpmode=%d\n", tmpvfo, tmpfreq, tmpmode); - vfoAB[tmpvfo]->mode = tmpmode; - vfoAB[tmpvfo]->freq = tmpfreq; + (*vfoAB[tmpvfo])->mode = tmpmode; + (*vfoAB[tmpvfo])->freq = tmpfreq; printf("modeA=%X, modeB=%X\n", vfoA->mode, vfoB->mode); } @@ -422,20 +482,50 @@ int main(int argc, char *argv[]) split = 1; } } - else if (strncmp(buf, "BD;", 3) == 0) - { - continue; - } - else if (strncmp(buf, "BU;", 3) == 0) - { - continue; + else if (buf[0] == 'B' && (buf[1] == 'D' || buf[1] == 'U')) // BU/BD + { // Frequency Band Selection(Setting 1)/[UP}/{DOWN] Operating(Setting 2) + int band, cycle, idx, newfreq; + int dir = buf[1] == 'D' ? -1 : +1; + kvfo_t ovfo = *vfoLR[0]; // Current operating VFO + + if (buf[2] == ';') + { // Setting 2 + /* The TS-890S doesn't have a real BAND_UP/BAND_DOWN commnd + * This one just does a simple UP/DOWN. As the manual says, just + * like pushing the UP/DOWN button on the mic + */ + newfreq = ovfo->freq + dir * 1000; // Needs to be tracked by mode + // Checking for band edges needs to go here + ovfo->freq = newfreq; + } + else if (buf[3] == ';') + { // Read + idx = buf[2] - '0'; + if (idx < 0 || idx > 1) {cmd_err = 1; continue;} + snprintf(buf + 3, sizeof(buf) - 3, "%d;", bandslot[idx][ovfo->band]); + OUTPUT(buf); + } + else if (buf[5] == ';') + { // Setting 1 + band = atoi(buf + 3); + if (band < 0 || band >= NBANDS) {cmd_err = 1; continue;} + if (band == ovfo->band) + { // Same band, just cycle the band memory # + bandslot[ovfo->vfo][band] = (bandslot[ovfo->vfo][band] + 1) % nummems; + } + *(vfoLR[0]) = &band_mem[ovfo->vfo][band][bandslot[ovfo->vfo][band]]; + } + else + { + cmd_err = 1; + } } else if (strcmp(buf, "RX;") == 0) - { + { // Receive Function State ptt = ptt_mic = ptt_data = ptt_tune = 0; } else if (strncmp(buf, "TX", 2) == 0) - { + { // Transmission Mode ptt = ptt_mic = ptt_data = ptt_tune = 0; switch (buf[2]) @@ -450,7 +540,7 @@ int main(int argc, char *argv[]) } } else if (strncmp(buf, "TB;", 3) == 0) - { + { // Split sprintf(buf, "TB%d;", split); OUTPUT(buf); } @@ -458,6 +548,22 @@ int main(int argc, char *argv[]) { sscanf(buf, "TB%d", &split); } + else if (strncmp(buf, "TS", 2) == 0) + { // TF-SET + if (buf[2] == ';') + { + snprintf(buf, sizeof buf, "TS%d;", tfset); + OUTPUT(buf); + } + else if (buf[2] >= '0' && buf[2] < '2') + { + tfset = buf[2] - '0'; + } + else + { + cmd_err = 1; + } + } else if (strncmp(buf, "KS;", 3) == 0) { sprintf(buf, "KS%03d;", keyspd); @@ -483,15 +589,19 @@ int main(int argc, char *argv[]) } else { - sprintf(buf, "OM%d%X;", tmpvfo, vfoLR[tmpvfo]->mode); + sprintf(buf, "OM%d%X;", tmpvfo, (*vfoLR[tmpvfo])->mode); OUTPUT(buf); } - continue; } + else + { /* Setting - Only sets the active function(RX/TX), - * which is always the left VFO. + * which is always the left VFO unless split is active and + * we are transmitting. */ - sscanf(&buf[3], "%1X", &vfoLR[0]->mode); + int idx = split && ((ptt + ptt_mic + ptt_data + ptt_tune) > 0); + sscanf(&buf[3], "%1X", &(*vfoLR[idx])->mode); + } } else if (strncmp(buf, "RM", 2) == 0) { // Meter control/readout @@ -793,32 +903,16 @@ int main(int argc, char *argv[]) } else if (strncmp(buf, "SC", 2) == 0) { // Scan functions - switch (buf[2]) { - case '0': // Scan - case '1': // Scan Speed - case '2': // Tone Scan/CTCSS Scan - case '3': // Program Scan/VFO Scan Selection - break; - default: - cmd_err = 1; + switch (buf[2]) { + case '0': // Scan + case '1': // Scan Speed + case '2': // Tone Scan/CTCSS Scan + case '3': // Program Scan/VFO Scan Selection + break; + default: + cmd_err = 1; } } - else if (strncmp(buf, "TS", 2) == 0) - { // TF-SET - if (buf[2] == ';') - { - snprintf(buf, sizeof buf, "TS%d;", tfset); - OUTPUT(buf); - continue; - } - int tmpset = buf[2] - '0'; - if (tmpset < 0 || tmpset > 1) - { - cmd_err = 1; - continue; - } - tfset = tmpset; - } else if (strlen(buf) > 0) { fprintf(stderr, "Unknown command: %s\n", buf); commit 7aa739a97d5b5f3803a0940ac74f6955d77b26ed Author: George Baltz N3GB <Geo...@gm...> Date: Tue Oct 8 11:11:03 2024 -0400 Get rid of ghost commands. They ain't coming back. diff --git a/simulators/simts890.c b/simulators/simts890.c index 1ba3769db..f827f14c0 100644 --- a/simulators/simts890.c +++ b/simulators/simts890.c @@ -212,19 +212,6 @@ int main(int argc, char *argv[]) (ptt + ptt_mic + ptt_data + ptt_tune) > 0 ? 1 : 0, vfoLR[0]->mode); OUTPUT(ifbuf); } -#if 0 - else if (strncmp(buf, "RM2", 3) == 0) - { - pbuf = "RM20020;"; - OUTPUT(pbuf); - } - else if (strcmp(buf, "RM5;") == 0) - { - hl_usleep(mysleep * 1000); - pbuf = "RM5100000;"; - OUTPUT(pbuf); - } -#endif else if (strncmp(buf, "AN", 2) == 0) { // Antenna connection handling hl_usleep(mysleep * 1000); @@ -325,19 +312,6 @@ int main(int argc, char *argv[]) { sscanf(buf,"PC%d", &pc); } -#if 0 - else if (strcmp(buf, "FW1;") == 0) - { - //usleep(mysleep * 1000); - pbuf = "FW10;"; - OUTPUT(pbuf); - hl_usleep(20 * 1000); - } - else if (strncmp(buf, "FW", 2) == 0) - { - continue; - } -#endif else if (strcmp(buf, "ID;") == 0) { hl_usleep(mysleep * 1000); @@ -345,18 +319,6 @@ int main(int argc, char *argv[]) snprintf(buf, sizeof(buf), "ID%03d;", id); OUTPUT(buf); } - -#if 0 - else if (strncmp(buf, "AI", 2) == 0) - { - if (strcmp(buf, "AI;")) - { - hl_usleep(mysleep * 1000); - n = fprintf(fp, "%s", "AI0;"); - } - } - -#endif else if (strcmp(buf, "EX00011;") == 0) { pbuf = "EX00011 001;"; @@ -426,18 +388,6 @@ int main(int argc, char *argv[]) printf("modeA=%X, modeB=%X\n", vfoA->mode, vfoB->mode); } -#if 0 - else if (strncmp(buf, "MD;", 3) == 0) - { - snprintf(buf, sizeof(buf), "MD%d;", - vfoA->mode); // not worried about modeB yet for simulator - OUTPUT(buf); - } - else if (strncmp(buf, "MD", 2) == 0) - { - sscanf(buf, "MD%d", &vfoA->mode); // not worried about modeB yet for simulator - } -#endif else if (strncmp(buf, "FL", 2) == 0) { switch (buf[2]) { @@ -472,17 +422,6 @@ int main(int argc, char *argv[]) split = 1; } } -#if 0 - else if (strncmp(buf, "DA;", 3) == 0) - { - snprintf(buf, sizeof(buf), "DA%d;", datamode); - OUTPUT(buf); - } - else if (strncmp(buf, "DA", 2) == 0) - { - sscanf(buf, "DA%d", &datamode); - } -#endif else if (strncmp(buf, "BD;", 3) == 0) { continue; @@ -510,18 +449,6 @@ int main(int argc, char *argv[]) break; } } -#if 0 - else if (strncmp(buf, "CB;", 3) == 0) - { - printf("No CB command!\n"); - sprintf(buf, "CB%d;", operatingband); - OUTPUT(buf); - } - else if (strncmp(buf, "CB", 2) == 0) - { - sscanf(buf, "CB... [truncated message content] |
From: n0nb <n0...@us...> - 2024-10-25 21:19: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 e3b067307a93bebd3eab6c5d11687f6adc482d27 (commit) via f9d60d6b25d24b66b37b7c48f1afba548a6dd2c5 (commit) via 407a1deabe03e6b3fed17c9ba8288deafd839bd2 (commit) via 9b26eb1684d4be31c71857ae2fcc2d246e680710 (commit) via 8b0dc0731c34d215d991f1f11b76ee503221ae72 (commit) via 87531d273dd3902e2130c9a7db64da2dbc518cb1 (commit) via f6b8bdabe8fe369249b0f22946a3c417f1368056 (commit) via c02cf9726f5857e74eb4bd0545a881d8ccc8c112 (commit) via c015c3690b7784cd1a17e624ed2c813f8038dc2c (commit) via 41eb2b076c370571f9a2c27553aaa45ecc55b034 (commit) via 327517a881c127ee91d3dbd7882aa65a8fe62085 (commit) via e096426ddc8210f298571ad943159f2b3844ddef (commit) via c01e55b09b164587f8b7ddfa8d910f39ec60b0ed (commit) via 2a7d5387ee1b4e0e8c8ca5d0bb19d76f7a95d335 (commit) via 882d22a50ca99f4a2600620844ca4ffb216400fc (commit) via 96fc6855671e046f95da1b9f7b5a765de0b607aa (commit) via baf2897e76b367325a1a2085df7bf4b0459fd862 (commit) via ba62edc51b9b2d390b1c051562c34b06dda909bf (commit) via 53a3d8635373124b9b6b93c141673f2ea1c6c814 (commit) via e5c8117cea9798174a7bc5464743cba60c8d2b41 (commit) via 4afe039147ad1633cdaeaa328ad5aec50b279ccb (commit) via c1130737fa01be6c481145311201db8ce6d2ab09 (commit) via 6a9cec677af718d97f7f0097524cb235c4e16322 (commit) via 0548fea7c1340efb1c7667bea834a0c1f164f455 (commit) via aa9d227d64c1a17af7ad224dd82bba221954accf (commit) via e55c7dd8404d144c9b5219c07a2d500467710f8c (commit) via db854ab8e029310471d971990da2eae46f76bc46 (commit) via 07e490eada0ab711b4b20fb184f2fc2304461be7 (commit) via f33aa9a712c177bcfaf0e084bdb5ab996afbf2be (commit) via 141ca8bf3f5ea6b05fa6d1ed204b3369378091a2 (commit) via 64d39f58efe1601d89fd8067be172fd355b89c64 (commit) via a6fe6b547539e14e8ecb2a28cce6eb7f2f47b2cd (commit) via 548745d1f04fa327516ab125c66b1e7049abfdba (commit) via 7bde413c52a8d3b31e269b3107605eb255a58446 (commit) via 0b12c5cfff269ecde77c51d5adc107bd1744465f (commit) via 23e373b99dcff7ddf173cad79aad1a639ed30bc2 (commit) via f63b60a86644e9d0cf4af1c6c4b5891974a80129 (commit) via 4613f7d9331686ab5d75a424aebaa05e52b30d32 (commit) via e24617a4fe22a134701a8c800c8170fa80b72220 (commit) via 56eda7a76c6fea9504cc70ea895a82b8f2d6699a (commit) via 96bd1367fb84754c16e7429e16963fe01287555e (commit) via b0afbd22e6b56893ad86bec181423f26cff4bb32 (commit) via 55f83b1647aa43fc6cd0a946e57f2fd81287d075 (commit) via 73cdd0b214f6cb7dd2e2199c0c13a9e26bfeb5be (commit) via 4efdf1dffdf2053f509eba8138d1f9cdfa4900d0 (commit) via 4b05884fd7ee40c3a0869b89bed3d40fa3661ffa (commit) via 88bb2e63c25b931094476cbfa783f47c01a4c193 (commit) via c4f7cf35f9286acd9eb5405b0b7304452be490a9 (commit) via c37fb872cdd20cf4af355544aed105f0b9f95d54 (commit) via 1d45224e8a58ada49f449fd378c7b416162cfd27 (commit) via 48398dd3d46ed071a52a285797060ad62fbeeecb (commit) via 5fd100f06e56e62e0b4ee73773a615ac5b914ad1 (commit) via 31b625df2bed7080ea2faecce0a309f9b176a6b6 (commit) via 2a47377243cb89ef7607b162b83d3534772f3ca7 (commit) via 76a1a589c900fe1d7b7e0b3ba7dc3ea6a9c70925 (commit) via 9236b778ae05b9642b12000c8412c88e0855c9a8 (commit) via 76c3cd15bb72d6f2b83758b558e5368875baf125 (commit) via d81726e72452aa6d8150ad6f0468d86070440e51 (commit) via 496d8fde316c24572576b58bce9fc5bed52fd418 (commit) via 8a6a500ccdfbc63b98b31b0ebb6d854bcbe0097f (commit) via fc849732c0c1dfdbccc0d7666f46952eeee4c731 (commit) via 99d008a664fa2381d12e47741a645350800a1418 (commit) via 711089f25269e26e23bbe139d8f53fd4c45c6ca5 (commit) via 2b3000c21de924a5d9ad78586b3d2959a54c07ee (commit) via c58d46cfbec8982169f3b007f61f23a8b27cc4eb (commit) via 0eca80281fe8ebf9c2bb9c57608e15fd4bff4ebc (commit) via e09dd84bc25a1650b32ff1bc7fed26a4d50135f7 (commit) via b9b4d44f4f9539626119c5c34c9e13b156d2e290 (commit) via 6d0b4a7fce20eb7d2038e8026e5f82f84c24b3c4 (commit) via 1ffd767f884327f01a9369a657f174eea3009186 (commit) via 92a35118cbaa550771d723b431afd846156f1d1a (commit) via 0f4066bcdfbcad31bad397515f793aca7cf6bdf5 (commit) via f10ff6a61b3615eba4442db783fc65c9cf8e837d (commit) via 14615c5bb53a052204856caab03947eeae483135 (commit) via 276b891fd6c33568650f46c989bf8626675548c1 (commit) via 3e1df2db19ca0ea641c18aea25d9b3c408f40fc4 (commit) via 150bfa5a25ee9082843714d50ca32ee3f0b04ab6 (commit) via 83109ba43874e3532df7a19b6d77f04dbf284315 (commit) via 5fc4e6753103278d962b084d5ac32eebe21cc9c9 (commit) via ec7b23b19cb329cb17860778190860fb067f4087 (commit) via 913c00a707157c198b5d247f7a468dbb923b4ce4 (commit) via d179eed3e8459d87c0bdb43dbf7602da5737e0b7 (commit) via 9360ab4e3bf34dfb6edef5a0e8f77f202538db5e (commit) via ca705649ce0da3271d2e6120b51e11b2586eca2a (commit) via f4bb956bf90fc22d2bb21cce5dc16ba4a07346b8 (commit) via 1235945076a9388c24b68921f60eb188805079c6 (commit) via a9f4a35c7deb7256e366daf00f1b2c69f1ed6fc0 (commit) via 5f1c2b134818b8a2669e4e01163a64fc82690bb6 (commit) via 32f5f97a5f7e6a340900dd0328177d5e2fe4e0b4 (commit) via e50dd7bcde4bbb49b75110bc79da1369955b31ce (commit) via 19ee9056d9163b793d2c35071232e698090ea07f (commit) via c1da9b979cb369839c1ca7210c52f9bb83a41b59 (commit) via 5ea17ccd21e680ddf5e21454e1b8530d2b6ab5af (commit) via 1f3360e11d6f624483efbe32b6348be1f2b1aa7f (commit) via f8485ec2dc74789a02e72dc8896162b14510e461 (commit) via 7d78e8a2842ede00d1bfa62a3b83f79b3f8ba0c4 (commit) via 49e5ba81b032f4b2748d8a80082e911202fede08 (commit) via de13630c643276d4f7724daa919583650b03831e (commit) via 1ff85278640c8f4da639ee2a8640abc1a9d7d386 (commit) via 5f6554c797cb57d8053f47d4f72a27a570436ead (commit) via b667e31dcf56fd6a65512eb88e59ef55437c8577 (commit) via 99535c06822b7b66885e164d327c273fb14fc42a (commit) via 676c39a9d0d42385d04285474d3a4f24d32ac4b7 (commit) via 52deeeeebf13c6e10b19f71f19b32f174a349407 (commit) via 3f40c7b70da224093cb27a17ee81d8e1eaf272bf (commit) via ed7b65d58c7269ea87cbc0f3d66df3202216a321 (commit) via 82c03a80fcfd7b82c16fa236370cae59a3349621 (commit) via fe909084b923ba21317a15c2efb8bbaadf8666ac (commit) via 86f6339f5ebef581437323edd3be1f61be6bcb40 (commit) via f3f3cb9977ef3f4ec6a047e33dddb358a1e41e96 (commit) via 1dd12f0ef071048aa9ae0cba7cdc680cf580c3d7 (commit) via ba1424ff7d93b2f9960999eb96310a4066547519 (commit) via ef4d932ffd2ce196b250ceb5fc3b3736b784c285 (commit) via d0da604d502235318a3ca9c1fa6073e81b5a31e2 (commit) via f2811b739406af6a20715ade6b26f8ca72705cff (commit) via be9f3e7a62ca74e175e0185641fa16adc25ac958 (commit) via ecadc46ca26dcac51ab0f3e50aa9acef9a824a1e (commit) via 853a0a2822553cb808f43b5600b839afa93d66c4 (commit) via cb26ccbbc45b611b275758bc69deb2eef6be7c0a (commit) via 8d52565335784aad266eaec984b41e988a4a8332 (commit) via 4c3aca9299584349b32a8d8b834805cb9cee8901 (commit) via ae29c0c66568bcc989884055c0059ba1ae001fa0 (commit) via fc33324dcc27d3f884307185750566578b0819ea (commit) via 293f5ec2e5b1d455df9da136a5892b52d30f5740 (commit) via bdf4baa5b7d7630af8579fc3714f46b26c3dec7c (commit) via e35b87b11a25fb622c0e2469b81e064d1de66f65 (commit) via 240407d917ccec87082ec1e5b840c65c770fc528 (commit) via 0082572cd0f4461cf0f1f58d38a7f60713253839 (commit) via 23b4e00f0e9e9144339ebae26b0774606c640621 (commit) via 5d3d35d7bea2920b2a8715bd4cd321caec38be1b (commit) via fa4926c2d6d01c650346146772ad0a6c9830fe1e (commit) via 6d76ba4e7ff578edd6b4d0040094887b35bd5bb2 (commit) via d20a2358606bec98e232be0a7dbbfacafe98b2ab (commit) via 8fcb77664c15cbc76c3ce9806194d390cf763159 (commit) via 111a51217d82c0b0a50f6e8c2854b63c02f3d8eb (commit) via 6cc21cdad3b21e0b8e7f7b72482d58a7dcc4f360 (commit) via 147fb072f4e78181930e2395c9d323d421654753 (commit) via c4988900699971be3c7423568ed4533ab2f641d3 (commit) via 67c62e9b2a5ad1a2743b0dd595da26436f0915b4 (commit) via 93d12b9c6a1e13bd99954d1d12cd2b113cb19c65 (commit) via efb3cdc09d4f184d34f1444444d51cf5daa37c61 (commit) via f64727c1e094a89970e82ff6fea4dbb4e0e6c151 (commit) via 7e35ffac8d9f0ce63b641ec0e28260f314777389 (commit) via 940814617baf4a074e4cf00aa708231e6fc8318f (commit) via 954fd001610556370cec1ffda8e3fd2b7c54cb99 (commit) via f6c1a1429193dec15ee84e400044287fb3a437bb (commit) via 25ecaea63a34cb93bd12531181e2b1dfb1f61112 (commit) via 0dd52cec026b0c2518774723d7056c147a4639ea (commit) via 3a09649816251a92ffa767486a66d561a4bcaddb (commit) via 4d1148c1ba52e6401ccdd6b80b173ff766f3341f (commit) via 099cc7fc489c7fe27ec42d626924f8fa50bb07f6 (commit) via 846a56a39bfcb94018132da2947eccbb0c4740cd (commit) from 137231cb7b1bdc9dfe075f4cf4c311a9ebfcc306 (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 e3b067307a93bebd3eab6c5d11687f6adc482d27 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Oct 25 12:11:50 2024 -0500 Fix icom width filter using 1,2,3 for all modes diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 54b7b53de..ce1de5b83 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2428,6 +2428,9 @@ static int icom_set_mode_x26(RIG *rig, vfo_t vfo, rmode_t mode, rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s, vfo_number=%d\n", __func__, rig_strvfo(vfo), vfo_number); + // allow width of 1,2,3 to set explicit filter + if (width >=1 && width <= 3) buf[2] = width; + retval = icom_transaction(rig, C_SEND_SEL_MODE, vfo_number, buf, buf_len, ackbuf, &ack_len); diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index e41cdbbc2..b5bb5a3d1 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20241020" +#define BACKEND_VER "20241025" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit f9d60d6b25d24b66b37b7c48f1afba548a6dd2c5 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Oct 22 10:30:30 2024 -0500 Remove duplicate parm diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 8a9ac7ad7..60d4da02b 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -1182,7 +1182,7 @@ enum multicast_item_e { //! @cond Doxygen_Suppress #define RIG_PARM_FLOAT_LIST (RIG_PARM_BACKLIGHT|RIG_PARM_BAT|RIG_PARM_KEYLIGHT|RIG_PARM_BACKLIGHT) -#define RIG_PARM_STRING_LIST (RIG_PARM_BANDSELECT|RIG_PARM_KEYERTYPE|RIG_PARM_KEYERTYPE) +#define RIG_PARM_STRING_LIST (RIG_PARM_BANDSELECT|RIG_PARM_KEYERTYPE) #define RIG_PARM_READONLY_LIST (RIG_PARM_BAT) #define RIG_PARM_IS_FLOAT(l) ((l)&RIG_PARM_FLOAT_LIST) commit 407a1deabe03e6b3fed17c9ba8288deafd839bd2 Merge: 9b26eb168 8b0dc0731 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Oct 22 09:21:33 2024 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 9b26eb1684d4be31c71857ae2fcc2d246e680710 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Oct 22 09:16:38 2024 -0500 Fix power_minmax for kenwood https://github.com/Hamlib/Hamlib/issues/1622 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index ad262512b..9922b8930 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -3037,11 +3037,11 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min, rs->power_min = 5; rs->power_max = 100; if (power_min) *power_min = 5; - if (power_max) *power_max = 5; + if (power_max) *power_max = 100; - if (rs->current_mode == RIG_MODE_AM) { *power_max = 50; } + if (rs->current_mode == RIG_MODE_AM) { *power_max = 25; } - if (rs->current_freq >= 70) + if (rs->current_freq >= 70000000) { rs->power_max = 50; commit 8b0dc0731c34d215d991f1f11b76ee503221ae72 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Oct 22 09:16:38 2024 -0500 Fix power_minmax for kenwood diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index ad262512b..9922b8930 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -3037,11 +3037,11 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min, rs->power_min = 5; rs->power_max = 100; if (power_min) *power_min = 5; - if (power_max) *power_max = 5; + if (power_max) *power_max = 100; - if (rs->current_mode == RIG_MODE_AM) { *power_max = 50; } + if (rs->current_mode == RIG_MODE_AM) { *power_max = 25; } - if (rs->current_freq >= 70) + if (rs->current_freq >= 70000000) { rs->power_max = 50; commit 87531d273dd3902e2130c9a7db64da2dbc518cb1 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Oct 21 22:31:42 2024 -0500 Fix KEYERTYPE diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index bbe579bc2..8a9ac7ad7 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -1152,7 +1152,8 @@ enum rig_parm_e { enum rig_keyertype_e { RIG_KEYERTYPE_STRAIGHT = 0, RIG_KEYERTYPE_BUG = (1 << 0), - RIG_KEYERTYPE_PADDLE = (2 << 0) + RIG_KEYERTYPE_PADDLE = (1 << 1), + RIG_KEYERTYPE_UNKNOWN = (1 << 2) }; /** @@ -1181,7 +1182,7 @@ enum multicast_item_e { //! @cond Doxygen_Suppress #define RIG_PARM_FLOAT_LIST (RIG_PARM_BACKLIGHT|RIG_PARM_BAT|RIG_PARM_KEYLIGHT|RIG_PARM_BACKLIGHT) -#define RIG_PARM_STRING_LIST (RIG_PARM_BANDSELECT|RIG_PARM_KEYERTYPE) +#define RIG_PARM_STRING_LIST (RIG_PARM_BANDSELECT|RIG_PARM_KEYERTYPE|RIG_PARM_KEYERTYPE) #define RIG_PARM_READONLY_LIST (RIG_PARM_BAT) #define RIG_PARM_IS_FLOAT(l) ((l)&RIG_PARM_FLOAT_LIST) diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 5be851fb6..4c6020baf 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -3745,11 +3745,13 @@ declare_proto_rig(set_parm) break; case RIG_CONF_STRING: +#if 0 if (parm == RIG_PARM_KEYERTYPE) { val.i = atoi(arg2); } else +#endif { val.cs = arg2; } commit f6b8bdabe8fe369249b0f22946a3c417f1368056 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Oct 20 11:28:44 2024 -0500 Allow 1,2,3 width usage for all modes in icom.c diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 9050a9214..54b7b53de 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2586,6 +2586,8 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (priv_caps->mode_with_filter) { HAMLIB_TRACE; + // allow 1,2,3 values to set filter number + if (width >= 1 && width <= 3) datamode[1] = width; if (datamode[0] == 0) { datamode[1] = 0; } // the only good combo possible according to manual @@ -2593,7 +2595,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if((priv_caps->fm_filters[0] != 0) && (mode == RIG_MODE_FM || mode == RIG_MODE_WFM)) { // assumed fm_filters is ascending sequence -- see ic7300.c for example - if (width <= 3) datamode[1] = width; + if (width >= 1 && width <= 3) datamode[1] = width; else if (width <= priv_caps->fm_filters[0]) datamode[1] = 3; else if (width <= priv_caps->fm_filters[1]) datamode[1] = 2; else datamode[1] = 1; diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 8da32718e..e41cdbbc2 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20241018" +#define BACKEND_VER "20241020" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit c02cf9726f5857e74eb4bd0545a881d8ccc8c112 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Oct 18 09:30:19 2024 -0500 Fix compile warning on icom.c fm_filters diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 95ed7a186..9050a9214 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2590,7 +2590,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (datamode[0] == 0) { datamode[1] = 0; } // the only good combo possible according to manual // we need to let FM mode widths through here with datamode[1] set to FM width - if((priv_caps->fm_filters != NULL) && (mode == RIG_MODE_FM || mode == RIG_MODE_WFM)) + if((priv_caps->fm_filters[0] != 0) && (mode == RIG_MODE_FM || mode == RIG_MODE_WFM)) { // assumed fm_filters is ascending sequence -- see ic7300.c for example if (width <= 3) datamode[1] = width; diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index bcc9a05a5..8da32718e 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20241009" +#define BACKEND_VER "20241018" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit c015c3690b7784cd1a17e624ed2c813f8038dc2c Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Oct 13 16:11:25 2024 -0500 Update rigctl.1 for IC7300 filter 1,2,3 usage diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index d79f55f95..866fa3b76 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -494,6 +494,7 @@ Mode is a token: \(oqUSB\(cq, \(oqLSB\(cq, \(oqCW\(cq, \(oqCWR\(cq, \(oqDSB\(cq. .IP Passband is in Hz as an integer, -1 for no change, or \(oq0\(cq for the radio backend default. +IC7300 can use 1,2,3 to select which filter to use .IP .BR Note : Passing a \(oq?\(cq (query) as the first argument instead of a Mode token will commit 41eb2b076c370571f9a2c27553aaa45ecc55b034 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Oct 13 16:10:00 2024 -0500 Fix IC7300 set mode FM Allow IC7300 to use width of 1,2,3 to select filter diff --git a/NEWS b/NEWS index 52398b117..32e029f7b 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ Version 5.x -- future * Change FT1000MP Mark V model names to align with FT1000MP Version 4.6 + * IC7300 Mode filter can now be set by # (i.e. 1,2,3) * Fixed AF6SA WRC rotor controller * Added Rhode&Schwarz XK852 * Added Xiegu X6200 diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 2bce4bebb..7cd2e9373 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -67,7 +67,7 @@ int ic9700_set_vfo(RIG *rig, vfo_t vfo); #define IC7300_PARMS (RIG_PARM_ANN|RIG_PARM_BACKLIGHT|RIG_PARM_SCREENSAVER|RIG_PARM_TIME|RIG_PARM_BEEP|RIG_PARM_KEYERTYPE|RIG_PARM_AFIF) #define IC7300_VFO_OPS (RIG_OP_CPY|RIG_OP_XCHG|RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_MCL|RIG_OP_TUNE) -#define IC7300_SCAN_OPS (RIG_SCAN_STOP|RIG_SCAN_MEM|RIG_SCAN_PROG|RIG_SCAN_SLCT) +#define IC7300_SCAN_OPS (RIG_SCAN_STOP|RIG_SCAN_MEM|RIG_SCAN_PROG|RIG_SCAN_SLCT|RIG_SCAN_VFO) #define IC7300_ANTS (RIG_ANT_1) /* ant-1 is Hf-6m */ @@ -419,7 +419,8 @@ static const struct icom_priv_caps IC7300_priv_caps = .x1cx03_possibly = 1, .x1ax03_supported = 1, .mode_with_filter = 1, - .data_mode_supported = 1 + .data_mode_supported = 1, + .fm_filters = { 7000, 10000, 15000 } }; static const struct icom_priv_caps IC9700_priv_caps = @@ -474,7 +475,7 @@ static const struct icom_priv_caps IC9700_priv_caps = .x1cx03_possibly = 1, .x1ax03_supported = 1, .mode_with_filter = 1, - .data_mode_supported = 1 + .data_mode_supported = 1, }; static const struct icom_priv_caps IC705_priv_caps = @@ -741,7 +742,7 @@ struct rig_caps ic7300_caps = RIG_MODEL(RIG_MODEL_IC7300), .model_name = "IC-7300", .mfg_name = "Icom", - .version = BACKEND_VER ".13", + .version = BACKEND_VER ".14", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 6d2b18ee5..95ed7a186 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -512,19 +512,19 @@ const struct confparams icom_cfg_params[] = }, { TOK_FILTER_USBD, "filter_usbd", "Filter to use USBD", "Filter to use for USBD/LSBD when setting mode", - "0", RIG_CONF_NUMERIC, {.n = {0, 3, 1}} + "1", RIG_CONF_NUMERIC, {.n = {0, 3, 1}} }, { TOK_FILTER_USB, "filter_usb", "Filter to use USB", "Filter to use when for USB/LSB setting mode", - "0", RIG_CONF_NUMERIC, {.n = {0, 3, 1}} + "2", RIG_CONF_NUMERIC, {.n = {0, 3, 1}} }, { TOK_FILTER_CW, "filter_cw", "Filter to use CW", "Filter to use for CW/CWR when setting mode", - "0", RIG_CONF_NUMERIC, {.n = {0, 3, 1}} + "3", RIG_CONF_NUMERIC, {.n = {0, 3, 1}} }, { TOK_FILTER_FM, "filter_fm", "Filter to use FM", "Filter to use for FM/PKTFM when setting mode", - "0", RIG_CONF_NUMERIC, {.n = {0, 3, 1}} + "1", RIG_CONF_NUMERIC, {.n = {0, 3, 1}} }, {RIG_CONF_END, NULL,} }; @@ -858,6 +858,7 @@ static int icom_check_ack(int ack_len, unsigned char *ackbuf) { // if we don't get ACK/NAK some serial corruption occurred // so we'll call it a timeout for retry purposes + rig_debug(RIG_DEBUG_WARN, "%s: command timed out (%#.2x)\n", __func__, ackbuf[0]); return -RIG_ETIMEOUT; } @@ -2346,7 +2347,7 @@ static int icom_get_mode_x26(RIG *rig, vfo_t vfo, int *mode_len, static int icom_set_mode_x26(RIG *rig, vfo_t vfo, rmode_t mode, rmode_t icom_mode, int datamode, - int filter) + int filter, pbwidth_t width) { struct icom_priv_data *priv = STATE(rig)->priv; const struct icom_priv_caps *priv_caps = rig->caps->priv; @@ -2354,6 +2355,7 @@ static int icom_set_mode_x26(RIG *rig, vfo_t vfo, rmode_t mode, unsigned char buf[3]; unsigned char ackbuf[MAXFRAMELEN]; int ack_len = sizeof(ackbuf); + int buf_len = 3; int mode_len; unsigned char mode_buf[4]; @@ -2380,25 +2382,45 @@ static int icom_set_mode_x26(RIG *rig, vfo_t vfo, rmode_t mode, if (priv->filter_usbd > 0 && (mode == RIG_MODE_PKTUSB || mode == RIG_MODE_PKTLSB)) { - rig_debug(RIG_DEBUG_TRACE, "%s: filter usbd=%d\n", __func__, priv->filter_usbd); + rig_debug(RIG_DEBUG_TRACE, "%s: filter usbd=%d, width=%d\n", __func__, priv->filter_usbd, (int)width); buf[2] = priv->filter_usbd; + if (width >= 1 && width <=3) buf[2] = width; + if (width == RIG_PASSBAND_NOCHANGE) + { + buf_len = 1; + } } else if (priv->filter_usb > 0 && (mode == RIG_MODE_USB || mode == RIG_MODE_LSB)) { rig_debug(RIG_DEBUG_TRACE, "%s: filter usb=%d\n", __func__, priv->filter_usb); buf[2] = priv->filter_usb; + if (width == RIG_PASSBAND_NOCHANGE) + { + buf_len = 1; + } } else if (priv->filter_cw > 0 && (mode == RIG_MODE_CW || mode == RIG_MODE_CWR)) { rig_debug(RIG_DEBUG_TRACE, "%s: filter cw=%d\n", __func__, priv->filter_cw); buf[2] = priv->filter_cw; + if (width == RIG_PASSBAND_NOCHANGE) + { + buf_len = 1; + } } - else if (priv->filter_fm > 0 && (mode == RIG_MODE_FM || mode == RIG_MODE_PKTFM)) + else if (mode == RIG_MODE_FM || mode == RIG_MODE_PKTFM) { - rig_debug(RIG_DEBUG_TRACE, "%s: filter fm=%d\n", __func__, priv->filter_fm); - buf[2] = priv->filter_fm; + rig_debug(RIG_DEBUG_TRACE, "%s: width=%d\n", __func__, (int)width); + buf[2] = width; + if (width > 10000) buf[2] = 1; + else if (width > 7000) buf[2] = 2; + else if (width > 3) buf[2] = 3; + if (width == RIG_PASSBAND_NOCHANGE) + { + buf_len = 1; + } } int vfo_number = icom_get_vfo_number_x25x26(rig, vfo); @@ -2406,7 +2428,7 @@ static int icom_set_mode_x26(RIG *rig, vfo_t vfo, rmode_t mode, rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s, vfo_number=%d\n", __func__, rig_strvfo(vfo), vfo_number); - retval = icom_transaction(rig, C_SEND_SEL_MODE, vfo_number, buf, 3, ackbuf, + retval = icom_transaction(rig, C_SEND_SEL_MODE, vfo_number, buf, buf_len, ackbuf, &ack_len); if (priv->x26cmdfails < 0 || priv_caps->x25x26_always) @@ -2568,11 +2590,17 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (datamode[0] == 0) { datamode[1] = 0; } // the only good combo possible according to manual // we need to let FM mode widths through here with datamode[1] set to FM width - if((RIG_IS_IC7300 || RIG_IS_IC9700) && (mode == RIG_MODE_FM || mode == RIG_MODE_WFM)) + if((priv_caps->fm_filters != NULL) && (mode == RIG_MODE_FM || mode == RIG_MODE_WFM)) { - if (width <= 7000) datamode[1] = 3; - else if (width <= 10000) datamode[1] = 2; + // assumed fm_filters is ascending sequence -- see ic7300.c for example + if (width <= 3) datamode[1] = width; + else if (width <= priv_caps->fm_filters[0]) datamode[1] = 3; + else if (width <= priv_caps->fm_filters[1]) datamode[1] = 2; else datamode[1] = 1; + if (width > 3) + { + rig_debug(RIG_DEBUG_WARN, "%s: IC7300 width set by 1,2,3 - adjustable widht not implemented yet\n", __func__); + } } rig_debug(RIG_DEBUG_TRACE, "%s(%d) mode_icom=%d, datamode=%d, filter=%d\n", @@ -2585,7 +2613,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else { if (datamode[0] == 0) datamode[1] = 0; - retval = icom_set_mode_x26(rig, vfo, mode, mode_icom, datamode[0], datamode[1]); + retval = icom_set_mode_x26(rig, vfo, mode, mode_icom, datamode[0], datamode[1], width); } if (retval != RIG_OK) diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 608dbe594..bcc9a05a5 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -251,6 +251,7 @@ struct icom_priv_caps int x1ax03_supported; /*!< Rig supports setting/getting filter width */ int mode_with_filter; /*!< Rig mode commands include filter selection */ int data_mode_supported; /*!< Rig supports data mode flag */ + int fm_filters[3]; /*!< For models with FIL1/2/3 for FM low-to-high fixed filters -- IC7300/9700 */ }; struct icom_priv_data commit 327517a881c127ee91d3dbd7882aa65a8fe62085 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Oct 10 22:58:12 2024 -0500 Remote get_ts from ic707.c -- rig does not support it https://github.com/Hamlib/Hamlib/issues/1617 diff --git a/rigs/icom/ic707.c b/rigs/icom/ic707.c index da5ab31b9..81d7d1d78 100644 --- a/rigs/icom/ic707.c +++ b/rigs/icom/ic707.c @@ -59,7 +59,7 @@ struct rig_caps ic707_caps = RIG_MODEL(RIG_MODEL_IC707), .model_name = "IC-707", .mfg_name = "Icom", - .version = BACKEND_VER ".3", + .version = BACKEND_VER ".4", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -159,7 +159,7 @@ struct rig_caps ic707_caps = .set_split_mode = icom_set_split_mode, .get_split_mode = icom_get_split_mode, .set_ts = icom_set_ts, - .get_ts = icom_get_ts, +// .get_ts = icom_get_ts, // apparently does not have this .scan = icom_scan, commit e096426ddc8210f298571ad943159f2b3844ddef Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Oct 9 08:53:37 2024 -0500 rigctld show-conf now exits only if no -r argument is given https://github.com/Hamlib/Hamlib/issues/1619 diff --git a/tests/rigctld.c b/tests/rigctld.c index 44be5afc6..45042e3ad 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -761,8 +761,11 @@ int main(int argc, char *argv[]) if (show_conf) { rig_token_foreach(my_rig, print_conf_list, (rig_ptr_t)my_rig); - fflush(stdout); - exit(0); + if (rig_file == NULL) + { + fflush(stdout); + exit(0); + } } /* commit c01e55b09b164587f8b7ddfa8d910f39ec60b0ed Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Oct 9 08:35:59 2024 -0500 Change icom_scan to use vfo argument to set vfo -- default VFO_CURR to just switching to vfo mode https://github.com/Hamlib/Hamlib/issues/1619#issuecomment-2402159608 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index fcb4c7a4c..6d2b18ee5 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -8664,11 +8664,14 @@ int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) unsigned char ackbuf[MAXFRAMELEN]; int scan_len, ack_len = sizeof(ackbuf), retval; int scan_cn, scan_sc; + vfo_t myvfo = vfo; ENTERFUNC; scan_len = 0; scan_cn = C_CTL_SCAN; + // for current vfo just switch to VFO mode (we might be in MEM) + if (myvfo == RIG_VFO_CURR) myvfo = RIG_VFO_VFO; switch (scan) { case RIG_SCAN_STOP: @@ -8678,7 +8681,7 @@ int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) case RIG_SCAN_VFO: case RIG_SCAN_MEM: HAMLIB_TRACE; - retval = rig_set_vfo(rig, scan==RIG_SCAN_MEM?RIG_VFO_MEM:RIG_VFO_VFO); + retval = rig_set_vfo(rig, scan==RIG_SCAN_MEM?RIG_VFO_MEM:myvfo); if (retval != RIG_OK) { commit 2a7d5387ee1b4e0e8c8ca5d0bb19d76f7a95d335 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Oct 9 08:30:55 2024 -0500 Change icom_scan VFO to just switch to VFO mode instead of VFOA https://github.com/Hamlib/Hamlib/issues/1619#issuecomment-2402159608 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index b95eebcde..fcb4c7a4c 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -8678,7 +8678,7 @@ int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) case RIG_SCAN_VFO: case RIG_SCAN_MEM: HAMLIB_TRACE; - retval = rig_set_vfo(rig, scan==RIG_SCAN_MEM?RIG_VFO_MEM:RIG_VFO_A); + retval = rig_set_vfo(rig, scan==RIG_SCAN_MEM?RIG_VFO_MEM:RIG_VFO_VFO); if (retval != RIG_OK) { diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 80c0eff6a..608dbe594 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20241007" +#define BACKEND_VER "20241009" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit 882d22a50ca99f4a2600620844ca4ffb216400fc Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Oct 7 12:19:03 2024 -0500 Add help to N command in rigctl diff --git a/src/sprintflst.c b/src/sprintflst.c index 047fb2bc5..1ad8434ba 100644 --- a/src/sprintflst.c +++ b/src/sprintflst.c @@ -852,6 +852,37 @@ int rig_sprintf_spectrum_avg_modes(char *str, int nlen, return len; } +int rig_sprintf_tuning_steps(char *str, int nlen, const struct tuning_step_list *tuning_step_list) +{ + int i, len = 0; + + *str = '\0'; + + for (i = 0; i < HAMLIB_TSLSTSIZ; i++) + { + int lentmp; + + if (tuning_step_list[i].modes == RIG_MODE_NONE) + { + break; + } + + lentmp = snprintf(str + len, nlen - len, "%s%d", i>0?", ":"", (int)tuning_step_list[i].ts); + + if (len < 0 || lentmp >= nlen - len) + { + rig_debug(RIG_DEBUG_ERR, "%s(%d): overflowed str buffer\n", __FILE__, __LINE__); + break; + } + + len += lentmp; + check_buffer_overflow(str, len, nlen); + } + + return len; + +} + char *get_rig_conf_type(enum rig_conf_e type) { switch (type) diff --git a/src/sprintflst.h b/src/sprintflst.h index bfb80ebe4..1e207aae5 100644 --- a/src/sprintflst.h +++ b/src/sprintflst.h @@ -51,6 +51,7 @@ extern HAMLIB_EXPORT( int ) rot_sprintf_status(char *str, int len, rot_status_t extern HAMLIB_EXPORT( int ) rig_sprintf_spectrum_modes(char *str, int nlen, const enum rig_spectrum_mode_e *modes); extern HAMLIB_EXPORT( int ) rig_sprintf_spectrum_spans(char *str, int nlen, const freq_t *spans); extern HAMLIB_EXPORT( int ) rig_sprintf_spectrum_avg_modes(char *str, int nlen, const struct rig_spectrum_avg_mode *avg_modes); +extern HAMLIB_EXPORT( int ) rig_sprintf_tuning_steps(char *str, int nlen, const struct tuning_step_list *tuning_step_list); extern HAMLIB_EXPORT( char *) get_rig_conf_type(enum rig_conf_e type); extern HAMLIB_EXPORT( int ) print_ext_param(const struct confparams *cfp, rig_ptr_t ptr); diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index c4ea871c7..5be851fb6 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -3191,9 +3191,17 @@ declare_proto_rig(get_split_vfo) declare_proto_rig(set_ts) { unsigned long ts; + char s[SPRINTF_MAX_SIZE]; ENTERFUNC2; + if (!strcmp(arg1, "?")) + { + rig_sprintf_tuning_steps(s, sizeof(s), rig->caps->tuning_steps); + fprintf(fout, "%s\n", s); + RETURNFUNC2(RIG_OK); + } + CHKSCN1ARG(sscanf(arg1, "%lu", &ts)); RETURNFUNC2(rig_set_ts(rig, vfo, ts)); commit 96fc6855671e046f95da1b9f7b5a765de0b607aa Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Oct 7 09:19:04 2024 -0500 Update rigctl.1 diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index 48baede60..d79f55f95 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -182,7 +182,7 @@ below. .BR \-L ", " \-\-show\-conf List all config parameters for the radio defined with .B \-m -above. Note the dummy device has no serial parameters. +above. Will exit if no -r is given. Note the dummy device has no serial parameters. . .TP .BR \-C ", " \-\-set\-conf = \fIparm=val\fP [ \fI,parm=val\fP ] @@ -1137,7 +1137,7 @@ Set .RI \(aq Transceive \(aq mode. .IP -Transcieve is a token: \(oqOFF\(cq, \(oqRIG\(cq, \(oqPOLL\(cq. +Transceive is a token: \(oqOFF\(cq, \(oqRIG\(cq, \(oqPOLL\(cq. .IP Transceive is a mechanism for radios to report events without a specific call for information. commit baf2897e76b367325a1a2085df7bf4b0459fd862 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Oct 7 08:11:31 2024 -0500 Add SCAN_VFO to icom.c and fix ic707.c to support correct scan modes diff --git a/rigs/icom/ic707.c b/rigs/icom/ic707.c index 0cc6e66f4..da5ab31b9 100644 --- a/rigs/icom/ic707.c +++ b/rigs/icom/ic707.c @@ -40,7 +40,7 @@ #define IC707_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_CPY) -#define IC707_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM|RIG_SCAN_STOP|RIG_SCAN_SLCT) +#define IC707_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM|RIG_SCAN_STOP) #define IC707_ANTS RIG_ANT_1 @@ -59,7 +59,7 @@ struct rig_caps ic707_caps = RIG_MODEL(RIG_MODEL_IC707), .model_name = "IC-707", .mfg_name = "Icom", - .version = BACKEND_VER ".2", + .version = BACKEND_VER ".3", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 7e227e40b..b95eebcde 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -8675,9 +8675,10 @@ int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) scan_sc = S_SCAN_STOP; break; + case RIG_SCAN_VFO: case RIG_SCAN_MEM: HAMLIB_TRACE; - retval = rig_set_vfo(rig, RIG_VFO_MEM); + retval = rig_set_vfo(rig, scan==RIG_SCAN_MEM?RIG_VFO_MEM:RIG_VFO_A); if (retval != RIG_OK) { @@ -8688,7 +8689,7 @@ int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) * but some old models don't have it. * Should be put in icom_priv_caps ? */ - if (rig->caps->rig_type == RIG_TYPE_RECEIVER) + if (rig->caps->rig_type == RIG_TYPE_RECEIVER && scan == RIG_SCAN_MEM) { scan_sc = S_SCAN_MEM2; } @@ -8738,7 +8739,7 @@ int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) break; default: - rig_debug(RIG_DEBUG_ERR, "%s: unsupported scan %#x", __func__, scan); + rig_debug(RIG_DEBUG_ERR, "%s: unsupported scan %#x\n", __func__, scan); RETURNFUNC(-RIG_EINVAL); } diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 15e1559c2..80c0eff6a 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20241005" +#define BACKEND_VER "20241007" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit ba62edc51b9b2d390b1c051562c34b06dda909bf Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Oct 7 07:52:48 2024 -0500 Fix simic7300 diff --git a/simulators/simic7300.c b/simulators/simic7300.c index 7c0c48487..797259dba 100644 --- a/simulators/simic7300.c +++ b/simulators/simic7300.c @@ -779,6 +779,9 @@ while (1) if (powerstat) { + unsigned char tmp = buf[2]; + buf[2] = buf[3]; + buf[3] = tmp; frameParse(fd, buf, len); } else commit 53a3d8635373124b9b6b93c141673f2ea1c6c814 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Oct 5 14:48:09 2024 -0500 Fix async detection in icom.c diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 75f16bf22..7e227e40b 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -9068,6 +9068,11 @@ int icom_process_async_frame(RIG *rig, size_t frame_length, * the rest is data * and don't forget one byte at the end for the EOM */ + if (frame[2] != 0x00) + { + rig_debug(RIG_DEBUG_VERBOSE, "%s: 3rd byte not 0x00...not async\n", __func__); + RETURNFUNC(RIG_OK); + } switch (frame[4]) { case C_RD_FREQ: diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index b45c0b3da..15e1559c2 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20241001" +#define BACKEND_VER "20241005" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit e5c8117cea9798174a7bc5464743cba60c8d2b41 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Oct 4 16:28:32 2024 -0500 Add STOP and VFO to IC707 scan operations https://github.com/Hamlib/Hamlib/issues/1619 diff --git a/rigs/icom/ic707.c b/rigs/icom/ic707.c index d242a5215..0cc6e66f4 100644 --- a/rigs/icom/ic707.c +++ b/rigs/icom/ic707.c @@ -40,7 +40,7 @@ #define IC707_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_CPY) -#define IC707_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM) /* TBC */ +#define IC707_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM|RIG_SCAN_STOP|RIG_SCAN_SLCT) #define IC707_ANTS RIG_ANT_1 commit 4afe039147ad1633cdaeaa328ad5aec50b279ccb Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Oct 4 16:24:25 2024 -0500 Improve conf.c debug output diff --git a/src/conf.c b/src/conf.c index a38fd4c47..24fd6a5e3 100644 --- a/src/conf.c +++ b/src/conf.c @@ -1372,10 +1372,18 @@ const struct confparams *HAMLIB_API rig_confparam_lookup(RIG *rig, const struct confparams *cfp; hamlib_token_t token; - rig_debug(RIG_DEBUG_VERBOSE, "%s called for %s\n", __func__, name); if (!rig || !rig->caps) { + if (rig) + { + rig_debug(RIG_DEBUG_ERR, "%s: rig->caps is NULL\n", __func__); + } + else + { + rig_debug(RIG_DEBUG_ERR, "%s: rig is NULL\n", __func__); + } + return NULL; } @@ -1386,6 +1394,7 @@ const struct confparams *HAMLIB_API rig_confparam_lookup(RIG *rig, { if (!strcmp(cfp->name, name) || token == cfp->token) { + rig_debug(RIG_DEBUG_VERBOSE, "%s called for %s\n", __func__, cfp->name); return cfp; } } @@ -1394,6 +1403,7 @@ const struct confparams *HAMLIB_API rig_confparam_lookup(RIG *rig, { if (!strcmp(cfp->name, name) || token == cfp->token) { + rig_debug(RIG_DEBUG_VERBOSE, "%s called for %s\n", __func__, cfp->name); return cfp; } } @@ -1404,11 +1414,15 @@ const struct confparams *HAMLIB_API rig_confparam_lookup(RIG *rig, { if (!strcmp(cfp->name, name) || token == cfp->token) { + rig_debug(RIG_DEBUG_VERBOSE, "%s called for %s\n", __func__, cfp->name); return cfp; } } } + + rig_debug(RIG_DEBUG_VERBOSE, "%s called for %s and not found\n", __func__, + name); return NULL; } commit c1130737fa01be6c481145311201db8ce6d2ab09 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Oct 4 15:44:40 2024 -0500 Remove get_freq from ft757gx.c -- at least some of them apparently can't read freq diff --git a/rigs/yaesu/ft757gx.c b/rigs/yaesu/ft757gx.c index 1c6a3cb28..78011543b 100644 --- a/rigs/yaesu/ft757gx.c +++ b/rigs/yaesu/ft757gx.c @@ -55,7 +55,7 @@ static int ft757gx_get_conf(RIG *rig, hamlib_token_t token, char *val); static int ft757gx_set_conf(RIG *rig, hamlib_token_t token, const char *val); static int ft757_set_freq(RIG *rig, vfo_t vfo, freq_t freq); -static int ft757_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); +//static int ft757_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); static int ft757gx_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); static int ft757_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, @@ -230,7 +230,7 @@ struct rig_caps ft757gx2_caps = RIG_MODEL(RIG_MODEL_FT757GXII), .model_name = "FT-757GXII", .mfg_name = "Yaesu", - .version = "20200325.0", + .version = "20240927.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_MOBILE, @@ -338,7 +338,7 @@ struct rig_caps ft757gx2_caps = .rig_close = NULL, /* port closed */ .set_freq = ft757_set_freq, /* set freq */ - .get_freq = ft757_get_freq, /* get freq */ + .get_freq = ft757gx_get_freq, /* get freq */ .set_mode = ft757_set_mode, /* set mode */ .get_mode = ft757_get_mode, /* get mode */ .set_vfo = ft757_set_vfo, /* set vfo */ @@ -515,6 +515,7 @@ static int ft757gx_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) * Return Freq */ +#if 0 static int ft757_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) { struct ft757_priv_data *priv = (struct ft757_priv_data *)STATE(rig)->priv; @@ -552,6 +553,7 @@ static int ft757_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) *freq); return RIG_OK; } +#endif static int ft757_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) commit 6a9cec677af718d97f7f0097524cb235c4e16322 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Oct 4 15:43:29 2024 -0500 Have multicast wait until rig is powered on diff --git a/src/multicast.c b/src/multicast.c index 9ef201e12..1c7e57373 100644 --- a/src/multicast.c +++ b/src/multicast.c @@ -390,6 +390,12 @@ void *multicast_thread(void *vrig) while (rs->multicast->runflag) { + while (STATE(rig)->powerstat == RIG_POWER_OFF) + { + rig_debug(RIG_DEBUG_VERBOSE,"%s: waiting for RIG_POWER_ON\n", __func__); + hl_usleep(500*1000); + } + #if 0 if ((retval = rig_get_freq(rig, RIG_VFO_A, &freqA)) != RIG_OK) commit 0548fea7c1340efb1c7667bea834a0c1f164f455 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Oct 4 15:40:56 2024 -0500 Fix spelling error in misc.c diff --git a/src/misc.c b/src/misc.c index b4b86331d..bcc24d818 100644 --- a/src/misc.c +++ b/src/misc.c @@ -2879,7 +2879,7 @@ const char *spaces(int len) } // if which==0 rig_band_select str will be returned -// if which!=0 the rig_parm_gran band str will be returne +// if which!=0 the rig_parm_gran band str will be returned const char *rig_get_band_str(RIG *rig, hamlib_band_t band, int which) { int i; commit aa9d227d64c1a17af7ad224dd82bba221954accf Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Oct 4 15:39:17 2024 -0500 Add device_class strings to cm108 diff --git a/src/cm108.c b/src/cm108.c index 120a6ab23..3e4bac440 100644 --- a/src/cm108.c +++ b/src/cm108.c @@ -68,6 +68,66 @@ #include "cm108.h" +#include <stdio.h> + +const char* get_usb_device_class_string(int device_class) { + switch (device_class) { + case 0x00: + return "Device Unspecified (Defined at Interface level)"; + case 0x01: + return "Audio"; + case 0x02: + return "Communications and CDC Control"; + case 0x03: + return "Human Interface Device (HID)"; + case 0x05: + return "Physical Interface Device"; + case 0x06: + return "Image (Scanner, Camera)"; + case 0x07: + return "Printer"; + case 0x08: + return "Mass Storage"; + case 0x09: + return "Hub"; + case 0x0A: + return "CDC Data"; + case 0x0B: + return "Smart Card"; + case 0x0D: + return "Content Security"; + case 0x0E: + return "Video"; + case 0x0F: + return "Personal Healthcare"; + case 0x10: + return "Audio/Video Devices"; + case 0x11: + return "Billboard Device Class"; + case 0x12: + return "USB Type-C Bridge Class"; + case 0x13: + return "Bulk Display"; + case 0x14: + return "MCTCP over USB"; + case 0x3C: + return "I3C"; + case 0x58: + return "Xbox"; + case 0xDC: + return "Diagnostic Device"; + case 0xE0: + return "Wireless Controller"; + case 0xEF: + return "Miscellaneous"; + case 0xFE: + return "Application Specific"; + case 0xFF: + return "Vendor Specific"; + default: + return "Unknown Device Class"; + } +} /** * \brief Open CM108 HID port (/dev/hidraw<i>X</i>). commit e55c7dd8404d144c9b5219c07a2d500467710f8c Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Oct 4 15:38:24 2024 -0500 Change IC910 to use IC9700 set_vfo routine diff --git a/rigs/icom/ic910.c b/rigs/icom/ic910.c index 67c10ade9..8afbfd55a 100644 --- a/rigs/icom/ic910.c +++ b/rigs/icom/ic910.c @@ -196,12 +196,14 @@ int ic910_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } } +extern int ic9700_set_vfo(RIG *rig, vfo_t vfo); + struct rig_caps ic910_caps = { RIG_MODEL(RIG_MODEL_IC910), .model_name = "IC-910", .mfg_name = "Icom", - .version = BACKEND_VER ".1", + .version = BACKEND_VER ".2", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -323,7 +325,7 @@ struct rig_caps ic910_caps = .set_ptt = icom_set_ptt, .get_ptt = icom_get_ptt, - .set_vfo = icom_set_vfo, + .set_vfo = ic9700_set_vfo, // .get_vfo = icom_get_vfo, .get_ts = icom_get_ts, .set_ts = icom_set_ts, commit db854ab8e029310471d971990da2eae46f76bc46 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Oct 4 15:36:50 2024 -0500 Add initializer-overrides to Makefile diff --git a/Makefile.am b/Makefile.am index 398b1f812..f191a4f69 100644 --- a/Makefile.am +++ b/Makefile.am @@ -30,4 +30,4 @@ DIST_SUBDIRS = macros include lib src c++ bindings tests doc android scripts rot # Install any third party macros into our tree for distribution ACLOCAL_AMFLAGS = -I macros --install -AM_CFLAGS=-D_TIME_BITS=64 +AM_CFLAGS=-D_TIME_BITS=64 -Winitializer-overrides commit 07e490eada0ab711b4b20fb184f2fc2304461be7 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Oct 3 22:23:46 2024 -0500 Add set_ts and get_ts to IC707 https://github.com/Hamlib/Hamlib/issues/1617 diff --git a/rigs/icom/ic707.c b/rigs/icom/ic707.c index b3ee6f9d8..d242a5215 100644 --- a/rigs/icom/ic707.c +++ b/rigs/icom/ic707.c @@ -59,7 +59,7 @@ struct rig_caps ic707_caps = RIG_MODEL(RIG_MODEL_IC707), .model_name = "IC-707", .mfg_name = "Icom", - .version = BACKEND_VER ".1", + .version = BACKEND_VER ".2", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -158,6 +158,8 @@ struct rig_caps ic707_caps = .get_split_freq = icom_get_split_freq, .set_split_mode = icom_set_split_mode, .get_split_mode = icom_get_split_mode, + .set_ts = icom_set_ts, + .get_ts = icom_get_ts, .scan = icom_scan, commit f33aa9a712c177bcfaf0e084bdb5ab996afbf2be Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Oct 1 22:31:16 2024 -0500 Fix IC707 tuning steps and memory items Add MEM_SPLIT diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index eeebb5f81..bbe579bc2 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -1671,7 +1671,8 @@ typedef enum { RIG_MTYPE_BAND, /*!< VFO/Band channel */ RIG_MTYPE_PRIO, /*!< Priority channel */ RIG_MTYPE_VOICE, /*!< Stored Voice Message */ - RIG_MTYPE_MORSE /*!< Morse Message */ + RIG_MTYPE_MORSE, /*!< Morse Message */ + RIG_MTYPE_SPLIT /*!< Split operations */ } chan_type_t; diff --git a/rigs/icom/ic707.c b/rigs/icom/ic707.c index 1b4834760..b3ee6f9d8 100644 --- a/rigs/icom/ic707.c +++ b/rigs/icom/ic707.c @@ -38,7 +38,7 @@ #define IC707_VFO_ALL (RIG_VFO_A|RIG_VFO_B|RIG_VFO_MEM) -#define IC707_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_CPY|RIG_OP_MCL) +#define IC707_VFO_OPS (RIG_OP_FROM_VFO|RIG_OP_TO_VFO|RIG_OP_CPY) #define IC707_SCAN_OPS (RIG_SCAN_VFO|RIG_SCAN_MEM) /* TBC */ @@ -59,9 +59,9 @@ struct rig_caps ic707_caps = RIG_MODEL(RIG_MODEL_IC707), .model_name = "IC-707", .mfg_name = "Icom", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, @@ -99,9 +99,9 @@ struct rig_caps ic707_caps = .chan_desc_sz = 0, .chan_list = { - { 1, 26, RIG_MTYPE_MEM, IC_MIN_MEM_CAP }, - { 27, 30, RIG_MTYPE_EDGE, IC_MIN_MEM_CAP }, - { 31, 35, RIG_MTYPE_SAT, IC_MIN_MEM_CAP }, /* split ? */ + { 1, 25, RIG_MTYPE_MEM, IC_MIN_MEM_CAP }, + { 26, 30, RIG_MTYPE_SPLIT, IC_MIN_MEM_CAP }, /* split ? */ + { 31, 32, RIG_MTYPE_EDGE, IC_MIN_MEM_CAP }, RIG_CHAN_END, }, @@ -126,7 +126,8 @@ struct rig_caps ic707_caps = }, .tuning_steps = { - {IC707_ALL_RX_MODES, 10}, /* basic resolution, there's no set_ts */ + {IC707_ALL_RX_MODES, 10}, + {IC707_ALL_RX_MODES, 1000}, RIG_TS_END, }, /* mode/filter list, remember: order matters! */ commit 141ca8bf3f5ea6b05fa6d1ed204b3369378091a2 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Oct 1 22:30:06 2024 -0500 Fix r8500 tuning steps diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index e8dafa04f..75f16bf22 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -176,7 +176,7 @@ const struct ts_sc_list r8500_ts_sc_list[] = {50, 0x01}, {100, 0x02}, {kHz(1), 0x03}, - {12500, 0x04}, + {2500, 0x04}, {kHz(5), 0x05}, {kHz(9), 0x06}, {kHz(10), 0x07}, diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 2e0356eb8..b45c0b3da 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20240922" +#define BACKEND_VER "20241001" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit 64d39f58efe1601d89fd8067be172fd355b89c64 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Oct 1 11:50:01 2024 -0500 Fix segfault in powerminmax for kenwood diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 711bd6168..ad262512b 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -3034,8 +3034,10 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min, // TS890S can't take power levels outside 5-100 and 5-25 // So all we'll do is read power_now case RIG_MODEL_TS890S: - rs->power_min = *power_min = 5; - rs->power_max = *power_max = 100; + rs->power_min = 5; + rs->power_max = 100; + if (power_min) *power_min = 5; + if (power_max) *power_max = 5; if (rs->current_mode == RIG_MODE_AM) { *power_max = 50; } diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 158f67125..171ba605c 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "idx_builtin.h" -#define BACKEND_VER "20240925" +#define BACKEND_VER "20241001" #define EOM_KEN ';' #define EOM_TH '\r' commit a6fe6b547539e14e8ecb2a28cce6eb7f2f47b2cd Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 28 22:50:25 2024 -0500 More sleep.c cleanup diff --git a/src/sleep.c b/src/sleep.c index 37b873e02..f02017f67 100644 --- a/src/sleep.c +++ b/src/sleep.c @@ -51,8 +51,6 @@ int hl_usleep(rig_useconds_t usec) { double sleep_time = usec / 1e6; struct timespec tv1; - double start_at = monotonic_seconds(); - double end_at = start_at + sleep_time; double delay = sleep_time; if (sleep_time > .001) { delay -= .0001; } @@ -86,6 +84,8 @@ int hl_usleep(rig_useconds_t usec) { struct timespec tv2; double lasterr = 0; + double start_at = monotonic_seconds(); + double end_at = start_at + sleep_time; tv2.tv_sec = 0; tv2.tv_nsec = 1000000; nanosleep(&tv1, NULL); commit 548745d1f04fa327516ab125c66b1e7049abfdba Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Sep 28 22:48:11 2024 -0500 Clean up sleep.c diff --git a/src/sleep.c b/src/sleep.c index 347962dce..37b873e02 100644 --- a/src/sleep.c +++ b/src/sleep.c @@ -50,19 +50,16 @@ extern double monotonic_seconds(); int hl_usleep(rig_useconds_t usec) { double sleep_time = usec / 1e6; - struct timespec tv1, tv2; + struct timespec tv1; double start_at = monotonic_seconds(); double end_at = start_at + sleep_time; double delay = sleep_time; - double lasterr = 0; if (sleep_time > .001) { delay -= .0001; } else if (sleep_time > .0001) { delay -= .00005; } tv1.tv_sec = (time_t) delay; tv1.tv_nsec = (long)((delay - tv1.tv_sec) * 1e+9); - tv2.tv_sec = 0; - tv2.tv_nsec = 1000000; // rig_debug(RIG_DEBUG_CACHE,"usec=%ld, sleep_time=%f, tv1=%ld,%ld\n", usec, sleep_time, (long)tv1.tv_sec, // (long)tv1.tv_nsec); @@ -74,26 +71,30 @@ int hl_usleep(rig_useconds_t usec) double elapsed; QueryPerformanceFrequency(&frequency); QueryPerformanceCounter(&start); - long long loops=0; do { struct timespec startc; clock_gettime(CLOCK_REALTIME, &startc); QueryPerformanceCounter(&end); elapsed = (double)(end.QuadPart - start.QuadPart) / frequency.QuadPart; - ++loops; } while (elapsed < sleep_time); } else { // Use Sleep for larger durations >= 3 milliseconds //Sleep((DWORD)(seconds * 1000 - 1)); // Convert seconds to milliseconds - usleep(sleep_time*1e6-400); + usleep(sleep_time*1e6-400); } #else + { + struct timespec tv2; + double lasterr = 0; + tv2.tv_sec = 0; + tv2.tv_nsec = 1000000; nanosleep(&tv1, NULL); while (((lasterr = end_at - monotonic_seconds()) > 0)) { nanosleep(&tv2, NULL); } + } #endif return 0; commit 7bde413c52a8d3b31e269b3107605eb255a58446 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Sep 27 22:57:58 2024 -0500 New hl_usleep routine to fix power on/on slowness and a little faster performance to boot. Times < 3ms use busy-wait for accuracy -- can't find any wait state to minimize CPU usage for those small times. https://github.com/Hamlib/Hamlib/issues/1601 https://github.com/Hamlib/Hamlib/issues/1604 diff --git a/src/sleep.c b/src/sleep.c index bf1dc5454..347962dce 100644 --- a/src/sleep.c +++ b/src/sleep.c @@ -67,15 +67,26 @@ int hl_usleep(rig_useconds_t usec) // (long)tv1.tv_nsec); #ifdef __WIN32__ - timeBeginPeriod(1); - nanosleep(&tv1, NULL); - while ((lasterr = end_at - monotonic_seconds()) > 0) - { - nanosleep(&tv2, NULL); + if (sleep_time < 0.003) { + // Busy-wait for small durations < 2 milliseconds + LARGE_INTEGER frequency, start, end; + double elapsed; + QueryPerformanceFrequency(&frequency); + QueryPerformanceCounter(&start); + long long loops=0; + do { + struct timespec startc; + clock_gettime(CLOCK_REALTIME, &startc); + QueryPerformanceCounter(&end); + elapsed = (double)(end.QuadPart - start.QuadPart) / frequency.QuadPart; + ++loops; + } while (elapsed < sleep_time); + } else { + // Use Sleep for larger durations >= 3 milliseconds + //Sleep((DWORD)(seconds * 1000 - 1)); // Convert seconds to milliseconds + usleep(sleep_time*1e6-400); } - - timeEndPeriod(1); #else nanosleep(&tv1, NULL); commit 0b12c5cfff269ecde77c51d5adc107bd1744465f Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Sep 25 22:35:16 2024 -0500 Fix power_min/max segfault diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 536ee5e73..711bd6168 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -3064,8 +3064,8 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min, __func__); // return the last values we got *power_now = rs->power_now; - *power_min = rs->power_min; - *power_max = rs->power_max; + if (power_min) *power_min = rs->power_min; + if (power_max) *power_max = rs->power_max; RETURNFUNC(RIG_OK); } diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 04d39b76f..158f67125 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "idx_builtin.h" -#define BACKEND_VER "20240919" +#define BACKEND_VER "20240925" #define EOM_KEN ';' #define EOM_TH '\r' commit 23e373b99dcff7ddf173cad79aad1a639ed30bc2 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Sep 22 10:41:02 2024 -0500 Speed up FT991 power on -- more rigs can added when identified https://github.com/Hamlib/Hamlib/issues/1601 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index e87ac16ae..ba22ec713 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -3706,10 +3706,14 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) // so we reopen the com port again HAMLIB_TRACE; //oser_close(rp); - rig_close(rig); - hl_usleep(3000000); - //PTTPORT(rig)->fd = ser_open(rp); - rig_open(rig); + // we can add more rigs to this exception to speed t... [truncated message content] |
From: n0nb <n0...@us...> - 2024-08-24 02:40:33
|
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 137231cb7b1bdc9dfe075f4cf4c311a9ebfcc306 (commit) via 4170953aa0fca9c9c351a13cd4847ac43d4f8fff (commit) via 79df61b9bc5cc2b5bb4a3703ee513e7f51ba45c2 (commit) via 5ba43ba00e2bc6bc8d41a57bb9cfec2ddfac5465 (commit) via b489f68533680d53ddb38178efe32170045436d9 (commit) via 227e1f47597a7a03177103db4ac5d7b6298e7a6e (commit) via ea481e98856e0326ec1a6adc38eee257f11590f2 (commit) via 67469ba119ad87b088b6942b2d4808dee40bfa2c (commit) via d7191615eeab68ef8c553b75dee3ffff774e3278 (commit) via df405cd6b5ae1130a93bb9b1487ef093b5f76560 (commit) via d556a2bcff17230e810f307ecac258e1ba53bb70 (commit) via 6e0aa59cc2aa425acc9b937b48c6d891167f871d (commit) via 4aff005665d22f0bea3293ede7f6bd08b8c24dca (commit) via 64518dac35ee91c76199ddce87a8f826843858fb (commit) via 0777ee61ca9b4ec13a0c1f3051ab8ce5c3df8f86 (commit) via 88572851b4774e7107331840d37c6b969960d9ef (commit) via 61036be5d9e5e752c919aba5f77cf8d8453bb919 (commit) via 6f9de59bbd349d92e200f4468870c43f344cffc8 (commit) via 82e9e5ffbe8b7c2b78e27d3f01d235047788fa50 (commit) via 8ec452827deb109c2e1aaa66732a57b7b6b50824 (commit) via a337debf260c0b5879326a824b30a9eb65f1b49e (commit) via 069b0bf5b05d6a209204dd1354d3f9f0fd953411 (commit) via 1e54e2476757bcecc8091d4d4aae5bdc33307311 (commit) via 9e6af9e99d24cf3756232de70354ea27a7f3286c (commit) via f3bd0bdf0a2d80b0fe223885973d74156b794918 (commit) via d3e191101f3603cc534549cfa4dd952d118a9e35 (commit) via 8975643aaa67b41d2d3dfeb330055544426625db (commit) via 437334818fbe70d9338352b0abdb50d54810f415 (commit) via 7719d048977acb035aabb6eca8c5d39c385fcb3b (commit) via 4c52f81e32c47844d4bb2a3b9864c12582088c65 (commit) via 24b47951b25443abfd43bc0f9725bcfd4031d9d1 (commit) via e63014a23f0fdcda5ad8a6bff9246489d9c8a358 (commit) via faee30ebd9c53b134947190e78bba469962020c4 (commit) via 15dc3ae8be03814b708b744f4df19415918a90d3 (commit) via 4312b26bc9401fe0d98c181bbd90fc81c280c3dd (commit) via 63acc6e6c24050ca289285ae6447723de1891b61 (commit) via 3e8b1d7a94c7366d7c14fa9bd4d0db86ff1c8dc0 (commit) from 3b1283496cdb89d3d43d0354216e8dfa0a8b8d00 (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 137231cb7b1bdc9dfe075f4cf4c311a9ebfcc306 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Aug 19 09:01:05 2024 -0500 Add RFPOWER_METER_WATTS and SWR for Elecraft K4 diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 587bd4cc9..22e85be3a 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -171,6 +171,29 @@ int k3_set_nb_level(RIG *rig, float dsp_nb, float if_nb); int k3_get_nb_level(RIG *rig, float *dsp_nb, float *if_nb); int k3_get_bar_graph_level(RIG *rig, float *smeter, float *pwr, float *alc, int *mode_tx); +int k4_get_bar_graph_level(RIG *rig, float *swr, float *pwr, float *alc, + int *mode_tx); +int kx3_get_bar_graph_level(RIG *rig, float *level); +int k3_send_voice_mem(RIG *rig, vfo_t vfo, int ch); +int k3_stop_voice_mem(RIG *rig, vfo_t vfo); +int k3_stop_morse(RIG *rig, vfo_t vfo); + +/* K4 functions */ +int k4_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt); +int k4_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt); +int k4_send_voice_mem(RIG *rig, vfo_t vfo, int ch); +int k4_stop_voice_mem(RIG *rig, vfo_t vfo); +int k4_stop_morse(RIG *rig, vfo_t vfo); + +/* + * K3 rig capabilities. + * This kit can recognize a large subset of TS-570/K2 commands and has many + * extensions of its own. Extension backend functions to standard Kenwood + * command are defined in elecraft.c (shared with K2) and in this file. + * + * Part of info comes from http://www.elecraft.com/K2_Manual_Download_Page.htm#K3 + * look for K3 Programmer's Reference PDF + */ int kx3_get_bar_graph_level(RIG *rig, float *level); int k3_send_voice_mem(RIG *rig, vfo_t vfo, int ch); int k3_stop_voice_mem(RIG *rig, vfo_t vfo); @@ -519,7 +542,7 @@ struct rig_caps k4_caps = RIG_MODEL(RIG_MODEL_K4), .model_name = "K4", .mfg_name = "Elecraft", - .version = BACKEND_VER ".31", + .version = BACKEND_VER ".32", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -2086,7 +2109,15 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) int tx_mode; float alc; - retval = k3_get_bar_graph_level(rig, NULL, NULL, &alc, &tx_mode); + if (RIG_IS_K4) + { + retval = k4_get_bar_graph_level(rig, NULL, NULL, &alc, &tx_mode); + tx_mode = 1; // Assume ALC is zero when in Tx so we don't care about ptt status + } + else + { + retval = k3_get_bar_graph_level(rig, NULL, NULL, &alc, &tx_mode); + } if (retval != RIG_OK) { @@ -2114,7 +2145,15 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) int tx_mode; float pwr; - retval = k3_get_bar_graph_level(rig, NULL, &pwr, NULL, &tx_mode); + if (RIG_IS_K4) + { + retval = k4_get_bar_graph_level(rig, NULL, &pwr, NULL, &tx_mode); + tx_mode = 1; // Does K4 return pwr=0 when in Rx? Hope so. + } + else + { + retval = k3_get_bar_graph_level(rig, NULL, &pwr, NULL, &tx_mode); + } if (retval != RIG_OK) { @@ -2319,14 +2358,22 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_SWR: - retval = kenwood_safe_transaction(rig, "SW", levelbuf, sizeof(levelbuf), 5); - - if (retval != RIG_OK) + if (RIG_IS_K4) { - return retval; + retval = k4_get_bar_graph_level(rig, &val->f, NULL, NULL, NULL); + return RIG_OK; } + else + { + retval = kenwood_safe_transaction(rig, "SW", levelbuf, sizeof(levelbuf), 5); - sscanf(levelbuf + 2, "%d", &val->i); + if (retval != RIG_OK) + { + return retval; + } + + sscanf(levelbuf + 2, "%d", &val->i); + } val->f = (float) val->i / 10.0f; break; @@ -2694,6 +2741,29 @@ int k3_get_nb_level(RIG *rig, float *dsp_nb, float *if_nb) return RIG_OK; } +int k4_get_bar_graph_level(RIG *rig, float *swr, float *pwr, float *alc, + int *mode_tx) +{ + int retval; + int ialc,icmp,ifwd,iswr; + char levelbuf[16]; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + retval = kenwood_safe_transaction(rig, "TM", levelbuf, sizeof(levelbuf), 14); + + if (retval != RIG_OK) + { + return retval; + } + + sscanf(levelbuf, "TM%03d%03d%03d%03d", &ialc, &icmp, &ifwd, &iswr); + if (swr) *swr = iswr/10.0; + if (pwr) *pwr = ifwd/100.0; // pwr is returned in 0-1 sscale + if (alc) *alc = ialc; + return RIG_OK; +} + int k3_get_bar_graph_level(RIG *rig, float *smeter, float *pwr, float *alc, int *mode_tx) { diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 77f5129d2..54082c091 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "idx_builtin.h" -#define BACKEND_VER "20240818" +#define BACKEND_VER "20240819" #define EOM_KEN ';' #define EOM_TH '\r' @@ -89,6 +89,7 @@ extern struct confparams kenwood_cfg_params[]; #define RIG_IS_K3S (rig->caps->rig_model == RIG_MODEL_K3S) #define RIG_IS_KX2 (rig->caps->rig_model == RIG_MODEL_KX2) #define RIG_IS_KX3 (rig->caps->rig_model == RIG_MODEL_KX3) +#define RIG_IS_K4 (rig->caps->rig_model == RIG_MODEL_K4) #define RIG_IS_THD7A (rig->caps->rig_model == RIG_MODEL_THD7A) #define RIG_IS_THD74 (rig->caps->rig_model == RIG_MODEL_THD74) #define RIG_IS_TMD700 (rig->caps->rig_model == RIG_MODEL_TMD700) diff --git a/simulators/simelecraftk4.c b/simulators/simelecraftk4.c index 1aa4cad2f..11e40bbd1 100644 --- a/simulators/simelecraftk4.c +++ b/simulators/simelecraftk4.c @@ -37,6 +37,7 @@ int ai = 0; int dt = 0; int modeA = 2; int modeB = 2; +int ptt = 0; // int freqa = 14074000, freqb = 14073500; // ID 0310 == 310, Must drop leading zero @@ -312,7 +313,7 @@ int main(int argc, char *argv[]) { WRITE(fd, "K30;", 4); } - else if (strcmp(buf, "RVM;") == 0) + else if (strncmp(buf, "RV", 2) == 0) { WRITE(fd, "RV02.37;", 8); } @@ -375,7 +376,7 @@ int main(int argc, char *argv[]) } else if (strncmp(buf, "TQ;", 3) == 0) { - SNPRINTF(buf, sizeof(buf), "TQ0;"); + SNPRINTF(buf, sizeof(buf), "TQ%d;", ptt); WRITE(fd, buf, strlen(buf)); } else if (strncmp(buf, "PC;", 3) == 0) @@ -430,6 +431,19 @@ int main(int argc, char *argv[]) { printf("Morse: %s\n", buf); } + else if (strncmp(buf, "TM", 2) == 0) + { + SNPRINTF(buf, sizeof(buf), "TM001002003004;"); + WRITE(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "TX", 2) == 0) + { + ptt = 1; + } + else if (strncmp(buf, "RX", 2) == 0) + { + ptt = 0; + } else if (strlen(buf) > 0) { fprintf(stderr, "Unknown command: %s\n", buf); commit 4170953aa0fca9c9c351a13cd4847ac43d4f8fff Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Aug 18 16:51:11 2024 -0500 Update man pages diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index fc701018b..8e80db79d 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -236,8 +236,8 @@ rigctl -m 2 -r ::1 (on Linux rigctld doesn't listen on IPV6 by default) .IP rigctld -T 127.0.0.1 .in +4n -rigctl -m 2 -rigctl -m 2 -r 127.0.0.1 +rigctl -m 2 (binds to all interfaces) +rigctl -m 2 -r 127.0.0.1 (bind only to 127.0.0.1) .EE Exceptions: .EX diff --git a/doc/man1/rotctld.1 b/doc/man1/rotctld.1 index f65bbcf3d..234b71a04 100644 --- a/doc/man1/rotctld.1 +++ b/doc/man1/rotctld.1 @@ -138,6 +138,27 @@ Use as the listening IP address. .IP The default is ANY. +.IP +.B rotctld +can be run and connected to like this: +. +.IP +.EX +rotctld (binds to all interfaces) +. +.in +4n +rotctl -m 2 +rotctl -m 2 -r 127.0.0.1 +rotctl -m 2 -r localhost +rotctl -m 2 -r 192.168.1.1 (local IP address) +rotctl -m 2 -r ::1 (on Linux rotctld doesn't listen on IPV6 by default) +.in +. +.IP +rotctld -T 127.0.0.1 (bind only to 127.0.0.1) +.in +4n +rotctl -m 2 (binds to all interfaces) +rotctl -m 2 -r 127.0.0.1 (bind only to 127.0.0.1) . .TP .BR \-t ", " \-\-port = \fInumber\fP @@ -149,8 +170,8 @@ The default is 4533. .IP .BR Note : As -.BR rigctld \(aqs -default port is 4532, it is advisable to use odd numbered ports for +.BR rotctld \(aqs +default port is 4533, it is advisable to use odd numbered ports for .BR rotctld , e.g. 4533, 4535, 4537, etc. . commit 79df61b9bc5cc2b5bb4a3703ee513e7f51ba45c2 Merge: 5ba43ba00 227e1f475 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Aug 18 08:23:28 2024 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 5ba43ba00e2bc6bc8d41a57bb9cfec2ddfac5465 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Aug 18 08:15:11 2024 -0500 Fix mingw compiles https://github.com/Hamlib/Hamlib/issues/1597 diff --git a/rotators/flir/flir.c b/rotators/flir/flir.c index cf76aec87..77e905ea2 100644 --- a/rotators/flir/flir.c +++ b/rotators/flir/flir.c @@ -63,8 +63,8 @@ struct flir_priv_data char *magic_conf; - float_t resolution_pp; - float_t resolution_tp; + double resolution_pp; + double resolution_tp; }; static int flir_request(ROT *rot, char *request, char *response, @@ -178,7 +178,7 @@ static int flir_open(ROT *rot) { struct flir_priv_data *priv; char return_str[MAXBUF]; - float_t resolution_pp, resolution_tp; + double resolution_pp, resolution_tp; int return_value = RIG_OK; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -206,8 +206,8 @@ static int flir_open(ROT *rot) // Get PAN resolution in arcsecs if (flir_request(rot, "PR\n", return_str, MAXBUF) == RIG_OK) { - sscanf(return_str, "* %f", &resolution_pp); - rig_debug(RIG_DEBUG_VERBOSE, "PAN resolution: %f arcsecs per position\n", + sscanf(return_str, "* %lf", &resolution_pp); + rig_debug(RIG_DEBUG_VERBOSE, "PAN resolution: %lf arcsecs per position\n", resolution_pp); priv->resolution_pp = resolution_pp; } @@ -219,8 +219,8 @@ static int flir_open(ROT *rot) // Get TILT resolution in arcsecs if (flir_request(rot, "TR\n", return_str, MAXBUF) == RIG_OK) { - sscanf(return_str, "* %f", &resolution_tp); - rig_debug(RIG_DEBUG_VERBOSE, "TILT resolution: %f arcsecs per position\n", + sscanf(return_str, "* %lf", &resolution_tp); + rig_debug(RIG_DEBUG_VERBOSE, "TILT resolution: %lf arcsecs per position\n", resolution_tp); priv->resolution_tp = resolution_tp; } @@ -517,7 +517,7 @@ struct rot_caps flir_caps = ROT_MODEL(ROT_MODEL_FLIR), .model_name = "PTU Serial", .mfg_name = "FLIR", - .version = "20221126.0", + .version = "20240818.0", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rot_type = ROT_TYPE_AZEL, diff --git a/tests/rotctl.c b/tests/rotctl.c index bf43a8f86..0cc62bfe6 100644 --- a/tests/rotctl.c +++ b/tests/rotctl.c @@ -108,8 +108,6 @@ static struct option long_options[] = /* variable for readline support */ #ifdef HAVE_LIBREADLINE static const int have_rl = 1; -#else -static const int have_rl = 0; #endif int main(int argc, char *argv[]) commit b489f68533680d53ddb38178efe32170045436d9 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Aug 18 07:16:34 2024 -0500 Fix mingw build diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index cf4922e63..13fbebe0a 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -3314,10 +3314,11 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) switch (level) { - int retval = RIG_OK; + int retval; case RIG_LEVEL_RFPOWER: { + retval = RIG_OK; pbwidth_t twidth; int err = rig_get_mode(rig, vfo, &priv->curr_mode, &twidth); // https://github.com/Hamlib/Hamlib/issues/1595 @@ -3904,6 +3905,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_RFPOWER: + { pbwidth_t twidth; int err = rig_get_mode(rig, vfo, &priv->curr_mode, &twidth); // https://github.com/Hamlib/Hamlib/issues/1595 @@ -3922,6 +3924,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) priv->power_min = 0; // our return scale is 0-max to match the input scale val->f = (priv->power_now - priv->power_min) / (float)(priv->power_max - priv->power_min); RETURNFUNC(RIG_OK); + } case RIG_LEVEL_AF: { diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 1658944f4..77f5129d2 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "idx_builtin.h" -#define BACKEND_VER "20240817" +#define BACKEND_VER "20240818" #define EOM_KEN ';' #define EOM_TH '\r' commit 227e1f47597a7a03177103db4ac5d7b6298e7a6e Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Aug 18 07:16:34 2024 -0500 Fix mingw build diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index cf4922e63..13fbebe0a 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -3314,10 +3314,11 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) switch (level) { - int retval = RIG_OK; + int retval; case RIG_LEVEL_RFPOWER: { + retval = RIG_OK; pbwidth_t twidth; int err = rig_get_mode(rig, vfo, &priv->curr_mode, &twidth); // https://github.com/Hamlib/Hamlib/issues/1595 @@ -3904,6 +3905,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_RFPOWER: + { pbwidth_t twidth; int err = rig_get_mode(rig, vfo, &priv->curr_mode, &twidth); // https://github.com/Hamlib/Hamlib/issues/1595 @@ -3922,6 +3924,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) priv->power_min = 0; // our return scale is 0-max to match the input scale val->f = (priv->power_now - priv->power_min) / (float)(priv->power_max - priv->power_min); RETURNFUNC(RIG_OK); + } case RIG_LEVEL_AF: { diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 1658944f4..77f5129d2 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "idx_builtin.h" -#define BACKEND_VER "20240817" +#define BACKEND_VER "20240818" #define EOM_KEN ';' #define EOM_TH '\r' commit ea481e98856e0326ec1a6adc38eee257f11590f2 Merge: 67469ba11 df405cd6b Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Aug 17 17:16:08 2024 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 67469ba119ad87b088b6942b2d4808dee40bfa2c Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Aug 17 17:14:07 2024 -0500 Fixup kenwood PC command for RF_POWER set/get https://github.com/Hamlib/Hamlib/issues/1595 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 258c0d030..cf4922e63 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -3049,6 +3049,7 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min, int max_length = 18; int expected_length; int retval; + int simple_PC = 0; // flag to do just a simple PC command char levelbuf[max_length + 1]; // read power_now, set 0, read power_min, set 255, read_power_max; set 0 // we set back to 0 for safety and if restore is true we restore power_min @@ -3061,6 +3062,8 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min, ENTERFUNC; + if (power_now == NULL || power_min == NULL) simple_PC = 1; + switch (rig->caps->rig_model) { // TS480 can't handle the long command string @@ -3087,7 +3090,10 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min, break; default: - cmd = "PC;PC000;PC;PC255;PC;PC000;"; + if (simple_PC) + cmd = "PC;"; + else + cmd = "PC;PC000;PC;PC255;PC;PC000;"; } // Don't do this if PTT is on...don't want to max out power!! @@ -3106,7 +3112,7 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min, if (retval != RIG_OK) { RETURNFUNC(retval); } - if (RIG_IS_TS890S || RIG_IS_TS480) + if (RIG_IS_TS890S || RIG_IS_TS480 || simple_PC) { expected_length = 6; } @@ -3130,7 +3136,7 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min, RETURNFUNC(-RIG_EPROTO); } - if (RIG_IS_TS890S || RIG_IS_TS480) + if (RIG_IS_TS890S || RIG_IS_TS480 || simple_PC) { n = sscanf(levelbuf, "PC%d;", power_now); @@ -3160,12 +3166,13 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min, } } - rig_debug(RIG_DEBUG_TRACE, "%s: returning now=%d, min=%d, max=%d\n", __func__, - *power_now, *power_min, *power_max); rs->power_now = *power_now; - rs->power_min = *power_min; - rs->power_max = *power_max; + if (!simple_PC) + { + rs->power_min = *power_min; + rs->power_max = *power_max; + } RETURNFUNC(RIG_OK); } @@ -3307,30 +3314,27 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) switch (level) { - int retval; + int retval = RIG_OK; case RIG_LEVEL_RFPOWER: { - static mode_t mode = RIG_MODE_NONE; - int power_now, power_min, power_max; pbwidth_t twidth; int err = rig_get_mode(rig, vfo, &priv->curr_mode, &twidth); // https://github.com/Hamlib/Hamlib/issues/1595 - if (!err && priv->curr_mode != mode) // only need to check when mode changes + if (!err && priv->last_mode_pc != priv->curr_mode) // only need to check when mode changes { - mode = priv->curr_mode; + priv->last_mode_pc = priv->curr_mode; // Power min/max can vary so we query to find them out every time - retval = kenwood_get_power_minmax(rig, &power_now, &power_min, &power_max, 0); + retval = kenwood_get_power_minmax(rig, &priv->power_now, &priv->power_min, &priv->power_max, 0); + if (retval != RIG_OK) { RETURNFUNC(retval); } } - if (retval != RIG_OK) { RETURNFUNC(retval); } - // https://github.com/Hamlib/Hamlib/issues/465 - kenwood_val = val.f * power_max; + kenwood_val = val.f * priv->power_max; - if (kenwood_val < power_min) { kenwood_val = power_min; } + if (kenwood_val < priv->power_min) { kenwood_val = priv->power_min; } - if (kenwood_val > power_max) { kenwood_val = power_max; } + if (kenwood_val > priv->power_max) { kenwood_val = priv->power_max; } SNPRINTF(levelbuf, sizeof(levelbuf), "PC%03d", kenwood_val); break; @@ -3690,8 +3694,6 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) switch (level) { - int power_now, power_min, power_max; - case RIG_LEVEL_RAWSTR: if (RIG_IS_TS590S || RIG_IS_TS590SG) { @@ -3902,13 +3904,23 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_RFPOWER: - // Power min/max can vary so we query to find them out every time - retval = kenwood_get_power_minmax(rig, &power_now, &power_min, &power_max, 1); - - if (retval != RIG_OK) { RETURNFUNC(retval); } + pbwidth_t twidth; + int err = rig_get_mode(rig, vfo, &priv->curr_mode, &twidth); + // https://github.com/Hamlib/Hamlib/issues/1595 + if (!err && priv->last_mode_pc != priv->curr_mode) // only need to check when mode changes + { + priv->last_mode_pc = priv->curr_mode; + // Power min/max can vary so we query to find them out every time + retval = kenwood_get_power_minmax(rig, &priv->power_now, &priv->power_min, &priv->power_max, 0); + if (retval != RIG_OK) { RETURNFUNC(retval); } + } + else + { + retval = kenwood_get_power_minmax(rig, &priv->power_now, NULL, NULL, 0); + } - 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); + priv->power_min = 0; // our return scale is 0-max to match the input scale + val->f = (priv->power_now - priv->power_min) / (float)(priv->power_max - priv->power_min); RETURNFUNC(RIG_OK); case RIG_LEVEL_AF: diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 3508f91bd..1658944f4 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "idx_builtin.h" -#define BACKEND_VER "20240815" +#define BACKEND_VER "20240817" #define EOM_KEN ';' #define EOM_TH '\r' @@ -182,6 +182,8 @@ struct kenwood_priv_data int save_k2_ext_lvl; // so we can restore to original int save_k3_ext_lvl; // so we can restore to original -- for future use if needed int voice_bank; /* last voice bank send for use by stop_voice_mem */ + mode_t last_mode_pc; // last mode memory for PC command + int power_now,power_min,power_max; }; commit d7191615eeab68ef8c553b75dee3ffff774e3278 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Aug 17 16:21:56 2024 -0500 Fix wording error in flrig.c diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index fe9c1ea6f..d62f7795a 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -954,7 +954,7 @@ static int flrig_open(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s: get_bwB is available=%s\n", __func__, value); } - /* see if set_bwA is available */ + /* see if set_bwB is available */ retval = flrig_transaction(rig, "rig.set_bwB", NULL, value, sizeof(value)); if (retval == RIG_ENAVAIL) // must not have it commit df405cd6b5ae1130a93bb9b1487ef093b5f76560 Merge: 6e0aa59cc d556a2bcf Author: Michael Black <mdb...@ya...> Date: Fri Aug 16 12:39:58 2024 -0500 Merge pull request #1596 from reinerh/patch-1 Fix typo commit d556a2bcff17230e810f307ecac258e1ba53bb70 Author: Reiner Herrmann <re...@re...> Date: Fri Aug 16 17:47:35 2024 +0200 Fix typo diff --git a/NEWS b/NEWS index e847ac75a..f1c0e3967 100644 --- a/NEWS +++ b/NEWS @@ -13,7 +13,7 @@ Version 5.x -- future * Change FT1000MP Mark V model names to align with FT1000MP Version 4.6 - * Added Xeigu X6200 + * Added Xiegu X6200 * Added Commradio CTX-10 * Added Guoehe PMR-171 * Added csntechnoligies.net S.A.T Satellite rotor control commit 6e0aa59cc2aa425acc9b937b48c6d891167f871d Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Aug 16 06:54:15 2024 -0500 Add ROT_MODEL_SPID_ROT1PROG to priv allocation in spid.c -- fixes potential segfaults diff --git a/rotators/spid/spid.c b/rotators/spid/spid.c index ad4ce13db..703856a77 100644 --- a/rotators/spid/spid.c +++ b/rotators/spid/spid.c @@ -198,6 +198,7 @@ static int spid_rot_init(ROT *rot) } if (rot->caps->rot_model == ROT_MODEL_SPID_ROT2PROG || + rot->caps->rot_model == ROT_MODEL_SPID_ROT1PROG || rot->caps->rot_model == ROT_MODEL_SPID_MD01_ROT2PROG) { struct spid_rot2prog_priv_data *priv; @@ -216,6 +217,10 @@ static int spid_rot_init(ROT *rot) priv->el_resolution = 0; priv->dir = 0; } + else + { + rig_debug(RIG_DEBUG_ERR, "%s: Unknown SPID model=%s\n", __func__, rot->caps->model_name); + } return RIG_OK; } commit 4aff005665d22f0bea3293ede7f6bd08b8c24dca Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Aug 15 17:15:02 2024 -0500 Fix TS-2000 flicker during RFPOWER request -- only check min/max when mode changes https://github.com/Hamlib/Hamlib/issues/1595 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 3cc70f6c8..258c0d030 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -3311,9 +3311,17 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_RFPOWER: { + static mode_t mode = RIG_MODE_NONE; int power_now, power_min, power_max; - // Power min/max can vary so we query to find them out every time - retval = kenwood_get_power_minmax(rig, &power_now, &power_min, &power_max, 0); + pbwidth_t twidth; + int err = rig_get_mode(rig, vfo, &priv->curr_mode, &twidth); + // https://github.com/Hamlib/Hamlib/issues/1595 + if (!err && priv->curr_mode != mode) // only need to check when mode changes + { + mode = priv->curr_mode; + // Power min/max can vary so we query to find them out every time + retval = kenwood_get_power_minmax(rig, &power_now, &power_min, &power_max, 0); + } if (retval != RIG_OK) { RETURNFUNC(retval); } diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 93b8cde1c..3508f91bd 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "idx_builtin.h" -#define BACKEND_VER "20240807" +#define BACKEND_VER "20240815" #define EOM_KEN ';' #define EOM_TH '\r' commit 64518dac35ee91c76199ddce87a8f826843858fb Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Aug 15 16:10:11 2024 -0500 Fix possible segfault in spid.c diff --git a/rotators/spid/spid.c b/rotators/spid/spid.c index a5f85bd52..ad4ce13db 100644 --- a/rotators/spid/spid.c +++ b/rotators/spid/spid.c @@ -535,7 +535,7 @@ static int spid_rot_stop(ROT *rot) return retval; } - priv->dir = 0; + if (priv) priv->dir = 0; return RIG_OK; } @@ -636,7 +636,7 @@ const struct rot_caps spid_rot1prog_rot_caps = ROT_MODEL(ROT_MODEL_SPID_ROT1PROG), .model_name = "Rot1Prog", .mfg_name = "SPID", - .version = "20240530.0", + .version = "20240815.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZIMUTH, @@ -674,7 +674,7 @@ const struct rot_caps spid_rot2prog_rot_caps = ROT_MODEL(ROT_MODEL_SPID_ROT2PROG), .model_name = "Rot2Prog", .mfg_name = "SPID", - .version = "20220109.0", + .version = "20240815.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZEL, @@ -712,7 +712,7 @@ const struct rot_caps spid_md01_rot2prog_rot_caps = ROT_MODEL(ROT_MODEL_SPID_MD01_ROT2PROG), .model_name = "MD-01/02 (ROT2 mode)", .mfg_name = "SPID", - .version = "20220109.0", + .version = "20240815.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZEL, commit 0777ee61ca9b4ec13a0c1f3051ab8ce5c3df8f86 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Aug 15 12:32:45 2024 -0500 Fix keyspd err message diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index bc6903262..42d543258 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -4544,7 +4544,7 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; } } - rig_debug(RIG_DEBUG_ERR, "%s: did not find KEYSPD=%d\n", __func__, icom_val); + if (i == 43) rig_debug(RIG_DEBUG_ERR, "%s: did not find KEYSPD=%d\n", __func__, icom_val); break; case RIG_LEVEL_PREAMP: commit 88572851b4774e7107331840d37c6b969960d9ef Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Aug 15 12:31:45 2024 -0500 Fix KEYSPD values for Icom rigs diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 4d90e3604..bc6903262 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -51,6 +51,53 @@ static int icom_get_spectrum_edge_frequency_range(RIG *rig, vfo_t vfo, static void icom_set_x25x26_ability(RIG *rig, int status); static int icom_get_vfo_number_x25x26(RIG *rig, vfo_t vfo); +const int cw_lookup [43][2] = +{ +{0,6}, +{7,7}, +{12,8}, +{19,9}, +{25,10}, +{31,11}, +{37,12}, +{43,13}, +{49,14}, +{55,15}, +{61,16}, +{67,17}, +{73,18}, +{79,19}, +{84,20}, +{91,21}, +{97,22}, +{103,23}, +{108,24}, +{114,25}, +{121,26}, +{128,27}, +{134,28}, +{140,29}, +{144,30}, +{151,31}, +{156,32}, +{164,33}, +{169,34}, +{175,35}, +{182,36}, +{188,37}, +{192,38}, +{199,39}, +{203,40}, +{211,41}, +{215,42}, +{224,43}, +{229,44}, +{234,45}, +{239,46}, +{244,47}, +{250,48} +}; + const cal_table_float_t icom_default_swr_cal = { 5, @@ -3485,6 +3532,7 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) switch (level) { + int i; case RIG_LEVEL_KEYSPD: if (val.i < 6) { @@ -3494,8 +3542,16 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { icom_val = 48; } + for(i=0;i<43;++i) + { + if (icom_val == cw_lookup[i][1]) + { + icom_val = cw_lookup[i][0]; + rig_debug(RIG_DEBUG_ERR, "%s: found %d at i=%d\n", __func__, icom_val, i); + break; + } + } - icom_val = (int) lroundf(((float) icom_val - 6.0f) * (255.0f / 42.0f)); break; case RIG_LEVEL_CWPITCH: @@ -4478,7 +4534,17 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_KEYSPD: - val->i = (int) lroundf((float) icom_val * (42.0f / 255.0f) + 6.0f); + for(i=0;i<43;++i) + { + int rigval = cw_lookup[i][0]; + if(rigval >= icom_val) + { + icom_val = cw_lookup[i][1]; + val->i = icom_val; + break; + } + } + rig_debug(RIG_DEBUG_ERR, "%s: did not find KEYSPD=%d\n", __func__, icom_val); break; case RIG_LEVEL_PREAMP: diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 07c988e46..5d9e315ad 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20240804" +#define BACKEND_VER "20240815" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit 61036be5d9e5e752c919aba5f77cf8d8453bb919 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Aug 14 12:45:52 2024 -0500 Fix smartsdr set_ptt diff --git a/rigs/flexradio/smartsdr.c b/rigs/flexradio/smartsdr.c index c452208a8..86492f9e6 100644 --- a/rigs/flexradio/smartsdr.c +++ b/rigs/flexradio/smartsdr.c @@ -511,7 +511,7 @@ int smartsdr_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) char slicechar[] = { '?','A','B','C','D','E','F','G','H' }; ENTERFUNC; - if (priv->ptt) + if (priv->ptt && ptt) // abort ptt if we're already transmitting { rig_debug(RIG_DEBUG_ERR, "%s: abort PTT on slice %c, another slice has PTT control\n", __func__, slicechar[priv->slicenum]); return -RIG_ENTARGET; diff --git a/rigs/flexradio/smartsdr_caps.h b/rigs/flexradio/smartsdr_caps.h index 50ec066d8..8d2407cae 100644 --- a/rigs/flexradio/smartsdr_caps.h +++ b/rigs/flexradio/smartsdr_caps.h @@ -1,5 +1,5 @@ .mfg_name = "Flex-radio", - .version = "20240807.0", + .version = "20240814.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 6f9de59bbd349d92e200f4468870c43f344cffc8 Merge: 9e6af9e99 82e9e5ffb Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Aug 12 11:17:53 2024 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 82e9e5ffbe8b7c2b78e27d3f01d235047788fa50 Merge: 1e54e2476 8ec452827 Author: Michael Black <mdb...@ya...> Date: Mon Aug 12 11:17:39 2024 -0500 Merge pull request #1594 from chrbayer84/cbayer-857-pwr-levels-cal cbayer 857 pwr levels cal commit 8ec452827deb109c2e1aaa66732a57b7b6b50824 Author: Christian Bayer <chr...@sa...> Date: Mon Aug 12 18:10:37 2024 +0200 fixed merge errors and variable declarations diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index 6452a82e5..c554855a7 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -227,6 +227,20 @@ enum ft857_digi FT857_DIGI_USER_U, }; + +#define FT857_PWR_CAL { 9, \ + { \ + { 0x00, 0.0f }, \ + { 0x01, 10.0f }, \ + { 0x02, 15.0f }, \ + { 0x03, 20.0f }, \ + { 0x04, 34.0f }, \ + { 0x05, 50.0f }, \ + { 0x06, 66.0f }, \ + { 0x07, 82.f }, \ + { 0x08, 100.0f } \ + } } + #define FT857_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_USB|\ RIG_MODE_LSB|RIG_MODE_RTTY|RIG_MODE_FM|RIG_MODE_PKTUSB) #define FT857_SSB_CW_RX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_USB|RIG_MODE_LSB) @@ -265,7 +279,7 @@ struct rig_caps ft857_caps = .retry = 0, .has_get_func = RIG_FUNC_NONE, .has_set_func = RIG_FUNC_LOCK | RIG_FUNC_TONE | RIG_FUNC_TSQL | RIG_FUNC_CSQL | RIG_FUNC_RIT, - .has_get_level = RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER, + .has_get_level = RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER | RIG_LEVEL_RFPOWER_METER_WATTS, .has_set_level = RIG_LEVEL_BAND_SELECT, .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, @@ -356,6 +370,7 @@ struct rig_caps ft857_caps = // {RIG_MODE_WFM, kHz(230)}, /* ?? */ RIG_FLT_END, }, + .rfpower_meter_cal = FT857_PWR_CAL, .rig_init = ft857_init, .rig_cleanup = ft857_cleanup, @@ -843,7 +858,7 @@ int ft857_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) return RIG_OK; } -static int ft857_get_pometer_level(RIG *rig, value_t *val) +static int ft857_get_pometer_level(RIG *rig, value_t *val, const cal_table_float_t *cal, float divider) { struct ft857_priv_data *p = (struct ft857_priv_data *) STATE(rig)->priv; rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); commit a337debf260c0b5879326a824b30a9eb65f1b49e Author: Christian Bayer <chr...@sa...> Date: Mon Aug 12 18:03:30 2024 +0200 fixed compile errors diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index c560cb122..6452a82e5 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -67,6 +67,7 @@ #include "bandplan.h" #include "cal.h" + enum ft857_native_cmd_e { FT857_NATIVE_CAT_LOCK_ON = 0, @@ -896,6 +897,10 @@ static int ft857_get_smeter_level(RIG *rig, value_t *val) int ft857_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); + freq_t freq; + rmode_t mode; + pbwidth_t width; + int freq_ms, mode_ms, width_ms; switch (level) { @@ -904,12 +909,14 @@ int ft857_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_RFPOWER: case RIG_LEVEL_RFPOWER_METER_WATTS: - // if (144000000 >= vfo && 148000000 <= vfo) { - // return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); - // } - // else if (420000000 >= vfo && 450000000 <= vfo) { - // return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); - // } + rig_get_cache(rig, vfo, &freq, &freq_ms, &mode, &mode_ms, &width, + &width_ms); + if (144000000.0f >= freq && 148000000.0f <= freq) { + return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); + } + else if (420000000.0f >= freq && 450000000.0f <= freq) { + return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); + } return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 1.0); default: commit 069b0bf5b05d6a209204dd1354d3f9f0fd953411 Merge: 7719d0489 1e54e2476 Author: Michael Black <mdb...@ya...> Date: Mon Aug 12 06:40:39 2024 -0500 Merge branch 'master' into cbayer-857-pwr-levels-cal commit 1e54e2476757bcecc8091d4d4aae5bdc33307311 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Aug 9 17:20:02 2024 -0500 Rename ctx10 unpack_frame to commradio_unpack_frame to avoid collision with freedv unpack_frame diff --git a/rigs/commradio/commradio.c b/rigs/commradio/commradio.c index 888db0f2c..c73c7b6fe 100644 --- a/rigs/commradio/commradio.c +++ b/rigs/commradio/commradio.c @@ -58,7 +58,7 @@ int commradio_transaction(RIG *rig, const unsigned char *cmd, int cmd_len, { goto transaction_quit; } - ret = unpack_frame(data, rx, ret); + ret = commradio_unpack_frame(data, rx, ret); if (ret < RIG_OK) { goto transaction_quit; diff --git a/rigs/commradio/ctx10.c b/rigs/commradio/ctx10.c index 1631a1664..fc411ee41 100644 --- a/rigs/commradio/ctx10.c +++ b/rigs/commradio/ctx10.c @@ -20,7 +20,7 @@ struct rig_caps ctx10_caps = RIG_MODEL(RIG_MODEL_CTX10), .model_name = "CTX-10", .mfg_name = "Commradio", - .version = "20240802.0", + .version = "20240809.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, diff --git a/rigs/commradio/frame.c b/rigs/commradio/frame.c index fc1756ab4..0bc44fd8a 100644 --- a/rigs/commradio/frame.c +++ b/rigs/commradio/frame.c @@ -104,7 +104,7 @@ int frame_message(unsigned char frame[], const unsigned char *data, return frame_len; } -int unpack_frame(unsigned char msg[], const unsigned char *frame, +int commradio_unpack_frame(unsigned char msg[], const unsigned char *frame, const int frame_len) { if (frame_len < 5) diff --git a/rigs/commradio/frame.h b/rigs/commradio/frame.h index 14458e412..56a7b177c 100644 --- a/rigs/commradio/frame.h +++ b/rigs/commradio/frame.h @@ -16,7 +16,7 @@ int frame_message(unsigned char frame[], const unsigned char *data, int data_len); -int unpack_frame(unsigned char msg[], const unsigned char *frame, int frame_len); +int commradio_unpack_frame(unsigned char msg[], const unsigned char *frame, int frame_len); #endif /* _FRAME_H */ commit 9e6af9e99d24cf3756232de70354ea27a7f3286c Merge: f3bd0bdf0 d3e191101 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Aug 9 17:16:10 2024 -0500 xMerge branch 'master' of https://github.com/Hamlib/Hamlib commit f3bd0bdf0a2d80b0fe223885973d74156b794918 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Aug 9 17:13:59 2024 -0500 Revert "export correct function for wsjtx" This reverts commit 4312b26bc9401fe0d98c181bbd90fc81c280c3dd. diff --git a/rigs/commradio/commradio.c b/rigs/commradio/commradio.c index 888db0f2c..c73c7b6fe 100644 --- a/rigs/commradio/commradio.c +++ b/rigs/commradio/commradio.c @@ -58,7 +58,7 @@ int commradio_transaction(RIG *rig, const unsigned char *cmd, int cmd_len, { goto transaction_quit; } - ret = unpack_frame(data, rx, ret); + ret = commradio_unpack_frame(data, rx, ret); if (ret < RIG_OK) { goto transaction_quit; diff --git a/rigs/commradio/ctx10.c b/rigs/commradio/ctx10.c index 1631a1664..fc411ee41 100644 --- a/rigs/commradio/ctx10.c +++ b/rigs/commradio/ctx10.c @@ -20,7 +20,7 @@ struct rig_caps ctx10_caps = RIG_MODEL(RIG_MODEL_CTX10), .model_name = "CTX-10", .mfg_name = "Commradio", - .version = "20240802.0", + .version = "20240809.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, diff --git a/rigs/commradio/frame.c b/rigs/commradio/frame.c index fc1756ab4..0bc44fd8a 100644 --- a/rigs/commradio/frame.c +++ b/rigs/commradio/frame.c @@ -104,7 +104,7 @@ int frame_message(unsigned char frame[], const unsigned char *data, return frame_len; } -int unpack_frame(unsigned char msg[], const unsigned char *frame, +int commradio_unpack_frame(unsigned char msg[], const unsigned char *frame, const int frame_len) { if (frame_len < 5) diff --git a/rigs/commradio/frame.h b/rigs/commradio/frame.h index 14458e412..56a7b177c 100644 --- a/rigs/commradio/frame.h +++ b/rigs/commradio/frame.h @@ -16,7 +16,7 @@ int frame_message(unsigned char frame[], const unsigned char *data, int data_len); -int unpack_frame(unsigned char msg[], const unsigned char *frame, int frame_len); +int commradio_unpack_frame(unsigned char msg[], const unsigned char *frame, int frame_len); #endif /* _FRAME_H */ commit d3e191101f3603cc534549cfa4dd952d118a9e35 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Aug 9 11:43:28 2024 -0500 Revert "Merge pull request #1592 from chrbayer84/cbayer-857-pwr-levels-cal" This reverts commit 15dc3ae8be03814b708b744f4df19415918a90d3, reversing changes made to 3b1283496cdb89d3d43d0354216e8dfa0a8b8d00. diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index 1f1471ae4..8456e4811 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -225,19 +225,6 @@ enum ft857_digi FT857_DIGI_USER_U, }; -#define FT857_PWR_CAL { 9, \ - { \ - { 0x00, 0.0f }, \ - { 0x01, 10.0f }, \ - { 0x02, 15.0f }, \ - { 0x03, 20.0f }, \ - { 0x04, 34.0f }, \ - { 0x05, 50.0f }, \ - { 0x06, 66.0f }, \ - { 0x07, 82.f }, \ - { 0x08, 100.0f } \ - } } - #define FT857_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_USB|\ RIG_MODE_LSB|RIG_MODE_RTTY|RIG_MODE_FM|RIG_MODE_PKTUSB) #define FT857_SSB_CW_RX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_USB|RIG_MODE_LSB) @@ -276,7 +263,7 @@ struct rig_caps ft857_caps = .retry = 0, .has_get_func = RIG_FUNC_NONE, .has_set_func = RIG_FUNC_LOCK | RIG_FUNC_TONE | RIG_FUNC_TSQL | RIG_FUNC_CSQL | RIG_FUNC_RIT, - .has_get_level = RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER | RIG_LEVEL_RFPOWER_METER_WATTS, + .has_get_level = RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER, .has_set_level = RIG_LEVEL_BAND_SELECT, .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, @@ -367,7 +354,7 @@ struct rig_caps ft857_caps = // {RIG_MODE_WFM, kHz(230)}, /* ?? */ RIG_FLT_END, }, - .rfpower_meter_cal = FT857_PWR_CAL, + .rig_init = ft857_init, .rig_cleanup = ft857_cleanup, .rig_open = ft857_open, @@ -854,7 +841,7 @@ int ft857_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) return RIG_OK; } -static int ft857_get_pometer_level(RIG *rig, value_t *val, const cal_table_float_t *cal, float divider) +static int ft857_get_pometer_level(RIG *rig, value_t *val) { struct ft857_priv_data *p = (struct ft857_priv_data *) STATE(rig)->priv; rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); @@ -874,7 +861,7 @@ static int ft857_get_pometer_level(RIG *rig, value_t *val, const cal_table_float { rig_debug(RIG_DEBUG_TRACE, "%s: bars=%d\n", __func__, p->tx_status & 0x0F); // does rig have 10 bars or 15? - val->f = (p->tx_status & 0x0F) / divider; + val->f = (p->tx_status & 0x0F) / 10.0; } else { @@ -915,23 +902,8 @@ int ft857_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return ft857_get_smeter_level(rig, val); case RIG_LEVEL_RFPOWER: - if (144000000 >= vfo && 148000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); - } - else if (420000000 >= vfo && 450000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); - } - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 1.0); - - case RIG_LEVEL_RFPOWER_METER_WATTS: - if (144000000 >= vfo && 148000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); - } - else if (420000000 >= vfo && 450000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); - } - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 1.0); - + return ft857_get_pometer_level(rig, val); + default: return -RIG_EINVAL; } commit 8975643aaa67b41d2d3dfeb330055544426625db Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Aug 9 11:41:44 2024 -0500 Revert "Merge pull request #1592 from chrbayer84/cbayer-857-pwr-levels-cal" This reverts commit 15dc3ae8be03814b708b744f4df19415918a90d3, reversing changes made to 3b1283496cdb89d3d43d0354216e8dfa0a8b8d00. diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index 1f1471ae4..8456e4811 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -225,19 +225,6 @@ enum ft857_digi FT857_DIGI_USER_U, }; -#define FT857_PWR_CAL { 9, \ - { \ - { 0x00, 0.0f }, \ - { 0x01, 10.0f }, \ - { 0x02, 15.0f }, \ - { 0x03, 20.0f }, \ - { 0x04, 34.0f }, \ - { 0x05, 50.0f }, \ - { 0x06, 66.0f }, \ - { 0x07, 82.f }, \ - { 0x08, 100.0f } \ - } } - #define FT857_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_USB|\ RIG_MODE_LSB|RIG_MODE_RTTY|RIG_MODE_FM|RIG_MODE_PKTUSB) #define FT857_SSB_CW_RX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_USB|RIG_MODE_LSB) @@ -276,7 +263,7 @@ struct rig_caps ft857_caps = .retry = 0, .has_get_func = RIG_FUNC_NONE, .has_set_func = RIG_FUNC_LOCK | RIG_FUNC_TONE | RIG_FUNC_TSQL | RIG_FUNC_CSQL | RIG_FUNC_RIT, - .has_get_level = RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER | RIG_LEVEL_RFPOWER_METER_WATTS, + .has_get_level = RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER, .has_set_level = RIG_LEVEL_BAND_SELECT, .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, @@ -367,7 +354,7 @@ struct rig_caps ft857_caps = // {RIG_MODE_WFM, kHz(230)}, /* ?? */ RIG_FLT_END, }, - .rfpower_meter_cal = FT857_PWR_CAL, + .rig_init = ft857_init, .rig_cleanup = ft857_cleanup, .rig_open = ft857_open, @@ -854,7 +841,7 @@ int ft857_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) return RIG_OK; } -static int ft857_get_pometer_level(RIG *rig, value_t *val, const cal_table_float_t *cal, float divider) +static int ft857_get_pometer_level(RIG *rig, value_t *val) { struct ft857_priv_data *p = (struct ft857_priv_data *) STATE(rig)->priv; rig_debug(RIG_DEBUG_VERBOSE, "%s: called \n", __func__); @@ -874,7 +861,7 @@ static int ft857_get_pometer_level(RIG *rig, value_t *val, const cal_table_float { rig_debug(RIG_DEBUG_TRACE, "%s: bars=%d\n", __func__, p->tx_status & 0x0F); // does rig have 10 bars or 15? - val->f = (p->tx_status & 0x0F) / divider; + val->f = (p->tx_status & 0x0F) / 10.0; } else { @@ -915,23 +902,8 @@ int ft857_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return ft857_get_smeter_level(rig, val); case RIG_LEVEL_RFPOWER: - if (144000000 >= vfo && 148000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); - } - else if (420000000 >= vfo && 450000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); - } - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 1.0); - - case RIG_LEVEL_RFPOWER_METER_WATTS: - if (144000000 >= vfo && 148000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); - } - else if (420000000 >= vfo && 450000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); - } - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 1.0); - + return ft857_get_pometer_level(rig, val); + default: return -RIG_EINVAL; } commit 437334818fbe70d9338352b0abdb50d54810f415 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Aug 9 11:40:38 2024 -0500 Revert "Abort multicast routine when UDP errors occur" This reverts commit 3b1283496cdb89d3d43d0354216e8dfa0a8b8d00. diff --git a/src/network.c b/src/network.c index 17183cf79..87c07cad8 100644 --- a/src/network.c +++ b/src/network.c @@ -1093,7 +1093,6 @@ void *multicast_publisher(void *arg) "%s: error sending UDP packet: %s\n", __func__, strerror(errno)); flag = 1; - break; // we'll just quit this routine for now -- debug in the future } } } commit 7719d048977acb035aabb6eca8c5d39c385fcb3b Author: Christian Bayer <chr...@sa...> Date: Fri Aug 9 16:32:28 2024 +0200 disable scaling diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index d931c261f..5fb502c09 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -916,21 +916,13 @@ int ft857_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return ft857_get_smeter_level(rig, val); case RIG_LEVEL_RFPOWER: - if (144000000 >= vfo && 148000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); - } - else if (420000000 >= vfo && 450000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); - } - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 1.0); - case RIG_LEVEL_RFPOWER_METER_WATTS: - if (144000000 >= vfo && 148000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 4.0); - } - else if (420000000 >= vfo && 450000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); - } + // if (144000000 >= vfo && 148000000 <= vfo) { + // return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); + // } + // else if (420000000 >= vfo && 450000000 <= vfo) { + // return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); + // } return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 1.0); default: commit 4c52f81e32c47844d4bb2a3b9864c12582088c65 Author: Christian Bayer <chr...@sa...> Date: Fri Aug 9 14:53:36 2024 +0200 divider update diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index 8f8d3d477..d931c261f 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -926,7 +926,7 @@ int ft857_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_RFPOWER_METER_WATTS: if (144000000 >= vfo && 148000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); + return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 4.0); } else if (420000000 >= vfo && 450000000 <= vfo) { return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); commit 24b47951b25443abfd43bc0f9725bcfd4031d9d1 Author: Christian Bayer <chr...@sa...> Date: Fri Aug 9 14:34:36 2024 +0200 use correct value diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index abe7bf7cc..8f8d3d477 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -875,7 +875,7 @@ static int ft857_get_pometer_level(RIG *rig, value_t *val, const cal_table_float { rig_debug(RIG_DEBUG_TRACE, "%s: bars=%d\n", __func__, p->tx_status & 0x0F); // does rig have 10 bars or 15? - val->f = rig_raw2val_float(*val, cal)/divider; + val->f = rig_raw2val_float(p->tx_status & 0x0F, cal)/divider; } else { commit e63014a23f0fdcda5ad8a6bff9246489d9c8a358 Author: Christian Bayer <chr...@go...> Date: Fri Aug 9 08:32:14 2024 -0400 added header diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index 24c6dff59..abe7bf7cc 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -65,6 +65,7 @@ #include "misc.h" #include "tones.h" #include "bandplan.h" +#include "cal.h" enum ft857_native_cmd_e { commit faee30ebd9c53b134947190e78bba469962020c4 Author: Christian Bayer <chr...@sa...> Date: Fri Aug 9 14:19:01 2024 +0200 fixed cal table conversion diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index 1f1471ae4..24c6dff59 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -874,7 +874,7 @@ static int ft857_get_pometer_level(RIG *rig, value_t *val, const cal_table_float { rig_debug(RIG_DEBUG_TRACE, "%s: bars=%d\n", __func__, p->tx_status & 0x0F); // does rig have 10 bars or 15? - val->f = (p->tx_status & 0x0F) / divider; + val->f = rig_raw2val_float(*val, cal)/divider; } else { commit 15dc3ae8be03814b708b744f4df19415918a90d3 Merge: 3b1283496 4312b26bc Author: Michael Black <mdb...@ya...> Date: Fri Aug 9 07:08:09 2024 -0500 Merge pull request #1592 from chrbayer84/cbayer-857-pwr-levels-cal Untested: ft-857 power levels for 2m/70cm commit 4312b26bc9401fe0d98c181bbd90fc81c280c3dd Author: Christian Bayer <chr...@go...> Date: Fri Aug 9 07:15:20 2024 -0400 export correct function for wsjtx diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index afa50d19c..1f1471ae4 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -276,7 +276,7 @@ struct rig_caps ft857_caps = .retry = 0, .has_get_func = RIG_FUNC_NONE, .has_set_func = RIG_FUNC_LOCK | RIG_FUNC_TONE | RIG_FUNC_TSQL | RIG_FUNC_CSQL | RIG_FUNC_RIT, - .has_get_level = RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER, + .has_get_level = RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER | RIG_LEVEL_RFPOWER_METER_WATTS, .has_set_level = RIG_LEVEL_BAND_SELECT, .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, @@ -915,14 +915,23 @@ int ft857_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return ft857_get_smeter_level(rig, val); case RIG_LEVEL_RFPOWER: - if (144000000 >= vfo && 148000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); - } - else if (420000000 >= vfo && 450000000 <= vfo) { - return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); - } + if (144000000 >= vfo && 148000000 <= vfo) { + return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); + } + else if (420000000 >= vfo && 450000000 <= vfo) { + return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); + } return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 1.0); - + + case RIG_LEVEL_RFPOWER_METER_WATTS: + if (144000000 >= vfo && 148000000 <= vfo) { + return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 2.0); + } + else if (420000000 >= vfo && 450000000 <= vfo) { + return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 5.0); + } + return ft857_get_pometer_level(rig, val, &rig->caps->rfpower_meter_cal, 1.0); + default: return -RIG_EINVAL; } commit 63acc6e6c24050ca289285ae6447723de1891b61 Merge: 3e8b1d7a9 3b1283496 Author: chrbayer84 <chr...@gm...> Date: Fri Aug 9 04:11:37 2024 -0400 Merge branch 'Hamlib:master' into cbayer-857-pwr-levels-cal commit 3e8b1d7a94c7366d7c14fa9bd4d0db86ff1c8dc0 Author: Christian Bayer <chr...@sa...> Date: Fri Aug 9 10:10:40 2024 +0200 ft-857 power levels for 2m/70cm diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index 8456e4811..afa50d19c 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -225,6 +225,19 @@ enum ft857_digi FT857_DIGI_USER_U, }; +#define FT857_PWR_CAL { 9, \ + { \ + { 0x00, 0.0f }, \ + { 0x01, 10.0f }, \ + { 0x02, 15.0f }, \ + { 0x03, 20.0f }, \ + { 0x04, 34.0f }, \ + { 0x05, 50.0f }, \ + { 0x06, 66.0f }, \ + { 0x07, 82.f }, \ + { 0x08, 100.0f } \ + } } + #define FT857_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_USB|\ RIG_MODE_LSB|RIG_MODE_RTTY|RIG_MODE_FM|RIG_MODE_PKTUSB) #define FT857_SSB_CW_RX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_USB|RIG_MODE_LSB) @@ -354,7 +367,7 @@ struct rig_caps ft857_caps = // {RIG_MODE_WFM, kHz(230)}, /* ?? */ RIG_FLT_END, }, - + .rfpower_meter_cal = FT857_PWR_CAL, .rig_init = ft857_init, .rig_cleanup = ft857_cleanup, ... [truncated message content] |
From: n0nb <n0...@us...> - 2024-08-08 12:36:11
|
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 3b1283496cdb89d3d43d0354216e8dfa0a8b8d00 (commit) via d9d07e513c66a2558840addb53d9227554eec5f2 (commit) via 782911f5214e087f0f3c50c767e2ae4bc3738794 (commit) via afccc646db9f0d8693009f19ff89a75ca923fd1b (commit) via dd9d98ca1a86494aee8fb79b0c15e6127fe9ed97 (commit) via eeca01c08088f70f1ce52ff7c0d8b72055f01124 (commit) via 7b71bc09ab260a784f6faccee143e8233d19bae6 (commit) via df48595add88d2fc6ee3ded71eaa6cb70db45efd (commit) via fe43a6425ecfd7fde14e61f07fe7aa783f519f91 (commit) via 4d07c2abad33bfa46bb9f994a48bcc615e38725e (commit) via 9d8cc7d2608156eae0c9ccf853df8698dc054d70 (commit) via 48862ece543bd5e5654b0c6b64c83f8aa9db55d1 (commit) via ff71f202c9ad77f6f8cb2fb61061879ded4220d6 (commit) via 725542775b0df57d1fd067cdec5764528baf8c8f (commit) via 47d1dbb0306385add4bfb4641fe62ff4a7a27bd5 (commit) via 0fdfacafa3a5021353aa82c926138d114497ce6f (commit) via 9ace7dbe5c1bfb0ffeb1399db116f7f4c9eda2a5 (commit) via 6679746c62b398f5ffb488c0d480461836a079f6 (commit) via fd153e26f4104b4df7d9c1460b54a310cb74aebd (commit) via 1a37c569fa95f877909ded91cf9d7ff5c4d5aeb5 (commit) via 748be3707ff353b25585b12a780a5253f9f2a8de (commit) via 2b10a3078e98682a0eeb689f8761bbf037f5f498 (commit) via 2668605fbd0968dce8126bcbd5357eade65fb9a9 (commit) via ae39040fb12d2366a4c2dca33c5361e271d9a250 (commit) via 6db44d6d497d6e1399fde1daaf65d1fcf36f11e3 (commit) via 5ec0b8464572ee7290fe65d11b95e60bb5b76cd3 (commit) via 647b477dc95d3d688e352a125e77993c1f46d652 (commit) via 3f59e962e1060e517a10f25310cecff2ccca53d9 (commit) via b718788c9ab46a7b370b74ef77436c9741f8b09b (commit) via 75783cb1255d184c13f13464322ce6ba3c234a4e (commit) via ed33a235f4acd515bc415556343b599698958387 (commit) via db74acc725aa86d9a153d012cf4fa2dec82e1037 (commit) via 673d031d5e6819ab7169ead9947e24b1a9b87476 (commit) via 979d2adccf7e7f76821d8c760808341b29f0fd2f (commit) via abd6d4f388cb7c236f14025e670e85d124f04655 (commit) via 2e96b91b04eece8b9aeee304a0cbd09002044607 (commit) via 56d55f59b313d55f85e2e7f2fd0df3ef021c4388 (commit) via 3e2922fe69be4d5e69c465e853652e4355c5b311 (commit) via 8b9c7680633e2639ec2e192f82d030fcd6096869 (commit) via c0be98aea96dbea63c038438f28db8aeb4fdefd5 (commit) via 1e8ba0dff9bdb30de73bf8e9d36c76a49e8668cc (commit) via 16707507c66842d28dc93ad2b341fce5c2d24cae (commit) via 7bf63ecbf0235b86b23425f3912c4c8bd36d8c4d (commit) via c28caa7a9cab11d190bc783d29ce2b373aa9db37 (commit) via 105a411c749700ebe8a0b90260d210e70979cdc2 (commit) via fc8642fbf85bb3d866f9dfb9b139c9e7b0611f80 (commit) via 21897517b6fc40a0c50582da54cea708458a06e6 (commit) via 8cc51f5ad72c49f2c5d0f6da7d1a3fb9e6066509 (commit) via f5ad3c64bfb0c86622184416f0543f1d741726b4 (commit) via a3f930b061d9e48f0c7b3c476ec8d56696ed55ff (commit) via 47cb5fdc1abee6b9851ea1bb74507be925ef835c (commit) via 74d780f19f2bcd7a774185b0fa0b8888538b3827 (commit) via 2f1e6b636e301edf6a1a1309c144378d8e764ea2 (commit) via 52f91b3ced59528ac2979767e9a1cfbb68fb757d (commit) via 27838026f5a415b260dd9cd86b1e3ff1c7f9dce0 (commit) via a40311173be7826abfbaf9115ed3bae0d061bf01 (commit) via 645cab50dda663efa7394815611a98a21881af87 (commit) via fc27cc32ceb1a5c36244dc9ab1765a0b1f41e295 (commit) via 40b20aa91272e0a483de434f18cf9622439bbf55 (commit) via 5814f745b9429a9f141f1b28b916b65a5bef762b (commit) via 6ed7cfe73d3a949a05ec7ce9fd2bc19b9b0b3c89 (commit) via 7b9f1241d9c61465c92908ca1e7c6e0011c04628 (commit) via 388a18e5da4895bd176887440b6f752dd96ca4aa (commit) via 660bfcb1d98c42494925b3efee5fff7a8208c70a (commit) via 6a2bbf130dde42695c3c675e771c3660aed13e48 (commit) via 5daf92d224a478f519570420749a75c5f9e0b6e8 (commit) via 328731921ef7cd4bfbda6553ab76f29cf8a9ffb7 (commit) via 150ac1608fbe91579c4cedc629a3b69554653111 (commit) via f98fc86f93fc3428369899dda55881bffe927316 (commit) via a2aecdcf020d01b24d98cce9f264dd2cea439335 (commit) via 37321a1df898022e0c2020839ca91c99a90a8e9c (commit) via b0dc954a9298991edd0bb10e591040dc0bea3b9c (commit) via d4480045f39163aa6c17169bcc7bfa1cd1ba7031 (commit) via 02102f60e4a1fcbbbf467e07eb803b0aa2a1c9d4 (commit) via 00bc700ec18020e477dd025d7ef65d7c73e63279 (commit) via 5b8cc94b012be67a861e2abcb3fcfe448bb681c0 (commit) from fee7007fb9031869ce38e09f3ce57745b1f32626 (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 3b1283496cdb89d3d43d0354216e8dfa0a8b8d00 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Aug 7 17:26:03 2024 -0500 Abort multicast routine when UDP errors occur Some setups don't work correctly and this is not critical now diff --git a/src/network.c b/src/network.c index 87c07cad8..17183cf79 100644 --- a/src/network.c +++ b/src/network.c @@ -1093,6 +1093,7 @@ void *multicast_publisher(void *arg) "%s: error sending UDP packet: %s\n", __func__, strerror(errno)); flag = 1; + break; // we'll just quit this routine for now -- debug in the future } } } commit d9d07e513c66a2558840addb53d9227554eec5f2 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Aug 7 12:02:09 2024 -0500 For Kenwood rigs add 50ms wait after set_freq to allow rig to update internal IF command diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 3c1637c31..3cc70f6c8 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -1963,6 +1963,7 @@ int kenwood_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (priv->verify_cmd[1] == 'A' && vfo_letter == 'B') { priv->verify_cmd[1] = 'A'; } err = kenwood_transaction(rig, freqbuf, NULL, 0); + hl_usleep(50*1000); // TS480 is slow to change freq so give it some time as well as others just in case if (priv->verify_cmd[1] == 'B' && vfo_letter == 'B') { priv->verify_cmd[1] = 'A'; } diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 390c5b00e..93b8cde1c 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "idx_builtin.h" -#define BACKEND_VER "20240730" +#define BACKEND_VER "20240807" #define EOM_KEN ';' #define EOM_TH '\r' commit 782911f5214e087f0f3c50c767e2ae4bc3738794 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Aug 7 06:06:41 2024 -0500 Remove sleep in smartsdr set_ptt and move the priv->ptt earlier. Trying to avoid ptt on more than one slice at a time. diff --git a/rigs/flexradio/smartsdr.c b/rigs/flexradio/smartsdr.c index fd8847fef..c452208a8 100644 --- a/rigs/flexradio/smartsdr.c +++ b/rigs/flexradio/smartsdr.c @@ -516,6 +516,7 @@ int smartsdr_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) rig_debug(RIG_DEBUG_ERR, "%s: abort PTT on slice %c, another slice has PTT control\n", __func__, slicechar[priv->slicenum]); return -RIG_ENTARGET; } + priv->ptt = ptt; if (ptt) { sprintf(cmd, "dax audio set %d tx=1", priv->slicenum + 1); @@ -527,8 +528,6 @@ int smartsdr_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) smartsdr_transaction(rig, cmd); sprintf(cmd, "xmit %d", ptt); smartsdr_transaction(rig, cmd); - if (!ptt) hl_usleep(100*1000); // need a little time for PTT to actually turn off - priv->ptt = ptt; RETURNFUNC(RIG_OK); } diff --git a/rigs/flexradio/smartsdr_caps.h b/rigs/flexradio/smartsdr_caps.h index 80845fe61..50ec066d8 100644 --- a/rigs/flexradio/smartsdr_caps.h +++ b/rigs/flexradio/smartsdr_caps.h @@ -1,5 +1,5 @@ .mfg_name = "Flex-radio", - .version = "20240806.0", + .version = "20240807.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit afccc646db9f0d8693009f19ff89a75ca923fd1b Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Aug 6 17:52:36 2024 -0500 Flex slice return RIG_ENTARGET when ptt is requested and ptt is already engaged diff --git a/rigs/flexradio/smartsdr.c b/rigs/flexradio/smartsdr.c index 60ab0d96e..fd8847fef 100644 --- a/rigs/flexradio/smartsdr.c +++ b/rigs/flexradio/smartsdr.c @@ -508,8 +508,14 @@ int smartsdr_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) { struct smartsdr_priv_data *priv = (struct smartsdr_priv_data *)STATE(rig)->priv; char cmd[64]; + char slicechar[] = { '?','A','B','C','D','E','F','G','H' }; ENTERFUNC; + if (priv->ptt) + { + rig_debug(RIG_DEBUG_ERR, "%s: abort PTT on slice %c, another slice has PTT control\n", __func__, slicechar[priv->slicenum]); + return -RIG_ENTARGET; + } if (ptt) { sprintf(cmd, "dax audio set %d tx=1", priv->slicenum + 1); commit dd9d98ca1a86494aee8fb79b0c15e6127fe9ed97 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Aug 6 17:10:58 2024 -0500 Make write_block_sync return the correct value diff --git a/src/iofunc.c b/src/iofunc.c index 1b355ea1e..e22e738e7 100644 --- a/src/iofunc.c +++ b/src/iofunc.c @@ -960,13 +960,22 @@ static int port_wait_for_data(hamlib_port_t *p, int direct) int HAMLIB_API write_block_sync(hamlib_port_t *p, const unsigned char *txbuffer, size_t count) { + int retval = RIG_OK; if (p->asyncio) { - return (int) write(p->fd_sync_write, txbuffer, count); + retval = write(p->fd_sync_write, txbuffer, count); } - - return (int) write(p->fd, txbuffer, count); + else + { + retval = write(p->fd, txbuffer, count); + } + if (retval != count) + { + rig_debug(RIG_DEBUG_ERR, "%s: write failed: %s\n", __func__, strerror(errno)); + retval = -RIG_EIO; + } + return retval; } int HAMLIB_API write_block_sync_error(hamlib_port_t *p, commit eeca01c08088f70f1ce52ff7c0d8b72055f01124 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Aug 6 17:01:07 2024 -0500 Give a little time for Flex to turn off ptt diff --git a/rigs/flexradio/smartsdr.c b/rigs/flexradio/smartsdr.c index dd7b04860..60ab0d96e 100644 --- a/rigs/flexradio/smartsdr.c +++ b/rigs/flexradio/smartsdr.c @@ -518,9 +518,10 @@ int smartsdr_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) } sprintf(cmd, "slice set %d tx=1", priv->slicenum); - smartsdr_transaction(rig, cmd); + smartsdr_transaction(rig, cmd); sprintf(cmd, "xmit %d", ptt); smartsdr_transaction(rig, cmd); + if (!ptt) hl_usleep(100*1000); // need a little time for PTT to actually turn off priv->ptt = ptt; RETURNFUNC(RIG_OK); } diff --git a/rigs/flexradio/smartsdr_caps.h b/rigs/flexradio/smartsdr_caps.h index b00ca4e91..80845fe61 100644 --- a/rigs/flexradio/smartsdr_caps.h +++ b/rigs/flexradio/smartsdr_caps.h @@ -1,5 +1,5 @@ .mfg_name = "Flex-radio", - .version = "20240609.0", + .version = "20240806.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 7b71bc09ab260a784f6faccee143e8233d19bae6 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Aug 4 17:11:19 2024 -0500 Change timeout on IC7100 to 700ms instead of 1000ms Hopefully allow for timeout when async packets are coming in every 1000ms https://github.com/Hamlib/Hamlib/issues/1587 diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 4be5c3012..216f36890 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -218,11 +218,11 @@ again1: // if we get a reply that is not our cmd/subcmd we should just ignore it and retry the read. // this should somewhat allow splitting the COM port between two controllers if (cmd != buf[4]) { - rig_debug(RIG_DEBUG_VERBOSE, "%s: cmd x%02d != buf x%02x so retry read\n", __func__, cmd, buf[4]); + rig_debug(RIG_DEBUG_VERBOSE, "%s: cmd x%02x != buf x%02x so retry read\n", __func__, cmd, buf[4]); goto again1; } if (subcmd != -1 && subcmd != buf[5]) { - rig_debug(RIG_DEBUG_VERBOSE, "%s: subcmd x%02d != buf x%02x so retry read\n", __func__, subcmd, buf[5]); + rig_debug(RIG_DEBUG_VERBOSE, "%s: subcmd x%02x != buf x%02x so retry read\n", __func__, subcmd, buf[5]); goto again1; } diff --git a/rigs/icom/ic7100.c b/rigs/icom/ic7100.c index 4c2cd7325..dbb3dd5d4 100644 --- a/rigs/icom/ic7100.c +++ b/rigs/icom/ic7100.c @@ -342,7 +342,7 @@ struct rig_caps ic7100_caps = .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = 0, .post_write_delay = 0, - .timeout = 1000, + .timeout = 700, .retry = 3, .has_get_func = IC7100_FUNC_ALL, .has_set_func = IC7100_FUNC_ALL | RIG_FUNC_RESUME, commit df48595add88d2fc6ee3ded71eaa6cb70db45efd Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Aug 4 11:51:18 2024 -0500 Put rig_flush back in frame.c for the IC-7100 -- hopefully fixed async packets on the CI-V port coming from amplifiers The 7100 cannot unlink the CI-V port and these async packets are not being handled well. https://github.com/Hamlib/Hamlib/issues/1587 diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 4705ea265..4be5c3012 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -156,7 +156,11 @@ int icom_one_transaction(RIG *rig, unsigned char cmd, int subcmd, set_transaction_active(rig); collision_retry: - //rig_flush(rp); + // The IC7100 cannot separate the CI-V port from the USB CI-V + // We see async packets coming in so we'll try and do the flush + // This also means the IC7100 will not support async packets anymore + if (rig->caps->rig_model == RIG_MODEL_IC7100) + rig_flush(rp); frm_len = make_cmd_frame(sendbuf, priv->re_civ_addr, ctrl_id, cmd, subcmd, payload, payload_len); diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 90e50d8d3..07c988e46 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20240801" +#define BACKEND_VER "20240804" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit fe43a6425ecfd7fde14e61f07fe7aa783f519f91 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Aug 2 16:31:49 2024 -0500 In icom frame.c move the frm building inside the collision_retry block https://github.com/Hamlib/Hamlib/issues/1587 diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 74b4dfa36..4705ea265 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -150,9 +150,6 @@ int icom_one_transaction(RIG *rig, unsigned char cmd, int subcmd, ctrl_id = priv_caps->serial_full_duplex == 0 ? CTRLID : 0x80; - frm_len = make_cmd_frame(sendbuf, priv->re_civ_addr, ctrl_id, cmd, - subcmd, payload, payload_len); - /* * should check return code and that write wrote cmd_len chars! */ @@ -160,6 +157,9 @@ int icom_one_transaction(RIG *rig, unsigned char cmd, int subcmd, collision_retry: //rig_flush(rp); + frm_len = make_cmd_frame(sendbuf, priv->re_civ_addr, ctrl_id, cmd, + subcmd, payload, payload_len); + if (data_len) { *data_len = 0; } commit 4d07c2abad33bfa46bb9f994a48bcc615e38725e Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Aug 2 08:41:23 2024 -0500 Remove some bad declarations in ctx10.c diff --git a/rigs/commradio/ctx10.c b/rigs/commradio/ctx10.c index 10782fd1e..1631a1664 100644 --- a/rigs/commradio/ctx10.c +++ b/rigs/commradio/ctx10.c @@ -20,7 +20,7 @@ struct rig_caps ctx10_caps = RIG_MODEL(RIG_MODEL_CTX10), .model_name = "CTX-10", .mfg_name = "Commradio", - .version = "20240118" ".0", + .version = "20240802.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -43,15 +43,15 @@ struct rig_caps ctx10_caps = .has_set_level = RIG_LEVEL_NONE, .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, - .level_gran = {}, - .parm_gran = {}, +// .level_gran = {}, +// .parm_gran = {}, .ctcss_list = NULL, .dcs_list = NULL, - .preamp = { RIG_DBLST_END, }, - .attenuator = { RIG_DBLST_END, }, - .max_rit = Hz(0), - .max_xit = Hz(0), - .max_ifshift = Hz(0), +// .preamp = { RIG_DBLST_END, }, +// .attenuator = { RIG_DBLST_END, }, +// .max_rit = Hz(0), +// .max_xit = Hz(0), +// .max_ifshift = Hz(0), .targetable_vfo = 0, .vfo_ops = (RIG_OP_FROM_VFO|RIG_OP_TO_VFO), .scan_ops = RIG_SCAN_NONE, commit 9d8cc7d2608156eae0c9ccf853df8698dc054d70 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Aug 1 17:30:03 2024 -0500 Move the async detection for Icom to after the echo detection https://github.com/Hamlib/Hamlib/issues/1587 diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 0498af506..74b4dfa36 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -206,16 +206,6 @@ again1: RETURNFUNC(-RIG_EPROTO); } - // https://github.com/Hamlib/Hamlib/issues/1575 - // these types of async can interrupt the cmd we sent - // if our host number changes must not be for us - if (sendbuf[3] != buf[2]) - { - hl_usleep(100); - rig_flush(rp); - goto collision_retry; - } - if (icom_is_async_frame(rig, frm_len, buf)) { icom_process_async_frame(rig, frm_len, buf); @@ -332,6 +322,17 @@ again2: priv->serial_USB_echo_off = 0; goto again2; } + // https://github.com/Hamlib/Hamlib/issues/1575 + // these types of async can interrupt the cmd we sent + // if our host number changes must not be for us + if (sendbuf[3] != buf[2]) + { + rig_debug(RIG_DEBUG_VERBOSE, "%s: unknown async? read again\n", __func__); + hl_usleep(100); + rig_flush(rp); + goto collision_retry; + } + if (icom_is_async_frame(rig, frm_len, buf)) { commit 48862ece543bd5e5654b0c6b64c83f8aa9db55d1 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Aug 1 16:49:38 2024 -0500 Add comment for Barrett 4100 -- not ready for prime time diff --git a/rigs/barrett/4100.c b/rigs/barrett/4100.c index 8b8d1db04..99004f6ac 100644 --- a/rigs/barrett/4100.c +++ b/rigs/barrett/4100.c @@ -244,7 +244,7 @@ struct rig_caps barrett4100_caps = .mfg_name = "Rhode&Schwarz", .version = BACKEND_VER ".1", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_BETA, // do no promote until somebody confirms it works ok -- nobody to test it .rig_type = RIG_TYPE_TRANSCEIVER, .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, .ptt_type = RIG_PTT_RIG, commit ff71f202c9ad77f6f8cb2fb61061879ded4220d6 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Aug 1 11:59:15 2024 -0500 Another attempt to fix IC7100 behavior when amplifier is sending requests Seems the IC7100 cannot separate the CI-V port from the USB CI-V like other Icom rigs diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index c544442ba..0498af506 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -208,7 +208,8 @@ again1: // https://github.com/Hamlib/Hamlib/issues/1575 // these types of async can interrupt the cmd we sent - if (sendbuf[3] != buf[2] && buf[4] == 0x03) + // if our host number changes must not be for us + if (sendbuf[3] != buf[2]) { hl_usleep(100); rig_flush(rp); diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index c36744ec0..90e50d8d3 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20240731" +#define BACKEND_VER "20240801" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit 725542775b0df57d1fd067cdec5764528baf8c8f Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Jul 31 11:49:59 2024 -0500 Hopefully fix IC-7100 0xe1 packet async problem diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 69ee33ba7..c544442ba 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -206,6 +206,15 @@ again1: RETURNFUNC(-RIG_EPROTO); } + // https://github.com/Hamlib/Hamlib/issues/1575 + // these types of async can interrupt the cmd we sent + if (sendbuf[3] != buf[2] && buf[4] == 0x03) + { + hl_usleep(100); + rig_flush(rp); + goto collision_retry; + } + if (icom_is_async_frame(rig, frm_len, buf)) { icom_process_async_frame(rig, frm_len, buf); commit 47d1dbb0306385add4bfb4641fe62ff4a7a27bd5 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Jul 31 11:48:21 2024 -0500 Remove 0xe1 check for async -- not that simple and now ignored when wrong response in frame.c diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 5bc76736d..4d90e3604 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -8971,7 +8971,7 @@ int icom_is_async_frame(RIG *rig, size_t frame_length, /* Spectrum scope data is not CI-V transceive data, but handled the same way as it is pushed by the rig */ // IC-7100 sends 0xe1 for broadcast frame? - return frame[2] == 0xe1 || frame[2] == BCASTID || (frame[2] == CTRLID && frame[4] == C_CTL_SCP + return frame[2] == BCASTID || (frame[2] == CTRLID && frame[4] == C_CTL_SCP && frame[5] == S_SCP_DAT); } diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index a0477319a..c36744ec0 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20240726" +#define BACKEND_VER "20240731" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit 0fdfacafa3a5021353aa82c926138d114497ce6f Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jul 30 11:11:54 2024 -0500 Fix PT8000A ptt and bandwidth diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 62450fd92..3c1637c31 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -378,7 +378,6 @@ transaction_write: skip |= strncmp(cmdstr, "PS1", 3) == 0; skip |= strncmp(cmdstr, "PS0", 3) == 0; skip |= strncmp(cmdstr, "K22", 3) == 0; - skip |= (rig->caps->rig_model == RIG_MODEL_PT8000A); // Skip Hilberling command check if (skip) { diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index 7c9ec248d..d6a49cab5 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -1897,6 +1897,7 @@ struct rig_caps pt8000a_caps = }, /* mode/filter list, remember: order matters! */ .filters = { + {RIG_MODE_SSB, kHz(6.0)}, {RIG_MODE_SSB, kHz(1.0)}, {RIG_MODE_SSB, kHz(1.2)}, {RIG_MODE_SSB, kHz(1.4)}, @@ -1920,7 +1921,6 @@ struct rig_caps pt8000a_caps = {RIG_MODE_SSB, kHz(3.4)}, {RIG_MODE_SSB, kHz(3.5)}, {RIG_MODE_SSB, kHz(4.6)}, - {RIG_MODE_SSB, kHz(6.0)}, {RIG_MODE_CW, Hz(50)}, {RIG_MODE_CW, Hz(100)}, {RIG_MODE_CW, Hz(200)}, @@ -1987,8 +1987,8 @@ struct rig_caps pt8000a_caps = .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, +// .set_powerstat = kenwood_set_powerstat, +// .get_powerstat = kenwood_get_powerstat, .get_info = kenwood_ts480_get_info, .reset = kenwood_reset, .set_ant = kenwood_set_ant, commit 9ace7dbe5c1bfb0ffeb1399db116f7f4c9eda2a5 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jul 30 10:03:16 2024 -0500 Don't do any ID checks on Hilberling PT8000A diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 22730dcad..62450fd92 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -378,7 +378,7 @@ transaction_write: skip |= strncmp(cmdstr, "PS1", 3) == 0; skip |= strncmp(cmdstr, "PS0", 3) == 0; skip |= strncmp(cmdstr, "K22", 3) == 0; - skip |= (rig->caps->rig_model == RIG_MODEL_PT8000A && (strncmp(cmdstr, "TQ", 2) == 0)); // Skip Hilberling TQn command check + skip |= (rig->caps->rig_model == RIG_MODEL_PT8000A); // Skip Hilberling command check if (skip) { @@ -5161,6 +5161,7 @@ int kenwood_set_trn(RIG *rig, int trn) case RIG_MODEL_POWERSDR: // powersdr doesn't have AI command case RIG_MODEL_THETIS: // powersdr doesn't have AI command + case RIG_MODEL_PT8000A: // powersdr doesn't have AI command RETURNFUNC(-RIG_ENAVAIL); case RIG_MODEL_TS990S: diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 4f9078639..390c5b00e 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "idx_builtin.h" -#define BACKEND_VER "20240712" +#define BACKEND_VER "20240730" #define EOM_KEN ';' #define EOM_TH '\r' commit 6679746c62b398f5ffb488c0d480461836a079f6 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jul 30 09:46:37 2024 -0500 Remove KEYSPD from Hilberling PT8000A diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index 2f9bc21c5..7c9ec248d 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -44,10 +44,16 @@ #define TS480_LEVEL_GET (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_MICGAIN|RIG_LEVEL_STRENGTH|RIG_LEVEL_KEYSPD|RIG_LEVEL_CWPITCH| \ RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_NR|RIG_LEVEL_PREAMP|RIG_LEVEL_COMP|RIG_LEVEL_ATT|RIG_LEVEL_VOXDELAY|RIG_LEVEL_VOXGAIN|RIG_LEVEL_BKIN_DLYMS| \ RIG_LEVEL_SWR|RIG_LEVEL_COMP_METER|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW) +#define PT8000A_LEVEL_GET (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_MICGAIN|RIG_LEVEL_STRENGTH|RIG_LEVEL_CWPITCH| \ + RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_NR|RIG_LEVEL_PREAMP|RIG_LEVEL_COMP|RIG_LEVEL_ATT|RIG_LEVEL_VOXDELAY|RIG_LEVEL_VOXGAIN|RIG_LEVEL_BKIN_DLYMS| \ + RIG_LEVEL_SWR|RIG_LEVEL_COMP_METER|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW) #define TS480_LEVEL_SET (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_CWPITCH| \ RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_NR|RIG_LEVEL_PREAMP|RIG_LEVEL_COMP|RIG_LEVEL_ATT|RIG_LEVEL_VOXDELAY|RIG_LEVEL_VOXGAIN|RIG_LEVEL_BKIN_DLYMS| \ RIG_LEVEL_METER|RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW) +#define PT8000A_LEVEL_SET (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_MICGAIN|RIG_LEVEL_CWPITCH| \ + RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_NR|RIG_LEVEL_PREAMP|RIG_LEVEL_COMP|RIG_LEVEL_ATT|RIG_LEVEL_VOXDELAY|RIG_LEVEL_VOXGAIN|RIG_LEVEL_BKIN_DLYMS| \ + RIG_LEVEL_METER|RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW) #define TS480_FUNC_ALL (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_NR|RIG_FUNC_NR|RIG_FUNC_BC|RIG_FUNC_BC2|RIG_FUNC_RIT|RIG_FUNC_XIT| \ RIG_FUNC_TUNER|RIG_FUNC_MON|RIG_FUNC_FBKIN|RIG_FUNC_LOCK) @@ -1830,7 +1836,7 @@ struct rig_caps qrplabs_caps = }; /* - * Hilberling PS8000A TS480 emulation + * Hilberling PT8000A TS480 emulation * Notice that some rigs share the same functions. */ struct rig_caps pt8000a_caps = @@ -1838,7 +1844,7 @@ struct rig_caps pt8000a_caps = RIG_MODEL(RIG_MODEL_PT8000A), .model_name = "PT-8000A", .mfg_name = "Hilberling", - .version = BACKEND_VER ".3", + .version = BACKEND_VER ".2", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1988,8 +1994,8 @@ struct rig_caps pt8000a_caps = .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_SET, - .has_get_level = TS480_LEVEL_GET, + .has_set_level = PT8000A_LEVEL_SET, + .has_get_level = PT8000A_LEVEL_GET, .set_level = kenwood_ts480_set_level, .get_level = kenwood_ts480_get_level, .has_get_func = TS480_FUNC_ALL, commit fd153e26f4104b4df7d9c1460b54a310cb74aebd Merge: 2b10a3078 1a37c569f Author: Michael Black <mdb...@ya...> Date: Mon Jul 29 11:20:21 2024 -0500 Merge pull request #1590 from chrbayer84/upstream-817 FT-817 power/SWR levels commit 1a37c569fa95f877909ded91cf9d7ff5c4d5aeb5 Merge: 748be3707 2b10a3078 Author: chrbayer84 <chr...@gm...> Date: Mon Jul 29 11:57:27 2024 -0400 Merge branch 'master' into upstream-817 diff --cc rigs/yaesu/ft817.c index 2234d42a7,590af3d48..a2ba846f3 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@@ -1200,8 -1194,8 +1200,9 @@@ static int ft817_get_ptt(RIG *rig, vfo_ } } - *ptt = ((p->tx_status & 0x20) == 0x20); + *ptt = p->tx_status != 0xff; + + return RIG_OK; } @@@ -1234,8 -1228,9 +1235,9 @@@ static int ft817_get_tx_level(RIG *rig if (ptt == RIG_PTT_OFF) { - val->f = p->swr; - val->f = p->swr; - //rig_debug(RIG_DEBUG_VERBOSE, "%s: rig not keyed\n", __func__); - return RIG_OK; // use known prior value ++ ++ val->f = p->swr; + return RIG_OK; } n = ft817_get_status(rig, FT817_NATIVE_CAT_GET_TX_METERING); @@@ -1246,7 -1241,8 +1248,8 @@@ } } - val->f = rig_raw2val_float(*tx_level, cal); - p->swr = val->f; + p->swr = val->f = rig_raw2val_float(*tx_level, cal); ++ rig_debug(RIG_DEBUG_VERBOSE, "%s: level %f\n", __func__, val->f); return RIG_OK; commit 748be3707ff353b25585b12a780a5253f9f2a8de Author: Christian Bayer <chr...@go...> Date: Mon Jul 29 17:54:50 2024 +0200 FT-817 power and SWR levels diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index 499e2c019..2234d42a7 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -128,6 +128,7 @@ struct ft817_priv_data /* Digi mode is not part of regular fm_status response. * So keep track of it in a separate variable. */ unsigned char dig_mode; + float swr; }; static int ft817_init(RIG *rig); @@ -261,15 +262,15 @@ enum ft817_digi // Thanks to Olivier Schmitt sc....@gm... for these tables #define FT817_PWR_CAL { 9, \ { \ - { 0x00, 0 }, \ - { 0x01, 10 }, \ - { 0x02, 14 }, \ - { 0x03, 20 }, \ - { 0x04, 34 }, \ - { 0x05, 50 }, \ - { 0x06, 66 }, \ - { 0x07, 82 }, \ - { 0x08, 100 } \ + { 0x00, 0.0f }, \ + { 0x01, 0.5f }, \ + { 0x02, 0.75f }, \ + { 0x03, 1.0f }, \ + { 0x04, 1.7f }, \ + { 0x05, 2.5f }, \ + { 0x06, 3.3f }, \ + { 0x07, 4.1f }, \ + { 0x08, 5.0f } \ } } #define FT817_ALC_CAL { 6, \ @@ -330,7 +331,7 @@ struct rig_caps ft817_caps = .has_set_func = RIG_FUNC_LOCK | RIG_FUNC_TONE | RIG_FUNC_TSQL | RIG_FUNC_CSQL | RIG_FUNC_RIT, .has_get_level = RIG_LEVEL_STRENGTH | RIG_LEVEL_RAWSTR | RIG_LEVEL_RFPOWER | - RIG_LEVEL_ALC | RIG_LEVEL_SWR, + RIG_LEVEL_ALC | RIG_LEVEL_SWR | RIG_LEVEL_RFPOWER_METER_WATTS, .has_set_level = RIG_LEVEL_BAND_SELECT, .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, @@ -765,6 +766,7 @@ struct rig_caps ft818_caps = static int ft817_init(RIG *rig) { + struct ft817_priv_data *p; rig_debug(RIG_DEBUG_VERBOSE, "%s: called, version %s\n", __func__, rig->caps->version); @@ -772,6 +774,9 @@ static int ft817_init(RIG *rig) { return -RIG_ENOMEM; } + p = (struct ft817_priv_data *) STATE(rig)->priv; + + p->swr = 10; return RIG_OK; } @@ -979,9 +984,9 @@ static int ft817_get_status(RIG *rig, int status) /* FT-817 returns 2 bytes with 4 nibbles. * Extract raw values here; * convert to float when they are requested. */ - p->swr_level = result[0] & 0xF; - p->pwr_level = result[0] >> 4; - p->alc_level = result[1] & 0xF; + p->swr_level = (result[1] & 0xF0) >> 4; + p->pwr_level = (result[0] & 0xF0) >> 4; + p->alc_level = result[0] & 0x0F; p->mod_level = result[1] >> 4; rig_debug(RIG_DEBUG_TRACE, "%s: swr: %d, pwr %d, alc %d, mod %d\n", __func__, @@ -1168,10 +1173,12 @@ static int ft817_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, } *split = (c[0] & 0x80) ? RIG_SPLIT_ON : RIG_SPLIT_OFF; + *tx_vfo = RIG_VFO_A; } else { *split = (p->tx_status & 0x20) ? RIG_SPLIT_ON : RIG_SPLIT_OFF; + *tx_vfo = RIG_VFO_B; } return RIG_OK; @@ -1193,7 +1200,7 @@ static int ft817_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) } } - *ptt = ((p->tx_status & 0x20) == 0x20); + *ptt = p->tx_status != 0xff; return RIG_OK; } @@ -1227,8 +1234,8 @@ static int ft817_get_tx_level(RIG *rig, value_t *val, unsigned char *tx_level, if (ptt == RIG_PTT_OFF) { - rig_debug(RIG_DEBUG_VERBOSE, "%s: rig not keyed\n", __func__); - return -RIG_ERJCTED; //Or return OK? + val->f = p->swr; + return RIG_OK; } n = ft817_get_status(rig, FT817_NATIVE_CAT_GET_TX_METERING); @@ -1239,7 +1246,7 @@ static int ft817_get_tx_level(RIG *rig, value_t *val, unsigned char *tx_level, } } - val->f = rig_raw2val_float(*tx_level, cal); + p->swr = val->f = rig_raw2val_float(*tx_level, cal); rig_debug(RIG_DEBUG_VERBOSE, "%s: level %f\n", __func__, val->f); return RIG_OK; @@ -1333,6 +1340,10 @@ static int ft817_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_SWR: return ft817_get_tx_level(rig, val, &p->swr_level, &rig->caps->swr_cal); + case RIG_LEVEL_RFPOWER_METER_WATTS: + return ft817_get_tx_level(rig, val, &p->pwr_level, + &rig->caps->rfpower_meter_cal); + default: return -RIG_EINVAL; } commit 2b10a3078e98682a0eeb689f8761bbf037f5f498 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jul 28 17:30:37 2024 -0500 Allow FT817 to return prior SWR value when not in transmit diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index 802f5672b..590af3d48 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -128,6 +128,7 @@ struct ft817_priv_data /* Digi mode is not part of regular fm_status response. * So keep track of it in a separate variable. */ unsigned char dig_mode; + float swr; }; static int ft817_init(RIG *rig); @@ -309,7 +310,7 @@ struct rig_caps ft817_caps = RIG_MODEL(RIG_MODEL_FT817), .model_name = "FT-817", .mfg_name = "Yaesu", - .version = "20240728.2", + .version = "20240728.3", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1227,8 +1228,9 @@ static int ft817_get_tx_level(RIG *rig, value_t *val, unsigned char *tx_level, if (ptt == RIG_PTT_OFF) { - rig_debug(RIG_DEBUG_VERBOSE, "%s: rig not keyed\n", __func__); - return -RIG_ERJCTED; //Or return OK? + val->f = p->swr; + //rig_debug(RIG_DEBUG_VERBOSE, "%s: rig not keyed\n", __func__); + return RIG_OK; // use known prior value } n = ft817_get_status(rig, FT817_NATIVE_CAT_GET_TX_METERING); @@ -1240,6 +1242,7 @@ static int ft817_get_tx_level(RIG *rig, value_t *val, unsigned char *tx_level, } val->f = rig_raw2val_float(*tx_level, cal); + p->swr = val->f; rig_debug(RIG_DEBUG_VERBOSE, "%s: level %f\n", __func__, val->f); return RIG_OK; commit 2668605fbd0968dce8126bcbd5357eade65fb9a9 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jul 28 16:58:48 2024 -0500 Fix boo-boo on ft817.c diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index 744107b10..802f5672b 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -261,7 +261,7 @@ enum ft817_digi // Thanks to Olivier Schmitt sc....@gm... for these tables #define FT817_PWR_CAL { 9, \ { \ - { 0x00, 0.ss }, \ + { 0x00, 0.0f }, \ { 0x01, 0.5f }, \ { 0x02, 0.75f }, \ { 0x03, 1.0f }, \ commit ae39040fb12d2366a4c2dca33c5361e271d9a250 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jul 28 16:56:15 2024 -0500 Adjust PWR table for FT817 diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index 42bc48ca9..744107b10 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -261,15 +261,15 @@ enum ft817_digi // Thanks to Olivier Schmitt sc....@gm... for these tables #define FT817_PWR_CAL { 9, \ { \ - { 0x00, 0 }, \ - { 0x01, 10 }, \ - { 0x02, 14 }, \ - { 0x03, 20 }, \ - { 0x04, 34 }, \ - { 0x05, 50 }, \ - { 0x06, 66 }, \ - { 0x07, 82 }, \ - { 0x08, 100 } \ + { 0x00, 0.ss }, \ + { 0x01, 0.5f }, \ + { 0x02, 0.75f }, \ + { 0x03, 1.0f }, \ + { 0x04, 1.7f }, \ + { 0x05, 2.5f }, \ + { 0x06, 3.3f }, \ + { 0x07, 4.1f }, \ + { 0x08, 5.0f } \ } } #define FT817_ALC_CAL { 6, \ @@ -283,7 +283,7 @@ enum ft817_digi } } // SWR values from Christian WA4YA, DL4YA -#define FT817_SWR_CAL { 2, \ +#define FT817_SWR_CAL { 16, \ { \ { 0, 1.0f }, \ { 1, 1.4f }, \ @@ -309,7 +309,7 @@ struct rig_caps ft817_caps = RIG_MODEL(RIG_MODEL_FT817), .model_name = "FT-817", .mfg_name = "Yaesu", - .version = "20240728.0", + .version = "20240728.2", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1193,7 +1193,7 @@ static int ft817_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) } } - *ptt = ((p->tx_status & 0x80) == 0); + *ptt = ((p->tx_status & 0x20) == 0x20); return RIG_OK; } commit 6db44d6d497d6e1399fde1daaf65d1fcf36f11e3 Author: Christian Bayer <chr...@sa...> Date: Sun Jul 28 20:00:35 2024 +0200 upstream 817 diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index 0b0066b42..499e2c019 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -282,10 +282,25 @@ enum ft817_digi { 0x05, 100 } \ } } -#define FT817_SWR_CAL { 2, \ +// SWR values from Christian WA4YA, DL4YA +#define FT817_SWR_CAL { 16, \ { \ - { 0, 0 }, \ - { 15, 100 } \ + { 0, 1.0f }, \ + { 1, 1.4f }, \ + { 2, 1.8f }, \ + { 3, 2.13f }, \ + { 4, 2.25f }, \ + { 5, 3.7f }, \ + { 6, 6.0f }, \ + { 7, 7.0f }, \ + { 8, 8.0f }, \ + { 9, 9.0f }, \ + { 10, 10.0f }, \ + { 11, 10.0f }, \ + { 12, 10.0f }, \ + { 13, 10.0f }, \ + { 14, 10.0f }, \ + { 15, 10.0f } \ } } @@ -294,7 +309,7 @@ struct rig_caps ft817_caps = RIG_MODEL(RIG_MODEL_FT817), .model_name = "FT-817", .mfg_name = "Yaesu", - .version = "20240520.0", + .version = "20240728.1", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1178,7 +1193,7 @@ static int ft817_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) } } - *ptt = ((p->tx_status & 0x80) == 0); + *ptt = ((p->tx_status & 0x20) == 0x20); return RIG_OK; } commit 5ec0b8464572ee7290fe65d11b95e60bb5b76cd3 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jul 28 06:57:54 2024 -0500 Update SWR values for FT817 thanks to Christian WA4YA, DL4YA diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index 0b0066b42..42bc48ca9 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -282,10 +282,25 @@ enum ft817_digi { 0x05, 100 } \ } } +// SWR values from Christian WA4YA, DL4YA #define FT817_SWR_CAL { 2, \ { \ - { 0, 0 }, \ - { 15, 100 } \ + { 0, 1.0f }, \ + { 1, 1.4f }, \ + { 2, 1.8f }, \ + { 3, 2.13f }, \ + { 4, 2.25f }, \ + { 5, 3.7f }, \ + { 6, 6.0f }, \ + { 7, 7.0f }, \ + { 8, 8.0f }, \ + { 9, 9.0f }, \ + { 10, 10.0f }, \ + { 11, 10.0f }, \ + { 12, 10.0f }, \ + { 13, 10.0f }, \ + { 14, 10.0f }, \ + { 15, 10.0f } \ } } @@ -294,7 +309,7 @@ struct rig_caps ft817_caps = RIG_MODEL(RIG_MODEL_FT817), .model_name = "FT-817", .mfg_name = "Yaesu", - .version = "20240520.0", + .version = "20240728.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 647b477dc95d3d688e352a125e77993c1f46d652 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jul 26 15:48:44 2024 -0500 Fix x26cmdfails in icom.c diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 44b90e225..5bc76736d 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2256,7 +2256,7 @@ static int icom_get_mode_x26(RIG *rig, vfo_t vfo, int *mode_len, const struct icom_priv_caps *priv_caps = rig->caps->priv; int retval; - if (priv->x26cmdfails != 0 && priv_caps->x25x26_always==0) + if (priv->x26cmdfails > 0 && priv_caps->x25x26_always==0) { rig_debug(RIG_DEBUG_WARN, "%s: x26cmdfails=%d, x25x26_always=%d\n", __func__, priv->x26cmdfails, priv_caps->x25x26_always); return -RIG_ENAVAIL; diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 370e4c19b..a0477319a 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20240725" +#define BACKEND_VER "20240726" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit 3f59e962e1060e517a10f25310cecff2ccca53d9 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jul 26 07:35:19 2024 -0500 Update simic7100 diff --git a/simulators/simic7100.c b/simulators/simic7100.c index afeae7de2..213940684 100644 --- a/simulators/simic7100.c +++ b/simulators/simic7100.c @@ -25,6 +25,7 @@ struct ip_mreq #include <termios.h> #include <unistd.h> +#undef ECHO #define BUFSIZE 256 #define X25 @@ -61,7 +62,7 @@ void dumphex(const unsigned char *buf, int n) int frameGet(int fd, unsigned char *buf) { - int i = 0, n; + int i = 0; memset(buf, 0, BUFSIZE); unsigned char c; @@ -77,10 +78,10 @@ again: char mytime[256]; date_strget(mytime, sizeof(mytime), 1); printf("%s:", mytime); dumphex(buf, i); +#ifdef ECHO // echo n = write(fd, buf, i); - - if (n != i) { printf("%s: error on write: %s\n", __func__, strerror(errno)); } +#endif return i; } @@ -146,6 +147,13 @@ void frameParse(int fd, unsigned char *frame, int len) if (powerstat) { + unsigned char frame2[11]; + memcpy(frame2,frame,11); + frame2[2] = 0xe1; + frame2[3] = 0x88; + dump_hex(frame2,11); + n = write(fd, frame2, 11); + dump_hex(frame,11); n = write(fd, frame, 11); } @@ -223,8 +231,9 @@ void frameParse(int fd, unsigned char *frame, int len) if (frame[5] == 0xfd) { printf("get split %d\n", 1); - frame[7] = 0xfd; - n = write(fd, frame, 8); + frame[5] = split; + frame[6] = 0xfd; + n = write(fd, frame, 7); } else { commit b718788c9ab46a7b370b74ef77436c9741f8b09b Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Jul 25 12:08:23 2024 -0500 Echo detection is now dynamic so can be changed while running Async packet is now handled correctly...may be tied to the ANT CI-V port https://github.com/Hamlib/Hamlib/issues/1575 https://github.com/Hamlib/Hamlib/issues/1587 https://github.com/Hamlib/Hamlib/issues/1588 diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 30cfdd225..69ee33ba7 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -306,6 +306,7 @@ read_another_frame: * FIXME: handle padding/collisions * ACKFRMLEN is the smallest frame we can expect from the rig */ + priv->serial_USB_echo_off = 1; again2: buf[0] = 0; frm_len = read_icom_frame(rp, buf, sizeof(buf)); diff --git a/rigs/icom/ic7100.c b/rigs/icom/ic7100.c index a7ff0288e..4c2cd7325 100644 --- a/rigs/icom/ic7100.c +++ b/rigs/icom/ic7100.c @@ -201,8 +201,8 @@ static const struct icom_priv_caps ic7100_priv_caps = .extcmds = ic7100_extcmds, .antack_len = 2, .ant_count = 2, - .x25x26_always = 1, - .x25x26_possibly = 0, + .x25x26_always = 0, + .x25x26_possibly = 1, .x1cx03_always = 0, .x1cx03_possibly = 1, .x1ax03_supported = 1, @@ -327,7 +327,7 @@ struct rig_caps ic7100_caps = RIG_MODEL(RIG_MODEL_IC7100), .model_name = "IC-7100", .mfg_name = "Icom", - .version = BACKEND_VER ".7", + .version = BACKEND_VER ".8", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 65f1cfa47..44b90e225 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1152,7 +1152,7 @@ retry_open: rig_debug(RIG_DEBUG_TRACE, "%s: echo status known, getting frequency\n", __func__); rp->retry = 0; - rs->current_vfo = icom_current_vfo(rig); +// rs->current_vfo = icom_current_vfo(rig); // some rigs like the IC7100 still echo when in standby // so asking for freq now should timeout if such a rig freq_t tfreq; @@ -1228,7 +1228,7 @@ retry_open: rig_get_func(rig, RIG_VFO_CURR, RIG_FUNC_SATMODE, &satmode); } - rs->current_vfo = icom_current_vfo(rig); + //rs->current_vfo = icom_current_vfo(rig); } #if 0 // do not do this here -- needs to be done when ranges are requested instead as this is very slow @@ -8995,6 +8995,7 @@ int icom_process_async_frame(RIG *rig, size_t frame_length, */ switch (frame[4]) { + case C_RD_FREQ: case C_SND_FREQ: { // TODO: The freq length might be less than 4 or 5 bytes on older rigs! diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 2933748b4..370e4c19b 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20240717" +#define BACKEND_VER "20240725" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit 75783cb1255d184c13f13464322ce6ba3c234a4e Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Jul 23 09:34:09 2024 -0500 Revert "Try to fix IC-7100 remote operation echo oddity" Seems to break things severely This reverts commit ed33a235f4acd515bc415556343b599698958387. diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index ff9ccf348..30cfdd225 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -221,10 +221,6 @@ again1: rig_debug(RIG_DEBUG_VERBOSE, "%s: subcmd x%02d != buf x%02x so retry read\n", __func__, subcmd, buf[5]); goto again1; } - if (sendbuf[3] != buf[2]) { // then the reply controller addr is not the same so skip it - rig_debug(RIG_DEBUG_VERBOSE, "%s: subcmd x%02d != buf x%02x so retry read\n", __func__, subcmd, buf[5]); - goto again1; - } // we might have 0xfe string during rig wakeup rig_debug(RIG_DEBUG_TRACE, "%s: DEBUG retval=%d, frm_len=%d, cmd=0x%02x\n", diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index d0cf8779c..65f1cfa47 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -8970,7 +8970,8 @@ int icom_is_async_frame(RIG *rig, size_t frame_length, } /* Spectrum scope data is not CI-V transceive data, but handled the same way as it is pushed by the rig */ - return frame[2] == BCASTID || (frame[2] == CTRLID && frame[4] == C_CTL_SCP + // IC-7100 sends 0xe1 for broadcast frame? + return frame[2] == 0xe1 || frame[2] == BCASTID || (frame[2] == CTRLID && frame[4] == C_CTL_SCP && frame[5] == S_SCP_DAT); } diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 2d64d643d..2933748b4 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20240722" +#define BACKEND_VER "20240717" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit ed33a235f4acd515bc415556343b599698958387 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jul 22 16:57:14 2024 -0500 Try to fix IC-7100 remote operation echo oddity https://github.com/Hamlib/Hamlib/issues/1575 diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 30cfdd225..ff9ccf348 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -221,6 +221,10 @@ again1: rig_debug(RIG_DEBUG_VERBOSE, "%s: subcmd x%02d != buf x%02x so retry read\n", __func__, subcmd, buf[5]); goto again1; } + if (sendbuf[3] != buf[2]) { // then the reply controller addr is not the same so skip it + rig_debug(RIG_DEBUG_VERBOSE, "%s: subcmd x%02d != buf x%02x so retry read\n", __func__, subcmd, buf[5]); + goto again1; + } // we might have 0xfe string during rig wakeup rig_debug(RIG_DEBUG_TRACE, "%s: DEBUG retval=%d, frm_len=%d, cmd=0x%02x\n", diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 65f1cfa47..d0cf8779c 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -8970,8 +8970,7 @@ int icom_is_async_frame(RIG *rig, size_t frame_length, } /* Spectrum scope data is not CI-V transceive data, but handled the same way as it is pushed by the rig */ - // IC-7100 sends 0xe1 for broadcast frame? - return frame[2] == 0xe1 || frame[2] == BCASTID || (frame[2] == CTRLID && frame[4] == C_CTL_SCP + return frame[2] == BCASTID || (frame[2] == CTRLID && frame[4] == C_CTL_SCP && frame[5] == S_SCP_DAT); } diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 2933748b4..2d64d643d 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20240717" +#define BACKEND_VER "20240722" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit db74acc725aa86d9a153d012cf4fa2dec82e1037 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jul 21 22:22:12 2024 -0500 Try to fix Hilberling PTT again diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index 34f04631a..2f9bc21c5 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -1838,7 +1838,7 @@ struct rig_caps pt8000a_caps = RIG_MODEL(RIG_MODEL_PT8000A), .model_name = "PT-8000A", .mfg_name = "Hilberling", - .version = BACKEND_VER ".2", + .version = BACKEND_VER ".3", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1979,7 +1979,7 @@ struct rig_caps pt8000a_caps = .set_split_vfo = kenwood_set_split_vfo, .get_split_vfo = kenwood_get_split_vfo_if, .get_ptt = kenwood_get_ptt, - .set_ptt = qdx_set_ptt, + .set_ptt = kenwood_set_ptt, .get_dcd = kenwood_get_dcd, .set_powerstat = kenwood_set_powerstat, .get_powerstat = kenwood_get_powerstat, commit 673d031d5e6819ab7169ead9947e24b1a9b87476 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jul 21 17:38:40 2024 -0500 Fix Hilbering TQ and AI commands diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 80216f4d1..22730dcad 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -378,7 +378,7 @@ transaction_write: skip |= strncmp(cmdstr, "PS1", 3) == 0; skip |= strncmp(cmdstr, "PS0", 3) == 0; skip |= strncmp(cmdstr, "K22", 3) == 0; - skip |= (rig->caps->rig_model == RIG_MODEL_PT8000A && (strlen(cmdstr) > 3) && (strncmp(cmdstr, "TQ", 2) == 0)); // Skip Hilberling TQn command check + skip |= (rig->caps->rig_model == RIG_MODEL_PT8000A && (strncmp(cmdstr, "TQ", 2) == 0)); // Skip Hilberling TQn command check if (skip) { @@ -1083,7 +1083,10 @@ int kenwood_open(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s: found the right driver for %s(%u)\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 */ + if (rig->caps->rig_model != RIG_MODEL_PT8000A) // doesn't know AI command + { + kenwood_get_trn(rig, &priv->trn_state); /* ignore errors */ + } /* Currently we cannot cope with AI mode so turn it off in case last client left it on */ diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index ac204d24b..4f9078639 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "idx_builtin.h" -#define BACKEND_VER "20240713" +#define BACKEND_VER "20240712" #define EOM_KEN ';' #define EOM_TH '\r' commit 979d2adccf7e7f76821d8c760808341b29f0fd2f Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jul 19 23:10:10 2024 -0500 On EBUSY write we'll do 2 retries with 200ms wait diff --git a/src/rig.c b/src/rig.c index d61f46831..4725e83fc 100644 --- a/src/rig.c +++ b/src/rig.c @@ -8601,6 +8601,8 @@ void *async_data_handler(void *arg) } else { + static int busy_retry=2; +again: result = write_block_sync(RIGPORT(rig), frame, frame_length); if (result < 0) @@ -8608,6 +8610,10 @@ void *async_data_handler(void *arg) // TODO: error handling? can writing to a pipe really fail in ways we can recover from? rig_debug(RIG_DEBUG_ERR, "%s: write_block_sync() failed, result=%d\n", __func__, result); + if (result == EBUSY && --busy_retry>0) { // we can try again + hl_usleep(200*1000); + goto again; + } continue; } } commit abd6d4f388cb7c236f14025e670e85d124f04655 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jul 19 22:39:12 2024 -0500 Avoid possible segfault diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 6361380f3..38efffaae 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -5628,19 +5628,19 @@ declare_proto_rig(set_clock) &hour, &min, &sec, &msec, &utc_offset); } - else if (arg1[16] == '+' || arg1[16] == '-') + else if (arg1 && (arg1[16] == '+' || arg1[16] == '-')) { // YYYY-MM-DDTHH:MM+ZZ n = sscanf(arg1, "%04d-%02d-%02dT%02d:%02d%d", &year, &mon, &day, &hour, &min, &utc_offset); } - else if (arg1[19] == '+' || arg1[19] == '-') + else if (arg1 && (arg1[19] == '+' || arg1[19] == '-')) { // YYYY-MM-DDTHH:MM:SS+ZZ n = sscanf(arg1, "%04d-%02d-%02dT%02d:%02d:%02d%d", &year, &mon, &day, &hour, &min, &sec, &utc_offset); } - else if (arg1[23] == '+' || arg1[23] == '-') + else if (arg1 && (arg1[23] == '+' || arg1[23] == '-')) { // YYYY-MM-DDTHH:MM:SS.SSS+ZZ n = sscanf(arg1, "%04d-%02d-%02dT%02d:%02d:%02d%lf%d", &year, &mon, &day, &hour, commit 2e96b91b04eece8b9aeee304a0cbd09002044607 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Jul 17 22:43:35 2024 -0500 Add Xiegu X6200 diff --git a/NEWS b/NEWS index 45f3ae855..e847ac75a 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ Version 5.x -- future * Change FT1000MP Mark V model names to align with FT1000MP Version 4.6 + * Added Xeigu X6200 * Added Commradio CTX-10 * Added Guoehe PMR-171 * Added csntechnoligies.net S.A.T Satellite rotor control diff --git a/include/hamlib/riglist.h b/include/hamlib/riglist.h index 958ab1d1a..ad9114c78 100644 --- a/include/hamlib/riglist.h +++ b/include/hamlib/riglist.h @@ -296,6 +296,7 @@ #define RIG_MODEL_G90 RIG_MAKE_MODEL(RIG_ICOM, 88) /* Xiegu G90 */ #define RIG_MODEL_X5105 RIG_MAKE_MODEL(RIG_ICOM, 89) /* Xiegu X5105 -- G90 compatible */ #define RIG_MODEL_IC905 RIG_MAKE_MODEL(RIG_ICOM, 90) +#define RIG_MODEL_X6200 RIG_MAKE_MODEL(RIG_ICOM, 91) /* Xiegu X6200 */ /* * Optoelectronics (CI-V) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 1dfedee7d..65f1cfa47 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -9924,6 +9924,7 @@ DECLARE_INITRIG_BACKEND(icom) rig_register(&x6100_caps); rig_register(&g90_caps); rig_register(&x5105_caps); + rig_register(&x6200_caps); return (RIG_OK); } diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 575e8558c..2933748b4 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -517,6 +517,7 @@ extern struct rig_caps x108g_caps; extern struct rig_caps x6100_caps; extern struct rig_caps g90_caps; extern struct rig_caps x5105_caps; +extern struct rig_caps x6200_caps; extern struct rig_caps icr8600_caps; extern struct rig_caps icr30_caps; diff --git a/rigs/icom/xiegu.c b/rigs/icom/xiegu.c index 342250154..6b8301cc4 100644 --- a/rigs/icom/xiegu.c +++ b/rigs/icom/xiegu.c @@ -160,7 +160,7 @@ int xiegu_rig_open(RIG *rig) case 0x0090: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "G90S");break; case 0x0106: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "G106/G106C");break; case 0x6100: - case 0x00a4: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "X6100");break; + ... [truncated message content] |
From: n0nb <n0...@us...> - 2024-07-01 23:15:51
|
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 fee7007fb9031869ce38e09f3ce57745b1f32626 (commit) via 98f6c1aea66f0e7e1090edd69e72aa66ff5cb3ed (commit) via 85ab6944bd3a452c51aa42574811542b25572f66 (commit) via 3f909be270a4bffef980d48d2e55cd0869e22771 (commit) via dbd169a83f03fb837467546923f31ddb33767227 (commit) via 6aec79b78aeffee6e7f7d339dfc579ee1fc48cb8 (commit) via 8b0e35ff0ab6ef2037ee5b8bdbbb7fa11dc30f47 (commit) via 0790f4d72e4947a9ba5c7c4d8747f7eecb6d0cd9 (commit) via 6996a1222c021326ce34ff3ff760e4f4a1c5b4d8 (commit) via 23e350ad23d3773e80bad7a614d53ffd370fc30b (commit) via 8cdef7f4b1001640eef64a2b5fca22fb44b2527e (commit) via c502556fdb0c9cc0b11d08f490d7c7643b2f0455 (commit) via 096af1f592b369f314de84159f0aa39788afa456 (commit) via 06301679d32507f58b3f746c5614f31071947eff (commit) via cd135de590b2eb16ab06c64f69990de23427678e (commit) via 1d8d41128a788d2c63ff122b227077a335535c99 (commit) via 0fe15fa858d25c1f0b047bf93a20f2655456e182 (commit) via da4f9fbc3e650590d9154af6d51fd24ac5e1b2aa (commit) via 08c82ddbb5ea412be53edfa419eae76432b4d8b6 (commit) via 25da0396c93540293afc1dc400699f97fdc999c9 (commit) via 097f2bbeadca168805e9dbc97f28158169532c0d (commit) via 81db5ffa5896864a8da083839f62a331e769709e (commit) via a0be1bfb32ab92ab50a0e1f820e87c78b85e57ee (commit) via 0b9ff1518c7a439bb96bfbebad62442b88a1947e (commit) via 5f0fe34dad605d25277dfef11f5fc10d5246ebe5 (commit) via e09d1611b2b9d73cbd0d713170b54d47c4a15a1e (commit) via 142f22846c6ae2125c9befd6415e0c0e4d64ac7f (commit) via 108f52806e1957a2de6ac6933e38c58f81dfc6d1 (commit) via 0212db94eb34193e8c4927cd36a58264b2b414b4 (commit) via a462bc19ae1f28a86bd8386ab2dceb3690592493 (commit) via 697904c882d91c61cf571e3dafa56c0f2e376542 (commit) via d1520aa166369548d3a0cb46781644e0c2c717e4 (commit) via 81a8745fcaee0a9ffc296d49d4f710f94359cf38 (commit) via 86a7a0636c278c5dfdc86baeb9fdb291e559fdc4 (commit) via 341a205bd7e5765e64a2e5f35ed2264b2cf9e6e2 (commit) from 5fc4e0b5d0efc8d6f2eaa634046ce2940406b705 (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 fee7007fb9031869ce38e09f3ce57745b1f32626 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jun 30 16:25:58 2024 -0500 Add Android.mk file for commradio diff --git a/rigs/commradio/Android.mk b/rigs/commradio/Android.mk new file mode 100644 index 000000000..95bdd0861 --- /dev/null +++ b/rigs/commradio/Android.mk @@ -0,0 +1,12 @@ +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := commradio.c ctx10.c frame.c +LOCAL_MODULE := commradio + +LOCAL_CFLAGS := +LOCAL_C_INCLUDES := android include src +LOCAL_LDLIBS := -lhamlib -Lobj/local/$(TARGET_ARCH_ABI) + +include $(BUILD_STATIC_LIBRARY) commit 98f6c1aea66f0e7e1090edd69e72aa66ff5cb3ed Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jun 30 14:58:08 2024 -0500 Add Commradio CTX-10 diff --git a/NEWS b/NEWS index 5eeb45879..45f3ae855 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ Version 5.x -- future * Change FT1000MP Mark V model names to align with FT1000MP Version 4.6 + * Added Commradio CTX-10 * Added Guoehe PMR-171 * Added csntechnoligies.net S.A.T Satellite rotor control * Added PSTRotator control diff --git a/configure.ac b/configure.ac index cfcd2eb1f..c65e1ac4f 100644 --- a/configure.ac +++ b/configure.ac @@ -66,7 +66,7 @@ dnl added to AC_CONFIG_FILES near the end of this file. See README.developer 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/codan 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 rigs/gomspace rigs/mds rigs/anytone rigs/motorola" +RIG_BACKEND_LIST="rigs/adat rigs/alinco rigs/aor rigs/barrett rigs/codan 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 rigs/gomspace rigs/mds rigs/anytone rigs/motorola rigs/commradio" ROT_BACKEND_LIST="rotators/amsat rotators/apex rotators/ars rotators/celestron rotators/cnctrk rotators/grbltrk rotators/easycomm rotators/ether6 rotators/flir rotators/fodtrack rotators/gs232a rotators/heathkit rotators/m2 rotators/meade rotators/rotorez rotators/sartek rotators/saebrtrack rotators/spid rotators/ts7400 rotators/prosistel rotators/ioptron rotators/satel rotators/radant" # Amplifiers are all in the amplifiers directory AMP_BACKEND_LIST="amplifiers/elecraft amplifiers/gemini amplifiers/expert" @@ -904,6 +904,7 @@ rigs/alinco/Makefile rigs/aor/Makefile rigs/barrett/Makefile rigs/codan/Makefile +rigs/commradio/Makefile rigs/dorji/Makefile rigs/drake/Makefile rigs/dummy/Makefile diff --git a/include/hamlib/riglist.h b/include/hamlib/riglist.h index c4775fe3d..d09c51aed 100644 --- a/include/hamlib/riglist.h +++ b/include/hamlib/riglist.h @@ -688,6 +688,12 @@ #define RIG_BACKEND_MOTOROLA "Motorola" #define RIG_MODEL_MICOM2 RIG_MAKE_MODEL(RIG_MOTOROLA, 1) +/* + * Commradio / AeroStream Communications + */ +#define RIG_COMMRADIO 39 +#define RIG_BACKEND_COMMRADIO "commradio" +#define RIG_MODEL_CTX10 RIG_MAKE_MODEL(RIG_COMMRADIO, 1) //! @endcond diff --git a/rigs/commradio/Makefile.am b/rigs/commradio/Makefile.am new file mode 100644 index 000000000..85a2d7fe1 --- /dev/null +++ b/rigs/commradio/Makefile.am @@ -0,0 +1,6 @@ +COMMRADIOSRC = commradio.c commradio.h frame.c frame.h ctx10.c + +noinst_LTLIBRARIES = libhamlib-commradio.la +libhamlib_commradio_la_SOURCES = $(COMMRADIOSRC) + +EXTRA_DIST = Android.mk diff --git a/rigs/commradio/commradio.c b/rigs/commradio/commradio.c new file mode 100644 index 000000000..852aedc1b --- /dev/null +++ b/rigs/commradio/commradio.c @@ -0,0 +1,226 @@ +/* + * Hamlib CommRadio backend + * idk, copyright and GPL here + */ + +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +#include <hamlib/rig.h> +#include <register.h> +#include <serial.h> + +#include "misc.h" + +#include "commradio.h" +#include "frame.h" + + +/* + * As far as I can tell, the commands and their structure are the same for the + * CR-1a as they are for the CTX-10, but I don't have a CR1a to test with. + * I'm putting these functions here in case they are reusable. + */ + +int commradio_transaction(RIG *rig, const unsigned char *cmd, int cmd_len, + unsigned char *data, int *data_len) +{ + int ret = -RIG_EINTERNAL; + struct rig_state *rs; + + ENTERFUNC; + + rs = &rig->state; + rs->transaction_active = 1; + + /* + * Flush is needed until async mode is done. The CTX-10 sends frames every + * time the VFO changes. + */ + rig_flush(&rs->rigport); + + int frame_len; + unsigned char frame[3+2*(cmd_len+2)]; + size_t rx_len = CR_FRAMELENGTH; + unsigned char rx[rx_len]; + frame_len = frame_message(frame, cmd, cmd_len); + ret = write_block(&rs->rigport, frame, frame_len); + if (ret < RIG_OK) + { + goto transaction_quit; + } + + const char stopset[] = { CR_EOF }; + ret = read_string(&rs->rigport, rx, rx_len-1, stopset, 1, 0, 1); + if (ret < RIG_OK) + { + goto transaction_quit; + } + ret = unpack_frame(data, rx, ret); + if (ret < RIG_OK) + { + goto transaction_quit; + } + *data_len = ret; + //TODO: check for error response 0x11 + +transaction_quit: + rs->transaction_active = 0; + RETURNFUNC(ret); +} + + +int commradio_init(RIG *rig) +{ + ENTERFUNC; + // I can't think of anything that goes in here yet. + RETURNFUNC(RIG_OK); +} + +int commradio_cleanup(RIG *rig) +{ + ENTERFUNC; + // dealloc stuff if it gets added to _init + RETURNFUNC(RIG_OK); +} + +int commradio_rig_open(RIG *rig) +{ + ENTERFUNC; + // Possibly check if our serial port is configured right and we are not + // doing bad things to the GPIO lines + RETURNFUNC(RIG_OK); +} + +int commradio_rig_close(RIG *rig) +{ + ENTERFUNC; + // i don't really know + RETURNFUNC(RIG_OK); +} + +/* + * The CTX-10 sends VFO frequency updates when the knob is turned by the + * operator, so this is really a good case for async events. Unfortunately + * I can't find any good examples of how to do that, so instead just flush + * and send a request... + */ + +int commradio_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) +{ + const unsigned char cmd[] = {0x32}; // Get frequency request + unsigned char data[CR_FRAMELENGTH]; + int data_len; + int ret = -RIG_EINTERNAL; + + ENTERFUNC; + + ret = commradio_transaction(rig, cmd, 1, data, &data_len); + if(data_len == 5 && (data[0] == 0x33 || data[0] == 0x34)) + { + *freq = (data[1] << 24 | data[2] << 16 | data[3] << 8 | data[4]); + ret = RIG_OK; + } + else + { + rig_debug(RIG_DEBUG_ERR, "%s: Unexpected response to 0x32\n", __func__); + } + RETURNFUNC(ret); +} + + +int commradio_set_freq(RIG *rig, vfo_t vfo, freq_t freq) +{ + unsigned char data[CR_FRAMELENGTH]; + int data_len; + int ret = -RIG_EINTERNAL; + + ENTERFUNC; + + if(freq < 150000 || freq > 30000000) + { + RETURNFUNC(-RIG_EINVAL); + } + uint32_t int_freq = freq; + rig_debug(RIG_DEBUG_VERBOSE, "%s: Got freq=%f, int_freq=%u\n", __func__, + freq, int_freq); + unsigned char cmd[] = + { + 0x30, // Set frequency request + 0xFF & (int_freq >> 24), + 0xFF & (int_freq >> 16), + 0xFF & (int_freq >> 8), + 0xFF & (int_freq) + }; + + ret = commradio_transaction(rig, cmd, 5, data, &data_len); + if(data_len == 5 && (data[0] == 0x31 || data[0] == 0x34)) + { + uint32_t new_freq = (data[1] << 24 | data[2] << 16 | data[3] << 8 | data[4]); + if(int_freq == new_freq) + { + RETURNFUNC(RIG_OK); + } + else + { + RETURNFUNC(-RIG_ERJCTED); + } + } + // CTX-10 returns 11 02 30 00 00 00 01 if we try to go out of its + // general-coverage frequency range 150kHz - 30MHz. I'm not sure why Hamlib + // even tries to do this, since its defined in the caps... + else + { + rig_debug(RIG_DEBUG_ERR, "%s: Unexpected response to 0x30\n", __func__); + ret = -RIG_ERJCTED; + } + RETURNFUNC(ret); +} + +/* + * Stubs. I'm not aware of a way to get or set the mode on the CTX-10. + */ +int commradio_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) +{ + return (RIG_OK); +} + +int commradio_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) +{ + *mode = RIG_MODE_NONE; + return (RIG_OK); +} + +/* + * Stubs. The CTX-10 has only one VFO and split mode doesn't change how it + * responds via the serial port. + */ +int commradio_set_vfo(RIG *rig, vfo_t vfo) +{ + return (RIG_OK); +} + +int commradio_get_vfo(RIG *rig, vfo_t *vfo) +{ + *vfo = RIG_VFO_A; + return (RIG_OK); +} + + +DECLARE_INITRIG_BACKEND(commradio) +{ + rig_debug(RIG_DEBUG_VERBOSE, "%s: _init called\n", __func__); + rig_register(&ctx10_caps); + + return (RIG_OK); +} + +/* + * For some reason, I can't get this to even link without this function. + */ +DECLARE_PROBERIG_BACKEND(commradio) +{ + return (RIG_MODEL_NONE); +} + diff --git a/rigs/commradio/commradio.h b/rigs/commradio/commradio.h new file mode 100644 index 000000000..f17a8a085 --- /dev/null +++ b/rigs/commradio/commradio.h @@ -0,0 +1,21 @@ + +#ifndef _COMMRADIO_H +#define _COMMRADIO_H + +int commradio_transaction(RIG *rig, const unsigned char *cmd, int cmd_len, + unsigned char *data, int *data_len); +int commradio_init(RIG *rig); +int commradio_cleanup(RIG *rig); +int commradio_rig_open(RIG *rig); +int commradio_rig_close(RIG *rig); +int commradio_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); +int commradio_set_freq(RIG *rig, vfo_t vfo, freq_t freq); +int commradio_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); +int commradio_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); +int commradio_set_vfo(RIG *rig, vfo_t vfo); +int commradio_get_vfo(RIG *rig, vfo_t *vfo); + +extern struct rig_caps ctx10_caps; + +#endif /* _COMMRADIO_H */ + diff --git a/rigs/commradio/ctx10.c b/rigs/commradio/ctx10.c new file mode 100644 index 000000000..10782fd1e --- /dev/null +++ b/rigs/commradio/ctx10.c @@ -0,0 +1,95 @@ + +#include <stdlib.h> + +#include "hamlib/rig.h" +#include "bandplan.h" +#include "commradio.h" + +/* + * The CTX-10 has only one VFO, but can be set into some sort of "split" mode + * where the screen shows two different frequencies. + * So far I have not figured out how to access these via serial. + */ +#define CTX10_VFO (RIG_VFO_A) + +#define CTX10_RX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_AM) +#define CTX10_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB) + +struct rig_caps ctx10_caps = +{ + RIG_MODEL(RIG_MODEL_CTX10), + .model_name = "CTX-10", + .mfg_name = "Commradio", + .version = "20240118" ".0", + .copyright = "LGPL", + .status = RIG_STATUS_STABLE, + .rig_type = RIG_TYPE_TRANSCEIVER, + .ptt_type = RIG_PTT_NONE, + .dcd_type = RIG_DCD_NONE, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 3000000, + .serial_rate_max = 3000000, + .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 = 1000, + .retry = 3, + .has_get_func = RIG_FUNC_NONE, + .has_set_func = RIG_FUNC_NONE, + .has_get_level = RIG_LEVEL_NONE, + .has_set_level = RIG_LEVEL_NONE, + .has_get_parm = RIG_PARM_NONE, + .has_set_parm = RIG_PARM_NONE, + .level_gran = {}, + .parm_gran = {}, + .ctcss_list = NULL, + .dcs_list = NULL, + .preamp = { RIG_DBLST_END, }, + .attenuator = { RIG_DBLST_END, }, + .max_rit = Hz(0), + .max_xit = Hz(0), + .max_ifshift = Hz(0), + .targetable_vfo = 0, + .vfo_ops = (RIG_OP_FROM_VFO|RIG_OP_TO_VFO), + .scan_ops = RIG_SCAN_NONE, + .transceive = RIG_TRN_OFF, + .bank_qty = 0, + .chan_desc_sz = 0, + .chan_list = { RIG_CHAN_END, }, + .rx_range_list1 = { + {kHz(150), MHz(30), CTX10_RX_MODES, -1, -1, CTX10_VFO, 0}, + RIG_FRNG_END, + }, + .tx_range_list1 = { + FRQ_RNG_80m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), + FRQ_RNG_60m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), + FRQ_RNG_40m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), + FRQ_RNG_30m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), + FRQ_RNG_20m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), + FRQ_RNG_17m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), + FRQ_RNG_15m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), + FRQ_RNG_12m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), + FRQ_RNG_10m_REGION2(CTX10_TX_MODES, W(1), W(10), CTX10_VFO, 0), + }, + .tuning_steps = { + {CTX10_RX_MODES, 10}, + RIG_TS_END, + }, +// .async_data_supported = 1, //TODO: Revisit this +// .decode_event = commradio_decode_event, + .rig_init = commradio_init, +// .rig_cleanup = commradio_cleanup, +// .rig_open = commradio_rig_open, +// .rig_close = commradio_rig_close, + .get_freq = commradio_get_freq, + .set_freq = commradio_set_freq, + .get_mode = commradio_get_mode, + .set_mode = commradio_set_mode, + .get_vfo = commradio_get_vfo, + .set_vfo = commradio_set_vfo, + .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS +}; + diff --git a/rigs/commradio/frame.c b/rigs/commradio/frame.c new file mode 100644 index 000000000..fc1756ab4 --- /dev/null +++ b/rigs/commradio/frame.c @@ -0,0 +1,160 @@ +/* + * Hamlib CommRadio backend + * idk, copyright and GPL here + */ + +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +#include <hamlib/rig.h> +#include <serial.h> + +#include "frame.h" + + +/* + * Brute-force determined to be polynomial = 0x1021. + * Seems to be the same CRC16 as Kermit. Initialized with 0. + */ +uint16_t crc16tab[] = { + 0, 4489, 8978, 12955, 17956, 22445, 25910, 29887, 35912, 40385, + 44890, 48851, 51820, 56293, 59774, 63735, 4225, 264, 13203, 8730, + 22181, 18220, 30135, 25662, 40137, 36160, 49115, 44626, 56045, 52068, + 63999, 59510, 8450, 12427, 528, 5017, 26406, 30383, 17460, 21949, + 44362, 48323, 36440, 40913, 60270, 64231, 51324, 55797, 12675, 8202, + 4753, 792, 30631, 26158, 21685, 17724, 48587, 44098, 40665, 36688, + 64495, 60006, 55549, 51572, 16900, 21389, 24854, 28831, 1056, 5545, + 10034, 14011, 52812, 57285, 60766, 64727, 34920, 39393, 43898, 47859, + 21125, 17164, 29079, 24606, 5281, 1320, 14259, 9786, 57037, 53060, + 64991, 60502, 39145, 35168, 48123, 43634, 25350, 29327, 16404, 20893, + 9506, 13483, 1584, 6073, 61262, 65223, 52316, 56789, 43370, 47331, + 35448, 39921, 29575, 25102, 20629, 16668, 13731, 9258, 5809, 1848, + 65487, 60998, 56541, 52564, 47595, 43106, 39673, 35696, 33800, 38273, + 42778, 46739, 49708, 54181, 57662, 61623, 2112, 6601, 11090, 15067, + 20068, 24557, 28022, 31999, 38025, 34048, 47003, 42514, 53933, 49956, + 61887, 57398, 6337, 2376, 15315, 10842, 24293, 20332, 32247, 27774, + 42250, 46211, 34328, 38801, 58158, 62119, 49212, 53685, 10562, 14539, + 2640, 7129, 28518, 32495, 19572, 24061, 46475, 41986, 38553, 34576, + 62383, 57894, 53437, 49460, 14787, 10314, 6865, 2904, 32743, 28270, + 23797, 19836, 50700, 55173, 58654, 62615, 32808, 37281, 41786, 45747, + 19012, 23501, 26966, 30943, 3168, 7657, 12146, 16123, 54925, 50948, + 62879, 58390, 37033, 33056, 46011, 41522, 23237, 19276, 31191, 26718, + 7393, 3432, 16371, 11898, 59150, 63111, 50204, 54677, 41258, 45219, + 33336, 37809, 27462, 31439, 18516, 23005, 11618, 15595, 3696, 8185, + 63375, 58886, 54429, 50452, 45483, 40994, 37561, 33584, 31687, 27214, + 22741, 18780, 15843, 11370, 7921, 3960 + }; + +static uint16_t crc16byte(const unsigned char byte, uint16_t crc) +{ + return crc16tab[(crc & 0xFF) ^ byte] ^ (crc >> 8); +} + +static uint16_t crc16(const unsigned char *data, int data_len, uint16_t crc) +{ + for (int i = 0; i < data_len; i++) + { + crc = crc16byte(data[i], crc); + } + return crc; +} + +static int esc_append(unsigned char frame[], int idx, const unsigned char a) +{ + switch(a) + { + case CR_SOF: + case CR_EOF: + case CR_ESC: + frame[idx] = CR_ESC; + frame[idx+1] = a ^ 20; + return idx+2; + break; + default: + frame[idx] = a; + return idx+1; + } +} + +/* + * frame[] might be 2x the size of data and crc +3 bytes if it is just a long + * string of 0xFC, 0xFD, or 0xFE for some insane reason. + * + */ +int frame_message(unsigned char frame[], const unsigned char *data, + const int data_len) +{ + uint16_t crc = 0; + frame[0] = CR_SOF; + frame[1] = 0x21; /* Messages to the radio are always 0x21 */ + crc = crc16byte(frame[1], crc); + frame[2] = data[0]; + crc = crc16byte(frame[2], crc); + int frame_len = 3; + for (int i = 1; i < data_len; i++) + { + crc = crc16byte(data[i], crc); + frame_len = esc_append(frame, frame_len, data[i]); + } + frame_len = esc_append(frame, frame_len, crc >> 8); + frame_len = esc_append(frame, frame_len, crc & 0xFF); + frame[frame_len] = CR_EOF; + frame_len++; + return frame_len; +} + +int unpack_frame(unsigned char msg[], const unsigned char *frame, + const int frame_len) +{ + if (frame_len < 5) + { + rig_debug(RIG_DEBUG_ERR, + "%s Got a frame that was too small (<5) to be valid\n", + __func__); + return -RIG_ETRUNC; + } + if ((frame[0] != CR_SOF) || (frame[frame_len-1] != CR_EOF)) + { + rig_debug(RIG_DEBUG_ERR, + "%s Tried to unpack a frame without start or end\n", __func__); + return -RIG_EPROTO; + } + if (frame[1] != 0x11) + { + rig_debug(RIG_DEBUG_ERR, + "%s Message address is not for host (0x11)\n", __func__); + return -RIG_EPROTO; + } + int msg_len = 0; + for (int i = 2; i < frame_len; i++) + { + switch (frame[i]) + { + case CR_SOF: + return -RIG_EPROTO; + break; + case CR_EOF: + i = frame_len; + break; + case CR_ESC: + i++; + msg[msg_len] = frame[i] ^ 20; + msg_len++; + break; + default: + msg[msg_len] = frame[i]; + msg_len++; + } + } + uint16_t msg_crc = (msg[msg_len-2] << 8) | msg[msg_len-1]; + msg_len = msg_len-2; + uint16_t crc = crc16(msg, msg_len, crc16byte(frame[1],0)); + if (msg_crc != crc) + { + rig_debug(RIG_DEBUG_ERR, "%s CRC check failed. msg_crc=%x, crc=%x\n", __func__, msg_crc, crc); + } + return msg_len; +} + + diff --git a/rigs/commradio/frame.h b/rigs/commradio/frame.h new file mode 100644 index 000000000..14458e412 --- /dev/null +++ b/rigs/commradio/frame.h @@ -0,0 +1,22 @@ +/* + * Hamlib CommRadio backend + * idk, copyright and GPL here + */ + +#ifndef _FRAME_H +#define _FRAME_H + +#define CR_SOF 0xFE +#define CR_EOF 0xFD +#define CR_ESC 0xFC + +//TODO: Find out what the frame length actually is for IQ/spectrum data +#define CR_FRAMELENGTH 256 + +int frame_message(unsigned char frame[], const unsigned char *data, + int data_len); + +int unpack_frame(unsigned char msg[], const unsigned char *frame, int frame_len); + +#endif /* _FRAME_H */ + diff --git a/src/register.c b/src/register.c index e011c0294..68bb96ebe 100644 --- a/src/register.c +++ b/src/register.c @@ -91,6 +91,7 @@ DEFINE_INITRIG_BACKEND(gomspace); DEFINE_INITRIG_BACKEND(mds); DEFINE_INITRIG_BACKEND(anytone); DEFINE_INITRIG_BACKEND(motorola); +DEFINE_INITRIG_BACKEND(commradio); //! @endcond #ifdef HAVE_WINRADIO @@ -152,6 +153,7 @@ static struct { RIG_MDS, RIG_BACKEND_MDS, RIG_FUNCNAMA(mds) }, { RIG_ANYTONE, RIG_BACKEND_ANYTONE, RIG_FUNCNAMA(anytone) }, { RIG_MOTOROLA, RIG_BACKEND_MOTOROLA, RIG_FUNCNAMA(motorola) }, + { RIG_COMMRADIO, RIG_BACKEND_COMMRADIO, RIG_FUNCNAM(commradio) }, { 0, NULL }, /* end */ }; commit 85ab6944bd3a452c51aa42574811542b25572f66 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Jun 29 15:40:30 2024 -0500 Add 100ms delay to qdx_set_ptt to flush whatever response the Hilbering PT8000A is sending diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index 2a72bbab0..34f04631a 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -1219,6 +1219,7 @@ int ts480_init(RIG *rig) int qdx_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) { const char *ptt_cmd; + struct hamlib_port *rp = RIGPORT(rig); ENTERFUNC; rig_debug(RIG_DEBUG_VERBOSE, "%s: ptt=%d\n", __func__, ptt); @@ -1234,7 +1235,8 @@ int qdx_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 + hl_usleep(100 * 1000); // a little time for PTT to return whatever it returns which we ignore + rig_flush(rp); RETURNFUNC(retval); } @@ -1836,7 +1838,7 @@ struct rig_caps pt8000a_caps = RIG_MODEL(RIG_MODEL_PT8000A), .model_name = "PT-8000A", .mfg_name = "Hilberling", - .version = BACKEND_VER ".1", + .version = BACKEND_VER ".2", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 3f909be270a4bffef980d48d2e55cd0869e22771 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Jun 29 15:36:49 2024 -0500 Fix Hilberling TQ command by ignoring ID check diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index d88a2000a..be3302a2c 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -378,6 +378,7 @@ transaction_write: skip |= strncmp(cmdstr, "PS1", 3) == 0; skip |= strncmp(cmdstr, "PS0", 3) == 0; skip |= strncmp(cmdstr, "K22", 3) == 0; + skip |= strncmp(cmdstr, "TQ", 2) == 0; // Skip Hilberling TQ command check if (skip) { diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index bbbeac31b..70ee75608 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "idx_builtin.h" -#define BACKEND_VER "20240511" +#define BACKEND_VER "20240629" #define EOM_KEN ';' #define EOM_TH '\r' commit dbd169a83f03fb837467546923f31ddb33767227 Merge: 6aec79b78 8b0e35ff0 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Jun 26 22:13:06 2024 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 6aec79b78aeffee6e7f7d339dfc579ee1fc48cb8 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Jun 26 22:12:36 2024 -0500 Avoid segfault on 32-bit RigPi -- time_t size may be 32-bit diff --git a/src/misc.c b/src/misc.c index 4b4398230..24e604fab 100644 --- a/src/misc.c +++ b/src/misc.c @@ -3098,8 +3098,10 @@ int rig_test_2038(RIG *rig) if (s == NULL) { failed = 1; } +#if 0 // this fails on 32-bit RigPi -- time_t 32-bit maybe? else rig_debug(RIG_DEBUG_VERBOSE, "%s: time_t 2038 test = 0x%08lx:%s", __func__, x, s == NULL ? "NULL" : s); +#endif #endif commit 8b0e35ff0ab6ef2037ee5b8bdbbb7fa11dc30f47 Merge: da4f9fbc3 0790f4d72 Author: Michael Black <mdb...@ya...> Date: Wed Jun 26 16:07:21 2024 -0500 Merge pull request #1570 from GeoBaltz/fix15 Balance ENTERFUNC/RETURNFUNC calls commit 0790f4d72e4947a9ba5c7c4d8747f7eecb6d0cd9 Author: George Baltz N3GB <Geo...@gm...> Date: Wed Jun 26 16:44:04 2024 -0400 Fix ENTERFUNC/RETURNFUNC imbalances found by repaired func_chk diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index 3c2d8c662..044d7c972 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -435,7 +435,7 @@ static int dummy_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (rig == NULL) { rig_debug(RIG_DEBUG_ERR, "%s: rig is NULL!!!\n", __func__); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } priv = (struct dummy_priv_data *)STATE(rig)->priv; diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index f3fe13e9a..eea6eae27 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2134,12 +2134,12 @@ int icom_set_dsp_flt(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (priv->no_1a_03_cmd == ENUM_1A_03_UNK) { priv->no_1a_03_cmd = ENUM_1A_03_NO; /* do not keep asking */ - return (RIG_OK); + RETURNFUNC(RIG_OK); } else { rig_debug(RIG_DEBUG_ERR, "%s: 1A 03 %02x failed\n", __func__, flt_ext); - return (retval); + RETURNFUNC(retval); } } @@ -5219,7 +5219,7 @@ int icom_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK) { - RETURNFUNC2(retval); + RETURNFUNC(retval); } RETURNFUNC(RIG_OK); @@ -5347,7 +5347,7 @@ int icom_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift) if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK) { - RETURNFUNC2(retval); + RETURNFUNC(retval); } RETURNFUNC(RIG_OK); @@ -5446,7 +5446,7 @@ int icom_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs) if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK) { - RETURNFUNC2(retval); + RETURNFUNC(retval); } RETURNFUNC(RIG_OK); @@ -7549,7 +7549,7 @@ int icom_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone) if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK) { - RETURNFUNC2(retval); + RETURNFUNC(retval); } RETURNFUNC(RIG_OK); @@ -7740,7 +7740,7 @@ int icom_set_dcs_code(RIG *rig, vfo_t vfo, tone_t code) if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK) { - RETURNFUNC2(retval); + RETURNFUNC(retval); } RETURNFUNC(RIG_OK); @@ -7837,7 +7837,7 @@ int icom_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code) if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK) { - RETURNFUNC2(retval); + RETURNFUNC(retval); } RETURNFUNC(RIG_OK); @@ -8248,7 +8248,7 @@ int icom_set_bank(RIG *rig, vfo_t vfo, int bank) if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK) { - RETURNFUNC2(retval); + RETURNFUNC(retval); } RETURNFUNC(RIG_OK); @@ -8671,7 +8671,7 @@ int icom_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) if ((retval = icom_check_ack(ack_len, ackbuf)) != RIG_OK) { - RETURNFUNC2(retval); + RETURNFUNC(retval); } RETURNFUNC(RIG_OK); @@ -8719,7 +8719,7 @@ morse_retry: } } - RETURNFUNC2(retval); + RETURNFUNC(retval); } RETURNFUNC(RIG_OK); diff --git a/rigs/kenwood/ts2000.c b/rigs/kenwood/ts2000.c index feed1ecf1..6936b7a68 100644 --- a/rigs/kenwood/ts2000.c +++ b/rigs/kenwood/ts2000.c @@ -620,7 +620,7 @@ static int ts2000_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } val->f = levelint / (float) 255; - return RIG_OK; + RETURNFUNC(RIG_OK); case RIG_LEVEL_SQL: SNPRINTF(cmdbuf, sizeof(cmdbuf), "SQ%c", vfo_num); diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index 0ecefc1af..2a72bbab0 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -742,7 +742,7 @@ kenwood_ts480_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } default: - return kenwood_get_level(rig, vfo, level, val); + RETURNFUNC(kenwood_get_level(rig, vfo, level, val)); } RETURNFUNC(RIG_OK); diff --git a/rigs/kenwood/ts590.c b/rigs/kenwood/ts590.c index b647f9554..6acc9f17f 100644 --- a/rigs/kenwood/ts590.c +++ b/rigs/kenwood/ts590.c @@ -610,7 +610,7 @@ static int ts590_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported agc value", __func__); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } SNPRINTF(levelbuf, sizeof(levelbuf), "GT%02d", kenwood_val); @@ -1004,7 +1004,7 @@ static int ts590_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; default: - return -RIG_ENAVAIL; + RETURNFUNC(-RIG_ENAVAIL); } break; diff --git a/rigs/motorola/micom.c b/rigs/motorola/micom.c index 7d26a30f4..9734316e6 100644 --- a/rigs/motorola/micom.c +++ b/rigs/motorola/micom.c @@ -170,7 +170,7 @@ static int micom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) write_block(rp, ack, sizeof(ack)); set_transaction_inactive(rig); *freq = (reply[4] << 24) | (reply[5] << 16) | (reply[6] << 8) | reply[7]; - RETURNFUNC(RIG_OK); + RETURNFUNC2(RIG_OK); } static int micom_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 3c7e9b067..e87ac16ae 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1037,12 +1037,12 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) __func__, rig_strvfo(vfo), rig_strvfo(rig_s->tx_vfo)); // when in split we can change VFOB but not VFOA - if (cachep->split == RIG_SPLIT_ON && target_vfo == '0') { return -RIG_ENTARGET; } + if (cachep->split == RIG_SPLIT_ON && target_vfo == '0') { RETURNFUNC(-RIG_ENTARGET); } // when not in split we can't change VFOA at all - if (cachep->split == RIG_SPLIT_OFF && target_vfo == '0') { return -RIG_ENTARGET; } + if (cachep->split == RIG_SPLIT_OFF && target_vfo == '0') { RETURNFUNC(-RIG_ENTARGET); } - if (vfo != rig_s->tx_vfo) { return -RIG_ENTARGET; } + if (vfo != rig_s->tx_vfo) { RETURNFUNC(-RIG_ENTARGET); } } if (is_ftdx3000 || is_ftdx3000dm || is_ftdx5000 || is_ftdx1200) @@ -1069,7 +1069,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) } while (err == RIG_OK && ptt == RIG_PTT_ON && retry-- > 0); - if (ptt) { return -RIG_ENTARGET; } + if (ptt) { RETURNFUNC(-RIG_ENTARGET); } } if (RIG_MODEL_FT450 == caps->rig_model) @@ -5129,7 +5129,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig cannot read MG in CW/RTTY modes\n", __func__); - return RIG_OK; + RETURNFUNC(RIG_OK); } if (is_ft991 || is_ft710 || is_ftdx3000 || is_ftdx3000dm || is_ftdx5000 @@ -6961,7 +6961,7 @@ int newcat_set_parm(RIG *rig, setting_t parm, value_t val) default: rig_debug(RIG_DEBUG_ERR, "%s: Unknown band %s=%d\n", __func__, val.s, rigband); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "BS%02d%c", band, cat_term); @@ -7646,7 +7646,7 @@ int newcat_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) ENTERFUNC; - if (scan != RIG_SCAN_VFO) { RETURNFUNC2(-RIG_EINVAL); } + if (scan != RIG_SCAN_VFO) { RETURNFUNC(-RIG_EINVAL); } SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "SC%d%c", scan == RIG_SCAN_STOP ? 0 : ch, cat_term); @@ -7655,10 +7655,10 @@ int newcat_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) { rig_debug(RIG_DEBUG_VERBOSE, "%s:%d command err = %d\n", __func__, __LINE__, retval); - RETURNFUNC2(retval); + RETURNFUNC(retval); } - RETURNFUNC2(retval); + RETURNFUNC(retval); } commit 6996a1222c021326ce34ff3ff760e4f4a1c5b4d8 Author: George Baltz N3GB <Geo...@gm...> Date: Wed Jun 26 10:08:40 2024 -0400 Fix func_chk to do useful things Allow multiple input files Do analysis on function-by-function basis Add 'return' to processing Fix some false positives in comments diff --git a/tests/func_chk.c b/tests/func_chk.c index 76161f32a..31dfd19ed 100644 --- a/tests/func_chk.c +++ b/tests/func_chk.c @@ -1,48 +1,93 @@ -/* this can change for balanced ENTERFUNC/RETURNFUNC statements */ +/* This can check for balanced ENTERFUNC/RETURNFUNC statements */ /* RETURNFUNC2 is used when ENTERFUNC is not used in a function */ +// +// Still may give false positives for /* */ comments or string literals +// Have to live with them until we can "borrow" a C parser/tokenizer +// that doesn't bloat the build requirements. +// +// Note that this is very dependent on the Hamlib coding style #include <stdio.h> #include <string.h> int main(int argc, const char *argv[]) { char buf[4096]; - char buf2[4096]; - FILE *fp = fopen(argv[1], "r"); - int linenum = 0; - int enterfunc = 0; + const char *fname; + char *s; + FILE *fp; + int idx, inafunc; + int linenum; + int enterfunc; int retval = 0; - retval = 0; - while (fgets(buf, sizeof(buf), fp)) - { - ++linenum; - buf[16] = 0; + for (idx = 1; idx < argc; idx++) + { + fp = fopen(argv[idx], "r"); + if (fp == NULL) { fprintf(stderr, "Can't open %s\n", argv[idx]); continue;} +#if 0 + if (!(fname = strrchr(argv[idx], '/'))) + { + fname = argv[idx]; + } + else + { + fname++; + } +#else + fname = argv[idx]; +#endif + linenum = enterfunc = inafunc = 0; - if (strstr(buf, "ENTERFUNC;")) { enterfunc = 1; } + while (fgets(buf, sizeof(buf), fp)) + { + ++linenum; - if (enterfunc && strstr(buf, "RETURNFUNC2")) - { - printf("Line#%d need RETURNFUNC %s\n", linenum, argv[1]); - retval = 1; - } + if (buf[0] == '{') + { //start of a function definition + inafunc = 1; + enterfunc = 0; + continue; + } + else if (buf[0] == '}') + { // end of function definition; back to comments + inafunc = 0; + } - strcpy(buf2, buf); - buf2[15] = 0; // truncate the string + if (!inafunc) + { // Not in a function, ignore everything + continue; + } - if (!enterfunc && strstr(buf2, "RETURNFUNC(")) - { - printf("Line#%d need RETURNFUNC2 %s\n", linenum, argv[1]); - retval = 1; - } + // Take care of // comments + if ((s = strstr(buf, "//"))) + { + *s = '\0'; + } - if (strstr(buf2, "RETURNFUNC(")) - { - if (enterfunc == 0) { printf("Line#%d no matching ENTERFUNC %s\n", linenum, argv[1]); } + if (strstr(buf, "ENTERFUNC;")) { enterfunc = 1; } - enterfunc = 0; - } - } + if (enterfunc && (strstr(buf, "RETURNFUNC2") || strstr(buf, "return ") + || strstr(buf, "return;"))) + { + printf("%s:%d need RETURNFUNC\n", fname, linenum); + retval = 1; + } - fclose(fp); + //TODO: Fix next to make a better guess at what's missing + if (!enterfunc && strstr(buf, "RETURNFUNC(")) + { + printf("%s:%d need RETURNFUNC2\n", fname, linenum); + retval = 1; + } + + if (strstr(buf, "RETURNFUNC(")) + { + if (enterfunc == 0) { printf("%s:%d no matching ENTERFUNC\n", fname, linenum); } + } + } + + //printf("%s:%d Done\n", fname, linenum); + fclose(fp); + } return retval; } commit 23e350ad23d3773e80bad7a614d53ffd370fc30b Author: George Baltz N3GB <Geo...@gm...> Date: Tue Jun 25 20:53:29 2024 -0400 Get rid of some false positives for func_chk Comments only. diff --git a/src/rig.c b/src/rig.c index d0f519eea..c42bde1b5 100644 --- a/src/rig.c +++ b/src/rig.c @@ -2609,7 +2609,7 @@ int HAMLIB_API rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) rig_cache_show(rig, __func__, __LINE__); rig_set_cache_freq(rig, vfo, *freq); rig_cache_show(rig, __func__, __LINE__); - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } } @@ -2850,7 +2850,7 @@ int HAMLIB_API rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) /* try and revert even if we had an error above */ rc2 = caps->set_vfo(rig, curr_vfo); - /* return the first error code */ + /* Return the first error code */ if (retcode == RIG_OK) { retcode = rc2; @@ -3019,7 +3019,7 @@ int HAMLIB_API rig_get_mode(RIG *rig, if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } } @@ -3613,7 +3613,7 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) rc2 = caps->set_vfo(rig, curr_vfo); } - /* return the first error code */ + /* Return the first error code */ if (RIG_OK == retcode) { retcode = rc2; @@ -3908,7 +3908,7 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; cachep->ptt = *ptt; elapsed_ms(&cachep->time_ptt, HAMLIB_ELAPSED_SET); @@ -4173,7 +4173,7 @@ int HAMLIB_API rig_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -4305,7 +4305,7 @@ int HAMLIB_API rig_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift) if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -4389,7 +4389,7 @@ int HAMLIB_API rig_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift) if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -4466,7 +4466,7 @@ int HAMLIB_API rig_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs) if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -4549,7 +4549,7 @@ int HAMLIB_API rig_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs) if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -4738,7 +4738,7 @@ int HAMLIB_API rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -4908,7 +4908,7 @@ int HAMLIB_API rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *tx_freq) if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -5144,7 +5144,7 @@ int HAMLIB_API rig_set_split_mode(RIG *rig, if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -5299,7 +5299,7 @@ int HAMLIB_API rig_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -5761,7 +5761,7 @@ int HAMLIB_API rig_set_split_vfo(RIG *rig, if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } } @@ -5962,7 +5962,7 @@ int HAMLIB_API rig_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -6040,7 +6040,7 @@ int HAMLIB_API rig_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -6112,7 +6112,7 @@ int HAMLIB_API rig_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit) if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -6190,7 +6190,7 @@ int HAMLIB_API rig_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -6262,7 +6262,7 @@ int HAMLIB_API rig_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts) if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -6339,7 +6339,7 @@ int HAMLIB_API rig_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts) if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -6417,7 +6417,7 @@ int HAMLIB_API rig_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -6511,7 +6511,7 @@ int HAMLIB_API rig_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -7018,7 +7018,7 @@ int HAMLIB_API rig_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -7126,7 +7126,7 @@ int HAMLIB_API rig_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -7202,7 +7202,7 @@ int HAMLIB_API rig_send_dtmf(RIG *rig, vfo_t vfo, const char *digits) if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -7279,7 +7279,7 @@ int HAMLIB_API rig_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length) if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -7376,7 +7376,7 @@ int HAMLIB_API rig_send_morse(RIG *rig, vfo_t vfo, const char *msg) if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -7445,7 +7445,7 @@ int HAMLIB_API rig_stop_morse(RIG *rig, vfo_t vfo) if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -7545,7 +7545,7 @@ int HAMLIB_API rig_wait_morse(RIG *rig, vfo_t vfo) if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } @@ -7616,7 +7616,7 @@ int HAMLIB_API rig_send_voice_mem(RIG *rig, vfo_t vfo, int ch) if (RIG_OK == retcode) { - /* return the first error code */ + /* Return the first error code */ retcode = rc2; } commit 8cdef7f4b1001640eef64a2b5fca22fb44b2527e Author: George Baltz N3GB <Geo...@gm...> Date: Tue Jun 25 03:25:56 2024 -0400 Finish balancing diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index c15f77d88..0c177b2b4 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -1792,6 +1792,7 @@ static int ft1000mp_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, pbwidth_t tx_width) { int retval; + ENTERFUNC; retval = rig_set_mode(rig, RIG_VFO_B, tx_mode, tx_width); RETURNFUNC(retval); } @@ -1800,6 +1801,7 @@ static int ft1000mp_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, pbwidth_t *tx_width) { int retval; + ENTERFUNC; retval = rig_get_mode(rig, RIG_VFO_B, tx_mode, tx_width); RETURNFUNC(retval); } @@ -1808,6 +1810,7 @@ static int ft1000mp_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t freq, rmode_t mode, pbwidth_t width) { int retval; + ENTERFUNC; retval = rig_set_mode(rig, RIG_VFO_B, mode, width); if (retval != RIG_OK) @@ -1832,6 +1835,7 @@ static int ft1000mp_get_split_freq_mode(RIG *rig, vfo_t vfo, freq_t *freq, rmode_t *mode, pbwidth_t *width) { int retval; + ENTERFUNC; retval = rig_get_mode(rig, RIG_VFO_B, mode, width); if (retval != RIG_OK) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 2219f18aa..3c7e9b067 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1628,7 +1628,7 @@ int newcat_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) { rig_debug(RIG_DEBUG_WARN, "%s: Cannot get from rig when power is off\n", __func__); - return RIG_OK; // to prevent repeats + RETURNFUNC(RIG_OK); // to prevent repeats } err = newcat_set_vfo_from_alias(rig, &vfo); @@ -2749,6 +2749,7 @@ int newcat_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, int newcat_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) { int err; + ENTERFUNC; vfo_t rx_vfo = RIG_VFO_NONE; rig_debug(RIG_DEBUG_TRACE, "%s: entered, rxvfo=%s, txvfo=%s, split=%d\n", @@ -2767,7 +2768,7 @@ int newcat_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) rig_debug(RIG_DEBUG_VERBOSE, "%s: force set_split off since we're on 60M exception\n", __func__); split = RIG_SPLIT_OFF; - //return RIG_OK; // fake the return code to make things happy + //RETURNFUNC(RIG_OK); // fake the return code to make things happy } if (is_ft991) @@ -4310,7 +4311,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig cannot set MG in CW/RTTY modes\n", __func__); - return RIG_OK; + RETURNFUNC(RIG_OK); } @@ -11081,7 +11082,7 @@ int newcat_get_vfo_mode(RIG *rig, vfo_t vfo, vfo_t *vfo_mode) { rig_debug(RIG_DEBUG_WARN, "%s: Cannot get from rig when power is off\n", __func__); - return RIG_OK; // to prevent repeats + RETURNFUNC(RIG_OK); // to prevent repeats } /* vfo, mem, P7 ************************** */ @@ -11179,7 +11180,7 @@ int newcat_get_cmd(RIG *rig) { rig_debug(RIG_DEBUG_WARN, "%s: Cannot get from rig when power is off\n", __func__); - return RIG_OK; // to prevent repeats + RETURNFUNC(RIG_OK); // to prevent repeats } // try to cache rapid repeats of the IF command @@ -11599,7 +11600,7 @@ repeat: if (strncmp(priv->cmd_str, "FA", 2) == 0 || strncmp(priv->cmd_str, "FB", 2) == 0) { - return RIG_OK; + RETURNFUNC(RIG_OK); } if (strncmp(priv->cmd_str, "PC", 2) == 0 && priv->ret_data[0] == '?') @@ -11961,7 +11962,7 @@ int newcat_send_voice_mem(RIG *rig, vfo_t vfo, int ch) if (!newcat_valid_command(rig, "PB")) { - RETURNFUNC(-RIG_ENAVAIL); + RETURNFUNC2(-RIG_ENAVAIL); } // we don't do any channel checking -- varies by rig -- could do it but not critical @@ -12185,7 +12186,7 @@ static int newcat_get_apf_frequency(RIG *rig, vfo_t vfo, int *freq) if (!newcat_valid_command(rig, "CO")) { - RETURNFUNC(-RIG_ENAVAIL); + RETURNFUNC2(-RIG_ENAVAIL); } if (is_ftdx101d || is_ftdx101mp) @@ -12203,12 +12204,12 @@ static int newcat_get_apf_frequency(RIG *rig, vfo_t vfo, int *freq) } else { - RETURNFUNC(-RIG_ENIMPL); + RETURNFUNC2(-RIG_ENIMPL); } if ((err = newcat_get_cmd(rig)) != RIG_OK) { - RETURNFUNC(err); + RETURNFUNC2(err); } ret_data_len = strlen(priv->ret_data); diff --git a/src/network.c b/src/network.c index 2c08c2cb2..417f44dc1 100644 --- a/src/network.c +++ b/src/network.c @@ -1601,7 +1601,7 @@ int network_multicast_publisher_start(RIG *rig, const char *multicast_addr, { rig_debug(RIG_DEBUG_WARN, "%s: No network found...multicast disabled\n", __func__); - return RIG_OK; + RETURNFUNC(RIG_OK); } #endif @@ -1610,7 +1610,7 @@ int network_multicast_publisher_start(RIG *rig, const char *multicast_addr, { rig_debug(RIG_DEBUG_TRACE, "%s(%d): not starting multicast publisher\n", __FILE__, __LINE__); - return RIG_OK; + RETURNFUNC(RIG_OK); } status = network_init(); commit c502556fdb0c9cc0b11d08f490d7c7643b2f0455 Author: George Baltz N3GB <Geo...@gm...> Date: Mon Jun 24 16:06:36 2024 -0400 More balancing In rigs/kenwood/* diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index 23042a812..1be7c3269 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -1294,7 +1294,7 @@ int powersdr_get_parm(RIG *rig, setting_t parm, value_t *val) if (n != 1) { rig_debug(RIG_DEBUG_ERR, "%s: unknown band=%s\n", __func__, buf); - return (-RIG_EPROTO); + RETURNFUNC(-RIG_EPROTO); } switch (band) diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 4c6069c26..d88a2000a 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -536,7 +536,7 @@ transaction_read: { rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig (get): '%s'\n", __func__, cmdstr); - RETURNFUNC(-RIG_ERJCTED); + RETURNFUNC2(-RIG_ERJCTED); } /* Command not understood by rig or rig busy */ @@ -1242,7 +1242,7 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo) if (vfo == RIG_VFO_B && priv->is_emulation && priv->curr_mode > 0) { HAMLIB_TRACE; - RETURNFUNC2(RIG_OK); + RETURNFUNC(RIG_OK); } #if 0 @@ -1251,7 +1251,7 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo) { rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo already is %s...skipping\n", __func__, rig_strvfo(vfo)); - RETURNFUNC2(RIG_OK); + RETURNFUNC(RIG_OK); } #endif @@ -1284,11 +1284,11 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo) case RIG_VFO_CURR: HAMLIB_TRACE; STATE(rig)->current_vfo = RIG_VFO_CURR; - RETURNFUNC2(RIG_OK); + RETURNFUNC(RIG_OK); default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported VFO %s\n", __func__, rig_strvfo(vfo)); - RETURNFUNC2(-RIG_EINVAL); + RETURNFUNC(-RIG_EINVAL); } //if rig=ts2000 then check Satellite mode status @@ -1302,7 +1302,7 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo) if (retval != RIG_OK) { - RETURNFUNC2(retval); + RETURNFUNC(retval); } rig_debug(RIG_DEBUG_VERBOSE, "%s: satellite mode status %s\n", __func__, @@ -1313,7 +1313,7 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo) { //SAT mode doesn't allow FR command (cannot select VFO) //selecting VFO is useless in SAT MODE - RETURNFUNC2(RIG_OK); + RETURNFUNC(RIG_OK); } } @@ -1344,7 +1344,7 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo) if (retval != RIG_OK) { - RETURNFUNC2(retval); + RETURNFUNC(retval); } HAMLIB_TRACE; @@ -1354,7 +1354,7 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo) /* If split mode on, the don't change TxVFO */ if ('N' == cmdbuf[1] || priv->split != RIG_SPLIT_OFF) { - RETURNFUNC2(RIG_OK); + RETURNFUNC(RIG_OK); } HAMLIB_TRACE; @@ -1406,7 +1406,7 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo) cmdbuf[1] = 'T'; RETURNFUNC(kenwood_transaction(rig, cmdbuf, NULL, 0)); #else - RETURNFUNC2(retval); + RETURNFUNC(retval); #endif } @@ -2262,7 +2262,7 @@ int kenwood_set_xit(RIG *rig, vfo_t vfo, shortfreq_t rit) int kenwood_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) { - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + ENTERFUNC; if (RIG_IS_TS990S) { @@ -2751,7 +2751,7 @@ static int kenwood_get_filter_width(RIG *rig, rmode_t mode, pbwidth_t *width) if (filter_value >= 50) // then it's probably a custom filter width { *width = filter_value; - return (RIG_OK); + RETURNFUNC(RIG_OK); } RETURNFUNC(-RIG_EINVAL); @@ -3788,23 +3788,23 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } ack_len = strlen(lvlbuf); if (ack_len != len) { - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } if (sscanf(&lvlbuf[len - 3], "%d", &lvl) != 1) { - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } val->f = (float) lvl / 255.f; - return RIG_OK; + RETURNFUNC(RIG_OK); } case RIG_LEVEL_ATT: @@ -5547,7 +5547,7 @@ int kenwood_send_voice_mem(RIG *rig, vfo_t vfo, int bank) || rig->caps->rig_model == RIG_MODEL_TS480)) { rig_debug(RIG_DEBUG_ERR, "%s: TS2000/TS480 channel is from 1 to 3\n", __func__); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } // some rigs have 5 channels -- newew ones have 10 channels @@ -5556,7 +5556,7 @@ int kenwood_send_voice_mem(RIG *rig, vfo_t vfo, int bank) || rig->caps->rig_model == RIG_MODEL_TS590S)) { rig_debug(RIG_DEBUG_ERR, "%s: TS590S/SG channel is from 1 to 5\n", __func__); - return -RIG_EINVAL; + RETURNFUNC(-RIG_EINVAL); } if (rig->caps->rig_model == RIG_MODEL_TS2000 @@ -6070,7 +6070,7 @@ const char *kenwood_get_info(RIG *rig) char firmbuf[10]; int retval; - ENTERFUNC; + ENTERFUNC2; if (!rig) { diff --git a/rigs/kenwood/ts2000.c b/rigs/kenwood/ts2000.c index 477b541c7..feed1ecf1 100644 --- a/rigs/kenwood/ts2000.c +++ b/rigs/kenwood/ts2000.c @@ -272,7 +272,7 @@ int ts2000_init(RIG *rig) if (retval != RIG_OK) { - return retval; + RETURNFUNC(retval); } priv = (struct kenwood_priv_data *) STATE(rig)->priv; @@ -328,12 +328,12 @@ static int ts2000_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) { case RIG_FUNC_MON: SNPRINTF(buf, sizeof(buf), "ML00%c", (status == 0) ? '0' : '1'); - RETURNFUNC(kenwood_transaction(rig, buf, NULL, 0)); + RETURNFUNC2(kenwood_transaction(rig, buf, NULL, 0)); case RIG_FUNC_LOCK: SNPRINTF(buf, sizeof(buf), "LK%c%c", (status == 0) ? '0' : '1', (status == 0) ? '0' : '1'); - RETURNFUNC(kenwood_transaction(rig, buf, NULL, 0)); + RETURNFUNC2(kenwood_transaction(rig, buf, NULL, 0)); default: return kenwood_set_func(rig, vfo, func, status); @@ -377,7 +377,7 @@ static int ts2000_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) break; default: - return kenwood_get_func(rig, vfo, func, status); + RETURNFUNC(kenwood_get_func(rig, vfo, func, status)); } RETURNFUNC(RIG_OK); @@ -462,7 +462,7 @@ static int ts2000_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_PREAMP: if (val.i != 12 && val.i != 0) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC2(-RIG_EINVAL); } SNPRINTF(levelbuf, sizeof(levelbuf), "PA%c", (val.i == 12) ? '1' : '0'); @@ -471,7 +471,7 @@ static int ts2000_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_ATT: if (val.i != 12 && val.i != 0) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC2(-RIG_EINVAL); } SNPRINTF(levelbuf, sizeof(levelbuf), "RA%02d", (val.i == 12) ? 1 : 0); @@ -493,7 +493,7 @@ static int ts2000_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) break; default: - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC2(-RIG_EINVAL); } SNPRINTF(levelbuf, sizeof(levelbuf), "RM%d", kenwood_val); @@ -502,10 +502,10 @@ static int ts2000_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_CWPITCH: if (val.i > 1000 || val.i < 400) { - RETURNFUNC(-RIG_EINVAL); + RETURNFUNC2(-RIG_EINVAL); } - RETURNFUNC(ts2000_set_ex_menu(rig, 31, 2, (val.i - 400) / 50)); + RETURNFUNC2(ts2000_set_ex_menu(rig, 31, 2, (val.i - 400) / 50)); default: return kenwood_set_level(rig, vfo, level, val); @@ -597,26 +597,26 @@ static int ts2000_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) switch (level) { case RIG_LEVEL_AF: - return kenwood_get_level(rig, vfo, level, val); + RETURNFUNC(kenwood_get_level(rig, vfo, level, val)); case RIG_LEVEL_RF: retval = kenwood_transaction(rig, "RG", ackbuf, sizeof(ackbuf)); if (RIG_OK != retval) { - return retval; + RETURNFUNC(retval); } ack_len = strlen(ackbuf); if (5 != ack_len) { - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } if (1 != sscanf(&ackbuf[2], "%d", &levelint)) { - return -RIG_EPROTO; + RETURNFUNC(-RIG_EPROTO); } ... [truncated message content] |
From: n0nb <n0...@us...> - 2024-06-15 13:19:19
|
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 5fc4e0b5d0efc8d6f2eaa634046ce2940406b705 (commit) via 096f29cfd9adf7ce9f1e31193b4d6a4136a360ea (commit) via ce84fc68a5d7657d49170d3d0b60dd0a0f2b243f (commit) via eae88631733af0b7c8f290bfc9e84a73ce3c20e0 (commit) via 661efce725a61431d031e47682ac348674615ce7 (commit) via d160c620642125c66526beaf8d0d1c96d52886c3 (commit) via db73ef20e50907f017c26008098674f9d7467372 (commit) via b19c179ce7d455e6b2f294145e9614623d91dcf2 (commit) via 305e20948e1ada3b0a8db2e5a92dd2f27b4c3208 (commit) from ff0ed58edf3955596892ed5082ee44da89d94cf9 (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 5fc4e0b5d0efc8d6f2eaa634046ce2940406b705 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jun 14 10:30:05 2024 -0500 Reduce timing on ts890 diff --git a/rigs/kenwood/ts890s.c b/rigs/kenwood/ts890s.c index ede63c181..a4dbd6182 100644 --- a/rigs/kenwood/ts890s.c +++ b/rigs/kenwood/ts890s.c @@ -491,7 +491,7 @@ struct rig_caps ts890s_caps = RIG_MODEL(RIG_MODEL_TS890S), .model_name = "TS-890S", .mfg_name = "Kenwood", - .version = BACKEND_VER ".15", + .version = BACKEND_VER ".16", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -506,8 +506,8 @@ struct rig_caps ts890s_caps = .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = 0, .post_write_delay = 0, - .timeout = 500, - .retry = 10, + .timeout = 200, + .retry = 1, .preamp = {12, RIG_DBLST_END,}, .attenuator = {6, 12, 18, RIG_DBLST_END,}, .max_rit = kHz(9.99), commit 096f29cfd9adf7ce9f1e31193b4d6a4136a360ea Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jun 14 10:28:44 2024 -0500 Show flrig agc labels but don't do anything with them yet. Mapping to Hamlib AGC levels is a bit complicated so deferring this until somebody needs it. diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index ff3e9e85a..29432c4ac 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -143,7 +143,7 @@ struct rig_caps flrig_caps = RIG_MODEL(RIG_MODEL_FLRIG), .model_name = "", .mfg_name = "FLRig", - .version = "20240418.0", + .version = "20240612.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1119,6 +1119,13 @@ static int flrig_open(RIG *rig) rig_get_split_vfo(rig, RIG_VFO_A, &split, &tx_vfo); + retval = flrig_transaction(rig, "rig.get_agc_labels", NULL, value, sizeof(value)); + + if (retval != RIG_OK) { RETURNFUNC(retval); } + + rig_debug(RIG_DEBUG_ERR, "%s: agc_labels=%s\n", __func__, value); + + RETURNFUNC(retval); } commit ce84fc68a5d7657d49170d3d0b60dd0a0f2b243f Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jun 14 09:57:05 2024 -0500 Remove debug from conf.c diff --git a/src/conf.c b/src/conf.c index 2807710b2..26273ef58 100644 --- a/src/conf.c +++ b/src/conf.c @@ -1469,7 +1469,6 @@ int HAMLIB_API rig_set_conf(RIG *rig, hamlib_token_t token, const char *val) */ int HAMLIB_API rig_get_conf(RIG *rig, hamlib_token_t token, char *val) { - printf("tokendid=%lx, %s\n", token, val); return rig_get_conf2(rig, token, val, 128); } commit eae88631733af0b7c8f290bfc9e84a73ce3c20e0 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Jun 14 09:40:55 2024 -0500 Improve orion.h behavior on timeouts diff --git a/rigs/tentec/orion.h b/rigs/tentec/orion.h index 4daf547b1..1f8abbfed 100644 --- a/rigs/tentec/orion.h +++ b/rigs/tentec/orion.h @@ -36,7 +36,7 @@ #include "rig.h" #include "riglist.h" -#define BACKEND_VER "20240612" +#define BACKEND_VER "20240613" #define TRUE 1 #define FALSE 0 @@ -214,10 +214,10 @@ RIG_MODEL(RIG_MODEL_TT565), .serial_stop_bits = 1, .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_HARDWARE, -.write_delay = 0, /* no delay between characters written */ +.write_delay = 1, /* no delay between characters written */ .post_write_delay = 0, /* ms delay between writes DEBUGGING HERE */ -.timeout = 2000, /* ms */ -.retry = 4, +.timeout = 200, /* ms */ +.retry = 1, .has_get_func = TT565_FUNCS, .has_set_func = TT565_FUNCS, commit 661efce725a61431d031e47682ac348674615ce7 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Jun 13 07:18:33 2024 -0500 Allow pstrotator to return az/el on 1st call to get_pos and add status values diff --git a/rigs/dummy/rot_pstrotator.c b/rigs/dummy/rot_pstrotator.c index caf1f911e..7beb58065 100644 --- a/rigs/dummy/rot_pstrotator.c +++ b/rigs/dummy/rot_pstrotator.c @@ -1,7 +1,6 @@ /* - i Hamlib Dummy backend - main file - * Copyright (c) 2001-2009 by Stephane Fillod - * + i Hamlib PSTRotator backend + * Copyright (c) 2024 Michael Black W9MDB * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -41,8 +40,7 @@ #define PSTROTATOR_ROT_PARM 0 #define PSTROTATOR_ROT_STATUS (ROT_STATUS_MOVING | ROT_STATUS_MOVING_AZ | ROT_STATUS_MOVING_LEFT | ROT_STATUS_MOVING_RIGHT | \ - ROT_STATUS_MOVING_EL | ROT_STATUS_MOVING_UP | ROT_STATUS_MOVING_DOWN | \ - ROT_STATUS_LIMIT_UP | ROT_STATUS_LIMIT_DOWN | ROT_STATUS_LIMIT_LEFT | ROT_STATUS_LIMIT_RIGHT) + ROT_STATUS_MOVING_EL | ROT_STATUS_MOVING_UP | ROT_STATUS_MOVING_DOWN ) struct pstrotator_rot_priv_data { @@ -57,6 +55,8 @@ struct pstrotator_rot_priv_data int sockfd2; // the reply port for PSTRotator which is port+1 pthread_t threadid; + + int receiving; // true if we are receiving az/el data }; static int write_transaction(ROT *rot, char *cmd) @@ -213,9 +213,11 @@ static void *pstrotator_handler_start(void *arg) rs->pstrotator_handler_priv_data; pstrotator_handler_priv->args.rot = rot; pstrotator_handler_priv->pstrotator_handler_thread_run = 1; + priv->receiving = 0; while (pstrotator_handler_priv->pstrotator_handler_thread_run) { + int az = 0, el = 0; char buf[256]; readPacket(priv->sockfd2, buf, sizeof(buf), 1); @@ -228,6 +230,16 @@ static void *pstrotator_handler_start(void *arg) //dump_hex((unsigned char *)buf, strlen(buf)); int n = sscanf(buf, "AZ:%g", &priv->az); n += sscanf(buf, "EL:%g", &priv->el); + + if (n > 0) { priv->receiving = 1; } + + if (priv->az != az && priv->el != el) { priv->status = ROT_STATUS_MOVING; } + else if (priv->az < az) { priv->status = ROT_STATUS_MOVING_LEFT; } + else if (priv->az > az) { priv->status = ROT_STATUS_MOVING_RIGHT; } + else if (priv->el < el) { priv->status = ROT_STATUS_MOVING_DOWN; } + else if (priv->el > el) { priv->status = ROT_STATUS_MOVING_UP; } + else { priv->status = ROT_STATUS_NONE; } + //if (n > 0) rig_debug(RIG_DEBUG_CACHE, "%s: az=%.1f, el=%.1f\n", __func__, priv->az, priv->el); } @@ -267,10 +279,6 @@ static int pstrotator_rot_init(ROT *rot) static int pstrotator_rot_cleanup(ROT *rot) { struct rot_state *rs = ROTSTATE(rot); -#if 0 - struct pstrotator_rot_priv_data *priv = (struct pstrotator_rot_priv_data *) - rs->priv; -#endif rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -341,14 +349,26 @@ static int pstrotator_rot_open(ROT *rot) static int pstrotator_rot_close(ROT *rot) { + struct pstrotator_rot_priv_data *priv; + priv = (struct pstrotator_rot_priv_data *)ROTSTATE(rot)->priv; + pstrotator_handler_priv_data *pstrotator_handler_priv; + pstrotator_handler_priv = (pstrotator_handler_priv_data *) + rot->state.pstrotator_handler_priv_data; + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + pstrotator_handler_priv->pstrotator_handler_thread_run = 0; + rig_debug(RIG_DEBUG_VERBOSE, "%s: waiting for thread to stop\n", __func__); + pthread_join(priv->threadid, NULL); + rig_debug(RIG_DEBUG_VERBOSE, "%s: thread stopped\n", __func__); + priv->threadid = 0; + return RIG_OK; } +#if 0 static int pstrotator_set_conf(ROT *rot, hamlib_token_t token, const char *val) { -#if 0 struct pstrotator_rot_priv_data *priv; priv = (struct pstrotator_rot_priv_data *)ROTSTATE(rot)->priv; @@ -369,16 +389,14 @@ static int pstrotator_set_conf(ROT *rot, hamlib_token_t token, const char *val) } return RIG_OK; -#else - return -RIG_ENIMPL; -#endif } +#endif +#if 0 static int pstrotator_get_conf2(ROT *rot, hamlib_token_t token, char *val, int val_len) { -#if 0 struct pstrotator_rot_priv_data *priv; priv = (struct pstrotator_rot_priv_data *)ROTSTATE(rot)->priv; @@ -394,15 +412,15 @@ static int pstrotator_get_conf2(ROT *rot, hamlib_token_t token, char *val, } return RIG_OK; -#else - return -RIG_ENIMPL; -#endif } +#endif +#if 0 static int pstrotator_get_conf(ROT *rot, hamlib_token_t token, char *val) { return pstrotator_get_conf2(rot, token, val, 128); } +#endif @@ -433,62 +451,12 @@ static int pstrotator_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) { struct pstrotator_rot_priv_data *priv = (struct pstrotator_rot_priv_data *) ROTSTATE(rot)->priv; -#if 0 - char buf[64]; - int n = 0; - fd_set rfds, efds; - int select_result; - struct timeval timeout; -#endif - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + write_transaction(rot, "<PST>AZ?</PST>"); write_transaction(rot, "<PST>EL?</PST>"); -#if 0 - - do - { - //read_string(&priv->port2, (unsigned char*)buf, sizeof(buf), stopset, stopset_len, 1, 1); - buf[0] = 0; - - // if moving we need to keep polling for updates until there are none - if (n == 2) - { - timeout.tv_sec = 0; - timeout.tv_usec = 0; - - FD_ZERO(&rfds); - FD_SET(priv->sockfd2, &rfds); - efds = rfds; - select_result = select(priv->sockfd2, &rfds, NULL, &efds, &timeout); - - if (select_result == 0) - { - //rig_debug(RIG_DEBUG_VERBOSE, "%s: timeout\n", __func__); - break; - } - else - { - rig_debug(RIG_DEBUG_VERBOSE, "%s: select_result=%d\n", __func__, select_result); - readPacket(priv->sockfd2, buf, sizeof(buf), 0); - } - } - else - { - readPacket(priv->sockfd2, buf, sizeof(buf), 1); - } - - dump_hex((unsigned char *)buf, strlen(buf)); - n += sscanf(buf, "AZ:%g", &priv->az); - n += sscanf(buf, "EL:%g", &priv->el); - - if (n > 2) { n = 2; } - } - while (strlen(buf) > 0); - -#endif - + hl_usleep(10 * 1000); *az = priv->az; *el = priv->el; @@ -532,7 +500,7 @@ struct rot_caps pstrotator_caps = ROT_MODEL(ROT_MODEL_PSTROTATOR), .model_name = "PstRotator", .mfg_name = "YO3DMU", - .version = "20240607.0", + .version = "20240613.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZEL, @@ -562,9 +530,6 @@ struct rot_caps pstrotator_caps = .rot_open = pstrotator_rot_open, .rot_close = pstrotator_rot_close, - .set_conf = pstrotator_set_conf, - .get_conf = pstrotator_get_conf, - .set_position = pstrotator_rot_set_position, .get_position = pstrotator_rot_get_position, .park = pstrotator_rot_park, commit d160c620642125c66526beaf8d0d1c96d52886c3 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Jun 12 15:32:21 2024 -0500 Make Origin width timeout behave better diff --git a/rigs/tentec/orion.c b/rigs/tentec/orion.c index 89cf4d157..7edc53910 100644 --- a/rigs/tentec/orion.c +++ b/rigs/tentec/orion.c @@ -694,6 +694,7 @@ int tt565_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) char ttmode, ttreceiver; int retry; int timeout; + int widthOld = rig->state.cache.widthMainA; struct rig_state *rs = STATE(rig); ttreceiver = which_receiver(rig, vfo); @@ -739,8 +740,6 @@ int tt565_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) return -RIG_EPROTO; } - /* Orion may need some time to "recover" from ?RxM before ?RxF */ - hl_usleep(100*1000); // was 80, now 100 -- still seeing infrequent failure /* Query passband width (filter) */ // since this fails at 80ms sometimes we won't retry and will reduce the timeout // Normally this comes back in about 30ms @@ -756,7 +755,9 @@ int tt565_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) if (retval != RIG_OK) { - return retval; + // if the width call fails we will just reuse the old width + *width = widthOld; + return RIG_OK; } if (respbuf[1] != 'R' || respbuf[3] != 'F' || resp_len <= 4) diff --git a/rigs/tentec/orion.h b/rigs/tentec/orion.h index ac43d3543..4daf547b1 100644 --- a/rigs/tentec/orion.h +++ b/rigs/tentec/orion.h @@ -36,7 +36,7 @@ #include "rig.h" #include "riglist.h" -#define BACKEND_VER "20240606" +#define BACKEND_VER "20240612" #define TRUE 1 #define FALSE 0 commit db73ef20e50907f017c26008098674f9d7467372 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jun 10 22:26:21 2024 -0500 Add csntechnologies.net S.A.T. satellite rotor Thanks to Randy KB0NAV diff --git a/NEWS b/NEWS index b91c026ac..7a3747187 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ Version 5.x -- future * Change FT1000MP Mark V model names to align with FT1000MP Version 4.6 + * Added csntechnoligies.net S.A.T Satellite rotor control * Added PSTRotator control * Added Flex SmartSDR slices A-H * Added Motorola Micom M2/M3 diff --git a/include/hamlib/rotlist.h b/include/hamlib/rotlist.h index a8ae9f754..cd49c7c10 100644 --- a/include/hamlib/rotlist.h +++ b/include/hamlib/rotlist.h @@ -87,6 +87,7 @@ #define ROT_MODEL_DUMMY ROT_MAKE_MODEL(ROT_DUMMY, 1) #define ROT_MODEL_NETROTCTL ROT_MAKE_MODEL(ROT_DUMMY, 2) #define ROT_MODEL_PSTROTATOR ROT_MAKE_MODEL(ROT_DUMMY, 3) +#define ROT_MODEL_SATROTCTL ROT_MAKE_MODEL(ROT_DUMMY, 4) /** diff --git a/rigs/dummy/netrotctl.c b/rigs/dummy/netrotctl.c index 27f4947f7..0b18c6357 100644 --- a/rigs/dummy/netrotctl.c +++ b/rigs/dummy/netrotctl.c @@ -373,3 +373,39 @@ struct rot_caps netrotctl_caps = .get_info = netrotctl_get_info, }; +/* + * S.A.T. rotator mimics net rotor but only minimal capabilities. + * Fails to work with net rotor since it fails dump_state. + */ + +static int satrotcrl_rot_init(ROT *rot) +{ + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + return RIG_OK; +} + +struct rot_caps satrotctl_caps = +{ + ROT_MODEL(ROT_MODEL_SATROTCTL), + .model_name = "S.A.T. Satellite ctl", + .mfg_name = "csntechnologies.net", + .version = "20240609.0", + .copyright = "LGPL", + .status = RIG_STATUS_UNTESTED, + .rot_type = ROT_TYPE_AZEL, + .port_type = RIG_PORT_NETWORK, + .timeout = 400, + + .min_az = -180., + .max_az = 450., + .min_el = 0., + .max_el = 90., + + .priv = NULL, /* priv */ + + .rot_init = satrotcrl_rot_init, + .set_position = netrotctl_set_position, + .get_position = netrotctl_get_position, +}; + diff --git a/rigs/dummy/rot_dummy.c b/rigs/dummy/rot_dummy.c index ae761b93f..ed1a96136 100644 --- a/rigs/dummy/rot_dummy.c +++ b/rigs/dummy/rot_dummy.c @@ -1011,6 +1011,7 @@ DECLARE_INITROT_BACKEND(dummy) rot_register(&dummy_rot_caps); rot_register(&netrotctl_caps); rot_register(&pstrotator_caps); + rot_register(&satrotctl_caps); return RIG_OK; } diff --git a/rigs/dummy/rot_dummy.h b/rigs/dummy/rot_dummy.h index 8106b40dc..a71204843 100644 --- a/rigs/dummy/rot_dummy.h +++ b/rigs/dummy/rot_dummy.h @@ -40,5 +40,6 @@ extern struct rot_caps dummy_rot_caps; extern struct rot_caps netrotctl_caps; extern struct rot_caps pstrotator; +extern struct rot_caps satrotctl_caps; #endif /* _ROT_DUMMY_H */ commit b19c179ce7d455e6b2f294145e9614623d91dcf2 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Jun 10 17:29:51 2024 -0500 Move pstrotator read to a separate thread so that get_pos can see real-time movement diff --git a/include/hamlib/rotator.h b/include/hamlib/rotator.h index 82bc634e2..9d4ccf824 100644 --- a/include/hamlib/rotator.h +++ b/include/hamlib/rotator.h @@ -628,6 +628,7 @@ struct rot_state { int current_speed; /*!< Current speed 1-100, to be used when no change to speed is requested. */ hamlib_port_t rotport; /*!< Rotator port (internal use). */ hamlib_port_t rotport2; /*!< 2nd Rotator port (internal use). */ + rig_ptr_t *pstrotator_handler_priv_data; }; diff --git a/rigs/dummy/rot_pstrotator.c b/rigs/dummy/rot_pstrotator.c index d89d34fab..caf1f911e 100644 --- a/rigs/dummy/rot_pstrotator.c +++ b/rigs/dummy/rot_pstrotator.c @@ -44,8 +44,6 @@ ROT_STATUS_MOVING_EL | ROT_STATUS_MOVING_UP | ROT_STATUS_MOVING_DOWN | \ ROT_STATUS_LIMIT_UP | ROT_STATUS_LIMIT_DOWN | ROT_STATUS_LIMIT_LEFT | ROT_STATUS_LIMIT_RIGHT) -static int simulating = 0; // do we need rotator emulation for debug? - struct pstrotator_rot_priv_data { azimuth_t az; @@ -56,67 +54,9 @@ struct pstrotator_rot_priv_data elevation_t target_el; rot_status_t status; - setting_t funcs; - value_t levels[RIG_SETTING_MAX]; - value_t parms[RIG_SETTING_MAX]; - - struct ext_list *ext_funcs; - struct ext_list *ext_levels; - struct ext_list *ext_parms; - - char *magic_conf; - -// hamlib_port_t port2; // the reply port for PSTRotator which is port+1 int sockfd2; // the reply port for PSTRotator which is port+1 -}; - -static const struct confparams pstrotator_ext_levels[] = -{ - { - TOK_EL_ROT_MAGICLEVEL, "MGL", "Magic level", "Magic level, as an example", - NULL, RIG_CONF_NUMERIC, { .n = { 0, 1, .001 } } - }, - { - TOK_EL_ROT_MAGICFUNC, "MGF", "Magic func", "Magic function, as an example", - NULL, RIG_CONF_CHECKBUTTON - }, - { - TOK_EL_ROT_MAGICOP, "MGO", "Magic Op", "Magic Op, as an example", - NULL, RIG_CONF_BUTTON - }, - { - TOK_EL_ROT_MAGICCOMBO, "MGC", "Magic combo", "Magic combo, as an example", - "VALUE1", RIG_CONF_COMBO, { .c = { .combostr = { "VALUE1", "VALUE2", "NONE", NULL } } } - }, - { RIG_CONF_END, NULL, } -}; - -static const struct confparams pstrotator_ext_funcs[] = -{ - { - TOK_EL_ROT_MAGICEXTFUNC, "MGEF", "Magic ext func", "Magic ext function, as an example", - NULL, RIG_CONF_CHECKBUTTON - }, - { RIG_CONF_END, NULL, } -}; -static const struct confparams pstrotator_ext_parms[] = -{ - { - TOK_EP_ROT_MAGICPARM, "MGP", "Magic parm", "Magic parameter, as an example", - NULL, RIG_CONF_NUMERIC, { .n = { 0, 1, .001 } } - }, - { RIG_CONF_END, NULL, } -}; - -/* cfgparams are configuration item generally used by the backend's open() method */ -static const struct confparams pstrotator_cfg_params[] = -{ - { - TOK_CFG_ROT_MAGICCONF, "mcfg", "Magic conf", "Magic parameter, as an example", - "ROTATOR", RIG_CONF_STRING, { } - }, - { RIG_CONF_END, NULL, } + pthread_t threadid; }; static int write_transaction(ROT *rot, char *cmd) @@ -160,53 +100,166 @@ static int write_transaction(ROT *rot, char *cmd) return RIG_OK; } -static int pstrotator_rot_init(ROT *rot) +static void set_timeout(int fd, int sec, int usec) { - struct pstrotator_rot_priv_data *priv; - struct rot_state *rs = ROTSTATE(rot); + struct timeval timeout; + timeout.tv_sec = sec; + timeout.tv_usec = usec; + //rig_debug(RIG_DEBUG_VERBOSE, "%s: sec=%d, usec=%d, timeout = %.6lf\n", __func__, + // sec, usec, sec + usec / 1e6); - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + if (setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (const char *)&timeout, + sizeof(timeout)) < 0) + { + rig_debug(RIG_DEBUG_ERR, "%s: setsockopt failed: %s\n", __func__, + strerror(errno)); + } +} - rs->priv = (struct pstrotator_rot_priv_data *) - calloc(1, sizeof(struct pstrotator_rot_priv_data)); +void readPacket(int sockfd, char *buf, int buf_len, int expected) +{ + struct sockaddr_in serverAddr; + socklen_t addrLen = sizeof(serverAddr); - if (!rs->priv) + buf[0] = 0; + + if (expected) { - return -RIG_ENOMEM; + set_timeout(sockfd, 1, 0); + } + else + { + set_timeout(sockfd, 0, 0); } - priv = rs->priv; + ssize_t n = recvfrom(sockfd, buf, buf_len, 0, (struct sockaddr *)&serverAddr, + &addrLen); - priv->ext_funcs = alloc_init_ext(pstrotator_ext_funcs); + if (n < 0) + { +#ifdef _WIN32 + int err = WSAGetLastError(); + + if (err == WSAEWOULDBLOCK || err == WSAETIMEDOUT) + { +#if 0 + + if (expected) + rig_debug(RIG_DEBUG_ERR, + "%s: recvfrom timed out. Is PSTRotator Setup/UDP Control enabled?\n", __func__); + +#endif + } + else + { + rig_debug(RIG_DEBUG_ERR, "%s: recvfrom error %d: %s\n", __func__, err, + strerror(errno)); + } - if (!priv->ext_funcs) +#else + + if (errno == EWOULDBLOCK || errno == EAGAIN) + { + if (expected) + rig_debug(RIG_DEBUG_ERR, + "%s: recvfrom timed out. Is PSTRotator Setup/UDP Control checked?\n", __func__); + } + else + { + rig_debug(RIG_DEBUG_ERR, "%s: recvfrom error: %s\n", __func__, strerror(errno)); + } + +#endif + n = 0; + } + + buf[n] = '\0'; // Null-terminate the received data + strtok(buf, "\r\n"); // get rid of CRs and such + + //if (n > 0) { rig_debug(RIG_DEBUG_VERBOSE, "%s: buf=%s\n", __func__, buf); } +} + +#if defined(HAVE_PTHREAD) +#if 0 +typedef struct pstrotator_handler_args_sw +{ + int port; // port for reading PstRotator messages -- always +1 from base port +} pstrotator_handler_args; + +typedef struct pstrotator_handler_priv_data_s +{ + pthread_t thread_id; + pstrotator_handler_args args; +} pstrotator_handler_priv_data; +#endif + +static void *pstrotator_handler_start(void *arg) +{ + ROT *rot = (ROT *)arg; + struct rot_state *rs = STATE(rot); + struct pstrotator_rot_priv_data *priv = rs->priv; + pstrotator_handler_priv_data *pstrotator_handler_priv; + + rs->pstrotator_handler_priv_data = calloc(1, + sizeof(pstrotator_handler_priv_data)); + + if (rs->pstrotator_handler_priv_data == NULL) { - return -RIG_ENOMEM; + rig_debug(RIG_DEBUG_ERR, "%s: priv is NULL?\n", __func__); + return NULL; } - priv->ext_levels = alloc_init_ext(pstrotator_ext_levels); + pstrotator_handler_priv = (pstrotator_handler_priv_data *) + rs->pstrotator_handler_priv_data; + pstrotator_handler_priv->args.rot = rot; + pstrotator_handler_priv->pstrotator_handler_thread_run = 1; - if (!priv->ext_levels) + while (pstrotator_handler_priv->pstrotator_handler_thread_run) { - return -RIG_ENOMEM; + char buf[256]; + readPacket(priv->sockfd2, buf, sizeof(buf), 1); + + if (strlen(buf) == 0) + { + hl_usleep(20 * 1000); + continue; + } + + //dump_hex((unsigned char *)buf, strlen(buf)); + int n = sscanf(buf, "AZ:%g", &priv->az); + n += sscanf(buf, "EL:%g", &priv->el); + //if (n > 0) rig_debug(RIG_DEBUG_CACHE, "%s: az=%.1f, el=%.1f\n", __func__, priv->az, priv->el); } - priv->ext_parms = alloc_init_ext(pstrotator_ext_parms); + return RIG_OK; +} + +#endif + +static int pstrotator_rot_init(ROT *rot) +{ + struct pstrotator_rot_priv_data *priv; + struct rot_state *rs = ROTSTATE(rot); + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - if (!priv->ext_parms) + rs->priv = (struct pstrotator_rot_priv_data *) + calloc(1, sizeof(struct pstrotator_rot_priv_data)); + + if (!rs->priv) { return -RIG_ENOMEM; } + priv = rs->priv; + ROTPORT(rot)->type.rig = RIG_PORT_UDP_NETWORK; priv->az = priv->el = 0; priv->target_az = priv->target_el = 0; - priv->magic_conf = strdup("ROTATOR"); - - strcpy(ROTPORT(rot)->pathname, "192.0.0.1:12000"); + strcpy(ROTPORT(rot)->pathname, "192.168.56.1:12000"); return RIG_OK; } @@ -214,15 +267,13 @@ static int pstrotator_rot_init(ROT *rot) static int pstrotator_rot_cleanup(ROT *rot) { struct rot_state *rs = ROTSTATE(rot); +#if 0 struct pstrotator_rot_priv_data *priv = (struct pstrotator_rot_priv_data *) rs->priv; +#endif rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - free(priv->ext_funcs); - free(priv->ext_levels); - free(priv->ext_parms); - free(priv->magic_conf); free(rs->priv); rs->priv = NULL; @@ -230,30 +281,16 @@ static int pstrotator_rot_cleanup(ROT *rot) return RIG_OK; } -static void set_timeout(int fd, int sec, int usec) -{ - struct timeval timeout; - timeout.tv_sec = sec; - timeout.tv_usec = usec; - rig_debug(RIG_DEBUG_VERBOSE, "%s: sec=%d, usec=%d, timeout = %.6lf\n", __func__, - sec, usec, sec + usec / 1e6); - - if (setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (const char *)&timeout, - sizeof(timeout)) < 0) - { - rig_debug(RIG_DEBUG_ERR, "%s: setsockopt failed: %s\n", __func__, - strerror(errno)); - } -} - static int pstrotator_rot_open(ROT *rot) { struct pstrotator_rot_priv_data *priv; int port = 0; int n1, n2, n3, n4; int sockfd; + int retval; struct sockaddr_in clientAddr; struct rot_state *rs = ROTSTATE(rot); + pthread_attr_t attr; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -289,6 +326,16 @@ static int pstrotator_rot_open(ROT *rot) priv->sockfd2 = sockfd; set_timeout(priv->sockfd2, 1, 0); + pthread_attr_init(&attr); + retval = pthread_create(&priv->threadid, &attr, pstrotator_handler_start, rot); + + if (retval != 0) + { + rig_debug(RIG_DEBUG_ERR, "%s; pthread_create error: %s\n", __func__, + strerror(errno)); + return -RIG_EINTERNAL; + } + return RIG_OK; } @@ -301,6 +348,7 @@ static int pstrotator_rot_close(ROT *rot) static int pstrotator_set_conf(ROT *rot, hamlib_token_t token, const char *val) { +#if 0 struct pstrotator_rot_priv_data *priv; priv = (struct pstrotator_rot_priv_data *)ROTSTATE(rot)->priv; @@ -321,12 +369,16 @@ static int pstrotator_set_conf(ROT *rot, hamlib_token_t token, const char *val) } return RIG_OK; +#else + return -RIG_ENIMPL; +#endif } static int pstrotator_get_conf2(ROT *rot, hamlib_token_t token, char *val, int val_len) { +#if 0 struct pstrotator_rot_priv_data *priv; priv = (struct pstrotator_rot_priv_data *)ROTSTATE(rot)->priv; @@ -342,6 +394,9 @@ static int pstrotator_get_conf2(ROT *rot, hamlib_token_t token, char *val, } return RIG_OK; +#else + return -RIG_ENIMPL; +#endif } static int pstrotator_get_conf(ROT *rot, hamlib_token_t token, char *val) @@ -359,85 +414,17 @@ static int pstrotator_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) rig_debug(RIG_DEBUG_VERBOSE, "%s called: %.2f %.2f\n", __func__, az, el); - if (simulating) - { - priv->target_az = az; - priv->target_el = el; - gettimeofday(&priv->tv, NULL); - } - else - { - char cmd[64]; - sprintf(cmd, "<PST><AZIMUTH>%f.2</AZIMUTH></PST>", az); - write_transaction(rot, cmd); - sprintf(cmd, "<PST><ELEVATION>%f.2</ELEVATION></PST>", el); - write_transaction(rot, cmd); - priv->az = az; - priv->el = el; - } - + char cmd[64]; + sprintf(cmd, "<PST><AZIMUTH>%f.2</AZIMUTH></PST>", az); + write_transaction(rot, cmd); + sprintf(cmd, "<PST><ELEVATION>%f.2</ELEVATION></PST>", el); + write_transaction(rot, cmd); + priv->az = az; + priv->el = el; return RIG_OK; } -void readPacket(int sockfd, char *buf, int buf_len, int expected) -{ - struct sockaddr_in serverAddr; - socklen_t addrLen = sizeof(serverAddr); - - buf[0] = 0; - - if (expected) - { - set_timeout(sockfd, 1, 0); - } - else - { - set_timeout(sockfd, 0, 0); - } - - ssize_t n = recvfrom(sockfd, buf, buf_len, 0, (struct sockaddr *)&serverAddr, - &addrLen); - - if (n < 0) - { -#ifdef _WIN32 - int err = WSAGetLastError(); - - if (err == WSAEWOULDBLOCK || err == WSAETIMEDOUT) - { - if (expected) - rig_debug(RIG_DEBUG_ERR, - "%s: recvfrom timed out. Is PSTRotator Setup/UDP Control enabled?\n", __func__); - } - else - { - rig_debug(RIG_DEBUG_ERR, "%s: recvfrom error %d: %s\n", __func__, err, - strerror(errno)); - } - -#else - - if (errno == EWOULDBLOCK || errno == EAGAIN) - { - if (expected) - rig_debug(RIG_DEBUG_ERR, - "%s: recvfrom timed out. Is PSTRotator Setup/UDP Control checked?\n", __func__); - } - else - { - rig_debug(RIG_DEBUG_ERR, "%s: recvfrom error: %s\n", __func__, strerror(errno)); - } - -#endif - n = 0; - } - - buf[n] = '\0'; // Null-terminate the received data - strtok(buf, "\r\n"); // get rid of CRs and such - - if (n > 0) { rig_debug(RIG_DEBUG_VERBOSE, "%s: buf=%s\n", __func__, buf); } -} /* * Get position of rotor, simulating slow rotation @@ -446,16 +433,20 @@ static int pstrotator_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) { struct pstrotator_rot_priv_data *priv = (struct pstrotator_rot_priv_data *) ROTSTATE(rot)->priv; +#if 0 char buf[64]; int n = 0; fd_set rfds, efds; int select_result; struct timeval timeout; +#endif rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); write_transaction(rot, "<PST>AZ?</PST>"); write_transaction(rot, "<PST>EL?</PST>"); +#if 0 + do { //read_string(&priv->port2, (unsigned char*)buf, sizeof(buf), stopset, stopset_len, 1, 1); @@ -491,10 +482,13 @@ static int pstrotator_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) dump_hex((unsigned char *)buf, strlen(buf)); n += sscanf(buf, "AZ:%g", &priv->az); n += sscanf(buf, "EL:%g", &priv->el); - if (n > 2) n = 2; + + if (n > 2) { n = 2; } } while (strlen(buf) > 0); +#endif + *az = priv->az; *el = priv->el; @@ -559,12 +553,7 @@ struct rot_caps pstrotator_caps = .has_get_parm = PSTROTATOR_ROT_PARM, .has_set_parm = ROT_PARM_SET(PSTROTATOR_ROT_PARM), - .level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, - - .extlevels = pstrotator_ext_levels, - .extfuncs = pstrotator_ext_funcs, - .extparms = pstrotator_ext_parms, - .cfgparams = pstrotator_cfg_params, + //.level_gran = { [ROT_LVL_SPEED] = { .min = { .i = 1 }, .max = { .i = 4 }, .step = { .i = 1 } } }, .has_status = PSTROTATOR_ROT_STATUS, diff --git a/rigs/dummy/rot_pstrotator.h b/rigs/dummy/rot_pstrotator.h index 6e8d5e3c1..9375549a3 100644 --- a/rigs/dummy/rot_pstrotator.h +++ b/rigs/dummy/rot_pstrotator.h @@ -40,4 +40,23 @@ extern struct rot_caps pstrotator_caps; extern struct rot_caps netrotctl_caps; +#if defined(HAVE_PTHREAD) +typedef struct pstrotator_handler_args_sw +{ + ROT *rot; + int port; // port for reading PstRotator messages -- always +1 from base port +} pstrotator_handler_args; + +typedef struct pstrotator_handler_priv_data_s +{ + pthread_t thread_id; + pstrotator_handler_args args; + int pstrotator_handler_thread_run; + int sockfd2; + +} pstrotator_handler_priv_data; +#endif + + + #endif /* _ROT_PSTROTATOR_H */ commit 305e20948e1ada3b0a8db2e5a92dd2f27b4c3208 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jun 9 23:40:52 2024 -0500 Fix ptt for smartsdr slice so only the active slice gets positive ptt diff --git a/rigs/flexradio/smartsdr.c b/rigs/flexradio/smartsdr.c index b0f152545..dd7b04860 100644 --- a/rigs/flexradio/smartsdr.c +++ b/rigs/flexradio/smartsdr.c @@ -52,6 +52,7 @@ struct smartsdr_priv_data int slicenum; // slice 0-7 maps to A-H int seqnum; int ptt; + int tx; // when 1 this slice has PTT control double freqA; double freqB; rmode_t modeA; @@ -178,6 +179,7 @@ int smartsdr_init(RIG *rig) rs->model_name); RETURNFUNC(-RIG_ENIMPL); } + priv->ptt = 0; RETURNFUNC(RIG_OK); @@ -261,11 +263,14 @@ int smartsdr_open(RIG *rig) sprintf(cmd, "sub slice %d", priv->slicenum); //sprintf(cmd, "sub slice all"); smartsdr_transaction(rig, cmd); - do + + do { - hl_usleep(100*1000); - smartsdr_transaction(rig, NULL); - } while (priv->freqA == 0 && --loops > 0); + hl_usleep(100 * 1000); + smartsdr_transaction(rig, NULL); + } + while (priv->freqA == 0 && --loops > 0); + //smartsdr_transaction(rig, "info", buf, sizeof(buf)); //rig_debug(RIG_DEBUG_VERBOSE, "%s: info=%s", __func__, buf); @@ -453,7 +458,13 @@ static int smartsdr_parse_S(RIG *rig, char *s) { if (strcmp(state, "TRANSMITTING") == 0) { priv->ptt = 1; } else { priv->ptt = 0; } - rig_debug(RIG_DEBUG_VERBOSE, "%s: PTT state=%s, ptt=%d\n", __func__, state, priv->ptt); + + rig_debug(RIG_DEBUG_VERBOSE, "%s: PTT state=%s, ptt=%d\n", __func__, state, + priv->ptt); + } + else if (sscanf(p, "tx=%d\n", &priv->tx)) + { + rig_debug(RIG_DEBUG_VERBOSE, "%s: tx=%d\n", __func__, priv->tx); } } while ((p = strtok(NULL, sep))); @@ -519,7 +530,13 @@ int smartsdr_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) struct smartsdr_priv_data *priv = (struct smartsdr_priv_data *)STATE(rig)->priv; ENTERFUNC; smartsdr_transaction(rig, NULL); - *ptt = priv->ptt; + *ptt = 0; + + if (priv->tx) + { + *ptt = priv->ptt; + } + rig_debug(RIG_DEBUG_VERBOSE, "%s: ptt=%d\n", __func__, *ptt); RETURNFUNC(RIG_OK); } diff --git a/rigs/flexradio/smartsdr_caps.h b/rigs/flexradio/smartsdr_caps.h index 75b563a3d..b00ca4e91 100644 --- a/rigs/flexradio/smartsdr_caps.h +++ b/rigs/flexradio/smartsdr_caps.h @@ -1,5 +1,5 @@ .mfg_name = "Flex-radio", - .version = "20240606.0", + .version = "20240609.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + include/hamlib/rotator.h | 1 + include/hamlib/rotlist.h | 1 + rigs/dummy/flrig.c | 9 +- rigs/dummy/netrotctl.c | 36 ++++ rigs/dummy/rot_dummy.c | 1 + rigs/dummy/rot_dummy.h | 1 + rigs/dummy/rot_pstrotator.c | 428 ++++++++++++++++++----------------------- rigs/dummy/rot_pstrotator.h | 19 ++ rigs/flexradio/smartsdr.c | 29 ++- rigs/flexradio/smartsdr_caps.h | 2 +- rigs/kenwood/ts890s.c | 6 +- rigs/tentec/orion.c | 7 +- rigs/tentec/orion.h | 8 +- src/conf.c | 1 - 15 files changed, 294 insertions(+), 256 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2024-06-09 14:03:33
|
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 ff0ed58edf3955596892ed5082ee44da89d94cf9 (commit) via c4e5f54bbfbd7c28f55234bc589f2e953dd7b51f (commit) via 5790af8cc662ed9ceab69740d43813ccf5522b41 (commit) via eeba884c7ef55eb8e5e4a052d7a5c74c3d8c39ff (commit) via 494787cb3c53686e9974f61a5fff6f7a77e7feb4 (commit) via aa94298a098535a841ded77cd22899ad40e5cb6b (commit) via f5870c84ef844aa60be0d710e8b6401214621141 (commit) via 1557ad70f752f7217c1eff963af1a1f3c4f96026 (commit) via c112a5f6a94703f59a9d74d421a25b1b4e606e22 (commit) via efcea5ddcdf28bbef703a37968e6cfd815208292 (commit) via 83583b6c0ae25d10c51991358c0ff7555a743688 (commit) via 967efefabef228ad44de7f8a9bc898c9c82ad05f (commit) via 07e50854486178270e286b1bbd81fe4c087adbce (commit) via 0884532e97a37af7227dcf6392ce85a5b46dec1e (commit) via 2c863c732298a46b97a9f3d48b0df26a327dc690 (commit) via 53287de4878e0bc53199dc9ce9aefbf7b2cf973f (commit) via 5b84c02b807babd12406826e0af75fed5576b7e1 (commit) via d17290b835c502b98936a107e11ef1fc261b3894 (commit) via d6dcd4aad43a791d34ecedac024fd00b32d270d6 (commit) via 9e4bacbec92d7f9e68b26b87a9736873df05baae (commit) via 9eda0628f6a68191a816706cb829afcc0c47af43 (commit) via a42d408094d89599529abae3be84c5b6415a3792 (commit) via 95cfde24f4582e38eac9a81c46e19220d23fc4c4 (commit) via b0df007d6b33d46f01bfb03d7c1c92f9f713f035 (commit) via 0dce1e478f7f63f511be43596ae33bc760f865cf (commit) via 3e6b9da1ebec41f9fd92045f603dfa7d33c34d88 (commit) via da264c2732c206dfe589770fd29f35f3dec800bf (commit) via a9c2569b69959fadb099801773ad65fa72dc34e2 (commit) from 4058b021d45946c8ff92c0ec6313cafa9e0c0507 (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 ff0ed58edf3955596892ed5082ee44da89d94cf9 Merge: 1557ad70f c4e5f54bb Author: Michael Black <mdb...@ya...> Date: Sat Jun 8 11:09:02 2024 -0500 Merge pull request #1563 from GeoBaltz/rp11 Convert all rig->state references in rigs/*/* to macro calls commit c4e5f54bbfbd7c28f55234bc589f2e953dd7b51f Author: George Baltz N3GB <Geo...@gm...> Date: Sat Jun 8 03:53:17 2024 -0400 FIx the stragglers Comments/false postitives New code diff --git a/rigs/dummy/rot_pstrotator.c b/rigs/dummy/rot_pstrotator.c index 2de2d9f81..d89d34fab 100644 --- a/rigs/dummy/rot_pstrotator.c +++ b/rigs/dummy/rot_pstrotator.c @@ -163,18 +163,19 @@ static int write_transaction(ROT *rot, char *cmd) static int pstrotator_rot_init(ROT *rot) { struct pstrotator_rot_priv_data *priv; + struct rot_state *rs = ROTSTATE(rot); rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - rot->state.priv = (struct pstrotator_rot_priv_data *) + rs->priv = (struct pstrotator_rot_priv_data *) calloc(1, sizeof(struct pstrotator_rot_priv_data)); - if (!rot->state.priv) + if (!rs->priv) { return -RIG_ENOMEM; } - priv = rot->state.priv; + priv = rs->priv; priv->ext_funcs = alloc_init_ext(pstrotator_ext_funcs); @@ -212,8 +213,9 @@ static int pstrotator_rot_init(ROT *rot) static int pstrotator_rot_cleanup(ROT *rot) { + struct rot_state *rs = ROTSTATE(rot); struct pstrotator_rot_priv_data *priv = (struct pstrotator_rot_priv_data *) - rot->state.priv; + rs->priv; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -221,9 +223,9 @@ static int pstrotator_rot_cleanup(ROT *rot) free(priv->ext_levels); free(priv->ext_parms); free(priv->magic_conf); - free(rot->state.priv); + free(rs->priv); - rot->state.priv = NULL; + rs->priv = NULL; return RIG_OK; } @@ -251,11 +253,12 @@ static int pstrotator_rot_open(ROT *rot) int n1, n2, n3, n4; int sockfd; struct sockaddr_in clientAddr; + struct rot_state *rs = ROTSTATE(rot); rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - priv = (struct pstrotator_rot_priv_data *)rot->state.priv; - //priv->port2 = rot->state.rotport; + priv = (struct pstrotator_rot_priv_data *)rs->priv; + //priv->port2 = rs->rotport; //priv->port2.type.rig = RIG_PORT_UDP_NETWORK; rig_debug(RIG_DEBUG_VERBOSE, "%s: pathname=%s\n", __func__, @@ -300,7 +303,7 @@ static int pstrotator_set_conf(ROT *rot, hamlib_token_t token, const char *val) { struct pstrotator_rot_priv_data *priv; - priv = (struct pstrotator_rot_priv_data *)rot->state.priv; + priv = (struct pstrotator_rot_priv_data *)ROTSTATE(rot)->priv; switch (token) { @@ -326,7 +329,7 @@ static int pstrotator_get_conf2(ROT *rot, hamlib_token_t token, char *val, { struct pstrotator_rot_priv_data *priv; - priv = (struct pstrotator_rot_priv_data *)rot->state.priv; + priv = (struct pstrotator_rot_priv_data *)ROTSTATE(rot)->priv; switch (token) { @@ -351,7 +354,7 @@ static int pstrotator_get_conf(ROT *rot, hamlib_token_t token, char *val) static int pstrotator_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) { struct pstrotator_rot_priv_data *priv = (struct pstrotator_rot_priv_data *) - rot->state.priv; + ROTSTATE(rot)->priv; rig_debug(RIG_DEBUG_VERBOSE, "%s called: %.2f %.2f\n", __func__, az, el); @@ -442,7 +445,7 @@ void readPacket(int sockfd, char *buf, int buf_len, int expected) static int pstrotator_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) { struct pstrotator_rot_priv_data *priv = (struct pstrotator_rot_priv_data *) - rot->state.priv; + ROTSTATE(rot)->priv; char buf[64]; int n = 0; fd_set rfds, efds; @@ -519,7 +522,7 @@ static int pstrotator_rot_get_status(ROT *rot, rot_status_t *status) { const struct pstrotator_rot_priv_data *priv = (struct pstrotator_rot_priv_data *) - rot->state.priv; + ROTSTATE(rot)->priv; *status = priv->status; diff --git a/rigs/tentec/orion.c b/rigs/tentec/orion.c index 6873cd68b..89cf4d157 100644 --- a/rigs/tentec/orion.c +++ b/rigs/tentec/orion.c @@ -694,6 +694,7 @@ int tt565_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) char ttmode, ttreceiver; int retry; int timeout; + struct rig_state *rs = STATE(rig); ttreceiver = which_receiver(rig, vfo); @@ -743,15 +744,15 @@ int tt565_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) /* Query passband width (filter) */ // since this fails at 80ms sometimes we won't retry and will reduce the timeout // Normally this comes back in about 30ms - retry = rig->state.retry; - timeout = rig->state.timeout; - rig->state.retry = 0; - rig->state.timeout = 100; + retry = rs->retry; + timeout = rs->timeout; + rs->retry = 0; + rs->timeout = 100; SNPRINTF(cmdbuf, sizeof(cmdbuf), "?R%cF" EOM, ttreceiver); resp_len = sizeof(respbuf); retval = tt565_transaction(rig, cmdbuf, strlen(cmdbuf), respbuf, &resp_len); - rig->state.retry = retry; - rig->state.timeout = timeout; + rs->retry = retry; + rs->timeout = timeout; if (retval != RIG_OK) { diff --git a/rigs/yaesu/ft1000d.c b/rigs/yaesu/ft1000d.c index 2f2b479ac..84ccbf3ff 100644 --- a/rigs/yaesu/ft1000d.c +++ b/rigs/yaesu/ft1000d.c @@ -2439,7 +2439,7 @@ static int ft1000d_set_vfo(RIG *rig, vfo_t vfo) } priv = (struct ft1000d_priv_data *)STATE(rig)->priv; - rig_debug(RIG_DEBUG_TRACE, "%s: MADE IT TO rig.state.priv = 0x%02x\n", __func__, + rig_debug(RIG_DEBUG_TRACE, "%s: MADE IT TO STATE(rig)->priv = 0x%02x\n", __func__, RIG_VFO_CURR); // if (vfo == RIG_VFO_CURR) { diff --git a/rigs/yaesu/ft847.c b/rigs/yaesu/ft847.c index b4ebe6d0a..4dfba1c28 100644 --- a/rigs/yaesu/ft847.c +++ b/rigs/yaesu/ft847.c @@ -1005,7 +1005,7 @@ struct rig_caps ft847uni_caps = /* * setup *priv - * serial port is already open (rig->state->fd) + * serial port is already open (STATE(rig)->fd) */ static int ft847_init(RIG *rig) commit 5790af8cc662ed9ceab69740d43813ccf5522b41 Author: George Baltz N3GB <Geo...@gm...> Date: Sat Jun 8 03:27:18 2024 -0400 Convert newcat.c diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 85a20865c..2219f18aa 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -476,15 +476,15 @@ int newcat_init(RIG *rig) ENTERFUNC; - rig->state.priv = (struct newcat_priv_data *) calloc(1, + STATE(rig)->priv = (struct newcat_priv_data *) calloc(1, sizeof(struct newcat_priv_data)); - if (!rig->state.priv) /* whoops! memory shortage! */ + if (!STATE(rig)->priv) /* whoops! memory shortage! */ { RETURNFUNC(-RIG_ENOMEM); } - priv = rig->state.priv; + priv = STATE(rig)->priv; // priv->current_vfo = RIG_VFO_MAIN; /* default to whatever */ // priv->current_vfo = RIG_VFO_A; @@ -534,12 +534,12 @@ int newcat_cleanup(RIG *rig) ENTERFUNC; - if (rig->state.priv) + if (STATE(rig)->priv) { - free(rig->state.priv); + free(STATE(rig)->priv); } - rig->state.priv = NULL; + STATE(rig)->priv = NULL; RETURNFUNC(RIG_OK); } @@ -554,8 +554,8 @@ int newcat_cleanup(RIG *rig) int newcat_open(RIG *rig) { - struct newcat_priv_data *priv = rig->state.priv; - struct rig_state *rig_s = &rig->state; + struct rig_state *rig_s = STATE(rig); + struct newcat_priv_data *priv = rig_s->priv; hamlib_port_t *rp = RIGPORT(rig); const char *handshake[3] = {"None", "Xon/Xoff", "Hardware"}; int err; @@ -659,7 +659,7 @@ int newcat_open(RIG *rig) if (priv->rig_id == NC_RIGID_FTDX3000 || priv->rig_id == NC_RIGID_FTDX3000DM) { - rig->state.disable_yaesu_bandselect = 1; + rig_s->disable_yaesu_bandselect = 1; rig_debug(RIG_DEBUG_VERBOSE, "%s: disabling FTDX3000 band select\n", __func__); } @@ -703,8 +703,8 @@ int newcat_open(RIG *rig) int newcat_close(RIG *rig) { - struct newcat_priv_data *priv = rig->state.priv; - struct rig_state *rig_s = &rig->state; + struct rig_state *rig_s = STATE(rig); + struct newcat_priv_data *priv = rig_s->priv; ENTERFUNC; @@ -753,7 +753,7 @@ int newcat_set_conf(RIG *rig, hamlib_token_t token, const char *val) ENTERFUNC; - priv = (struct newcat_priv_data *)rig->state.priv; + priv = (struct newcat_priv_data *)STATE(rig)->priv; if (priv == NULL) { @@ -806,7 +806,7 @@ int newcat_get_conf2(RIG *rig, hamlib_token_t token, char *val, int val_len) ENTERFUNC; - priv = (struct newcat_priv_data *)rig->state.priv; + priv = (struct newcat_priv_data *)STATE(rig)->priv; if (priv == NULL) { @@ -836,7 +836,7 @@ static int freq_60m[] = { 5332000, 5348000, 5358500, 5373000, 5405000 }; /* returns 0 if no exception or 1 if rig needs special handling */ int newcat_60m_exception(RIG *rig, freq_t freq, mode_t mode) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; int channel = -1; int i; @@ -937,6 +937,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) int err; struct rig_caps *caps; struct rig_cache *cachep = CACHE(rig); + struct rig_state *rig_s = STATE(rig); struct newcat_priv_data *priv; int special_60m = 0; vfo_t vfo_mode; @@ -965,7 +966,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) RETURNFUNC(-RIG_ENAVAIL); } - priv = (struct newcat_priv_data *)rig->state.priv; + priv = (struct newcat_priv_data *)rig_s->priv; caps = rig->caps; newcat_get_vfo_mode(rig, RIG_VFO_A, &vfo_mode); @@ -1033,7 +1034,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if ((is_ftdx101d || is_ftdx101mp) && cachep->ptt == RIG_PTT_ON) { rig_debug(RIG_DEBUG_TRACE, "%s: ftdx101 check vfo OK, vfo=%s, tx_vfo=%s\n", - __func__, rig_strvfo(vfo), rig_strvfo(rig->state.tx_vfo)); + __func__, rig_strvfo(vfo), rig_strvfo(rig_s->tx_vfo)); // when in split we can change VFOB but not VFOA if (cachep->split == RIG_SPLIT_ON && target_vfo == '0') { return -RIG_ENTARGET; } @@ -1041,7 +1042,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // when not in split we can't change VFOA at all if (cachep->split == RIG_SPLIT_OFF && target_vfo == '0') { return -RIG_ENTARGET; } - if (vfo != rig->state.tx_vfo) { return -RIG_ENTARGET; } + if (vfo != rig_s->tx_vfo) { return -RIG_ENTARGET; } } if (is_ftdx3000 || is_ftdx3000dm || is_ftdx5000 || is_ftdx1200) @@ -1119,8 +1120,8 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // And only when not in split mode (note this check has been removed for testing) int changing; - rig_debug(RIG_DEBUG_TRACE, "%s(%d)%s: rig->state.current_vfo=%s\n", __FILE__, - __LINE__, __func__, rig_strvfo(rig->state.current_vfo)); + rig_debug(RIG_DEBUG_TRACE, "%s(%d)%s: STATE(rig)->current_vfo=%s\n", __FILE__, + __LINE__, __func__, rig_strvfo(rig_s->current_vfo)); CACHE_RESET; @@ -1146,7 +1147,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) } if (newcat_valid_command(rig, "BS") && changing - && !rig->state.disable_yaesu_bandselect + && !rig_s->disable_yaesu_bandselect // remove the split check here -- hopefully works OK //&& !cachep->split // seems some rigs are problematic @@ -1161,7 +1162,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) && rig->caps->set_vfo != NULL) // gotta' have get_vfo too { - if (rig->state.current_vfo != vfo) + if (rig_s->current_vfo != vfo) { int vfo1 = 1, vfo2 = 0; @@ -1229,7 +1230,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (err != RIG_OK) { RETURNFUNC(err); } - if (rig->state.vfo_list & RIG_VFO_MAIN) + if (rig_s->vfo_list & RIG_VFO_MAIN) { err = rig_set_vfo(rig, vfotmp == RIG_VFO_MAIN ? RIG_VFO_SUB : RIG_VFO_MAIN); } @@ -1263,7 +1264,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) } // switch back to the starting vfo - if (rig->state.vfo_list & RIG_VFO_MAIN) + if (rig_s->vfo_list & RIG_VFO_MAIN) { err = rig_set_vfo(rig, vfotmp == RIG_VFO_MAIN ? RIG_VFO_MAIN : RIG_VFO_SUB); } @@ -1387,7 +1388,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) } rig_debug(RIG_DEBUG_TRACE, "%s: band changing? old=%d, new=%d\n", __func__, - newcat_band_index(freq), newcat_band_index(rig->state.current_freq)); + newcat_band_index(freq), newcat_band_index(rig_s->current_freq)); if (RIG_MODEL_FT450 == caps->rig_model && priv->ret_data[2] != target_vfo) { @@ -1418,7 +1419,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) int newcat_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) { char command[3]; - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; char c; int err; @@ -1500,7 +1501,7 @@ int newcat_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) pbwidth_t twidth; split_t split_save = cachep->split; - priv = (struct newcat_priv_data *)rig->state.priv; + priv = (struct newcat_priv_data *)STATE(rig)->priv; ENTERFUNC; @@ -1611,7 +1612,7 @@ int newcat_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) int newcat_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; char c; int err; char main_sub_vfo = '0'; @@ -1623,7 +1624,7 @@ int newcat_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) RETURNFUNC(-RIG_ENAVAIL); } - if (rig->state.powerstat == 0) + if (STATE(rig)->powerstat == 0) { rig_debug(RIG_DEBUG_WARN, "%s: Cannot get from rig when power is off\n", __func__); @@ -1697,8 +1698,8 @@ int newcat_set_vfo(RIG *rig, vfo_t vfo) vfo_t vfo_mode; char command[] = "VS"; - priv = (struct newcat_priv_data *)rig->state.priv; - state = &rig->state; + state = STATE(rig); + priv = (struct newcat_priv_data *)state->priv; priv->cache_start.tv_sec = 0; // invalidate the cache @@ -1805,7 +1806,7 @@ int newcat_set_vfo(RIG *rig, vfo_t vfo) state->current_vfo = vfo; /* if set_vfo worked, set current_vfo */ - rig_debug(RIG_DEBUG_TRACE, "%s: rig->state.current_vfo = %s\n", __func__, + rig_debug(RIG_DEBUG_TRACE, "%s: STATE(rig)->current_vfo = %s\n", __func__, rig_strvfo(vfo)); RETURNFUNC(RIG_OK); @@ -1814,7 +1815,7 @@ int newcat_set_vfo(RIG *rig, vfo_t vfo) // Either returns a valid RIG_VFO* or if < 0 an error code static vfo_t newcat_set_vfo_if_needed(RIG *rig, vfo_t vfo) { - vfo_t oldvfo = rig->state.current_vfo; + vfo_t oldvfo = STATE(rig)->current_vfo; ENTERFUNC; rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s, oldvfo=%s\n", __func__, rig_strvfo(vfo), @@ -1847,8 +1848,8 @@ static vfo_t newcat_set_vfo_if_needed(RIG *rig, vfo_t vfo) int newcat_get_vfo(RIG *rig, vfo_t *vfo) { - struct rig_state *state = &rig->state; - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct rig_state *state = STATE(rig); + struct newcat_priv_data *priv = (struct newcat_priv_data *)state->priv; int err; vfo_t vfo_mode; char const *command = "VS"; @@ -1882,13 +1883,13 @@ int newcat_get_vfo(RIG *rig, vfo_t *vfo) switch (priv->ret_data[2]) { case '0': - if (rig->state.vfo_list & RIG_VFO_MAIN) { *vfo = RIG_VFO_MAIN; } + if (state->vfo_list & RIG_VFO_MAIN) { *vfo = RIG_VFO_MAIN; } else { *vfo = RIG_VFO_A; } break; case '1': - if (rig->state.vfo_list & RIG_VFO_SUB) { *vfo = RIG_VFO_SUB; } + if (state->vfo_list & RIG_VFO_SUB) { *vfo = RIG_VFO_SUB; } else { *vfo = RIG_VFO_B; } break; @@ -1912,7 +1913,7 @@ int newcat_get_vfo(RIG *rig, vfo_t *vfo) state->current_vfo = *vfo; /* set now */ - rig_debug(RIG_DEBUG_TRACE, "%s: rig->state.current_vfo = %s\n", __func__, + rig_debug(RIG_DEBUG_TRACE, "%s: STATE(rig)->current_vfo = %s\n", __func__, rig_strvfo(state->current_vfo)); RETURNFUNC(RIG_OK); @@ -1921,7 +1922,7 @@ int newcat_get_vfo(RIG *rig, vfo_t *vfo) int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err = -RIG_EPROTO; char txon[] = "TX1;"; @@ -1986,9 +1987,9 @@ int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) // some rigs like the FT991 need time before doing anything else like set_freq // We won't mess with CW mode -- no freq change expected hopefully - if (rig->state.current_mode != RIG_MODE_CW - && rig->state.current_mode != RIG_MODE_CWR - && rig->state.current_mode != RIG_MODE_CWN + if (STATE(rig)->current_mode != RIG_MODE_CW + && STATE(rig)->current_mode != RIG_MODE_CWR + && STATE(rig)->current_mode != RIG_MODE_CWN && (is_ftdx3000 || is_ftdx3000dm) ) { @@ -2010,7 +2011,7 @@ int newcat_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) int newcat_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; char c; int err; @@ -2063,7 +2064,7 @@ int newcat_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) int newcat_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; char c; char command[] = "OS"; @@ -2116,7 +2117,7 @@ int newcat_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift) int newcat_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; char c; char command[] = "OS"; @@ -2177,7 +2178,7 @@ int newcat_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift) int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; char command[32]; freq_t freq = 0; @@ -2422,7 +2423,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; int ret_data_len; char *retoffs; @@ -2897,9 +2898,9 @@ int newcat_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) } rig_debug(RIG_DEBUG_TRACE, "%s: tx_vfo=%s, curr_vfo=%s\n", __func__, - rig_strvfo(*tx_vfo), rig_strvfo(rig->state.current_vfo)); + rig_strvfo(*tx_vfo), rig_strvfo(STATE(rig)->current_vfo)); - if (*tx_vfo != rig->state.current_vfo) + if (*tx_vfo != STATE(rig)->current_vfo) { *split = RIG_SPLIT_ON; } @@ -2918,7 +2919,7 @@ int newcat_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) int newcat_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int oldvfo; int ret; @@ -2970,7 +2971,7 @@ int newcat_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) int newcat_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; char *retval; int err; int offset = 0; @@ -3034,7 +3035,7 @@ int newcat_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) int newcat_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int oldvfo; int ret; @@ -3087,7 +3088,7 @@ int newcat_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit) int newcat_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; char *retval; int err; int offset = 0; @@ -3293,7 +3294,7 @@ int newcat_get_tone(RIG *rig, vfo_t vfo, tone_t *tone) int newcat_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; int i; ncboolean tone_match; @@ -3363,7 +3364,7 @@ int newcat_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone) int newcat_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; int t; int ret_data_len; @@ -3675,7 +3676,7 @@ int newcat_mW2power(RIG *rig, float *power, unsigned int mwpower, freq_t freq, int newcat_set_powerstat(RIG *rig, powerstat_t status) { hamlib_port_t *rp = RIGPORT(rig); - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int retval; int i = 0; int retry_save; @@ -3768,7 +3769,7 @@ int newcat_set_powerstat(RIG *rig, powerstat_t status) */ int newcat_get_powerstat(RIG *rig, powerstat_t *status) { - struct newcat_priv_data *priv = (struct newcat_priv_data *) rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; hamlib_port_t *rp = RIGPORT(rig); int result; char ps; @@ -3881,7 +3882,7 @@ EX0301033 => RX-ANT => MONITOR [RANT] */ int newcat_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; char which_ant; char command[] = "AN"; @@ -3973,7 +3974,7 @@ int newcat_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) int newcat_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option, ant_t *ant_curr, ant_t *ant_tx, ant_t *ant_rx) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; char c; char command[] = "AN"; @@ -4092,7 +4093,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { struct rig_state *state = STATE(rig); struct rig_cache *cachep = CACHE(rig); - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; int i; int fpf; @@ -4303,9 +4304,9 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) rmode_t exclude = RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR; - if ((rig->state.tx_vfo == RIG_VFO_A && (cachep->modeMainA & exclude)) - || (rig->state.tx_vfo == RIG_VFO_B && (cachep->modeMainB & exclude)) - || (rig->state.tx_vfo == RIG_VFO_C && (cachep->modeMainC & exclude))) + if ((STATE(rig)->tx_vfo == RIG_VFO_A && (cachep->modeMainA & exclude)) + || (STATE(rig)->tx_vfo == RIG_VFO_B && (cachep->modeMainB & exclude)) + || (STATE(rig)->tx_vfo == RIG_VFO_C && (cachep->modeMainC & exclude))) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig cannot set MG in CW/RTTY modes\n", __func__); @@ -4908,7 +4909,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_USB_AF: if (is_ftdx101d || is_ftdx101mp) { - rmode_t curmode = rig->state.current_vfo == RIG_VFO_A ? + rmode_t curmode = STATE(rig)->current_vfo == RIG_VFO_A ? cachep->modeMainA : cachep->modeMainB; float valf = val.f / level_info->step.f; @@ -4965,7 +4966,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { struct rig_state *state = STATE(rig); struct rig_cache *cachep = CACHE(rig); - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; int ret_data_len; char *retlvl; @@ -5121,9 +5122,9 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) rmode_t exclude = RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR; - if ((rig->state.tx_vfo == RIG_VFO_A && (cachep->modeMainA & exclude)) - || (rig->state.tx_vfo == RIG_VFO_B && (cachep->modeMainB & exclude)) - || (rig->state.tx_vfo == RIG_VFO_C && (cachep->modeMainC & exclude))) + if ((STATE(rig)->tx_vfo == RIG_VFO_A && (cachep->modeMainA & exclude)) + || (STATE(rig)->tx_vfo == RIG_VFO_B && (cachep->modeMainB & exclude)) + || (STATE(rig)->tx_vfo == RIG_VFO_C && (cachep->modeMainC & exclude))) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig cannot read MG in CW/RTTY modes\n", __func__); @@ -5505,7 +5506,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_USB_AF_INPUT: if (is_ftdx101d || is_ftdx101mp) { - rmode_t curmode = rig->state.current_vfo == RIG_VFO_A ? + rmode_t curmode = STATE(rig)->current_vfo == RIG_VFO_A ? cachep->modeMainA : cachep->modeMainB; switch (curmode) @@ -5547,7 +5548,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_USB_AF: if (is_ftdx101d || is_ftdx101mp) { - rmode_t curmode = rig->state.current_vfo == RIG_VFO_A ? + rmode_t curmode = STATE(rig)->current_vfo == RIG_VFO_A ? cachep->modeMainA : cachep->modeMainB; switch (curmode) @@ -6058,7 +6059,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; char main_sub_vfo = '0'; @@ -6497,7 +6498,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; int ret_data_len; int last_char_index; @@ -6912,7 +6913,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) int newcat_set_parm(RIG *rig, setting_t parm, value_t val) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int retval; int rigband = 0; int band = 0; @@ -6982,7 +6983,7 @@ int newcat_set_parm(RIG *rig, setting_t parm, value_t val) int newcat_get_parm(RIG *rig, setting_t parm, value_t *val) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int retval; ENTERFUNC; @@ -7024,7 +7025,7 @@ static int newcat_set_maxpower(RIG *rig, vfo_t vfo, hamlib_token_t token, static int newcat_get_maxpower(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t *val) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int retval; int code = 0; int offset = 0; @@ -7086,7 +7087,7 @@ static int newcat_get_maxpower(RIG *rig, vfo_t vfo, hamlib_token_t token, int newcat_set_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t val) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; ENTERFUNC; @@ -7140,7 +7141,7 @@ int newcat_set_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t val) int newcat_get_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t *val) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; char *result; int retval; int value; @@ -7301,7 +7302,7 @@ int newcat_recv_dtmf(RIG *rig, vfo_t vfo, char *digits, int *length) int newcat_send_morse(RIG *rig, vfo_t vfo, const char *msg) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int rc; ENTERFUNC; @@ -7398,7 +7399,7 @@ int newcat_set_bank(RIG *rig, vfo_t vfo, int bank) int newcat_set_mem(RIG *rig, vfo_t vfo, int ch) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err, i; ncboolean restore_vfo; chan_t *chan_list; @@ -7510,7 +7511,7 @@ int newcat_set_mem(RIG *rig, vfo_t vfo, int ch) int newcat_get_mem(RIG *rig, vfo_t vfo, int *ch) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; ENTERFUNC; @@ -7537,7 +7538,7 @@ int newcat_get_mem(RIG *rig, vfo_t vfo, int *ch) int newcat_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; char main_sub_vfo = '0'; @@ -7639,7 +7640,7 @@ int newcat_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) int newcat_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int retval; ENTERFUNC; @@ -7662,7 +7663,7 @@ int newcat_scan(RIG *rig, vfo_t vfo, scan_t scan, int ch) int newcat_set_trn(RIG *rig, int trn) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; char c; ENTERFUNC; @@ -7691,7 +7692,7 @@ int newcat_set_trn(RIG *rig, int trn) int newcat_get_trn(RIG *rig, int *trn) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; char c; char command[] = "AI"; @@ -7742,8 +7743,8 @@ int newcat_decode_event(RIG *rig) int newcat_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan) { - struct rig_state *state = &rig->state; - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct rig_state *state = STATE(rig); + struct newcat_priv_data *priv = (struct newcat_priv_data *)state->priv; int err, i; int rxit; char c_rit, c_xit, c_mode, c_vfo, c_tone, c_rptr_shift; @@ -7910,7 +7911,7 @@ int newcat_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan) int newcat_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; char *retval; char c, c2; int err, i; @@ -8102,7 +8103,7 @@ int newcat_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) const char *newcat_get_info(RIG *rig) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; static char idbuf[129]; /* extra large static string array */ /* Build the command string */ @@ -8270,7 +8271,7 @@ ncboolean newcat_is_rig(RIG *rig, rig_model_t model) int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo) { - struct newcat_priv_data *priv = (struct newcat_priv_data *) rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *) STATE(rig)->priv; char *command = "FT"; int result; char p1; @@ -8340,7 +8341,7 @@ int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo) RETURNFUNC(result); } - rig->state.tx_vfo = tx_vfo; + STATE(rig)->tx_vfo = tx_vfo; RETURNFUNC(result); } @@ -8348,7 +8349,7 @@ int newcat_set_tx_vfo(RIG *rig, vfo_t tx_vfo) int newcat_get_tx_vfo(RIG *rig, vfo_t *tx_vfo) { - struct newcat_priv_data *priv = (struct newcat_priv_data *) rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *) STATE(rig)->priv; char const *command = "FT"; vfo_t vfo_mode; int result; @@ -8373,7 +8374,7 @@ int newcat_get_tx_vfo(RIG *rig, vfo_t *tx_vfo) switch (c) { case '0': - if (rig->state.vfo_list & RIG_VFO_MAIN) + if (STATE(rig)->vfo_list & RIG_VFO_MAIN) { *tx_vfo = RIG_VFO_MAIN; } @@ -8385,7 +8386,7 @@ int newcat_get_tx_vfo(RIG *rig, vfo_t *tx_vfo) break; case '1' : - if (rig->state.vfo_list & RIG_VFO_SUB) + if (STATE(rig)->vfo_list & RIG_VFO_SUB) { *tx_vfo = RIG_VFO_SUB; } @@ -8424,7 +8425,7 @@ int newcat_get_tx_vfo(RIG *rig, vfo_t *tx_vfo) static int newcat_set_split(RIG *rig, split_t split, vfo_t *rx_vfo, vfo_t *tx_vfo) { - struct newcat_priv_data *priv = (struct newcat_priv_data *) rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *) STATE(rig)->priv; char *command = "ST"; char p1; int result; @@ -8474,8 +8475,8 @@ static int newcat_set_split(RIG *rig, split_t split, vfo_t *rx_vfo, switch (split) { case RIG_SPLIT_OFF: - *rx_vfo = rig->state.current_vfo; - *tx_vfo = rig->state.current_vfo; + *rx_vfo = STATE(rig)->current_vfo; + *tx_vfo = STATE(rig)->current_vfo; break; case RIG_SPLIT_ON: @@ -8493,7 +8494,7 @@ static int newcat_set_split(RIG *rig, split_t split, vfo_t *rx_vfo, } else { - *rx_vfo = rig->state.current_vfo; + *rx_vfo = STATE(rig)->current_vfo; result = newcat_get_tx_vfo(rig, tx_vfo); @@ -8515,7 +8516,7 @@ static int newcat_set_split(RIG *rig, split_t split, vfo_t *rx_vfo, static int newcat_get_split(RIG *rig, split_t *split, vfo_t *tx_vfo) { - struct newcat_priv_data *priv = (struct newcat_priv_data *) rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *) STATE(rig)->priv; char const *command = "ST"; int result; char c; @@ -8621,19 +8622,19 @@ int newcat_set_vfo_from_alias(RIG *rig, vfo_t *vfo) case RIG_VFO_CURR: /* RIG_VFO_RX == RIG_VFO_CURR */ case RIG_VFO_VFO: - *vfo = rig->state.current_vfo; + *vfo = STATE(rig)->current_vfo; break; case RIG_VFO_TX: /* set to another vfo for split or uplink */ - if (rig->state.vfo_list & RIG_VFO_MAIN) + if (STATE(rig)->vfo_list & RIG_VFO_MAIN) { - *vfo = (rig->state.current_vfo == RIG_VFO_SUB) ? RIG_VFO_MAIN : RIG_VFO_SUB; + *vfo = (STATE(rig)->current_vfo == RIG_VFO_SUB) ? RIG_VFO_MAIN : RIG_VFO_SUB; } else { - *vfo = (rig->state.current_vfo == RIG_VFO_B) ? RIG_VFO_A : RIG_VFO_B; + *vfo = (STATE(rig)->current_vfo == RIG_VFO_B) ? RIG_VFO_A : RIG_VFO_B; } break; @@ -8656,7 +8657,7 @@ int newcat_set_vfo_from_alias(RIG *rig, vfo_t *vfo) int newcat_set_narrow(RIG *rig, vfo_t vfo, ncboolean narrow) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; char c; char main_sub_vfo = '0'; @@ -8700,7 +8701,7 @@ int newcat_set_narrow(RIG *rig, vfo_t vfo, ncboolean narrow) int newcat_get_narrow(RIG *rig, vfo_t vfo, ncboolean *narrow) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; char c; char command[] = "NA"; @@ -8752,7 +8753,7 @@ int newcat_get_narrow(RIG *rig, vfo_t vfo, ncboolean *narrow) // if vfo != RIG_VFO_NONE then will use NA0 or NA1 depending on vfo Main or Sub static int get_narrow(RIG *rig, vfo_t vfo) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int narrow = 0; int err; @@ -8779,7 +8780,7 @@ static int get_narrow(RIG *rig, vfo_t vfo) int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; int w = 0; char main_sub_vfo = '0'; @@ -9642,7 +9643,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) static int set_roofing_filter(RIG *rig, vfo_t vfo, int index) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; struct newcat_priv_caps *priv_caps = (struct newcat_priv_caps *)rig->caps->priv; struct newcat_roofing_filter *roofing_filters; char main_sub_vfo = '0'; @@ -9747,7 +9748,7 @@ static int set_roofing_filter_for_width(RIG *rig, vfo_t vfo, int width) static int get_roofing_filter(RIG *rig, vfo_t vfo, struct newcat_roofing_filter **roofing_filter) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; struct newcat_priv_caps *priv_caps = (struct newcat_priv_caps *)rig->caps->priv; struct newcat_roofing_filter *roofing_filters; char roofing_filter_choice; @@ -9809,7 +9810,7 @@ static int get_roofing_filter(RIG *rig, vfo_t vfo, int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; int w; int sh_command_valid = 1; @@ -10946,7 +10947,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) int newcat_set_faststep(RIG *rig, ncboolean fast_step) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; char c; ENTERFUNC; @@ -10975,7 +10976,7 @@ int newcat_set_faststep(RIG *rig, ncboolean fast_step) int newcat_get_faststep(RIG *rig, ncboolean *fast_step) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; char c; char command[] = "FS"; @@ -11012,7 +11013,7 @@ int newcat_get_faststep(RIG *rig, ncboolean *fast_step) int newcat_get_rigid(RIG *rig) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; const char *s = NULL; ENTERFUNC; @@ -11050,7 +11051,7 @@ int newcat_get_rigid(RIG *rig) */ int newcat_get_vfo_mode(RIG *rig, vfo_t vfo, vfo_t *vfo_mode) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; int offset = 0; char *cmd = "IF"; @@ -11076,7 +11077,7 @@ int newcat_get_vfo_mode(RIG *rig, vfo_t vfo, vfo_t *vfo_mode) RETURNFUNC(err); } - if (rig->state.powerstat == 0) + if (STATE(rig)->powerstat == 0) { rig_debug(RIG_DEBUG_WARN, "%s: Cannot get from rig when power is off\n", __func__); @@ -11132,7 +11133,7 @@ int newcat_get_vfo_mode(RIG *rig, vfo_t vfo, vfo_t *vfo_mode) int newcat_vfomem_toggle(RIG *rig) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; char command[] = "VM"; ENTERFUNC; @@ -11163,9 +11164,9 @@ int newcat_vfomem_toggle(RIG *rig) */ int newcat_get_cmd(RIG *rig) { - struct rig_state *state = &rig->state; + struct rig_state *state = STATE(rig); hamlib_port_t *rp = RIGPORT(rig); - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int retry_count = 0; int rc = -RIG_EPROTO; int is_read_cmd = 0; @@ -11413,7 +11414,7 @@ int newcat_get_cmd(RIG *rig) */ int newcat_set_cmd_validate(RIG *rig) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; char valcmd[16]; int retries = 8; int retry = 0; @@ -11659,7 +11660,7 @@ repeat: int newcat_set_cmd(RIG *rig) { hamlib_port_t *rp = RIGPORT(rig); - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int retry_count = 0; int rc = -RIG_EPROTO; @@ -11956,7 +11957,7 @@ rmode_t newcat_rmode_width(RIG *rig, vfo_t vfo, char mode, pbwidth_t *width) int newcat_send_voice_mem(RIG *rig, vfo_t vfo, int ch) { char *p1 = "0"; // newer rigs have 2 bytes where is fixed at zero e.g. FT991 - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; if (!newcat_valid_command(rig, "PB")) { @@ -11971,7 +11972,7 @@ int newcat_send_voice_mem(RIG *rig, vfo_t vfo, int ch) static int newcat_set_clarifier(RIG *rig, vfo_t vfo, int rx, int tx) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; char main_sub_vfo = '0'; if (!newcat_valid_command(rig, "CF")) @@ -12024,7 +12025,7 @@ static int newcat_set_clarifier(RIG *rig, vfo_t vfo, int rx, int tx) static int newcat_get_clarifier(RIG *rig, vfo_t vfo, int *rx, int *tx) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; char main_sub_vfo = '0'; int err; int ret_data_len; @@ -12071,7 +12072,7 @@ static int newcat_get_clarifier(RIG *rig, vfo_t vfo, int *rx, int *tx) int newcat_set_clarifier_frequency(RIG *rig, vfo_t vfo, shortfreq_t freq) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; char main_sub_vfo = '0'; if (!newcat_valid_command(rig, "CF")) @@ -12092,7 +12093,7 @@ int newcat_set_clarifier_frequency(RIG *rig, vfo_t vfo, shortfreq_t freq) int newcat_get_clarifier_frequency(RIG *rig, vfo_t vfo, shortfreq_t *freq) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; char main_sub_vfo = '0'; int err; int ret_data_len; @@ -12142,7 +12143,7 @@ int newcat_get_clarifier_frequency(RIG *rig, vfo_t vfo, shortfreq_t *freq) static int newcat_set_apf_frequency(RIG *rig, vfo_t vfo, int freq) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; char main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0'; if (!newcat_valid_command(rig, "CO")) @@ -12176,7 +12177,7 @@ static int newcat_set_apf_frequency(RIG *rig, vfo_t vfo, int freq) static int newcat_get_apf_frequency(RIG *rig, vfo_t vfo, int *freq) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; char main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0'; int err; int ret_data_len; @@ -12228,7 +12229,7 @@ static int newcat_get_apf_frequency(RIG *rig, vfo_t vfo, int *freq) static int newcat_set_apf_width(RIG *rig, vfo_t vfo, int choice) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; if (!newcat_valid_command(rig, "EX")) { @@ -12271,7 +12272,7 @@ static int newcat_set_apf_width(RIG *rig, vfo_t vfo, int choice) static int newcat_get_apf_width(RIG *rig, vfo_t vfo, int *choice) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; int ret_data_len; char *ret_data; @@ -12330,7 +12331,7 @@ static int newcat_get_apf_width(RIG *rig, vfo_t vfo, int *choice) static int newcat_set_contour(RIG *rig, vfo_t vfo, int status) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; char main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0'; if (!newcat_valid_command(rig, "CO")) @@ -12368,7 +12369,7 @@ static int newcat_set_contour(RIG *rig, vfo_t vfo, int status) static int newcat_get_contour(RIG *rig, vfo_t vfo, int *status) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; char main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0'; int err; int ret_data_len; @@ -12425,7 +12426,7 @@ static int newcat_get_contour(RIG *rig, vfo_t vfo, int *status) static int newcat_set_contour_frequency(RIG *rig, vfo_t vfo, int freq) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; char main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0'; if (!newcat_valid_command(rig, "CO")) @@ -12466,7 +12467,7 @@ static int newcat_set_contour_frequency(RIG *rig, vfo_t vfo, int freq) static int newcat_get_contour_frequency(RIG *rig, vfo_t vfo, int *freq) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; char main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0'; int err; int ret_data_len; @@ -12533,7 +12534,7 @@ static int newcat_get_contour_frequency(RIG *rig, vfo_t vfo, int *freq) static int newcat_set_contour_level(RIG *rig, vfo_t vfo, int level) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; if (!newcat_valid_command(rig, "EX")) { @@ -12577,7 +12578,7 @@ static int newcat_set_contour_level(RIG *rig, vfo_t vfo, int level) static int newcat_get_contour_level(RIG *rig, vfo_t vfo, int *level) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; int ret_data_len; char *ret_data; @@ -12636,7 +12637,7 @@ static int newcat_get_contour_level(RIG *rig, vfo_t vfo, int *level) static int newcat_set_contour_width(RIG *rig, vfo_t vfo, int width) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; if (!newcat_valid_command(rig, "EX")) { @@ -12679,7 +12680,7 @@ static int newcat_set_contour_width(RIG *rig, vfo_t vfo, int width) static int newcat_get_contour_width(RIG *rig, vfo_t vfo, int *width) { - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; int err; int ret_data_len; char *ret_data; @@ -12741,7 +12742,7 @@ int newcat_set_clock(RIG *rig, int year, int month, int day, int hour, int min, { int retval = RIG_OK; int err; - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; if (!newcat_valid_command(rig, "DT")) { @@ -12789,7 +12790,7 @@ int newcat_get_clock(RIG *rig, int *year, int *month, int *day, int *hour, int retval = RIG_OK; int err; int n; - struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; + struct newcat_priv_data *priv = (struct newcat_priv_data *)STATE(rig)->priv; if (!newcat_valid_command(rig, "DT")) { commit eeba884c7ef55eb8e5e4a052d7a5c74c3d8c39ff Author: George Baltz N3GB <Geo...@gm...> Date: Fri Jun 7 16:58:26 2024 -0400 Next batch of state pointers diff --git a/rigs/yaesu/ft736.c b/rigs/yaesu/ft736.c index 68f62d43a..1b24e3b0c 100644 --- a/rigs/yaesu/ft736.c +++ b/rigs/yaesu/ft736.c @@ -226,15 +226,15 @@ int ft736_open(RIG *rig) rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); - rig->state.priv = (struct ft736_priv_data *) calloc(1, + STATE(rig)->priv = (struct ft736_priv_data *) calloc(1, sizeof(struct ft736_priv_data)); - if (!rig->state.priv) + if (!STATE(rig)->priv) { return -RIG_ENOMEM; } - priv = rig->state.priv; + priv = STATE(rig)->priv; priv->split = RIG_SPLIT_OFF; @@ -256,7 +256,7 @@ int ft736_close(RIG *rig) rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); - free(rig->state.priv); + free(STATE(rig)->priv); /* send Ext Cntl OFF: Deactivate CAT */ return write_block(RIGPORT(rig), cmd, YAESU_CMD_LENGTH); @@ -267,7 +267,7 @@ int ft736_close(RIG *rig) int ft736_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x01}; - const struct ft736_priv_data *priv = (struct ft736_priv_data *)rig->state.priv; + const struct ft736_priv_data *priv = (struct ft736_priv_data *)STATE(rig)->priv; int retval; // we will assume requesting to set VFOB is split mode @@ -318,7 +318,7 @@ int ft736_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x07}; unsigned char md; - const struct ft736_priv_data *priv = (struct ft736_priv_data *)rig->state.priv; + const struct ft736_priv_data *priv = (struct ft736_priv_data *)STATE(rig)->priv; if (vfo == RIG_VFO_B) { return ft736_set_split_mode(rig, vfo, mode, width); } @@ -366,7 +366,7 @@ int ft736_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) int ft736_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) { unsigned char cmd[YAESU_CMD_LENGTH] = { 0x00, 0x00, 0x00, 0x00, 0x8e}; - struct ft736_priv_data *priv = (struct ft736_priv_data *)rig->state.priv; + struct ft736_priv_data *priv = (struct ft736_priv_data *)STATE(rig)->priv; int ret; /* diff --git a/rigs/yaesu/ft747.c b/rigs/yaesu/ft747.c index 74a45c7d0..0922f0a8b 100644 --- a/rigs/yaesu/ft747.c +++ b/rigs/yaesu/ft747.c @@ -441,10 +441,10 @@ struct rig_caps ft747_caps = int ft747_init(RIG *rig) { - rig->state.priv = (struct ft747_priv_data *) calloc(1, + STATE(rig)->priv = (struct ft747_priv_data *) calloc(1, sizeof(struct ft747_priv_data)); - if (!rig->state.priv) /* whoops! memory shortage! */ + if (!STATE(rig)->priv) /* whoops! memory shortage! */ { return -RIG_ENOMEM; } @@ -465,12 +465,12 @@ int ft747_cleanup(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - if (rig->state.priv) + if (STATE(rig)->priv) { - free(rig->state.priv); + free(STATE(rig)->priv); } - rig->state.priv = NULL; + STATE(rig)->priv = NULL; return RIG_OK; } @@ -487,7 +487,7 @@ int ft747_open(RIG *rig) struct ft747_priv_data *p; int ret; - rig_s = &rig->state; + rig_s = STATE(rig); p = (struct ft747_priv_data *)rig_s->priv; rig_debug(RIG_DEBUG_VERBOSE, "ft747:rig_open: write_delay = %i msec \n", @@ -547,7 +547,7 @@ int ft747_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // cppcheck-suppress * char *fmt = "%s: requested freq after conversion = %"PRIll" Hz \n"; - p = (struct ft747_priv_data *)rig->state.priv; + p = (struct ft747_priv_data *)STATE(rig)->priv; rig_debug(RIG_DEBUG_VERBOSE, "ft747: requested freq = %"PRIfreq" Hz vfo = %s \n", freq, rig_strvfo(vfo)); @@ -595,7 +595,7 @@ int ft747_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) return RIG_OK; } - p = (struct ft747_priv_data *)rig->state.priv; + p = (struct ft747_priv_data *)STATE(rig)->priv; ret = ft747_get_update_data(rig); /* get whole shebang from rig */ if (ret < 0) @@ -712,7 +712,7 @@ int ft747_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) rig_debug(RIG_DEBUG_VERBOSE, "ft747: cmd_index = %i \n", cmd_index); rig_force_cache_timeout(&((struct ft747_priv_data *) - rig->state.priv)->status_tv); + STATE(rig)->priv)->status_tv); /* * phew! now send cmd to rig @@ -728,7 +728,7 @@ int ft747_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) unsigned char mymode; /* ft747 mode */ int ret; - p = (struct ft747_priv_data *)rig->state.priv; + p = (struct ft747_priv_data *)STATE(rig)->priv; ret = ft747_get_update_data(rig); /* get whole shebang from rig */ @@ -798,7 +798,7 @@ int ft747_set_vfo(RIG *rig, vfo_t vfo) struct ft747_priv_data *p; unsigned char cmd_index; /* index of sequence to send */ - p = (struct ft747_priv_data *)rig->state.priv; + p = (struct ft747_priv_data *)STATE(rig)->priv; switch (vfo) { @@ -831,7 +831,7 @@ int ft747_get_vfo(RIG *rig, vfo_t *vfo) unsigned char status; /* ft747 status flag */ int ret; - p = (struct ft747_priv_data *)rig->state.priv; + p = (struct ft747_priv_data *)STATE(rig)->priv; ret = ft747_get_update_data(rig); /* get whole shebang from rig */ @@ -872,7 +872,7 @@ int ft747_set_split(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) FT_747_NATIVE_SPLIT_OFF; rig_force_cache_timeout(&((struct ft747_priv_data *) - rig->state.priv)->status_tv); + STATE(rig)->priv)->status_tv); return ft747_send_priv_cmd(rig, cmd_index); @@ -884,7 +884,7 @@ int ft747_get_split(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) unsigned char status; /* ft747 status flag */ int ret; - p = (struct ft747_priv_data *)rig->state.priv; + p = (struct ft747_priv_data *)STATE(rig)->priv; ret = ft747_get_update_data(rig); /* get whole sheban... [truncated message content] |
From: n0nb <n0...@us...> - 2024-06-02 21:28: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 4058b021d45946c8ff92c0ec6313cafa9e0c0507 (commit) via 2f97b4bf82d7e9f770ea21ca4d5a73cce4083c97 (commit) via 3549dfe22c5d4a1f29bebde5db2b4429d4a18cd6 (commit) via 205e03bc57cee4d643bf2dff3411973a78e6daa2 (commit) via 3ce55b2a9474b3601e3417f9ddfb8cc33796f328 (commit) via 2794d2dfe143e88452d58f5a3924c1bce52390de (commit) via ce25f638434f20d789d0aecb4dd5a9bbadbfa30e (commit) via a63e518393264d2f4c31ab20b3bb33be5965c691 (commit) via c9cc7f0792b894c21c861695feca5e91a555fcc4 (commit) via c16ef021964fcd741d8f7d1fcce4b23cdf6b311a (commit) from 745e72a6cf7023cfd26c282207803e4c62897668 (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 4058b021d45946c8ff92c0ec6313cafa9e0c0507 Merge: 3549dfe22 2f97b4bf8 Author: Michael Black <mdb...@ya...> Date: Sun Jun 2 14:55:00 2024 -0500 Merge pull request #1561 from GeoBaltz/rp9 Still more conversion of state references to use pointers commit 2f97b4bf82d7e9f770ea21ca4d5a73cce4083c97 Author: George Baltz N3GB <Geo...@gm...> Date: Sun Jun 2 13:26:01 2024 -0400 Still more state pointer conversions. diff --git a/tests/README b/tests/README index 665709d4b..5a80db30d 100644 --- a/tests/README +++ b/tests/README @@ -17,7 +17,7 @@ If you don't know the number, listrigs can give it to you, In any case, you are encouraged to check for correct initialization by reading the source code, at the beginning of the main(). Check also -that the program is setup for your rig path strncpy(my_rig->state.rig_path... +that the program is setup for your rig path strncpy(HAMLIB_STATE(my_rig)->rig_path... dumpcaps - Output the caps contents of a rig dumpmem - Dump the memory contents of the rig diff --git a/tests/dumpmem.c b/tests/dumpmem.c index 978e0f556..c021c5030 100644 --- a/tests/dumpmem.c +++ b/tests/dumpmem.c @@ -83,11 +83,12 @@ int main(int argc, const char *argv[]) * RIG_CHAN_END * } */ + struct rig_state *rs = STATE(my_rig); - for (i = 0; my_rig->state.chan_list[i].type; i++) + for (i = 0; rs->chan_list[i].type; i++) { - for (j = my_rig->state.chan_list[i].startc; - j <= my_rig->state.chan_list[i].endc; j++) + for (j = rs->chan_list[i].startc; + j <= rs->chan_list[i].endc; j++) { dump_chan(my_rig, j); } diff --git a/tests/memcsv.c b/tests/memcsv.c index e4c24581a..aa9cdcff4 100644 --- a/tests/memcsv.c +++ b/tests/memcsv.c @@ -343,7 +343,7 @@ int csv_parm_save(RIG *rig, const char *outfilename) { int i, ret; FILE *f; - setting_t get_parm = all ? 0x7fffffff : rig->state.has_get_parm; + setting_t get_parm = all ? 0x7fffffff : STATE(rig)->has_get_parm; f = fopen(outfilename, "w"); @@ -742,6 +742,7 @@ int set_channel_data(RIG *rig, int i, j, n; const channel_cap_t *mem_caps; + struct rig_state *rs = STATE(rig); memset(chan, 0, sizeof(channel_t)); chan->vfo = RIG_VFO_CURR; @@ -759,7 +760,7 @@ int set_channel_data(RIG *rig, /* find channel caps of appropriate memory group? */ for (j = 0; j < HAMLIB_CHANLSTSIZ; j++) { - if (rig->state.chan_list[j].startc <= n && rig->state.chan_list[j].endc >= n) + if (rs->chan_list[j].startc <= n && rs->chan_list[j].endc >= n) { break; } @@ -772,7 +773,7 @@ int set_channel_data(RIG *rig, printf("Requested channel number %d, list number %d\n", n, j); - mem_caps = &rig->state.chan_list[j].mem_caps; + mem_caps = &rs->chan_list[j].mem_caps; if (mem_caps->bank_num) { diff --git a/tests/rigctl.c b/tests/rigctl.c index ae1e27182..12ddff9ee 100644 --- a/tests/rigctl.c +++ b/tests/rigctl.c @@ -564,6 +564,7 @@ int main(int argc, char *argv[]) } char *token = strtok(conf_parms, ","); + struct rig_state *rs = STATE(my_rig); while (token) { @@ -630,7 +631,7 @@ int main(int argc, char *argv[]) if (serial_rate != 0) { RIGPORT(my_rig)->parm.serial.rate = serial_rate; - my_rig->state.rigport_deprecated.parm.serial.rate = serial_rate; + rs->rigport_deprecated.parm.serial.rate = serial_rate; } if (civaddr) @@ -697,14 +698,14 @@ int main(int argc, char *argv[]) if (!skip_init && my_rig->caps->get_powerstat) { rig_get_powerstat(my_rig, &rig_powerstat); - my_rig->state.powerstat = rig_powerstat; + rs->powerstat = rig_powerstat; } if (my_rig->caps->rig_model == RIG_MODEL_NETRIGCTL) { /* We automatically detect if we need to be in vfo mode or not */ int rigctld_vfo_opt = netrigctl_get_vfo_mode(my_rig); - vfo_opt = my_rig->state.vfo_opt = rigctld_vfo_opt; + vfo_opt = rs->vfo_opt = rigctld_vfo_opt; rig_debug(RIG_DEBUG_TRACE, "%s vfo_opt=%d\n", __func__, vfo_opt); } diff --git a/tests/rigctld.c b/tests/rigctld.c index 572a6be6f..8a7103ecf 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -663,6 +663,7 @@ int main(int argc, char *argv[]) } char *token = strtok(conf_parms, ","); + struct rig_state *rs = STATE(my_rig); while (token) { @@ -696,12 +697,12 @@ int main(int argc, char *argv[]) rig_set_conf(my_rig, TOK_PATHNAME, rig_file); } - my_rig->state.twiddle_timeout = twiddle_timeout; - my_rig->state.twiddle_rit = twiddle_rit; - my_rig->state.uplink = uplink; + rs->twiddle_timeout = twiddle_timeout; + rs->twiddle_rit = twiddle_rit; + rs->uplink = uplink; rig_debug(RIG_DEBUG_TRACE, "%s: twiddle=%d, uplink=%d, twiddle_rit=%d\n", __func__, - my_rig->state.twiddle_timeout, my_rig->state.uplink, my_rig->state.twiddle_rit); + rs->twiddle_timeout, rs->uplink, rs->twiddle_rit); /* * ex: RIG_PTT_PARALLEL and /dev/parport0 @@ -709,22 +710,22 @@ int main(int argc, char *argv[]) if (ptt_type != RIG_PTT_NONE) { PTTPORT(my_rig)->type.ptt = ptt_type; - my_rig->state.pttport_deprecated.type.ptt = ptt_type; + rs->pttport_deprecated.type.ptt = ptt_type; // This causes segfault since backend rig_caps are const - // rigctld will use the rig->state version of this for clients + // rigctld will use the STATE(rig) version of this for clients //my_rig->caps->ptt_type = ptt_type; } if (dcd_type != RIG_DCD_NONE) { DCDPORT(my_rig)->type.dcd = dcd_type; - my_rig->state.dcdport_deprecated.type.dcd = dcd_type; + rs->dcdport_deprecated.type.dcd = dcd_type; } if (ptt_file) { strncpy(PTTPORT(my_rig)->pathname, ptt_file, HAMLIB_FILPATHLEN - 1); - strncpy(my_rig->state.pttport_deprecated.pathname, ptt_file, + strncpy(rs->pttport_deprecated.pathname, ptt_file, HAMLIB_FILPATHLEN - 1); // default to RTS when ptt_type is not specified if (ptt_type == RIG_PTT_NONE) @@ -737,7 +738,7 @@ int main(int argc, char *argv[]) if (dcd_file) { strncpy(DCDPORT(my_rig)->pathname, dcd_file, HAMLIB_FILPATHLEN - 1); - strncpy(my_rig->state.dcdport_deprecated.pathname, dcd_file, + strncpy(rs->dcdport_deprecated.pathname, dcd_file, HAMLIB_FILPATHLEN - 1); } @@ -745,7 +746,7 @@ int main(int argc, char *argv[]) if (serial_rate != 0) { RIGPORT(my_rig)->parm.serial.rate = serial_rate; - my_rig->state.rigport_deprecated.parm.serial.rate = serial_rate; + rs->rigport_deprecated.parm.serial.rate = serial_rate; } if (civaddr) @@ -1306,7 +1307,7 @@ void *handle_socket(void *arg) mutex_rigctld(1); rig_get_powerstat(my_rig, &rig_powerstat); mutex_rigctld(0); - my_rig->state.powerstat = rig_powerstat; + STATE(my_rig)->powerstat = rig_powerstat; } elapsed_ms(&powerstat_check_time, HAMLIB_ELAPSED_SET); commit 3549dfe22c5d4a1f29bebde5db2b4429d4a18cd6 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jun 2 08:47:27 2024 -0500 Revert "Move rot_dummy to rotators/dummy -- in preparation for PSKRotator dummy device" This reverts commit 205e03bc57cee4d643bf2dff3411973a78e6daa2. diff --git a/configure.ac b/configure.ac index f513bbf68..cfcd2eb1f 100644 --- a/configure.ac +++ b/configure.ac @@ -67,7 +67,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/codan 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 rigs/gomspace rigs/mds rigs/anytone rigs/motorola" -ROT_BACKEND_LIST="rotators/amsat rotators/apex rotators/ars rotators/celestron rotators/cnctrk rotators/dummy rotators/grbltrk rotators/easycomm rotators/ether6 rotators/flir rotators/fodtrack rotators/gs232a rotators/heathkit rotators/m2 rotators/meade rotators/rotorez rotators/sartek rotators/saebrtrack rotators/spid rotators/ts7400 rotators/prosistel rotators/ioptron rotators/satel rotators/radant" +ROT_BACKEND_LIST="rotators/amsat rotators/apex rotators/ars rotators/celestron rotators/cnctrk rotators/grbltrk rotators/easycomm rotators/ether6 rotators/flir rotators/fodtrack rotators/gs232a rotators/heathkit rotators/m2 rotators/meade rotators/rotorez rotators/sartek rotators/saebrtrack rotators/spid rotators/ts7400 rotators/prosistel rotators/ioptron rotators/satel rotators/radant" # Amplifiers are all in the amplifiers directory AMP_BACKEND_LIST="amplifiers/elecraft amplifiers/gemini amplifiers/expert" @@ -880,7 +880,6 @@ rotators/apex/Makefile rotators/ars/Makefile rotators/celestron/Makefile rotators/cnctrk/Makefile -rotators/dummy/Makefile rotators/grbltrk/Makefile rotators/easycomm/Makefile rotators/ether6/Makefile diff --git a/rigs/dummy/Makefile.am b/rigs/dummy/Makefile.am index 7d092e7a0..4792a8fc3 100644 --- a/rigs/dummy/Makefile.am +++ b/rigs/dummy/Makefile.am @@ -1,4 +1,4 @@ -DUMMYSRC = dummy_common.c dummy_common.h dummy.c dummy.h dummy.c netrigctl.c netrotctl.c flrig.c flrig.h trxmanager.c trxmanager.h amp_dummy.c amp_dummy.h netampctl.c tci1x.c aclog.c sdrsharp.c quisk.c +DUMMYSRC = dummy_common.c dummy_common.h dummy.c dummy.h rot_dummy.c rot_dummy.h netrigctl.c netrotctl.c flrig.c flrig.h trxmanager.c trxmanager.h amp_dummy.c amp_dummy.h netampctl.c tci1x.c aclog.c sdrsharp.c quisk.c noinst_LTLIBRARIES = libhamlib-dummy.la libhamlib_dummy_la_SOURCES = $(DUMMYSRC) diff --git a/rotators/dummy/rot_dummy.c b/rigs/dummy/rot_dummy.c similarity index 99% rename from rotators/dummy/rot_dummy.c rename to rigs/dummy/rot_dummy.c index a41441714..dec0f8cfc 100644 --- a/rotators/dummy/rot_dummy.c +++ b/rigs/dummy/rot_dummy.c @@ -25,7 +25,7 @@ #include <sys/time.h> #include "hamlib/rotator.h" -#include "../../rigs/dummy/dummy_common.h" +#include "dummy_common.h" #include "rig.h" #include "register.h" #include "idx_builtin.h" diff --git a/rotators/dummy/rot_dummy.h b/rigs/dummy/rot_dummy.h similarity index 100% rename from rotators/dummy/rot_dummy.h rename to rigs/dummy/rot_dummy.h diff --git a/rotators/dummy/Android.mk b/rotators/dummy/Android.mk deleted file mode 100644 index 43e2f7ad4..000000000 --- a/rotators/dummy/Android.mk +++ /dev/null @@ -1,12 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := rot_dummy.c -LOCAL_MODULE := rot_dummy - -LOCAL_CFLAGS := -LOCAL_C_INCLUDES := android include src -LOCAL_LDLIBS := -lhamlib -Lobj/local/$(TARGET_ARCH_ABI) - -include $(BUILD_STATIC_LIBRARY) diff --git a/rotators/dummy/Makefile.am b/rotators/dummy/Makefile.am deleted file mode 100644 index 7bcf0a988..000000000 --- a/rotators/dummy/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ - -noinst_LTLIBRARIES = libhamlib-rot_dummy.la -libhamlib_rot_dummy_la_SOURCES = rot_dummy.c rot_dummy.h - -EXTRA_DIST = Android.mk commit 205e03bc57cee4d643bf2dff3411973a78e6daa2 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jun 2 08:29:54 2024 -0500 Move rot_dummy to rotators/dummy -- in preparation for PSKRotator dummy device diff --git a/configure.ac b/configure.ac index cfcd2eb1f..f513bbf68 100644 --- a/configure.ac +++ b/configure.ac @@ -67,7 +67,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/codan 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 rigs/gomspace rigs/mds rigs/anytone rigs/motorola" -ROT_BACKEND_LIST="rotators/amsat rotators/apex rotators/ars rotators/celestron rotators/cnctrk rotators/grbltrk rotators/easycomm rotators/ether6 rotators/flir rotators/fodtrack rotators/gs232a rotators/heathkit rotators/m2 rotators/meade rotators/rotorez rotators/sartek rotators/saebrtrack rotators/spid rotators/ts7400 rotators/prosistel rotators/ioptron rotators/satel rotators/radant" +ROT_BACKEND_LIST="rotators/amsat rotators/apex rotators/ars rotators/celestron rotators/cnctrk rotators/dummy rotators/grbltrk rotators/easycomm rotators/ether6 rotators/flir rotators/fodtrack rotators/gs232a rotators/heathkit rotators/m2 rotators/meade rotators/rotorez rotators/sartek rotators/saebrtrack rotators/spid rotators/ts7400 rotators/prosistel rotators/ioptron rotators/satel rotators/radant" # Amplifiers are all in the amplifiers directory AMP_BACKEND_LIST="amplifiers/elecraft amplifiers/gemini amplifiers/expert" @@ -880,6 +880,7 @@ rotators/apex/Makefile rotators/ars/Makefile rotators/celestron/Makefile rotators/cnctrk/Makefile +rotators/dummy/Makefile rotators/grbltrk/Makefile rotators/easycomm/Makefile rotators/ether6/Makefile diff --git a/rigs/dummy/Makefile.am b/rigs/dummy/Makefile.am index 4792a8fc3..7d092e7a0 100644 --- a/rigs/dummy/Makefile.am +++ b/rigs/dummy/Makefile.am @@ -1,4 +1,4 @@ -DUMMYSRC = dummy_common.c dummy_common.h dummy.c dummy.h rot_dummy.c rot_dummy.h netrigctl.c netrotctl.c flrig.c flrig.h trxmanager.c trxmanager.h amp_dummy.c amp_dummy.h netampctl.c tci1x.c aclog.c sdrsharp.c quisk.c +DUMMYSRC = dummy_common.c dummy_common.h dummy.c dummy.h dummy.c netrigctl.c netrotctl.c flrig.c flrig.h trxmanager.c trxmanager.h amp_dummy.c amp_dummy.h netampctl.c tci1x.c aclog.c sdrsharp.c quisk.c noinst_LTLIBRARIES = libhamlib-dummy.la libhamlib_dummy_la_SOURCES = $(DUMMYSRC) diff --git a/rotators/dummy/Android.mk b/rotators/dummy/Android.mk new file mode 100644 index 000000000..43e2f7ad4 --- /dev/null +++ b/rotators/dummy/Android.mk @@ -0,0 +1,12 @@ +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := rot_dummy.c +LOCAL_MODULE := rot_dummy + +LOCAL_CFLAGS := +LOCAL_C_INCLUDES := android include src +LOCAL_LDLIBS := -lhamlib -Lobj/local/$(TARGET_ARCH_ABI) + +include $(BUILD_STATIC_LIBRARY) diff --git a/rotators/dummy/Makefile.am b/rotators/dummy/Makefile.am new file mode 100644 index 000000000..7bcf0a988 --- /dev/null +++ b/rotators/dummy/Makefile.am @@ -0,0 +1,5 @@ + +noinst_LTLIBRARIES = libhamlib-rot_dummy.la +libhamlib_rot_dummy_la_SOURCES = rot_dummy.c rot_dummy.h + +EXTRA_DIST = Android.mk diff --git a/rigs/dummy/rot_dummy.c b/rotators/dummy/rot_dummy.c similarity index 99% rename from rigs/dummy/rot_dummy.c rename to rotators/dummy/rot_dummy.c index dec0f8cfc..a41441714 100644 --- a/rigs/dummy/rot_dummy.c +++ b/rotators/dummy/rot_dummy.c @@ -25,7 +25,7 @@ #include <sys/time.h> #include "hamlib/rotator.h" -#include "dummy_common.h" +#include "../../rigs/dummy/dummy_common.h" #include "rig.h" #include "register.h" #include "idx_builtin.h" diff --git a/rigs/dummy/rot_dummy.h b/rotators/dummy/rot_dummy.h similarity index 100% rename from rigs/dummy/rot_dummy.h rename to rotators/dummy/rot_dummy.h commit 3ce55b2a9474b3601e3417f9ddfb8cc33796f328 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Jun 2 08:15:16 2024 -0500 Fix mingw compilation diff --git a/src/network.c b/src/network.c index 41461c20c..1d780f615 100644 --- a/src/network.c +++ b/src/network.c @@ -384,7 +384,12 @@ int network_open(hamlib_port_t *rp, int default_port) // return # of bytes read int network_flush2(hamlib_port_t *rp, unsigned char *stopset, char *buf, int buf_len) { - unsigned int len = 0; +#ifdef __MINGW32__ + ULONG len; +#else + uint len; +#endif + #ifdef __MINGW32__ int ret = ioctlsocket(rp->fd, FIONREAD, &len); #else commit 2794d2dfe143e88452d58f5a3924c1bce52390de Author: George Baltz N3GB <Geo...@gm...> Date: Fri May 31 09:48:30 2024 -0400 More state pointer changes Done with search/replace Less than 2300 left to do diff --git a/tests/dumpstate.c b/tests/dumpstate.c index d2fb9a794..fdae1a376 100644 --- a/tests/dumpstate.c +++ b/tests/dumpstate.c @@ -70,6 +70,7 @@ static int print_ext(RIG *rig, const struct confparams *cfp, rig_ptr_t ptr) int dumpstate(RIG *rig, FILE *fout) { const struct rig_caps *caps; + struct rig_state *rs = STATE(rig); int status, i; int can_esplit, can_echannel; char freqbuf[20]; @@ -89,20 +90,20 @@ int dumpstate(RIG *rig, FILE *fout) caps = rig->caps; - fprintf(fout, "Caps dump for model: %u\n", rig->state.rig_model); - fprintf(fout, "Model name:\t%s\n", rig->state.model_name); - fprintf(fout, "Mfg name:\t%s\n", rig->state.mfg_name); + fprintf(fout, "Caps dump for model: %u\n", rs->rig_model); + fprintf(fout, "Model name:\t%s\n", rs->model_name); + fprintf(fout, "Mfg name:\t%s\n", rs->mfg_name); fprintf(fout, "Hamlib version:\t%s\n", hamlib_version2); - fprintf(fout, "Backend version:\t%s\n", rig->state.version); - fprintf(fout, "Backend copyright:\t%s\n", rig->state.copyright); - fprintf(fout, "Backend status:\t%s\n", rig_strstatus(rig->state.status)); + fprintf(fout, "Backend version:\t%s\n", rs->version); + fprintf(fout, "Backend copyright:\t%s\n", rs->copyright); + fprintf(fout, "Backend status:\t%s\n", rig_strstatus(rs->status)); fprintf(fout, "Rig type:\t"); char *unknown = "Unknown"; for (i = 0; rig_type[i].type != -1; ++i) { - if ((rig_type[i].type & rig->state.rig_type) == rig_type[i].type) + if ((rig_type[i].type & rs->rig_type) == rig_type[i].type) { fprintf(fout, "%s ", rig_type[i].description); unknown = ""; @@ -119,7 +120,7 @@ int dumpstate(RIG *rig, FILE *fout) fprintf(fout, "PTT type:\t"); - switch (rig->state.ptt_type) + switch (rs->ptt_type) { case RIG_PTT_RIG: fprintf(fout, "Rig capable\n"); @@ -153,7 +154,7 @@ int dumpstate(RIG *rig, FILE *fout) fprintf(fout, "DCD type:\t"); - switch (rig->state.dcd_type) + switch (rs->dcd_type) { case RIG_DCD_RIG: fprintf(fout, "Rig capable\n"); @@ -187,22 +188,22 @@ int dumpstate(RIG *rig, FILE *fout) fprintf(fout, "Port type:\t"); - switch (rig->state.port_type) + switch (rs->port_type) { case RIG_PORT_SERIAL: fprintf(fout, "RS-232\n"); fprintf(fout, "Serial speed: %d..%d baud, %d%c%d, ctrl=%s\n", - rig->state.serial_rate_min, - rig->state.serial_rate_max, - rig->state.serial_data_bits, - rig->state.serial_parity == RIG_PARITY_NONE ? 'N' : - rig->state.serial_parity == RIG_PARITY_ODD ? 'O' : - rig->state.serial_parity == RIG_PARITY_EVEN ? 'E' : - rig->state.serial_parity == RIG_PARITY_MARK ? 'M' : 'S', - rig->state.serial_stop_bits, - rig->state.serial_handshake == RIG_HANDSHAKE_NONE ? "NONE" : - (rig->state.serial_handshake == RIG_HANDSHAKE_XONXOFF ? "XONXOFF" : "CTS/RTS") + rs->serial_rate_min, + rs->serial_rate_max, + rs->serial_data_bits, + rs->serial_parity == RIG_PARITY_NONE ? 'N' : + rs->serial_parity == RIG_PARITY_ODD ? 'O' : + rs->serial_parity == RIG_PARITY_EVEN ? 'E' : + rs->serial_parity == RIG_PARITY_MARK ? 'M' : 'S', + rs->serial_stop_bits, + rs->serial_handshake == RIG_HANDSHAKE_NONE ? "NONE" : + (rs->serial_handshake == RIG_HANDSHAKE_XONXOFF ? "XONXOFF" : "CTS/RTS") ); break; @@ -238,40 +239,40 @@ int dumpstate(RIG *rig, FILE *fout) fprintf(fout, "Write delay: %dms, timeout %dms, %d retry\n", - rig->state.write_delay, rig->state.timeout, rig->state.retry); + rs->write_delay, rs->timeout, rs->retry); fprintf(fout, "Post write delay: %dms\n", - rig->state.post_write_delay); + rs->post_write_delay); fprintf(fout, "Has targetable VFO: %s\n", - rig->state.targetable_vfo ? "Y" : "N"); + rs->targetable_vfo ? "Y" : "N"); fprintf(fout, "Has async data support: %s\n", - rig->state.async_data_supported ? "Y" : "N"); + rs->async_data_supported ? "Y" : "N"); - fprintf(fout, "Announce: 0x%x\n", rig->state.announces); + fprintf(fout, "Announce: 0x%x\n", rs->announces); fprintf(fout, "Max RIT: -%ld.%ldkHz/+%ld.%ldkHz\n", - rig->state.max_rit / 1000, rig->state.max_rit % 1000, - rig->state.max_rit / 1000, rig->state.max_rit % 1000); + rs->max_rit / 1000, rs->max_rit % 1000, + rs->max_rit / 1000, rs->max_rit % 1000); fprintf(fout, "Max XIT: -%ld.%ldkHz/+%ld.%ldkHz\n", - rig->state.max_xit / 1000, rig->state.max_xit % 1000, - rig->state.max_xit / 1000, rig->state.max_xit % 1000); + rs->max_xit / 1000, rs->max_xit % 1000, + rs->max_xit / 1000, rs->max_xit % 1000); fprintf(fout, "Max IF-SHIFT: -%ld.%ldkHz/+%ld.%ldkHz\n", - rig->state.max_ifshift / 1000, rig->state.max_ifshift % 1000, - rig->state.max_ifshift / 1000, rig->state.max_ifshift % 1000); + rs->max_ifshift / 1000, rs->max_ifshift % 1000, + rs->max_ifshift / 1000, rs->max_ifshift % 1000); fprintf(fout, "Preamp:"); - for (i = 0; i < HAMLIB_MAXDBLSTSIZ && rig->state.preamp[i] != 0; i++) + for (i = 0; i < HAMLIB_MAXDBLSTSIZ && rs->preamp[i] != 0; i++) { - fprintf(fout, " %ddB", rig->state.preamp[i]); + fprintf(fout, " %ddB", rs->preamp[i]); } if (i == 0) @@ -282,9 +283,9 @@ int dumpstate(RIG *rig, FILE *fout) fprintf(fout, "\n"); fprintf(fout, "Attenuator:"); - for (i = 0; i < HAMLIB_MAXDBLSTSIZ && rig->state.attenuator[i] != 0; i++) + for (i = 0; i < HAMLIB_MAXDBLSTSIZ && rs->attenuator[i] != 0; i++) { - fprintf(fout, " %ddB", rig->state.attenuator[i]); + fprintf(fout, " %ddB", rs->attenuator[i]); } if (i == 0) @@ -297,9 +298,9 @@ int dumpstate(RIG *rig, FILE *fout) fprintf(fout, "AGC levels:"); const struct icom_priv_caps *priv_caps = - (const struct icom_priv_caps *) rig->state.priv; + (const struct icom_priv_caps *) rs->priv; - if (priv_caps && RIG_BACKEND_NUM(rig->state.rig_model) == RIG_ICOM + if (priv_caps && RIG_BACKEND_NUM(rs->rig_model) == RIG_ICOM && priv_caps->agc_levels_present) { for (i = 0; i < HAMLIB_MAX_AGC_LEVELS @@ -311,10 +312,10 @@ int dumpstate(RIG *rig, FILE *fout) } else { - for (i = 0; i < HAMLIB_MAX_AGC_LEVELS && i < rig->state.agc_level_count; i++) + for (i = 0; i < HAMLIB_MAX_AGC_LEVELS && i < rs->agc_level_count; i++) { - fprintf(fout, " %d=%s", rig->state.agc_levels[i], - rig_stragclevel(rig->state.agc_levels[i])); + fprintf(fout, " %d=%s", rs->agc_levels[i], + rig_stragclevel(rs->agc_levels[i])); } } @@ -327,12 +328,12 @@ int dumpstate(RIG *rig, FILE *fout) fprintf(fout, "CTCSS:"); - for (i = 0; rig->state.ctcss_list && i < 60 - && rig->state.ctcss_list[i] != 0; i++) + for (i = 0; rs->ctcss_list && i < 60 + && rs->ctcss_list[i] != 0; i++) { fprintf(fout, " %u.%1u", - rig->state.ctcss_list[i] / 10, rig->state.ctcss_list[i] % 10); + rs->ctcss_list[i] / 10, rs->ctcss_list[i] % 10); } if (i == 0) @@ -348,9 +349,9 @@ int dumpstate(RIG *rig, FILE *fout) fprintf(fout, "DCS:"); - for (i = 0; rig->state.dcs_list && i < 128 && rig->state.dcs_list[i] != 0; i++) + for (i = 0; rs->dcs_list && i < 128 && rs->dcs_list[i] != 0; i++) { - fprintf(fout, " %u", rig->state.dcs_list[i]); + fprintf(fout, " %u", rs->dcs_list[i]); } if (i == 0) @@ -364,22 +365,22 @@ int dumpstate(RIG *rig, FILE *fout) fprintf(fout, "\n"); - rig_sprintf_func(prntbuf, sizeof(prntbuf), rig->state.has_get_func); + rig_sprintf_func(prntbuf, sizeof(prntbuf), rs->has_get_func); fprintf(fout, "Get functions: %s\n", prntbuf); - rig_sprintf_func(prntbuf, sizeof(prntbuf), rig->state.has_set_func); + rig_sprintf_func(prntbuf, sizeof(prntbuf), rs->has_set_func); fprintf(fout, "Set functions: %s\n", prntbuf); fprintf(fout, "Extra functions:\n"); rig_ext_func_foreach(rig, print_ext, fout); - rig_sprintf_level_gran(prntbuf, sizeof(prntbuf), rig->state.has_get_level, - rig->state.level_gran); + rig_sprintf_level_gran(prntbuf, sizeof(prntbuf), rs->has_get_level, + rs->level_gran); fprintf(fout, "Get level: %s\n", prntbuf); - if ((rig->state.has_get_level & RIG_LEVEL_RAWSTR) - && rig->state.str_cal.size == 0 - && !(rig->state.has_get_level & RIG_LEVEL_STRENGTH)) + if ((rs->has_get_level & RIG_LEVEL_RAWSTR) + && rs->str_cal.size == 0 + && !(rs->has_get_level & RIG_LEVEL_STRENGTH)) { fprintf(fout, @@ -388,14 +389,14 @@ int dumpstate(RIG *rig, FILE *fout) backend_warnings++; } - rig_sprintf_level_gran(prntbuf, sizeof(prntbuf), rig->state.has_set_level, - rig->state.level_gran); + rig_sprintf_level_gran(prntbuf, sizeof(prntbuf), rs->has_set_level, + rs->level_gran); fprintf(fout, "Set level: %s\n", prntbuf); - if (rig->state.has_set_level & RIG_LEVEL_READONLY_LIST) + if (rs->has_set_level & RIG_LEVEL_READONLY_LIST) { - //fprintf(fout, "Warning--backend can set readonly levels=0x%0llx\n", rig->state.has_set_level & RIG_LEVEL_READONLY_LIST); + //fprintf(fout, "Warning--backend can set readonly levels=0x%0llx\n", rs->has_set_level & RIG_LEVEL_READONLY_LIST); fprintf(fout, "Warning--backend can set readonly levels\n"); strcat(warnbuf, " READONLY_LEVEL"); backend_warnings++; @@ -404,15 +405,15 @@ int dumpstate(RIG *rig, FILE *fout) fprintf(fout, "Extra levels:\n"); rig_ext_level_foreach(rig, print_ext, fout); - rig_sprintf_parm_gran(prntbuf, sizeof(prntbuf), rig->state.has_get_parm, - rig->state.parm_gran); + rig_sprintf_parm_gran(prntbuf, sizeof(prntbuf), rs->has_get_parm, + rs->parm_gran); fprintf(fout, "Get parameters: %s\n", prntbuf); - rig_sprintf_parm_gran(prntbuf, sizeof(prntbuf), rig->state.has_set_parm, - rig->state.parm_gran); + rig_sprintf_parm_gran(prntbuf, sizeof(prntbuf), rs->has_set_parm, + rs->parm_gran); fprintf(fout, "Set parameters: %s\n", prntbuf); - if (rig->state.has_set_parm & RIG_PARM_READONLY_LIST) + if (rs->has_set_parm & RIG_PARM_READONLY_LIST) { fprintf(fout, "Warning--backend can set readonly parms!\n"); strcat(warnbuf, " READONLY_PARM"); @@ -423,9 +424,9 @@ int dumpstate(RIG *rig, FILE *fout) rig_ext_parm_foreach(rig, print_ext, fout); - if (rig->state.mode_list != 0) + if (rs->mode_list != 0) { - rig_sprintf_mode(prntbuf, sizeof(prntbuf), rig->state.mode_list); + rig_sprintf_mode(prntbuf, sizeof(prntbuf), rs->mode_list); } else { @@ -436,9 +437,9 @@ int dumpstate(RIG *rig, FILE *fout) fprintf(fout, "Mode list: %s\n", prntbuf); - if (rig->state.vfo_list != 0) + if (rs->vfo_list != 0) { - rig_sprintf_vfo(prntbuf, sizeof(prntbuf), rig->state.vfo_list); + rig_sprintf_vfo(prntbuf, sizeof(prntbuf), rs->vfo_list); } else { @@ -449,26 +450,26 @@ int dumpstate(RIG *rig, FILE *fout) fprintf(fout, "VFO list: %s\n", prntbuf); - rig_sprintf_vfop(prntbuf, sizeof(prntbuf), rig->state.vfo_ops); + rig_sprintf_vfop(prntbuf, sizeof(prntbuf), rs->vfo_ops); fprintf(fout, "VFO Ops: %s\n", prntbuf); - rig_sprintf_scan(prntbuf, sizeof(prntbuf), rig->state.scan_ops); + rig_sprintf_scan(prntbuf, sizeof(prntbuf), rs->scan_ops); fprintf(fout, "Scan Ops: %s\n", prntbuf); - fprintf(fout, "Number of banks:\t%d\n", rig->state.bank_qty); - fprintf(fout, "Memory name desc size:\t%d\n", rig->state.chan_desc_sz); + fprintf(fout, "Number of banks:\t%d\n", rs->bank_qty); + fprintf(fout, "Memory name desc size:\t%d\n", rs->chan_desc_sz); fprintf(fout, "Memories:"); - for (i = 0; i < HAMLIB_CHANLSTSIZ && rig->state.chan_list[i].type; i++) + for (i = 0; i < HAMLIB_CHANLSTSIZ && rs->chan_list[i].type; i++) { fprintf(fout, "\n\t%d..%d: \t%s", - rig->state.chan_list[i].startc, - rig->state.chan_list[i].endc, - rig_strmtype(rig->state.chan_list[i].type)); + rs->chan_list[i].startc, + rs->chan_list[i].endc, + rig_strmtype(rs->chan_list[i].type)); fprintf(fout, "\n\t Mem caps: "); - dump_chan_caps(&rig->state.chan_list[i].mem_caps, fout); + dump_chan_caps(&rs->chan_list[i].mem_caps, fout); } if (i == 0) @@ -478,57 +479,57 @@ int dumpstate(RIG *rig, FILE *fout) fprintf(fout, "\n"); - label1 = rig->state.tx_range_list1->label; + label1 = rs->tx_range_list1->label; label1 = label1 == NULL ? "TBD" : label1; fprintf(fout, "TX ranges #1 for %s:\n", label1); - range_print(fout, rig->state.tx_range_list1, 0); + range_print(fout, rs->tx_range_list1, 0); - labelrx1 = rig->state.rx_range_list1->label; + labelrx1 = rs->rx_range_list1->label; labelrx1 = labelrx1 == NULL ? "TBD" : labelrx1; fprintf(fout, "RX ranges #1 for %s:\n", labelrx1); - range_print(fout, rig->state.rx_range_list1, 1); + range_print(fout, rs->rx_range_list1, 1); - label2 = rig->state.rx_range_list2->label; + label2 = rs->rx_range_list2->label; label2 = label2 == NULL ? "TBD" : label2; fprintf(fout, "TX ranges #2 for %s:\n", label2); - range_print(fout, rig->state.tx_range_list2, 0); + range_print(fout, rs->tx_range_list2, 0); - label2 = rig->state.rx_range_list2->label; + label2 = rs->rx_range_list2->label; label2 = label2 == NULL ? "TBD" : label2; fprintf(fout, "RX ranges #2 for %s:\n", label2); - range_print(fout, rig->state.rx_range_list2, 1); + range_print(fout, rs->rx_range_list2, 1); - label3 = rig->state.rx_range_list3->label; + label3 = rs->rx_range_list3->label; label3 = label3 == NULL ? "TBD" : label3; fprintf(fout, "TX ranges #3 for %s:\n", label3); - range_print(fout, rig->state.tx_range_list3, 0); + range_print(fout, rs->tx_range_list3, 0); - label3 = rig->state.rx_range_list3->label; + label3 = rs->rx_range_list3->label; label3 = label3 == NULL ? "TBD" : label3; fprintf(fout, "RX ranges #3 for %s:\n", label3); - range_print(fout, rig->state.rx_range_list3, 1); + range_print(fout, rs->rx_range_list3, 1); - label4 = rig->state.rx_range_list4->label; + label4 = rs->rx_range_list4->label; label4 = label4 == NULL ? "TBD" : label4; fprintf(fout, "TX ranges #4 for %s:\n", label4); - range_print(fout, rig->state.tx_range_list5, 0); + range_print(fout, rs->tx_range_list5, 0); - label4 = rig->state.rx_range_list4->label; + label4 = rs->rx_range_list4->label; label4 = label4 == NULL ? "TBD" : label4; fprintf(fout, "RX ranges #4 for %s:\n", label4); - range_print(fout, rig->state.rx_range_list5, 1); + range_print(fout, rs->rx_range_list5, 1); - label5 = rig->state.rx_range_list5->label; + label5 = rs->rx_range_list5->label; label5 = label5 == NULL ? "TBD" : label5; fprintf(fout, "TX ranges #5 for %s:\n", label5); - range_print(fout, rig->state.tx_range_list5, 0); + range_print(fout, rs->tx_range_list5, 0); - label5 = rig->state.rx_range_list5->label; + label5 = rs->rx_range_list5->label; label5 = label5 == NULL ? "TBD" : label5; fprintf(fout, "RX ranges #5 for %s:\n", label5); - range_print(fout, rig->state.rx_range_list5, 1); + range_print(fout, rs->rx_range_list5, 1); - status = range_sanity_check(rig->state.tx_range_list1, 0); + status = range_sanity_check(rs->tx_range_list1, 0); fprintf(fout, "TX ranges #1 status for %s:\t%s (%d)\n", label1, status ? "Bad" : "OK", @@ -540,7 +541,7 @@ int dumpstate(RIG *rig, FILE *fout) backend_warnings++; } - status = range_sanity_check(rig->state.rx_range_list1, 1); + status = range_sanity_check(rs->rx_range_list1, 1); fprintf(fout, "RX ranges #1 status for %s:\t%s (%d)\n", labelrx1, status ? "Bad" : "OK", @@ -552,7 +553,7 @@ int dumpstate(RIG *rig, FILE *fout) backend_warnings++; } - status = range_sanity_check(rig->state.tx_range_list2, 0); + status = range_sanity_check(rs->tx_range_list2, 0); fprintf(fout, "TX ranges #2 status for %s:\t%s (%d)\n", label2, status ? "Bad" : "OK", @@ -564,7 +565,7 @@ int dumpstate(RIG *rig, FILE *fout) backend_warnings++; } - status = range_sanity_check(rig->state.rx_range_list2, 1); + status = range_sanity_check(rs->rx_range_list2, 1); fprintf(fout, "RX ranges #2 status for %s:\t%s (%d)\n", label2, status ? "Bad" : "OK", @@ -576,7 +577,7 @@ int dumpstate(RIG *rig, FILE *fout) backend_warnings++; } - status = range_sanity_check(rig->state.tx_range_list3, 0); + status = range_sanity_check(rs->tx_range_list3, 0); fprintf(fout, "TX ranges #3 status for %s:\t%s (%d)\n", label3, status ? "Bad" : "OK", @@ -588,7 +589,7 @@ int dumpstate(RIG *rig, FILE *fout) backend_warnings++; } - status = range_sanity_check(rig->state.rx_range_list3, 1); + status = range_sanity_check(rs->rx_range_list3, 1); fprintf(fout, "RX ranges #3 status for %s:\t%s (%d)\n", label3, status ? "Bad" : "OK", @@ -600,7 +601,7 @@ int dumpstate(RIG *rig, FILE *fout) backend_warnings++; } - status = range_sanity_check(rig->state.tx_range_list4, 0); + status = range_sanity_check(rs->tx_range_list4, 0); fprintf(fout, "TX ranges #4 status for %s:\t%s (%d)\n", label4, status ? "Bad" : "OK", @@ -612,7 +613,7 @@ int dumpstate(RIG *rig, FILE *fout) backend_warnings++; } - status = range_sanity_check(rig->state.rx_range_list4, 1); + status = range_sanity_check(rs->rx_range_list4, 1); fprintf(fout, "RX ranges #4 status for %s:\t%s (%d)\n", label4, status ? "Bad" : "OK", @@ -624,7 +625,7 @@ int dumpstate(RIG *rig, FILE *fout) backend_warnings++; } - status = range_sanity_check(rig->state.tx_range_list5, 0); + status = range_sanity_check(rs->tx_range_list5, 0); fprintf(fout, "TX ranges #5 status for %s:\t%s (%d)\n", label5, status ? "Bad" : "OK", @@ -636,7 +637,7 @@ int dumpstate(RIG *rig, FILE *fout) backend_warnings++; } - status = range_sanity_check(rig->state.rx_range_list5, 1); + status = range_sanity_check(rs->rx_range_list5, 1); fprintf(fout, "RX ranges #5 status for %s:\t%s (%d)\n", label5, status ? "Bad" : "OK", @@ -651,18 +652,18 @@ int dumpstate(RIG *rig, FILE *fout) fprintf(fout, "Tuning steps:"); for (i = 0; i < HAMLIB_TSLSTSIZ - && !RIG_IS_TS_END(rig->state.tuning_steps[i]); i++) + && !RIG_IS_TS_END(rs->tuning_steps[i]); i++) { - if (rig->state.tuning_steps[i].ts == RIG_TS_ANY) + if (rs->tuning_steps[i].ts == RIG_TS_ANY) { strcpy(freqbuf, "ANY"); /* strcpy! Looks safe for now */ } else { - sprintf_freq(freqbuf, sizeof(freqbuf), rig->state.tuning_steps[i].ts); + sprintf_freq(freqbuf, sizeof(freqbuf), rs->tuning_steps[i].ts); } - rig_sprintf_mode(prntbuf, sizeof(prntbuf), rig->state.tuning_steps[i].modes); + rig_sprintf_mode(prntbuf, sizeof(prntbuf), rs->tuning_steps[i].modes); fprintf(fout, "\n\t%s: \t%s", freqbuf, prntbuf); } @@ -674,7 +675,7 @@ int dumpstate(RIG *rig, FILE *fout) } fprintf(fout, "\n"); - status = ts_sanity_check(rig->state.tuning_steps); + status = ts_sanity_check(rs->tuning_steps); fprintf(fout, "Tuning steps status:\t%s (%d)\n", status ? "Bad" : "OK", status); if (status) @@ -685,18 +686,18 @@ int dumpstate(RIG *rig, FILE *fout) fprintf(fout, "Filters:"); - for (i = 0; i < HAMLIB_FLTLSTSIZ && !RIG_IS_FLT_END(rig->state.filters[i]); i++) + for (i = 0; i < HAMLIB_FLTLSTSIZ && !RIG_IS_FLT_END(rs->filters[i]); i++) { - if (rig->state.filters[i].width == RIG_FLT_ANY) + if (rs->filters[i].width == RIG_FLT_ANY) { strcpy(freqbuf, "ANY"); } else { - sprintf_freq(freqbuf, sizeof(freqbuf), rig->state.filters[i].width); + sprintf_freq(freqbuf, sizeof(freqbuf), rs->filters[i].width); } - rig_sprintf_mode(prntbuf, sizeof(prntbuf), rig->state.filters[i].modes); + rig_sprintf_mode(prntbuf, sizeof(prntbuf), rs->filters[i].modes); fprintf(fout, "\n\t%s: \t%s", freqbuf, prntbuf); } @@ -735,10 +736,10 @@ int dumpstate(RIG *rig, FILE *fout) fprintf(fout, "Spectrum scopes:"); for (i = 0; i < HAMLIB_MAX_SPECTRUM_SCOPES - && rig->state.spectrum_scopes[i].name != NULL; i++) + && rs->spectrum_scopes[i].name != NULL; i++) { - fprintf(fout, " %d=\"%s\"", rig->state.spectrum_scopes[i].id, - rig->state.spectrum_scopes[i].name); + fprintf(fout, " %d=\"%s\"", rs->spectrum_scopes[i].id, + rs->spectrum_scopes[i].name); } if (i == 0) @@ -748,22 +749,22 @@ int dumpstate(RIG *rig, FILE *fout) fprintf(fout, "\n"); - rig_sprintf_spectrum_modes(prntbuf, sizeof(prntbuf), rig->state.spectrum_modes); + rig_sprintf_spectrum_modes(prntbuf, sizeof(prntbuf), rs->spectrum_modes); fprintf(fout, "Spectrum modes: %s\n", prntbuf); - rig_sprintf_spectrum_spans(prntbuf, sizeof(prntbuf), rig->state.spectrum_spans); + rig_sprintf_spectrum_spans(prntbuf, sizeof(prntbuf), rs->spectrum_spans); fprintf(fout, "Spectrum spans: %s\n", prntbuf); rig_sprintf_spectrum_avg_modes(prntbuf, sizeof(prntbuf), - rig->state.spectrum_avg_modes); + rs->spectrum_avg_modes); fprintf(fout, "Spectrum averaging modes: %s\n", prntbuf); fprintf(fout, "Spectrum attenuator:"); for (i = 0; i < HAMLIB_MAXDBLSTSIZ - && rig->state.spectrum_attenuator[i] != 0; i++) + && rs->spectrum_attenuator[i] != 0; i++) { - fprintf(fout, " %ddB", rig->state.spectrum_attenuator[i]); + fprintf(fout, " %ddB", rs->spectrum_attenuator[i]); } if (i == 0) @@ -773,7 +774,7 @@ int dumpstate(RIG *rig, FILE *fout) fprintf(fout, "\n"); - fprintf(fout, "Has priv data:\t%c\n", rig->state.priv != NULL ? 'Y' : 'N'); + fprintf(fout, "Has priv data:\t%c\n", rs->priv != NULL ? 'Y' : 'N'); /* * Status is either 'Y'es, 'E'mulated, 'N'o * @@ -920,7 +921,7 @@ int dumpstate(RIG *rig, FILE *fout) can_echannel = rig->caps->set_mem && ((rig->caps->set_vfo - && ((rig->state.vfo_list & RIG_VFO_MEM) == RIG_VFO_MEM)) + && ((rs->vfo_list & RIG_VFO_MEM) == RIG_VFO_MEM)) || (rig->caps->vfo_op && rig_has_vfo_op(rig, RIG_OP_TO_VFO | RIG_OP_FROM_VFO))); diff --git a/tests/memload.c b/tests/memload.c index a37c6af28..e4e4eb689 100644 --- a/tests/memload.c +++ b/tests/memload.c @@ -120,6 +120,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) { xmlChar *prop; int i, n; + struct rig_state *rs = STATE(rig); memset(chan, 0, sizeof(channel_t)); chan->vfo = RIG_VFO_MEM; @@ -138,8 +139,8 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) /* find channel caps */ for (i = 0; i < HAMLIB_CHANLSTSIZ ; i++) { - if (rig->state.chan_list[i].startc <= n - && rig->state.chan_list[i].endc >= n) + if (rs->chan_list[i].startc <= n + && rs->chan_list[i].endc >= n) { break; @@ -150,7 +151,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) fprintf(stderr, "node %d %d\n", n, i); - if (rig->state.chan_list[i].mem_caps.bank_num) + if (rs->chan_list[i].mem_caps.bank_num) { prop = xmlGetProp(node, (unsigned char *) "bank_num"); @@ -160,7 +161,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) } } - if (rig->state.chan_list[i].mem_caps.channel_desc) + if (rs->chan_list[i].mem_caps.channel_desc) { prop = xmlGetProp(node, (unsigned char *) "channel_desc"); @@ -170,7 +171,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) } } - if (rig->state.chan_list[i].mem_caps.ant) + if (rs->chan_list[i].mem_caps.ant) { prop = xmlGetProp(node, (unsigned char *) "ant"); @@ -180,7 +181,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) } } - if (rig->state.chan_list[i].mem_caps.freq) + if (rs->chan_list[i].mem_caps.freq) { prop = xmlGetProp(node, (unsigned char *) "freq"); @@ -190,7 +191,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) } } - if (rig->state.chan_list[i].mem_caps.mode) + if (rs->chan_list[i].mem_caps.mode) { prop = xmlGetProp(node, (unsigned char *) "mode"); @@ -200,7 +201,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) } } - if (rig->state.chan_list[i].mem_caps.width) + if (rs->chan_list[i].mem_caps.width) { prop = xmlGetProp(node, (unsigned char *) "width"); @@ -210,7 +211,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) } } - if (rig->state.chan_list[i].mem_caps.tx_freq) + if (rs->chan_list[i].mem_caps.tx_freq) { prop = xmlGetProp(node, (unsigned char *) "tx_freq"); @@ -220,7 +221,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) } } - if (rig->state.chan_list[i].mem_caps.tx_mode) + if (rs->chan_list[i].mem_caps.tx_mode) { prop = xmlGetProp(node, (unsigned char *)"tx_mode"); @@ -230,7 +231,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) } } - if (rig->state.chan_list[i].mem_caps.tx_width) + if (rs->chan_list[i].mem_caps.tx_width) { prop = xmlGetProp(node, (unsigned char *)"tx_width"); @@ -240,7 +241,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) } } - if (rig->state.chan_list[i].mem_caps.split) + if (rs->chan_list[i].mem_caps.split) { chan->split = RIG_SPLIT_OFF; prop = xmlGetProp(node, (unsigned char *)"split"); @@ -251,7 +252,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) { chan->split = RIG_SPLIT_ON; - if (rig->state.chan_list[i].mem_caps.tx_vfo) + if (rs->chan_list[i].mem_caps.tx_vfo) { prop = xmlGetProp(node, (unsigned char *)"tx_vfo"); @@ -264,7 +265,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) } } - if (rig->state.chan_list[i].mem_caps.rptr_shift) + if (rs->chan_list[i].mem_caps.rptr_shift) { prop = xmlGetProp(node, (unsigned char *)"rptr_shift"); @@ -286,7 +287,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) } } - if (rig->state.chan_list[i].mem_caps.rptr_offs + if (rs->chan_list[i].mem_caps.rptr_offs && chan->rptr_shift != RIG_RPT_SHIFT_NONE) { prop = xmlGetProp(node, (unsigned char *)"rptr_offs"); @@ -298,7 +299,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) } } - if (rig->state.chan_list[i].mem_caps.tuning_step) + if (rs->chan_list[i].mem_caps.tuning_step) { prop = xmlGetProp(node, (unsigned char *)"tuning_step"); @@ -308,7 +309,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) } } - if (rig->state.chan_list[i].mem_caps.rit) + if (rs->chan_list[i].mem_caps.rit) { prop = xmlGetProp(node, (unsigned char *)"rit"); @@ -318,7 +319,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) } } - if (rig->state.chan_list[i].mem_caps.xit) + if (rs->chan_list[i].mem_caps.xit) { prop = xmlGetProp(node, (unsigned char *)"xit"); @@ -328,7 +329,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) } } - if (rig->state.chan_list[i].mem_caps.funcs) + if (rs->chan_list[i].mem_caps.funcs) { prop = xmlGetProp(node, (unsigned char *)"funcs"); @@ -338,7 +339,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) } } - if (rig->state.chan_list[i].mem_caps.ctcss_tone) + if (rs->chan_list[i].mem_caps.ctcss_tone) { prop = xmlGetProp(node, (unsigned char *)"ctcss_tone"); @@ -348,7 +349,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) } } - if (rig->state.chan_list[i].mem_caps.ctcss_sql) + if (rs->chan_list[i].mem_caps.ctcss_sql) { prop = xmlGetProp(node, (unsigned char *)"ctcss_sql"); @@ -358,7 +359,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) } } - if (rig->state.chan_list[i].mem_caps.dcs_code) + if (rs->chan_list[i].mem_caps.dcs_code) { prop = xmlGetProp(node, (unsigned char *)"dcs_code"); @@ -368,7 +369,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) } } - if (rig->state.chan_list[i].mem_caps.dcs_sql) + if (rs->chan_list[i].mem_caps.dcs_sql) { prop = xmlGetProp(node, (unsigned char *)"dcs_sql"); @@ -378,7 +379,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) } } - if (rig->state.chan_list[i].mem_caps.scan_group) + if (rs->chan_list[i].mem_caps.scan_group) { prop = xmlGetProp(node, (unsigned char *)"scan_group"); @@ -388,7 +389,7 @@ int set_chan(RIG *rig, channel_t *chan, xmlNodePtr node) } } - if (rig->state.chan_list[i].mem_caps.flags) + if (rs->chan_list[i].mem_caps.flags) { prop = xmlGetProp(node, (unsigned char *)"flags"); diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 5b8333c12..cc2c3f761 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -706,6 +706,7 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc, int retcode = -RIG_EINTERNAL; /* generic return code from functions */ unsigned char cmd; struct test_table *cmd_entry = NULL; + struct rig_state *rs = STATE(my_rig); char command[MAXARGSZ + 1]; char arg1[MAXARGSZ + 1], *p1 = NULL; @@ -868,7 +869,7 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc, return (RIG_OK); } - my_rig->state.vfo_opt = *vfo_opt; + rs->vfo_opt = *vfo_opt; if (cmd == 'Q' || cmd == 'q') { @@ -1779,10 +1780,10 @@ readline_repeat: rig_debug(RIG_DEBUG_TRACE, "%s: vfo_opt=%d\n", __func__, *vfo_opt); - if (my_rig->state.comm_state == 0) + if (rs->comm_state == 0) { rig_debug(RIG_DEBUG_WARN, "%s: %p rig not open...trying to reopen\n", __func__, - &my_rig->state.comm_state); + &rs->comm_state); rig_open(my_rig); } @@ -1808,7 +1809,7 @@ readline_repeat: else { // Allow only certain commands when the rig is powered off - if (my_rig->state.powerstat == RIG_POWER_OFF && (rig_powerstat == RIG_POWER_OFF + if (rs->powerstat == RIG_POWER_OFF && (rig_powerstat == RIG_POWER_OFF || rig_powerstat == RIG_POWER_STANDBY) && cmd_entry->cmd != '1' // dump_caps && cmd_entry->cmd != '3' // dump_conf @@ -1846,7 +1847,7 @@ readline_repeat: // we need to copy client_version to our thread in case there are multiple client versions // client_version is used to determine any backward compatibility requirements or problems - strncpy(client_version, my_rig->state.client_version, sizeof(client_version)); + strncpy(client_version, rs->client_version, sizeof(client_version)); } @@ -1927,15 +1928,16 @@ declare_proto_rig(hamlib_version) declare_proto_rig(client_version) { + struct rig_state *rs = STATE(rig); if ((interactive && prompt) || (interactive && !prompt && ext_resp)) { fprintf(fout, "%s: ", cmd->arg1); } fprintf(fout, "%s%c", arg1, resp_sep); - strncpy(rig->state.client_version, arg1, sizeof(rig->state.client_version) - 1); + strncpy(rs->client_version, arg1, sizeof(rs->client_version) - 1); rig_debug(RIG_DEBUG_VERBOSE, "%s: client_version=%s\n", __func__, - rig->state.client_version); + rs->client_version); return RIG_OK; } @@ -2270,15 +2272,16 @@ declare_proto_rig(set_mode) { rmode_t mode; pbwidth_t width; + struct rig_state *rs = STATE(rig); ENTERFUNC2; - if (rig->state.lock_mode || lock_mode) { RETURNFUNC2(RIG_OK); } + if (rs->lock_mode || lock_mode) { RETURNFUNC2(RIG_OK); } if (!strcmp(arg1, "?")) { char s[SPRINTF_MAX_SIZE]; - rig_sprintf_mode(s, sizeof(s), rig->state.mode_list); + rig_sprintf_mode(s, sizeof(s), rs->mode_list); fprintf(fout, "%s\n", s); RETURNFUNC2(RIG_OK); } @@ -2286,7 +2289,7 @@ declare_proto_rig(set_mode) mode = rig_parse_mode(arg1); CHKSCN1ARG(sscanf(arg2, "%ld", &width)); - if (rig->state.lock_mode) { RETURNFUNC2(RIG_OK); } + if (rs->lock_mode) { RETURNFUNC2(RIG_OK); } RETURNFUNC2(rig_set_mode(rig, vfo, mode, width)); } @@ -2336,7 +2339,7 @@ declare_proto_rig(set_vfo) if (!strcmp(arg1, "?")) { char s[SPRINTF_MAX_SIZE]; - rig_sprintf_vfo(s, sizeof(s), rig->state.vfo_list); + rig_sprintf_vfo(s, sizeof(s), STATE(rig)->vfo_list); fprintf(fout, "%s\n", s); RETURNFUNC2(RIG_OK); } @@ -2426,7 +2429,7 @@ declare_proto_rig(get_vfo_info) if (!strcmp(arg1, "?")) { char s[SPRINTF_MAX_SIZE]; - rig_sprintf_vfo(s, sizeof(s), rig->state.vfo_list); + rig_sprintf_vfo(s, sizeof(s), STATE(rig)->vfo_list); fprintf(fout, "%s\n", s); RETURNFUNC2(RIG_OK); } @@ -2474,7 +2477,7 @@ declare_proto_rig(get_vfo_list) ENTERFUNC2; - rig_sprintf_vfo(prntbuf, sizeof(prntbuf), rig->state.vfo_list); + rig_sprintf_vfo(prntbuf, sizeof(prntbuf), STATE(rig)->vfo_list); if ((interactive && prompt) || (interactive && !prompt && ext_resp)) { @@ -2511,7 +2514,7 @@ declare_proto_rig(get_modes) ENTERFUNC2; - rig_strrmodes(rig->state.mode_list, prntbuf, sizeof(prntbuf)); + rig_strrmodes(STATE(rig)->mode_list, prntbuf, sizeof(prntbuf)); if ((interactive && prompt) || (interactive && !prompt && ext_resp)) { @@ -2986,7 +2989,7 @@ declare_proto_rig(set_split_mode) if (!strcmp(arg1, "?")) { char s[SPRINTF_MAX_SIZE]; - rig_sprintf_mode(s, sizeof(s), rig->state.mode_list); + rig_sprintf_mode(s, sizeof(s), STATE(rig)->mode_list); fprintf(fout, "%s\n", s); RETURNFUNC2(RIG_OK); } @@ -3048,7 +3051,7 @@ declare_proto_rig(set_split_freq_mode) if (!strcmp(arg1, "?")) { char s[SPRINTF_MAX_SIZE]; - rig_sprintf_mode(s, sizeof(s), rig->state.mode_list); + rig_sprintf_mode(s, sizeof(s), STATE(rig)->mode_list); fprintf(fout, "%s\n", s); RETURNFUNC2(RIG_OK); } @@ -3116,7 +3119,7 @@ declare_proto_rig(set_split_vfo) if (!strcmp(arg2, "?")) { char s[SPRINTF_MAX_SIZE]; - rig_sprintf_vfo(s, sizeof(s), rig->state.vfo_list); + rig_sprintf_vfo(s, sizeof(s), STATE(rig)->vfo_list); fprintf(fout, "%s\n", s); RETURNFUNC2(RIG_OK); } @@ -3293,7 +3296,7 @@ declare_proto_rig(set_level) if (!strcmp(arg1, "?")) { char s[SPRINTF_MAX_SIZE]; - rig_sprintf_level(s, sizeof(s), rig->state.has_set_level); + rig_sprintf_level(s, sizeof(s), STATE(rig)->has_set_level); fputs(s, fout); if (rig->caps->set_ext_level) @@ -3409,7 +3412,7 @@ declare_proto_rig(get_level) if (!strcmp(arg1, "?")) { char s[SPRINTF_MAX_SIZE]; - rig_sprintf_level(s, sizeof(s), rig->state.has_get_level); + rig_sprintf_level(s, sizeof(s), STATE(rig)->has_get_level); fputs(s, fout); if (rig->caps->get_ext_level) @@ -3546,7 +3549,7 @@ declare_proto_rig(set_func) if (!strcmp(arg1, "?")) { char s[SPRINTF_MAX_SIZE]; - rig_sprintf_func(s, sizeof(s), rig->state.has_set_func); + rig_sprintf_func(s, sizeof(s), STATE(rig)->has_set_func); fprintf(fout, "%s\n", s); RETURNFUNC2(RIG_OK); } @@ -3586,7 +3589,7 @@ declare_proto_rig(get_func) if (!strcmp(arg1, "?")) { char s[SPRINTF_MAX_SIZE]; - rig_sprintf_func(s, sizeof(s), rig->state.has_get_func); + rig_sprintf_func(s, sizeof(s), STATE(rig)->has_get_func); fprintf(fout, "%s\n", s); RETURNFUNC2(RIG_OK); } @@ -3650,7 +3653,7 @@ declare_proto_rig(set_parm) if (!strcmp(arg1, "?")) { char s[SPRINTF_MAX_SIZE]; - rig_sprintf_parm(s, sizeof(s), rig->state.has_set_parm); + rig_sprintf_parm(s, sizeof(s), STATE(rig)->has_set_parm); fprintf(fout, "%s\n", s); RETURNFUNC2(RIG_OK); } @@ -3778,7 +3781,7 @@ declare_proto_rig(get_parm) if (!strcmp(arg1, "?")) { char s[SPRINTF_MAX_SIZE]; - rig_sprintf_parm(s, sizeof(s), rig->state.has_get_parm); + rig_sprintf_parm(s, sizeof(s), STATE(rig)->has_get_parm); fprintf(fout, "%s\n", s); RETURNFUNC2(RIG_OK); } @@ -3964,7 +3967,7 @@ declare_proto_rig(vfo_op) if (!strcmp(arg1, "?")) { char s[SPRINTF_MAX_SIZE]; - rig_sprintf_vfop(s, sizeof(s), rig->state.vfo_ops); + rig_sprintf_vfop(s, sizeof(s), STATE(rig)->vfo_ops); fprintf(fout, "%s\n", s); RETURNFUNC2(RIG_OK); } @@ -4589,7 +4592,7 @@ declare_proto_rig(dump_caps) declare_proto_rig(dump_state) { int i; - struct rig_state *rs = &rig->state; + struct rig_state *rs = STATE(rig); char buf[1024]; ENTERFUNC2; @@ -4761,13 +4764,13 @@ declare_proto_rig(dump_state) { if (RIG_LEVEL_IS_FLOAT(i)) { - fprintf(fout, "%d=%g,%g,%g;", i, rig->state.level_gran[i].min.f, - rig->state.level_gran[i].max.f, rig->state.level_gran[i].step.f); + fprintf(fout, "%d=%g,%g,%g;", i, rs->level_gran[i].min.f, + rs->level_gran[i].max.f, rs->level_gran[i].step.f); } else { - fprintf(fout, "%d=%d,%d,%d;", i, rig->state.level_gran[i].min.i, - rig->state.level_gran[i].max.i, rig->state.level_gran[i].step.i); + fprintf(fout, "%d=%d,%d,%d;", i, rs->level_gran[i].min.i, + rs->level_gran[i].max.i, rs->level_gran[i].step.i); } } @@ -4777,20 +4780,20 @@ declare_proto_rig(dump_state) { if (RIG_LEVEL_IS_FLOAT(i)) { - fprintf(fout, "%d=%g,%g,%g;", i, rig->state.parm_gran[i].min.f, - rig->state.parm_gran[i].max.f, rig->state.parm_gran[i].step.f); + fprintf(fout, "%d=%g,%g,%g;", i, rs->parm_gran[i].min.f, + rs->parm_gran[i].max.f, rs->parm_gran[i].step.f); } else { - fprintf(fout, "%d=%d,%d,%d;", i, rig->state.level_gran[i].min.i, - rig->state.level_gran[i].max.i, rig->state.level_gran[i].step.i); + fprintf(fout, "%d=%d,%d,%d;", i, rs->level_gran[i].min.i, + rs->level_gran[i].max.i, rs->level_gran[i].step.i); } } fprintf(fout, "\n"); - rig->state.rig_model = rig->caps->rig_model; - fprintf(fout, "rig_model=%d\n", rig->state.rig_model); + rs->rig_model = rig->caps->rig_model; + fprintf(fout, "rig_model=%d\n", rs->rig_model); fprintf(fout, "hamlib_version=%s\n", hamlib_version2); fprintf(fout, "done\n"); } @@ -5400,7 +5403,7 @@ declare_proto_rig(chk_vfo) fprintf(fout, "%s: ", cmd->arg1); /* i.e. "Frequency" */ } - fprintf(fout, "%d\n", rig->state.vfo_opt); + fprintf(fout, "%d\n", STATE(rig)->vfo_opt); chk_vfo_executed = 1; // this allows us to control dump_state version @@ -5414,7 +5417,7 @@ declare_proto_rig(set_vfo_opt) ENTERFUNC2; CHKSCN1ARG(sscanf(arg1, "%d", &opt)); - *vfo_opt = rig->state.vfo_opt = opt; + *vfo_opt = STATE(rig)->vfo_opt = opt; RETURNFUNC2(rig_set_vfo_opt(rig, opt)); } commit ce25f638434f20d789d0aecb4dd5a9bbadbfa30e Author: George Baltz N3GB <Geo...@gm...> Date: Thu May 30 17:55:54 2024 -0400 Convert macros in rig.h to use STATE() Note that the other pointer macros are NOT converted - they should be changed one-by-one as any are moved. diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 6e8419cd6..dd0cb43ab 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -33,7 +33,7 @@ // Our shared secret password #define HAMLIB_SECRET_LENGTH 32 -#define HAMLIB_TRACE rig_debug(RIG_DEBUG_TRACE,"%s%s(%d) trace\n",spaces(rig->state.depth), __FILE__, __LINE__) +#define HAMLIB_TRACE rig_debug(RIG_DEBUG_TRACE,"%s%s(%d) trace\n",spaces(STATE(rig)->depth), __FILE__, __LINE__) #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) #include <stdio.h> @@ -618,13 +618,13 @@ ... [truncated message content] |
From: n0nb <n0...@us...> - 2024-05-31 13:39:39
|
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 745e72a6cf7023cfd26c282207803e4c62897668 (commit) via 88439f8f12c3011751e995e01b2b09a4fa77dd66 (commit) via befb2ffcdf0965709055262fb5dad3e00d647d5c (commit) via 218385a76c0a82ef040be0a1eb5502b25c5664ed (commit) via 1e3be1a88fd96e59a9715b5f04079c782eccd05d (commit) via 3583b077e823f0b9474353f36fee4781c1bb4940 (commit) via be0f7407f2857ccc55ec1f18550b16644421dfb0 (commit) via a300a73f1d584c28c0e17414445be00c716740f3 (commit) via 86dc5c8d6fab469ab6191502ad4f4cd7bb0b7326 (commit) via c730e445a14b8faf1c6112cc8fb1c2217e6c1374 (commit) via 04c3c03334dd250cccee9b99c808e7b9dfdf5dcb (commit) via 2de9778f27a7d614cfe33d8af6f6ff2d1b78e444 (commit) via a721c04c536c0f7301608f49dcccbb1c03152f58 (commit) via f53dc99057869642b896c4743a99335900cfb39b (commit) via a5f53bbcf68ba5fea29a40efbda357f109897663 (commit) via 18568986f85688a6a2d6ae89c950af94dea6be2f (commit) from 461f3c4172ded779cf258cd5ea4d1c0179c4586f (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 745e72a6cf7023cfd26c282207803e4c62897668 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu May 30 17:34:02 2024 -0500 Add ROT_MOVE_UP_LEFT, ROT_MOVE_UP_CCW ROT_MOVE_UP_RIGHT, ROT_MOVE_UP_CW ROT_MOVE_DOWN_LEFT, ROT_MOVE_DOWN_CCW ROT_MOVE_DOWN_RIGHT, ROT_MOVE_DOWN_CW Supported by SPID rotators diff --git a/doc/man1/rotctl.1 b/doc/man1/rotctl.1 index f947223a2..93c925883 100644 --- a/doc/man1/rotctl.1 +++ b/doc/man1/rotctl.1 @@ -410,8 +410,9 @@ are returned as double precision floating point values. Move the rotator in a specific direction at the given rate. .IP .RI \(aq Direction \(aq -is an integer or keyword defined as \(oq2\(cq = UP, \(oq4\(cq = DOWN, \(oq8\(cq = LEFT or CCW -and \(oq16\(cq = RIGHT or CW +is an integer or keyword defined as \(oq2\(cq = UP, \(oq4\(cq = DOWN, \(oq8\(cq = LEFT or CCW, +\(oq16\(cq = RIGHT or CW, \(oq32\(cq = UP_LEFT or UP_CCW, \(oqR64\(cq = UP_RIGHT = UP_CW, +\(oq128\(cq = DOWN_LEFT or DOWN_CCW, \(oq256\(cq = DOWN_RIGHT or DOWN_CW .IP .RI \(aq Speed \(aq is an integer between 1 and 100. Use -1 for no change to current speed. diff --git a/doc/man1/rotctld.1 b/doc/man1/rotctld.1 index 852831c1e..f65bbcf3d 100644 --- a/doc/man1/rotctld.1 +++ b/doc/man1/rotctld.1 @@ -322,8 +322,9 @@ are returned as double precision floating point values. Move the rotator in a specific direction at the given rate. .IP .RI \(aq Direction \(aq -is an integer defined as \(oq2\(cq = Up, \(oq4\(cq = Down, \(oq8\(cq = Left, -and \(oq16\(cq = Right. +is an integer or keyword defined as \(oq2\(cq = UP, \(oq4\(cq = DOWN, \(oq8\(cq = LEFT or CCW, +\(oq16\(cq = RIGHT or CW, \(oq32\(cq = UP_LEFT or UP_CCW, \(oqR64\(cq = UP_RIGHT = UP_CW, +\(oq128\(cq = DOWN_LEFT or DOWN_CCW, \(oq256\(cq = DOWN_RIGHT or DOWN_CW .IP .RI \(aq Speed \(aq is an integer between 1 and 100. Use -1 for no change to current speed. diff --git a/include/hamlib/rotator.h b/include/hamlib/rotator.h index 6427001c3..82bc634e2 100644 --- a/include/hamlib/rotator.h +++ b/include/hamlib/rotator.h @@ -215,6 +215,126 @@ typedef enum { */ #define ROT_MOVE_CW ROT_MOVE_RIGHT +/** + * \def ROT_MOVE_UP_LEFT + * \brief A macro that returns the flag for the \b clockwise direction. + * + * This macro defines the value of the \b clockwise direction which can be + * used with the rot_move() function. This value is equivalent to + * ROT_MOVE_UP_CCW. + * + * \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW, + * ROT_MOVE_RIGHT, ROT_MOVE_CW, ROT_MOVE_UP_CCW, + * ROT_MOVE_UP_RIGHT, ROT_MOVE_UP_CW, ROT_MOVE_DOWN_LEFT, ROT_MOVE_DOWN_CCW, + * ROT_MOVE_DOWN_RIGHT, ROT_MOVE_DOWN_CW + */ +#define ROT_MOVE_UP_LEFT (1<<5) + +/** + * \def ROT_MOVE_UP_CCW + * \brief A macro that returns the flag for the \b clockwise direction. + * + * This macro defines the value of the \b clockwise direction which can be + * used with the rot_move() function. This value is equivalent to + * ROT_MOVE_UP_LEFT. + * + * \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW, + * ROT_MOVE_RIGHT, ROT_MOVE_CW, ROT_MOVE_UP_LEFT, + * ROT_MOVE_UP_RIGHT, ROT_MOVE_UP_CW, ROT_MOVE_DOWN_LEFT, ROT_MOVE_DOWN_CCW, + * ROT_MOVE_DOWN_RIGHT, ROT_MOVE_DOWN_CW + */ +#define ROT_MOVE_UP_CCW ROT_MOVE_UP_LEFT + +/** + * \def ROT_MOVE_UP_RIGHT + * \brief A macro that returns the flag for the \b clockwise direction. + * + * This macro defines the value of the \b clockwise direction which can be + * used with the rot_move() function. This value is equivalent to + * ROT_MOVE_UP_CW. + * + * \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW, + * ROT_MOVE_RIGHT, ROT_MOVE_CW, ROT_MOVE_UP_LEFT, ROT_MOVE_UP_CCW, + * ROT_MOVE_UP_CW, ROT_MOVE_DOWN_LEFT, ROT_MOVE_DOWN_CCW, + * ROT_MOVE_DOWN_RIGHT, ROT_MOVE_DOWN_CW + */ +#define ROT_MOVE_UP_RIGHT (1<<6) + +/** + * \def ROT_MOVE_UP_CW + * \brief A macro that returns the flag for the \b clockwise direction. + * + * This macro defines the value of the \b clockwise direction which can be + * used with the rot_move() function. This value is equivalent to + * ROT_MOVE_UP_RIGHT. + * + * \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW, + * ROT_MOVE_RIGHT, ROT_MOVE_CW, ROT_MOVE_UP_LEFT, ROT_MOVE_UP_CCW, + * ROT_MOVE_UP_RIGHT, ROT_MOVE_DOWN_LEFT, ROT_MOVE_DOWN_CCW, + * ROT_MOVE_DOWN_RIGHT, ROT_MOVE_DOWN_CW + */ +#define ROT_MOVE_UP_CW ROT_MOVE_UP_RIGHT + +/** + * \def ROT_MOVE_DOWN_LEFT + * \brief A macro that returns the flag for the \b clockwise direction. + * + * This macro defines the value of the \b clockwise direction which can be + * used with the rot_move() function. This value is equivalent to + * ROT_MOVE_DOWN_CCW. + * + * \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW, + * ROT_MOVE_RIGHT, ROT_MOVE_CW, ROT_MOVE_UP_LEFT, ROT_MOVE_UP_CCW, + * ROT_MOVE_UP_RIGHT, ROT_MOVE_UP_CW, ROT_MOVE_DOWN_CCW, + * ROT_MOVE_DOWN_RIGHT, ROT_MOVE_DOWN_CW + */ +#define ROT_MOVE_DOWN_LEFT (1 << 7) + + +/** + * \def ROT_MOVE_DOWN_CCW + * \brief A macro that returns the flag for the \b clockwise direction. + * + * This macro defines the value of the \b clockwise direction which can be + * used with the rot_move() function. This value is equivalent to + * ROT_MOVE_DOWN_LEFT. + * + * \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW, + * ROT_MOVE_RIGHT, ROT_MOVE_CW, ROT_MOVE_UP_LEFT, ROT_MOVE_UP_CCW, + * ROT_MOVE_UP_RIGHT, ROT_MOVE_UP_CW, ROT_MOVE_DOWN_LEFT, + * ROT_MOVE_DOWN_RIGHT, ROT_MOVE_DOWN_CW + */ +#define ROT_MOVE_DOWN_CCW ROT_MOVE_DOWN_LEFT + +/** + * \def ROT_MOVE_DOWN_RIGHT + * \brief A macro that returns the flag for the \b clockwise direction. + * + * This macro defines the value of the \b clockwise direction which can be + * used with the rot_move() function. This value is equivalent to + * ROT_MOVE_DOWN_CW. + * + * \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW, + * ROT_MOVE_RIGHT, ROT_MOVE_CW, ROT_MOVE_UP_LEFT, ROT_MOVE_UP_CCW, + * ROT_MOVE_UP_RIGHT, ROT_MOVE_UP_CW, ROT_MOVE_DOWN_LEFT, ROT_MOVE_DOWN_CCW, + * ROT_MOVE_DOWN_CW + */ +#define ROT_MOVE_DOWN_RIGHT (1 << 8) + +/** + * \def ROT_MOVE_DOWN_CW + * \brief A macro that returns the flag for the \b clockwise direction. + * + * This macro defines the value of the \b clockwise direction which can be + * used with the rot_move() function. This value is equivalent to + * ROT_MOVE_DOWN_RIGHT. + * + * \sa rot_move(), ROT_MOVE_UP, ROT_MOVE_DOWN, ROT_MOVE_LEFT, ROT_MOVE_CCW, + * ROT_MOVE_RIGHT, ROT_MOVE_CW, ROT_MOVE_UP_LEFT, ROT_MOVE_UP_CCW, + * ROT_MOVE_UP_RIGHT, ROT_MOVE_UP_CW, ROT_MOVE_DOWN_LEFT, ROT_MOVE_DOWN_CCW, + * ROT_MOVE_DOWN_RIGHT, + */ +#define ROT_MOVE_DOWN_CW ROT_MOVE_DOWN_RIGHT /** * \brief Rotator status flags diff --git a/rigs/dummy/rot_dummy.c b/rigs/dummy/rot_dummy.c index 1bf2b2d4e..dec0f8cfc 100644 --- a/rigs/dummy/rot_dummy.c +++ b/rigs/dummy/rot_dummy.c @@ -436,6 +436,22 @@ static int dummy_rot_move(ROT *rot, int direction, int speed) case ROT_MOVE_CW: return dummy_rot_set_position(rot, 180, priv->target_el); + case ROT_MOVE_UP_LEFT: + dummy_rot_set_position(rot, priv->target_az, 90); + return dummy_rot_set_position(rot, -180, priv->target_el); + + case ROT_MOVE_UP_RIGHT: + dummy_rot_set_position(rot, priv->target_az, 90); + return dummy_rot_set_position(rot, 180, priv->target_el); + + case ROT_MOVE_DOWN_LEFT: + dummy_rot_set_position(rot, priv->target_az, 0); + return dummy_rot_set_position(rot, -180, priv->target_el); + + case ROT_MOVE_DOWN_RIGHT: + dummy_rot_set_position(rot, priv->target_az, 0); + return dummy_rot_set_position(rot, 180, priv->target_el); + default: return -RIG_EINVAL; } diff --git a/rigs/flexradio/README b/rigs/flexradio/README new file mode 100644 index 000000000..4e9fcf2a6 --- /dev/null +++ b/rigs/flexradio/README @@ -0,0 +1 @@ +See https://github.com/flexradio/smartsdr-api-docs/wiki/SmartSDR-TCPIP-API diff --git a/rotators/spid/spid.c b/rotators/spid/spid.c index e0dd0d712..c9ef0b3e7 100644 --- a/rotators/spid/spid.c +++ b/rotators/spid/spid.c @@ -37,6 +37,7 @@ struct spid_rot2prog_priv_data { int az_resolution; int el_resolution; + int dir; // current direction }; enum spid_rot2prog_framemagic @@ -213,6 +214,7 @@ static int spid_rot_init(ROT *rot) priv->az_resolution = 0; priv->el_resolution = 0; + priv->dir = 0; } return RIG_OK; @@ -238,9 +240,10 @@ static int spid_rot_cleanup(ROT *rot) return RIG_OK; } -static int spid_get_conf2(ROT *rot, hamlib_token_t token, char *val, int val_len) +static int spid_get_conf2(ROT *rot, hamlib_token_t token, char *val, + int val_len) { - const struct spid_rot2prog_priv_data *priv = (struct spid_rot2prog_priv_data *) + const struct spid_rot2prog_priv_data *priv = (struct spid_rot2prog_priv_data *) rot->state.priv; rig_debug(RIG_DEBUG_TRACE, "%s called %d\n", __func__, (int)token); @@ -343,7 +346,7 @@ static int spid_rot2prog_rot_set_position(ROT *rot, azimuth_t az, { struct rot_state *rs = &rot->state; hamlib_port_t *rotp = ROTPORT(rot); - const struct spid_rot2prog_priv_data *priv = (struct spid_rot2prog_priv_data *) + const struct spid_rot2prog_priv_data *priv = (struct spid_rot2prog_priv_data *) rs->priv; int retval; int retry_read = 0; @@ -494,6 +497,8 @@ static int spid_rot_get_position(ROT *rot, azimuth_t *az, elevation_t *el) static int spid_rot_stop(ROT *rot) { + struct spid_rot2prog_priv_data *priv = (struct spid_rot2prog_priv_data *) + rot->state.priv; hamlib_port_t *rotp = ROTPORT(rot); int retval; int retry_read = 0; @@ -530,36 +535,68 @@ static int spid_rot_stop(ROT *rot) return retval; } + priv->dir = 0; + return RIG_OK; } static int spid_md01_rot2prog_rot_move(ROT *rot, int direction, int speed) { + struct spid_rot2prog_priv_data *priv = (struct spid_rot2prog_priv_data *) + rot->state.priv; char dir = 0x00; int retval; char cmdstr[13]; rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); + dir = priv->dir; + switch (direction) { case ROT_MOVE_UP: - dir = 0x04; + if (dir != 0x01 || dir != 0x02) { dir = 0; } + + dir |= 0x04; break; case ROT_MOVE_DOWN: + if (dir != 0x01 || dir != 0x02) { dir = 0; } + dir = 0x08; break; case ROT_MOVE_LEFT: + if (dir != 0x04 || dir != 0x08) { dir = 0; } + dir = 0x01; break; case ROT_MOVE_RIGHT: + if (dir != 0x04 || dir != 0x08) { dir = 0; } + dir = 0x02; break; + + case ROT_MOVE_UP_RIGHT: + dir = 0x06; + break; + + case ROT_MOVE_DOWN_RIGHT: + dir = 0x0a; + break; + + case ROT_MOVE_UP_LEFT: + dir = 0x05; + break; + + case ROT_MOVE_DOWN_LEFT: + dir = 0x09; + break; } + priv->dir = dir; + cmdstr[0] = 0x57; /* S */ cmdstr[1] = dir; /* H1 */ cmdstr[2] = 0x00; /* H2 */ @@ -599,7 +636,7 @@ const struct rot_caps spid_rot1prog_rot_caps = ROT_MODEL(ROT_MODEL_SPID_ROT1PROG), .model_name = "Rot1Prog", .mfg_name = "SPID", - .version = "20220109.0", + .version = "20240530.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZIMUTH, diff --git a/src/rotator.c b/src/rotator.c index c601f402d..f82702e62 100644 --- a/src/rotator.c +++ b/src/rotator.c @@ -949,8 +949,9 @@ int HAMLIB_API rot_reset(ROT *rot, rot_reset_t reset) * * Move the rotator in the specified direction. The \a direction is one of * #ROT_MOVE_CCW, #ROT_MOVE_CW, #ROT_MOVE_LEFT, #ROT_MOVE_RIGHT, #ROT_MOVE_UP, - * or #ROT_MOVE_DOWN. The \a speed is a value between 1 and 100 or - * #ROT_SPEED_NOCHANGE. + * #ROT_MOVE_DOWN, #ROT_MOVE_UP_LEFT, #ROT_MOVE_CCW, #ROT_MOVE_UP_RIGHT, #ROT_MOVE_UP_CW, + * #ROT_MOVE_DOWN_LEFT, #ROT_MOVE_DOWN_CCW, #ROT_MOVE_DOWN_RIGHT, #ROT_MOVE_DOWN_CW. + * The \a speed is a value between 1 and 100 or #ROT_SPEED_NOCHANGE. * * \retval RIG_OK The rotator move was successful. * \retval RIG_EINVAL \a rot is NULL or inconsistent. diff --git a/tests/rotctl_parse.c b/tests/rotctl_parse.c index d266cf3c0..af07cc736 100644 --- a/tests/rotctl_parse.c +++ b/tests/rotctl_parse.c @@ -1897,6 +1897,22 @@ declare_proto_rot(move) { direction = ROT_MOVE_DOWN; } + else if (!strcmp(arg1, "DOWN_RIGHT") || !strcmp(arg1, "DOWN_CW")) + { + direction = ROT_MOVE_DOWN_CW; + } + else if (!strcmp(arg1, "DOWN_LEFT") || !strcmp(arg1, "DOWN_CCW")) + { + direction = ROT_MOVE_DOWN_CCW; + } + else if (!strcmp(arg1, "UP_RIGHT") || !strcmp(arg1, "UP_CW")) + { + direction = ROT_MOVE_UP_CW; + } + else if (!strcmp(arg1, "UP_LEFT") || !strcmp(arg1, "UP_CCW")) + { + direction = ROT_MOVE_UP_CCW; + } else { CHKSCN1ARG(sscanf(arg1, "%d", &direction)); commit 88439f8f12c3011751e995e01b2b09a4fa77dd66 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu May 30 17:22:00 2024 -0500 Update simflex.c diff --git a/simulators/simflex.c b/simulators/simflex.c index 3ee3113f2..d006348b1 100644 --- a/simulators/simflex.c +++ b/simulators/simflex.c @@ -93,6 +93,7 @@ int main() { printf("Server is listening on port %d\n", PORT); + while (1) { // Accept incoming connection if ((new_socket = accept(server_fd, (struct sockaddr *)&address, (socklen_t*)&addrlen)) < 0) { perror("accept"); @@ -154,6 +155,7 @@ int main() { } close(new_socket); + } close(server_fd); #if defined(WIN32) || defined(_WIN32) WSACleanup(); commit befb2ffcdf0965709055262fb5dad3e00d647d5c Author: Mike Black W9MDB <mdb...@ya...> Date: Thu May 30 10:03:01 2024 -0500 Add a bit more debug to rigctlcom.c diff --git a/tests/rigctlcom.c b/tests/rigctlcom.c index 2716b98fe..4bf136ec3 100644 --- a/tests/rigctlcom.c +++ b/tests/rigctlcom.c @@ -502,6 +502,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "Config parameter error: %s\n", rigerror(retcode)); exit(2); } + #endif if (my_model > 5 && !rig_file) @@ -654,6 +655,9 @@ int main(int argc, char *argv[]) } while (retcode == 0 && !ctrl_c); + rig_debug(RIG_DEBUG_VERBOSE, "%s: rigctlcom exiting, retcode=%d, ctrl_c=%d\n", + __func__, retcode, ctrl_c); + rig_close(my_rig); /* close port */ rig_cleanup(my_rig); /* if you care about memory */ @@ -705,6 +709,7 @@ static rmode_t ts2000_get_mode() default: mode = 0; break; } + #else // Perhaps we should emulate a rig that has PKT modes instead?? //int kwidth_ssb[] = { 10, 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000 }; @@ -717,7 +722,7 @@ static rmode_t ts2000_get_mode() case RIG_MODE_USB: mode = 2; break; - case RIG_MODE_CW: mode = 3; + case RIG_MODE_CW: mode = 3; break; // is this correct? case RIG_MODE_FM: mode = 4; break; @@ -742,6 +747,7 @@ static rmode_t ts2000_get_mode() default: mode = 0; break; } + #endif @@ -802,8 +808,9 @@ static int handle_ts2000(void *arg) int p13 = 0; // P13(1) Tone dummy value for now int p14 = 0; // P14(2) Tone Freq dummy value for now int p15 = 0; // P15(1) Shift status dummy value for now - int retval = rig_get_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split), - &freq); + int retval = rig_get_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_A, + CACHE(my_rig)->split), + &freq); char response[64]; char *fmt = // cppcheck-suppress * @@ -816,7 +823,7 @@ static int handle_ts2000(void *arg) mode = ts2000_get_mode(); retval = rig_get_ptt(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split), - &ptt); + &ptt); if (retval != RIG_OK) { @@ -900,8 +907,9 @@ static int handle_ts2000(void *arg) freq_t freq = 0; char response[32]; - int retval = rig_get_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split), - &freq); + int retval = rig_get_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_A, + CACHE(my_rig)->split), + &freq); if (retval != RIG_OK) { @@ -917,8 +925,9 @@ static int handle_ts2000(void *arg) { char response[32]; freq_t freq = 0; - int retval = rig_get_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split), - &freq); + int retval = rig_get_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_B, + CACHE(my_rig)->split), + &freq); if (retval != RIG_OK) { @@ -972,7 +981,8 @@ static int handle_ts2000(void *arg) } else if (strcmp(arg, "TX;") == 0) { - return rig_set_ptt(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split), 1); + return rig_set_ptt(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split), + 1); } else if (strcmp(arg, "AI0;") == 0) { @@ -1089,8 +1099,9 @@ static int handle_ts2000(void *arg) { char response[32]; int valA; - int retval = rig_get_func(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split), - RIG_FUNC_AIP, &valA); + int retval = rig_get_func(my_rig, vfo_fixup(my_rig, RIG_VFO_A, + CACHE(my_rig)->split), + RIG_FUNC_AIP, &valA); int valB; if (retval != RIG_OK) @@ -1108,8 +1119,9 @@ static int handle_ts2000(void *arg) return retval; } - retval = rig_get_func(my_rig, vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split), - RIG_FUNC_AIP, &valB); + retval = rig_get_func(my_rig, vfo_fixup(my_rig, RIG_VFO_B, + CACHE(my_rig)->split), + RIG_FUNC_AIP, &valB); if (retval != RIG_OK) { @@ -1134,8 +1146,9 @@ static int handle_ts2000(void *arg) (char *)arg); } - retval = rig_set_func(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split), - RIG_FUNC_AIP, valA); + retval = rig_set_func(my_rig, vfo_fixup(my_rig, RIG_VFO_A, + CACHE(my_rig)->split), + RIG_FUNC_AIP, valA); if (retval != RIG_OK) { @@ -1144,8 +1157,9 @@ static int handle_ts2000(void *arg) return retval; } - retval = rig_set_func(my_rig, vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split), - RIG_FUNC_AIP, valB); + retval = rig_set_func(my_rig, vfo_fixup(my_rig, RIG_VFO_B, + CACHE(my_rig)->split), + RIG_FUNC_AIP, valB); if (retval != RIG_OK) { @@ -1560,13 +1574,15 @@ static int handle_ts2000(void *arg) } else if (strcmp(arg, "FT0;") == 0) { - return rig_set_split_vfo(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split), - vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split), 0); + return rig_set_split_vfo(my_rig, vfo_fixup(my_rig, RIG_VFO_A, + CACHE(my_rig)->split), + vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split), 0); } else if (strcmp(arg, "FT1;") == 0) { - return rig_set_split_vfo(my_rig, vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split), - vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split), 0); + return rig_set_split_vfo(my_rig, vfo_fixup(my_rig, RIG_VFO_B, + CACHE(my_rig)->split), + vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split), 0); } else if (strncmp(arg, "FA0", 3) == 0) { @@ -1583,7 +1599,8 @@ static int handle_ts2000(void *arg) freq_t freq; sscanf((char *)arg + 2, "%"SCNfreq, &freq); - return rig_set_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split), freq); + return rig_set_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split), + freq); } else if (strncmp(arg, "MD", 2) == 0) { commit 218385a76c0a82ef040be0a1eb5502b25c5664ed Author: Mike Black W9MDB <mdb...@ya...> Date: Wed May 29 17:50:10 2024 -0500 Fix ID for Xiegu X6100 diff --git a/rigs/icom/xiegu.c b/rigs/icom/xiegu.c index 46e0ad00e..d70de0f4a 100644 --- a/rigs/icom/xiegu.c +++ b/rigs/icom/xiegu.c @@ -148,10 +148,10 @@ int xiegu_rig_open(RIG *rig) if (retval == RIG_OK) { dump_hex(id,id_len); - iid = (int)id[2]; - if (id[3] != 0xfd) + iid = (int)id[1]; + if (id_len > 2) { - iid = (iid << 8) + id[3]; + iid = (iid << 8) + id[2]; } rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu Radio ID=0x%04x\n", __func__, iid); switch(iid) @@ -160,7 +160,7 @@ int xiegu_rig_open(RIG *rig) case 0x0090: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "G90S");break; case 0x0106: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "G106/G106C");break; case 0x6100: - case 0xa400: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "X6100");break; + case 0x00a4: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "X6100");break; default: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "Unknown");break; } } commit 1e3be1a88fd96e59a9715b5f04079c782eccd05d Author: Mike Black W9MDB <mdb...@ya...> Date: Wed May 29 17:06:36 2024 -0500 Fix Xiegu ID for G90 1-byte answer diff --git a/rigs/icom/xiegu.c b/rigs/icom/xiegu.c index fad83abdc..46e0ad00e 100644 --- a/rigs/icom/xiegu.c +++ b/rigs/icom/xiegu.c @@ -148,7 +148,11 @@ int xiegu_rig_open(RIG *rig) if (retval == RIG_OK) { dump_hex(id,id_len); - iid = (((int)id[2]) << 8) + id[3]; + iid = (int)id[2]; + if (id[3] != 0xfd) + { + iid = (iid << 8) + id[3]; + } rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu Radio ID=0x%04x\n", __func__, iid); switch(iid) { @@ -374,7 +378,7 @@ struct rig_caps x6100_caps = RIG_MODEL(RIG_MODEL_X6100), .model_name = "X6100", .mfg_name = "Xiegu", - .version = BACKEND_VER ".5", + .version = BACKEND_VER ".6", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -565,7 +569,7 @@ struct rig_caps g90_caps = RIG_MODEL(RIG_MODEL_G90), .model_name = "G90", .mfg_name = "Xiegu", - .version = BACKEND_VER ".10", + .version = BACKEND_VER ".11", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -740,7 +744,7 @@ struct rig_caps x5105_caps = RIG_MODEL(RIG_MODEL_X5105), .model_name = "X5105", .mfg_name = "Xiegu", - .version = BACKEND_VER ".1", + .version = BACKEND_VER ".2", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 3583b077e823f0b9474353f36fee4781c1bb4940 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed May 29 06:13:59 2024 -0500 Add network_flush2 to support async messages from Flex TCP This allow one to send a command to the Flex and process all the messages returned in the backend rather than thread. This then gives a synchronous behavior which clients expect diff --git a/src/network.c b/src/network.c index 1e76c0cd3..41461c20c 100644 --- a/src/network.c +++ b/src/network.c @@ -379,6 +379,31 @@ int network_open(hamlib_port_t *rp, int default_port) } +// flush and keep what gets flushed based on stopset +// Used by SmartSDR backend for example +// return # of bytes read +int network_flush2(hamlib_port_t *rp, unsigned char *stopset, char *buf, int buf_len) +{ + unsigned int len = 0; +#ifdef __MINGW32__ + int ret = ioctlsocket(rp->fd, FIONREAD, &len); +#else + int ret = ioctl(rp->fd, FIONREAD, &len); +#endif + if (ret != 0) + { + rig_debug(RIG_DEBUG_ERR, "%s: ioctl err '%s'\n", __func__, strerror(errno)); + return 0; + } + + if (len > 0) { + buf[0] = 0; + if (len > buf_len) len = buf_len-1; + read_string(rp, (unsigned char *)buf, len+1, (char*)stopset, 1, 0, 1); + } + + return len; +} /** * \brief Clears any data in the read buffer of the socket * diff --git a/src/network.h b/src/network.h index 7dc9c517c..18ed720e7 100644 --- a/src/network.h +++ b/src/network.h @@ -31,6 +31,7 @@ __BEGIN_DECLS int network_open(hamlib_port_t *p, int default_port); int network_close(hamlib_port_t *rp); void network_flush(hamlib_port_t *rp); +int network_flush2(hamlib_port_t *rp, unsigned char *stopset, char *buf, int buf_len); int network_publish_rig_poll_data(RIG *rig); int network_publish_rig_transceive_data(RIG *rig); int network_publish_rig_spectrum_data(RIG *rig, struct rig_spectrum_line *line); commit be0f7407f2857ccc55ec1f18550b16644421dfb0 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed May 29 06:12:00 2024 -0500 Fix RFMETER_POWER_WATTS in dummy.c diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index 9f8da3406..882f30581 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -1258,6 +1258,7 @@ static int dummy_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv; channel_t *curr = priv->curr; int idx; + static float rfpower = 0; ENTERFUNC; idx = rig_setting2idx(level); @@ -1311,6 +1312,7 @@ static int dummy_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { curr->levels[idx].f = (float)(time(NULL) % 32) / 64.0f + (float)( rand() % 4) / 8.0f; + rfpower = curr->levels[idx].f; } break; @@ -1322,9 +1324,11 @@ static int dummy_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } else { +#if 0 curr->levels[idx].f = (float)(time(NULL) % 32) / 64.0f + (float)( rand() % 4) / 8.0f; - curr->levels[idx].f *= 100.0f; +#endif + curr->levels[idx].f = 100.0f * rfpower; } break; @@ -2377,7 +2381,7 @@ struct rig_caps dummy_caps = RIG_MODEL(RIG_MODEL_DUMMY), .model_name = "Dummy", .mfg_name = "Hamlib", - .version = "20230611.0", + .version = "20240529.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, commit a300a73f1d584c28c0e17414445be00c716740f3 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue May 28 22:41:10 2024 -0500 Fix RIG_ELIMIT error diff --git a/src/rotator.c b/src/rotator.c index 51765ea5c..c601f402d 100644 --- a/src/rotator.c +++ b/src/rotator.c @@ -748,7 +748,7 @@ int HAMLIB_API rot_set_position(ROT *rot, rot_debug(RIG_DEBUG_TRACE, "%s: range problem az=%.02f(min=%.02f,max=%.02f), el=%02f(min=%.02f,max=%02f)\n", __func__, azimuth, rs->min_az, rs->max_az, elevation, rs->min_el, rs->max_el); - return -RIG_LIMIT; + return -RIG_ELIMIT; } if (caps->set_position == NULL) commit 86dc5c8d6fab469ab6191502ad4f4cd7bb0b7326 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue May 28 22:36:39 2024 -0500 Add new error message for ELIMIT diff --git a/src/rig.c b/src/rig.c index f42aace5a..22d2363bc 100644 --- a/src/rig.c +++ b/src/rig.c @@ -242,7 +242,8 @@ static const char *const rigerror_table[] = "Argument out of domain of func", "Function deprecated", "Security error password not provided or crypto failure", - "Rig is not powered on" + "Rig is not powered on", + "Limit exceeded" }; commit c730e445a14b8faf1c6112cc8fb1c2217e6c1374 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue May 28 22:35:46 2024 -0500 Add new error ELIMIT for things like rot_move that exceed set limits diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 9f52d271d..6e8419cd6 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -205,6 +205,7 @@ enum rig_errcode_e { RIG_EDEPRECATED,/*!< 18 Function deprecated */ RIG_ESECURITY, /*!< 19 Security error */ RIG_EPOWER, /*!< 20 Rig not powered on */ + RIG_ELIMIT, /*!< 21 Limit exceeded */ RIG_EEND // MUST BE LAST ITEM IN LAST }; /** diff --git a/src/rotator.c b/src/rotator.c index 5dd492b18..51765ea5c 100644 --- a/src/rotator.c +++ b/src/rotator.c @@ -748,7 +748,7 @@ int HAMLIB_API rot_set_position(ROT *rot, rot_debug(RIG_DEBUG_TRACE, "%s: range problem az=%.02f(min=%.02f,max=%.02f), el=%02f(min=%.02f,max=%02f)\n", __func__, azimuth, rs->min_az, rs->max_az, elevation, rs->min_el, rs->max_el); - return -RIG_EINVAL; + return -RIG_LIMIT; } if (caps->set_position == NULL) commit 04c3c03334dd250cccee9b99c808e7b9dfdf5dcb Author: Mike Black W9MDB <mdb...@ya...> Date: Mon May 27 23:06:37 2024 -0500 Add simft710.c diff --git a/simulators/Makefile.am b/simulators/Makefile.am index c08b82e17..05432a4d2 100644 --- a/simulators/Makefile.am +++ b/simulators/Makefile.am @@ -8,7 +8,7 @@ DISTCLEANFILES = bin_PROGRAMS = -check_PROGRAMS = simelecraft simicgeneric simkenwood simyaesu simic9100 simic9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simtmd700 simrotorez simspid simft817 simts590 simft847 simic7300 simic7000 simic7100 simic7200 simatd578 simic905 simts450 simic7600 simic7610 simic705 simts950 simts990 simic7851 simftdx101 simxiegug90 simqrplabs simft818 simic275 simtrusdx simft1000 simtmd710 simts890 simxiegux108g simxiegux6100 simic910 simft450 simelecraftk4 simmicom simflex +check_PROGRAMS = simelecraft simicgeneric simkenwood simyaesu simic9100 simic9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simtmd700 simrotorez simspid simft817 simts590 simft847 simic7300 simic7000 simic7100 simic7200 simatd578 simic905 simts450 simic7600 simic7610 simic705 simts950 simts990 simic7851 simftdx101 simxiegug90 simqrplabs simft818 simic275 simtrusdx simft1000 simtmd710 simts890 simxiegux108g simxiegux6100 simic910 simft450 simelecraftk4 simmicom simflex simft710 simelecraft_SOURCES = simelecraft.c simkenwood_SOURCES = simkenwood.c diff --git a/simulators/simft710.c b/simulators/simft710.c new file mode 100644 index 000000000..e136e8eab --- /dev/null +++ b/simulators/simft710.c @@ -0,0 +1,624 @@ +// can run this using rigctl/rigctld and socat pty devices +// gcc -o simyaesu simyaesu.c +#define _XOPEN_SOURCE 700 +// since we are POSIX here we need this +#if 0 +struct ip_mreq +{ + int dummy; +}; +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <fcntl.h> +#include <string.h> +#include <unistd.h> +#include "../include/hamlib/rig.h" + +#define BUFSIZE 256 + +float freqA = 14074000; +float freqB = 14074500; +char tx_vfo = '0'; +char rx_vfo = '0'; +char modeA = '1'; +char modeB = '1'; +int ks = 20; +int bandselect = 5; +int width = 21; +int narrow = 0; +int vd = 0; +int sm0 = 0; +int sm1 = 0; +int vs = 0; +int vx = 0; +int pa = 0; +int ra = 0; +int ag = 0; +int pc = 100; +int is = 0; +int bp_on = 0; +int bp_pos = 0; +int rl = 0; +int nb = 0; +int nr = 0; +int tx = 0; +int mg = 0; +int rg = 100; +int vg = 0; +int kr = 0; +int bi = 0; +int gt = 0; +int ex016 = 0; +int ex020 = 0; +int st = 0; + +// ID 0310 == 310, Must drop leading zero +typedef enum nc_rigid_e +{ + NC_RIGID_NONE = 0, + NC_RIGID_FT450 = 241, + NC_RIGID_FT450D = 244, + NC_RIGID_FT950 = 310, + NC_RIGID_FT891 = 135, + NC_RIGID_FT991 = 135, + NC_RIGID_FT2000 = 251, + NC_RIGID_FT2000D = 252, + NC_RIGID_FTDX1200 = 583, + NC_RIGID_FTDX9000D = 101, + NC_RIGID_FTDX9000Contest = 102, + NC_RIGID_FTDX9000MP = 103, + NC_RIGID_FTDX5000 = 362, + NC_RIGID_FTDX3000 = 460, + NC_RIGID_FTDX101D = 681, + NC_RIGID_FTDX101MP = 682, + NC_RIGID_FT710 = 800 +} nc_rigid_t; + +int +getmyline(int fd, char *buf) +{ + char c; + int i = 0; + memset(buf, 0, BUFSIZE); + + while (read(fd, &c, 1) > 0) + { + buf[i++] = c; + + if (c == ';') { return strlen(buf); } + } + + if (strlen(buf) == 0) { hl_usleep(10 * 1000); } + + return strlen(buf); +} + +#if defined(WIN32) || defined(_WIN32) +int openPort(char *comport) // doesn't matter for using pts devices +{ + int fd; + fd = open(comport, O_RDWR); + + if (fd < 0) + { + perror(comport); + } + + return fd; +} + +#else +int openPort(char *comport) // doesn't matter for using pts devices +{ + int fd = posix_openpt(O_RDWR); + char *name = ptsname(fd); + + if (name == NULL) + { + perror("pstname"); + return -1; + } + + printf("name=%s\n", name); + + if (fd == -1 || grantpt(fd) == -1 || unlockpt(fd) == -1) + { + perror("posix_openpt"); + return -1; + } + + return fd; +} +#endif + + + +int main(int argc, char *argv[]) +{ + char buf[256]; + char *pbuf; + int n; + int fd = openPort(argv[1]); + + while (1) + { + if (getmyline(fd, buf)) + { +// printf("Cmd:%s\n", buf); + } + else { continue; } + + if (strcmp(buf, ";") == 0) + { + pbuf = "?;"; + n = write(fd, pbuf, strlen(pbuf)); + } + else if (strcmp(buf, "RM4;") == 0) + { + hl_usleep(50 * 1000); + pbuf = "RM4100;"; + n = write(fd, pbuf, strlen(pbuf)); + + if (n <= 0) { perror("RM4"); } + } + else if (strcmp(buf, "RM5;") == 0) + { + static int power = 0; + power+=5; + if (power > 255) power = 0; + hl_usleep(50 * 1000); + snprintf(buf,sizeof(buf),"RM5%03d000;", power); + n = write(fd, buf, strlen(buf)); + + if (n <= 0) { perror("RM5"); } + } + else if (strcmp(buf, "RM6;") == 0) + { + hl_usleep(50 * 1000); + pbuf = "AN030;"; + n = write(fd, pbuf, strlen(pbuf)); + + if (n <= 0) { perror("AN"); } + } + else if (strcmp(buf, "IF;") == 0) + { + hl_usleep(50 * 1000); + pbuf = "IF059014200000+000000700000;"; + n = write(fd, pbuf, strlen(pbuf)); + + if (n <= 0) { perror("IF"); } + } + else if (strcmp(buf, "FA;") == 0) + { + SNPRINTF(buf, sizeof(buf), "FA%08.0f;", freqA); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "FA", 2) == 0) + { + sscanf(buf, "FA%f", &freqA); + } + else if (strcmp(buf, "FB;") == 0) + { + SNPRINTF(buf, sizeof(buf), "FB%08.0f;", freqB); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "FB", 2) == 0) + { + sscanf(buf, "FB%f", &freqB); + } + else if (strcmp(buf, "ID;") == 0) + { + hl_usleep(50 * 1000); + int id = NC_RIGID_FT710; + SNPRINTF(buf, sizeof(buf), "ID%03d;", id); + n = write(fd, buf, strlen(buf)); + + if (n <= 0) { perror("ID"); } + } + else if (strcmp(buf, "PS;") == 0) + { + SNPRINTF(buf, sizeof(buf), "PS1;"); + n = write(fd, buf, strlen(buf)); + } + else if (strcmp(buf, "AI;") == 0) + { + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "AI0;"); + n = write(fd, buf, strlen(buf)); + + if (n <= 0) { perror("ID"); } + } + else if (strcmp(buf, "AI0;") == 0) + { + hl_usleep(50 * 1000); + } + else if (strcmp(buf, "FT;") == 0) + { + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "FT%c;", tx_vfo); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("FT"); } + } + else if (strncmp(buf, "FT", 2) == 0) + { + tx_vfo = buf[2]; + } + else if (strcmp(buf, "MD0;") == 0) + { + printf("MD=%s\n", buf); + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "MD0%c;", modeA); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("MD0;"); } + } + else if (strncmp(buf, "MD0", 3) == 0) + { + modeA = buf[3]; + } + else if (strcmp(buf, "MD1;") == 0) + { + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "MD1%c;", modeB); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("MD0;"); } + } + else if (strncmp(buf, "MD1", 3) == 0) + { + modeB = buf[3]; + } + + + +#if 0 + else if (strncmp(buf, "AI", 2) == 0) + { + if (strcmp(buf, "AI;")) + { + hl_usleep(50 * 1000); + n = fprintf(fp, "%s", "AI0;"); + + if (n <= 0) { perror("AI"); } + } + } + +#endif + else if (strcmp(buf, "VS;") == 0) + { + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "VS%d;", vs); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("VS"); } + } + else if (strncmp(buf, "VS", 2) == 0) + { + sscanf(buf, "VS%d", &vs); + } + else if (strcmp(buf, "KR;") == 0) + { + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "KR%d;", kr); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("KR"); } + } + else if (strncmp(buf, "KR", 2) == 0) + { + sscanf(buf, "KR%d", &kr); + } + else if (strcmp(buf, "BI;") == 0) + { + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "BI%d;", bi); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("BI"); } + } + else if (strncmp(buf, "BI", 2) == 0) + { + sscanf(buf, "BI%d", &bi); + } + else if (strcmp(buf, "VX;") == 0) + { + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "VX%d;", vx); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("VX"); } + } + else if (strncmp(buf, "VX", 2) == 0) + { + sscanf(buf, "VX%d", &vx); + } + + else if (strcmp(buf, "PA;") == 0) + { + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "PA%d;", pa); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("PA"); } + } + else if (strncmp(buf, "PA", 2) == 0) + { + sscanf(buf, "PA%d", &vs); + } + else if (strcmp(buf, "RA;") == 0) + { + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "RA%d;", ra); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("RA"); } + } + else if (strncmp(buf, "RA", 2) == 0) + { + sscanf(buf, "RA%d", &ra); + } + else if (strcmp(buf, "AG;") == 0) + { + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "AG%d;", ag); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("AG"); } + } + else if (strncmp(buf, "AG", 2) == 0) + { + sscanf(buf, "AG%d", &ag); + } + else if (strcmp(buf, "PC;") == 0) + { + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "PC%03d;", pc); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("PC"); } + } + else if (strncmp(buf, "PC", 2) == 0) + { + sscanf(buf, "PC%d", &pc); + } + else if (strcmp(buf, "VG;") == 0) + { + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "VG%03d;", vg); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("VG"); } + } + else if (strncmp(buf, "VG", 2) == 0) + { + sscanf(buf, "VG%d", &vg); + } + else if (strcmp(buf, "RG0;") == 0) + { + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "RG0%03d;", rg); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("RG"); } + } + else if (strncmp(buf, "RG", 2) == 0) + { + sscanf(buf, "RG0%d", &rg); + } + else if (strcmp(buf, "GT0;") == 0) + { + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "GT0%0d;", gt); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("GT"); } + } + else if (strncmp(buf, "GT", 2) == 0) + { + sscanf(buf, "GT0%d", >); + } + else if (strcmp(buf, "TX;") == 0) + { + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "TX+%04d;", tx); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("TX"); } + } + else if (strncmp(buf, "TX", 2) == 0) + { + sscanf(buf, "TX%d", &tx); + } + else if (strcmp(buf, "IS;") == 0) + { + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "IS+%04d;", is); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("IS"); } + } + else if (strncmp(buf, "IS", 2) == 0) + { + sscanf(buf, "IS%d", &is); + } + else if (strcmp(buf, "RL0;") == 0) + { + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "RL0%d;", rl); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("RL"); } + } + else if (strncmp(buf, "RL", 2) == 0) + { + sscanf(buf, "RL0%02d", &rl); + } + else if (strcmp(buf, "BP00;") == 0) + { + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "BP0%d;", bp_on); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("BP"); } + } + else if (strncmp(buf, "BP00", 4) == 0) + { + sscanf(buf, "BP00%d", &bp_on); + } + else if (strcmp(buf, "BP01;") == 0) + { + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "BP0%d;", bp_pos); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("BP"); } + } + else if (strncmp(buf, "BP01", 4) == 0) + { + sscanf(buf, "BP01%d", &bp_pos); + } + else if (strcmp(buf, "NB0;") == 0) + { + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "NB0%d;", nb); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("NB"); } + } + else if (strncmp(buf, "NB0", 3) == 0) + { + sscanf(buf, "NB0%d", &nb); + } + else if (strcmp(buf, "NR0;") == 0) + { + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "NR0%d;", nr); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("NR"); } + } + else if (strncmp(buf, "NR0", 3) == 0) + { + sscanf(buf, "NR0%d", &nr); + } + + + else if (strcmp(buf, "EX032;") == 0) + { + static int ant = 0; + ant = (ant + 1) % 3; + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "EX032%1d;", ant); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("EX032"); } + } + else if (strcmp(buf, "EX016;") == 0) + { + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "EX016%04d;", ex016); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("EX016"); } + } + else if (strcmp(buf, "EX020;") == 0) + { + hl_usleep(50 * 1000); + SNPRINTF(buf, sizeof(buf), "EX020%04d;", ex020); + n = write(fd, buf, strlen(buf)); + + if (n < 0) { perror("EX016"); } + } + else if (strncmp(buf, "EX020", 5) == 0) + { + sscanf(buf, "EX020%d\n", &ex020); + } + else if (strncmp(buf, "KS;", 3) == 0) + { + sprintf(buf, "KS%d;", ks); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "KS", 2) == 0) + { + sscanf(buf, "KS%03d", &ks); + } + else if (strncmp(buf, "MG;", 3) == 0) + { + sprintf(buf, "MG%03d;", mg); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "MG", 2) == 0) + { + sscanf(buf, "MG%03d", &mg); + } + else if (strncmp(buf, "BS;", 3) == 0) // cannot query BS + { + sprintf(buf, "BS%02d;", bandselect); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "SH0;", 4) == 0) + { + sprintf(buf, "SH0%02d;", width); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "SH0", 3) == 0) + { + sscanf(buf, "SH0%02d", &width); + } + else if (strncmp(buf, "NA0;", 4) == 0) + { + sprintf(buf, "NA0%d;", narrow); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "NA0", 3) == 0) + { + sscanf(buf, "NA0%d", &narrow); + } + else if (strncmp(buf, "VD;", 3) == 0) + { + sprintf(buf, "VD%d;", vd); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "VD", 2) == 0) + { + sscanf(buf, "VD%d", &vd); + } + else if (strncmp(buf, "SM0;", 4) == 0) + { + sprintf(buf, "SM0%d;", sm0); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "SM0", 3) == 0) + { + sscanf(buf, "SM0%3d", &sm0); + } + else if (strncmp(buf, "SM1;", 4) == 0) + { + sprintf(buf, "SM1%d;", sm1); + n = write(fd, buf, strlen(buf)); + } + else if (strncmp(buf, "SM1", 3) == 0) + { + sscanf(buf, "SM1%3d", &sm1); + } + else if (strncmp(buf, "ST1", 3) == 0) + { + sscanf(buf, "ST1%3d", &st); + } + else if (strncmp(buf, "ST;", 3) == 0) + { + sprintf(buf,"ST%d;", st); + n = write(fd, buf, strlen(buf)); + } + else if (strlen(buf) > 0) + { + fprintf(stderr, "Unknown command: %s\n", buf); + } + + } + + return 0; +} commit 2de9778f27a7d614cfe33d8af6f6ff2d1b78e444 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon May 27 22:59:54 2024 -0500 Add RFPOWER_METER and WATTS to py3test.py diff --git a/bindings/py3test.py b/bindings/py3test.py index 91b7e2f14..52f85e1e7 100755 --- a/bindings/py3test.py +++ b/bindings/py3test.py @@ -73,6 +73,8 @@ def StartUp(): Hamlib.rigerror(my_rig.error_status))) print("AF level:\t\t%0.2f" % my_rig.get_level_f(Hamlib.RIG_LEVEL_AF)) + print("Power level:\t\t%0.2f" % my_rig.get_level_f(Hamlib.RIG_LEVEL_RFPOWER_METER)) + print("Power level Watts:\t\t%0.2f" % my_rig.get_level_f(Hamlib.RIG_LEVEL_RFPOWER_METER_WATTS)) print("strength:\t\t%s" % my_rig.get_level_i(Hamlib.RIG_LEVEL_STRENGTH)) print("status:\t\t\t%s" % my_rig.error_status) print("status(str):\t\t%s" % Hamlib.rigerror(my_rig.error_status)) commit a721c04c536c0f7301608f49dcccbb1c03152f58 Merge: a5f53bbcf f53dc9905 Author: Michael Black <mdb...@ya...> Date: Mon May 27 22:13:00 2024 -0500 Merge pull request #1557 from GeoBaltz/fix12 Normalize some debug/trace output. commit f53dc99057869642b896c4743a99335900cfb39b Author: George Baltz N3GB <Geo...@gm...> Date: Mon May 27 20:31:46 2024 -0400 Normalize some debug/trace output. Make spaces(len) actually return a string of length 'len', not len + 1. Eliminate static writable memory and a 256 byte write on each debug/trace call. Make the depth stars line up. diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index fc360c692..9f52d271d 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -33,7 +33,7 @@ // Our shared secret password #define HAMLIB_SECRET_LENGTH 32 -#define HAMLIB_TRACE rig_debug(RIG_DEBUG_TRACE,"%s%s(%d) trace\n",spaces(rig->state.depth-1), __FILE__, __LINE__) +#define HAMLIB_TRACE rig_debug(RIG_DEBUG_TRACE,"%s%s(%d) trace\n",spaces(rig->state.depth), __FILE__, __LINE__) #define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) #include <stdio.h> @@ -3738,7 +3738,7 @@ extern HAMLIB_EXPORT_VAR(char) debugmsgsave3[DEBUGMSGSAVE_SIZE]; // last-2 debu // Measuring elapsed time -- local variable inside function when macro is used #define ELAPSED1 struct timespec __begin; elapsed_ms(&__begin, HAMLIB_ELAPSED_SET); -#define ELAPSED2 rig_debug(RIG_DEBUG_VERBOSE, "%s%d:%s: elapsed=%.0lfms\n", spaces(rig->state.depth-1), rig->state.depth, __func__, elapsed_ms(&__begin, HAMLIB_ELAPSED_GET)); +#define ELAPSED2 rig_debug(RIG_DEBUG_VERBOSE, "%s%d:%s: elapsed=%.0lfms\n", spaces(rig->state.depth), rig->state.depth, __func__, elapsed_ms(&__begin, HAMLIB_ELAPSED_GET)); // use this instead of snprintf for automatic detection of buffer limit #define SNPRINTF(s,n,...) { snprintf(s,n,##__VA_ARGS__);if (strlen(s) > n-1) fprintf(stderr,"****** %s(%d): buffer overflow ******\n", __func__, __LINE__); } diff --git a/src/misc.c b/src/misc.c index e7bdb2c02..8d17baf6b 100644 --- a/src/misc.c +++ b/src/misc.c @@ -2857,26 +2857,21 @@ char *rig_date_strget(char *buf, int buflen, int localtime) return date_strget(buf, buflen, localtime); } +#define MAX_SPACES 256 const char *spaces(int len) { - static char s[256]; - memset(s, '*', sizeof(s)); + static const char s[MAX_SPACES + 1] = + "****************************************************************" + "****************************************************************" + "****************************************************************" + "****************************************************************"; - if (len > 255) + if (len < 0 || len > MAX_SPACES) { len = 0; } - if (len > 0) - { - s[len + 1] = 0; - } - else - { - s[1] = 0; - } - - return s; + return &s[MAX_SPACES - len]; } // if which==0 rig_band_select str will be returned commit a5f53bbcf68ba5fea29a40efbda357f109897663 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon May 27 16:11:38 2024 -0500 Change TS590 to Handshake=None -- it's not required and the rig can be in a state where RTS causes transmit. diff --git a/rigs/kenwood/ts590.c b/rigs/kenwood/ts590.c index f38b46418..b71181518 100644 --- a/rigs/kenwood/ts590.c +++ b/rigs/kenwood/ts590.c @@ -1725,7 +1725,7 @@ struct rig_caps ts590_caps = .serial_data_bits = 8, .serial_stop_bits = 1, .serial_parity = RIG_PARITY_NONE, - .serial_handshake = RIG_HANDSHAKE_HARDWARE, + .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = 0, .post_write_delay = 0, .timeout = 500, @@ -2119,7 +2119,7 @@ struct rig_caps ts590sg_caps = .serial_data_bits = 8, .serial_stop_bits = 1, .serial_parity = RIG_PARITY_NONE, - .serial_handshake = RIG_HANDSHAKE_HARDWARE, + .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = 0, .post_write_delay = 0, .timeout = 500, commit 18568986f85688a6a2d6ae89c950af94dea6be2f Author: Mike Black W9MDB <mdb...@ya...> Date: Sat May 25 11:38:16 2024 -0500 Fix port override diff --git a/src/conf.c b/src/conf.c index 9e1e83e2a..2807710b2 100644 --- a/src/conf.c +++ b/src/conf.c @@ -262,7 +262,7 @@ static int frontend_set_conf(RIG *rig, hamlib_token_t token, const char *val) char *val2 = strdup(val); char *p = strchr(val2,':'); // port in here? if (p) { - p = 0; // terminate it + *p = 0; // terminate it rig_debug(RIG_DEBUG_WARN, "%s: overriding port and changing to 4992\n", __func__); } sprintf(rs->rigport_deprecated.pathname, "%s:%s", val2, "4992"); ----------------------------------------------------------------------- Summary of changes: bindings/py3test.py | 2 + doc/man1/rotctl.1 | 5 +- doc/man1/rotctld.1 | 5 +- include/hamlib/rig.h | 5 +- include/hamlib/rotator.h | 120 ++++++++++++++++++++++++++++++++++ rigs/dummy/dummy.c | 8 ++- rigs/dummy/rot_dummy.c | 16 +++++ rigs/flexradio/README | 1 + rigs/icom/xiegu.c | 14 ++-- rigs/kenwood/ts590.c | 4 +- rotators/spid/spid.c | 47 +++++++++++-- simulators/Makefile.am | 2 +- simulators/simflex.c | 2 + simulators/{simft450.c => simft710.c} | 23 +++++-- src/conf.c | 2 +- src/misc.c | 21 +++--- src/network.c | 25 +++++++ src/network.h | 1 + src/rig.c | 3 +- src/rotator.c | 7 +- tests/rigctlcom.c | 61 ++++++++++------- tests/rotctl_parse.c | 16 +++++ 22 files changed, 324 insertions(+), 66 deletions(-) create mode 100644 rigs/flexradio/README copy simulators/{simft450.c => simft710.c} (96%) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2024-05-15 21:41: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 cd453b5b7167392cfdfd2e748bafc74334af4c7f (commit) from 9e816e37ff87c4a6b434014b49dc2d8d7a6d60a3 (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 cd453b5b7167392cfdfd2e748bafc74334af4c7f Author: Mike Black W9MDB <mdb...@ya...> Date: Tue May 14 10:27:39 2024 -0500 Reduce verbose level on debug to VERBOSE instead of ERR in newcat.c diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 5b5665543..85a20865c 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1332,7 +1332,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // just drop through } - rig_debug(RIG_DEBUG_ERR, "%s: is_ft991=%d, CACHE(rig)->split=%d, vfo=%s\n", + rig_debug(RIG_DEBUG_VERBOSE, "%s: is_ft991=%d, CACHE(rig)->split=%d, vfo=%s\n", __func__, is_ft991, cachep->split, rig_strvfo(vfo)); if (priv->band_index < 0) { priv->band_index = newcat_band_index(freq); } ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2024-05-13 20:27: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 9e816e37ff87c4a6b434014b49dc2d8d7a6d60a3 (commit) via efbe36570148bb17da5f44af6c1482d77166d8ba (commit) via c06255d364574b312858200fd11d3710708edf5b (commit) via 1988b7cf4fa901687635f4463f2bf959e288b493 (commit) via ee6b89d45bd2f0e42d40cd974d79d6ae697e50bc (commit) via 3c4b1a83f8f5afa5af2c838bc5a3bb4c4ebb1d3e (commit) via 37df9e93bd0267b2dd967ccb40741154430476cf (commit) via 2d30291caa23b17b1177b3f219e5ba37d3be5f25 (commit) via 64a119367d1fd156088e865c7108ba8d85e600ad (commit) via d71f7a93857a2eb1b551b13b5b6add03cbbe0b4e (commit) via 09fbc4cb64895925e3a00ec8d314f6b3e275ad7f (commit) via cf91e96333979368a0bde89d5c31b7ed4f39bce5 (commit) from 8221961de2e24121482e72959c77c27edaa74740 (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 9e816e37ff87c4a6b434014b49dc2d8d7a6d60a3 Merge: c06255d36 efbe36570 Author: Michael Black <mdb...@ya...> Date: Sun May 12 14:37:50 2024 -0500 Merge pull request #1551 from Hamlib/revert-1539-libgpiod Revert "Refactoring GPIO push-to-talk logic to use libgpiod rather than the d…" commit efbe36570148bb17da5f44af6c1482d77166d8ba Author: Michael Black <mdb...@ya...> Date: Sun May 12 14:37:23 2024 -0500 Revert "Refactoring GPIO push-to-talk logic to use libgpiod rather than the d…" diff --git a/configure.ac b/configure.ac index 77bb0cc4b..cfcd2eb1f 100644 --- a/configure.ac +++ b/configure.ac @@ -529,9 +529,6 @@ AS_IF([test x"${cf_with_xml_support}" = "xyes"], [ AC_SUBST([LIBXML2_LIBS]) AC_SUBST([LIBXML2_CFLAGS]) -# TODO: I don't know how to use autoconf -LIBS="$LIBS -lgpiod" - ## ----------------- ## ## Language bindings ## diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index a03890f8e..fc360c692 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -2340,7 +2340,6 @@ typedef struct hamlib_port { int fd; /*!< File descriptor */ void *handle; /*!< handle for USB */ - void *gpio; /*!< handle for GPIO */ int write_delay; /*!< Delay between each byte sent out, in mS */ int post_write_delay; /*!< Delay between each commands send out, in mS */ diff --git a/src/gpio.c b/src/gpio.c index 88bfd305f..e5fcfb597 100644 --- a/src/gpio.c +++ b/src/gpio.c @@ -19,91 +19,135 @@ * */ -#include "gpio.h" - -#include <errno.h> -#include <fcntl.h> #include <string.h> -#include <sys/stat.h> -#include <sys/types.h> +#include <errno.h> #include <unistd.h> -#include <gpiod.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> -#ifndef GPIOD_PATH -// This is what's used on the Raspberry Pi 4; I'm not sure about others -#define GPIO_CHIP_NAME "gpiochip0" -#endif +#include "gpio.h" -#define GPIO_CHIP_CONSUMER "Hamlib" int gpio_open(hamlib_port_t *port, int output, int on_value) { - struct gpiod_chip *chip; - struct gpiod_line *line; + char pathname[HAMLIB_FILPATHLEN * 2]; + FILE *fexp, *fdir; + int fd; + char *dir; port->parm.gpio.on_value = on_value; - chip = gpiod_chip_open_by_name(GPIO_CHIP_NAME); + SNPRINTF(pathname, HAMLIB_FILPATHLEN, "/sys/class/gpio/export"); + fexp = fopen(pathname, "w"); - if (!chip) + if (!fexp) { - rig_debug(RIG_DEBUG_ERR, "Failed to open GPIO chip %s: %s\n", GPIO_CHIP_NAME, strerror(errno)); + rig_debug(RIG_DEBUG_ERR, + "Export GPIO%s (using %s): %s\n", + port->pathname, + pathname, + strerror(errno)); return -RIG_EIO; } - line = gpiod_chip_get_line(chip, atoi(port->pathname)); - if (!line) + fprintf(fexp, "%s\n", port->pathname); + fclose(fexp); + + SNPRINTF(pathname, + sizeof(pathname), + "/sys/class/gpio/gpio%s/direction", + port->pathname); + fdir = fopen(pathname, "w"); + + if (!fdir) { - rig_debug(RIG_DEBUG_ERR, "Failed to acquire GPIO%s: %s\n", port->pathname, strerror(errno)); - gpiod_chip_close(chip); + rig_debug(RIG_DEBUG_ERR, + "GPIO%s direction (using %s): %s\n", + port->pathname, + pathname, + strerror(errno)); return -RIG_EIO; } - if ((output && gpiod_line_request_output(line, GPIO_CHIP_CONSUMER, 0) < 0) || - (!output && gpiod_line_request_input(line, GPIO_CHIP_CONSUMER) < 0)) + dir = output ? "out" : "in"; + rig_debug(RIG_DEBUG_VERBOSE, "Setting direction of GPIO%s to %s\n", + port->pathname, dir); + fprintf(fdir, "%s\n", dir); + fclose(fdir); + + SNPRINTF(pathname, + sizeof(pathname), + "/sys/class/gpio/gpio%s/value", + port->pathname); + fd = open(pathname, O_RDWR); + + if (fd < 0) { - rig_debug(RIG_DEBUG_ERR, "Failed to set GPIO%s to %s mode: %s\n", - port->pathname, (output ? "OUTPUT" : "INPUT"), strerror(errno)); - gpiod_line_release(line); - gpiod_chip_close(chip); + rig_debug(RIG_DEBUG_ERR, + "GPIO%s opening value file %s: %s\n", + port->pathname, + pathname, + strerror(errno)); return -RIG_EIO; } - port->gpio = line; - - return RIG_OK; + port->fd = fd; + return fd; } + int gpio_close(hamlib_port_t *port) { - gpiod_line_close_chip((struct gpiod_line*)port->gpio); - return RIG_OK; + int retval; + char pathname[HAMLIB_FILPATHLEN * 2]; + FILE *fexp; + + retval = close(port->fd); + + SNPRINTF(pathname, HAMLIB_FILPATHLEN, "/sys/class/gpio/unexport"); + fexp = fopen(pathname, "w"); + + if (!fexp) + { + rig_debug(RIG_DEBUG_ERR, + "Export GPIO%s (using %s): %s\n", + port->pathname, + pathname, + strerror(errno)); + return -RIG_EIO; + } + + fprintf(fexp, "%s\n", port->pathname); + fclose(fexp); + return retval; } + int gpio_ptt_set(hamlib_port_t *port, ptt_t pttx) { - int result = 0; + char *val; port->parm.gpio.value = pttx != RIG_PTT_OFF; - if ((port->parm.gpio.value && port->parm.gpio.on_value) || - (!port->parm.gpio.value && !port->parm.gpio.on_value)) + if ((port->parm.gpio.value && port->parm.gpio.on_value) + || (!port->parm.gpio.value && !port->parm.gpio.on_value)) { - result = gpiod_line_set_value((struct gpiod_line*)port->gpio, 1); + val = "1\n"; } else { - result = gpiod_line_set_value((struct gpiod_line*)port->gpio, 0); + val = "0\n"; } - if (result) + if (write(port->fd, val, strlen(val)) <= 0) { - rig_debug(RIG_DEBUG_ERR, "Failed to set the value of GPIO%s: %s\n", port->pathname, strerror(errno)); return -RIG_EIO; } return RIG_OK; } + int gpio_ptt_get(hamlib_port_t *port, ptt_t *pttx) { if (port->parm.gpio.value) @@ -120,15 +164,21 @@ int gpio_ptt_get(hamlib_port_t *port, ptt_t *pttx) int gpio_dcd_get(hamlib_port_t *port, dcd_t *dcdx) { - int val = gpiod_line_get_value((struct gpiod_line*)port->gpio); - if (val < 0) + char val; + int port_value; + + lseek(port->fd, 0, SEEK_SET); + + if (read(port->fd, &val, sizeof(val)) <= 0) { - rig_debug(RIG_DEBUG_ERR, "Failed to read the value of GPIO%s: %s\n", port->pathname, strerror(errno)); + return -RIG_EIO; } rig_debug(RIG_DEBUG_VERBOSE, "DCD GPIO pin value: %c\n", val); - if (val == port->parm.gpio.on_value) + port_value = val - '0'; + + if (port_value == port->parm.gpio.on_value) { *dcdx = RIG_DCD_ON; } commit c06255d364574b312858200fd11d3710708edf5b Merge: 1988b7cf4 cf91e9633 Author: Michael Black <mdb...@ya...> Date: Sun May 12 11:41:31 2024 -0500 Merge pull request #1539 from aschuhardt/libgpiod Refactoring GPIO push-to-talk logic to use libgpiod rather than the d… commit 1988b7cf4fa901687635f4463f2bf959e288b493 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat May 11 17:31:38 2024 -0500 Update simelecraft.c diff --git a/simulators/simelecraft.c b/simulators/simelecraft.c index 10fbee1f2..3fe6d53a7 100644 --- a/simulators/simelecraft.c +++ b/simulators/simelecraft.c @@ -37,6 +37,7 @@ int ai = 0; int dt = 0; int modea = 2; int modeb = 2; +int ptt = 0; // ID 0310 == 310, Must drop leading zero typedef enum nc_rigid_e @@ -162,8 +163,10 @@ int main(int argc, char *argv[]) printf("%s\n", buf); hl_usleep(50 * 1000); //pbuf = "IF059014200000+000000700000;"; - pbuf = "IF00007230000 -000000 0001000001 ;" ; + pbuf = strdup("IF00007230000 -000000 00?1000001 ;") ; + pbuf[28] = ptt == 0 ? '0' : '1'; WRITE(fd, pbuf, strlen(pbuf)); + free(pbuf); } else if (strcmp(buf, "ID;") == 0) { @@ -312,9 +315,13 @@ int main(int argc, char *argv[]) { WRITE(fd, "K30;", 4); } + else if (strcmp(buf, "RVD;") == 0) + { + WRITE(fd, "RVD02.36;", 9); + } else if (strcmp(buf, "RVM;") == 0) { - WRITE(fd, "RV02.37;", 8); + WRITE(fd, "RVM02.37;", 9); } else if (strcmp(buf, "MD;") == 0) { @@ -430,6 +437,14 @@ int main(int argc, char *argv[]) { printf("Morse: %s\n", buf); } + else if (strncmp(buf, "TX", 2) == 0) + { + ptt = 1; + } + else if (strncmp(buf, "RX", 2) == 0) + { + ptt = 0; + } else if (strlen(buf) > 0) { fprintf(stderr, "Unknown command: %s\n", buf); commit ee6b89d45bd2f0e42d40cd974d79d6ae697e50bc Author: Mike Black W9MDB <mdb...@ya...> Date: Sat May 11 17:30:10 2024 -0500 Fix currvfo warning message in kenwood.c diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index e0f029721..4c6069c26 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -1745,6 +1745,7 @@ int kenwood_get_split_vfo_if(RIG *rig, vfo_t rxvfo, split_t *split, switch (priv->info[30]) { case '0': + rs->rx_vfo = STATE(rig)->current_vfo; if (rs->rx_vfo == RIG_VFO_A) { HAMLIB_TRACE; @@ -1757,6 +1758,12 @@ int kenwood_get_split_vfo_if(RIG *rig, vfo_t rxvfo, split_t *split, *txvfo = rs->tx_vfo = priv->tx_vfo = (*split && !transmitting) ? RIG_VFO_B : RIG_VFO_A; } + else if (rs->rx_vfo == RIG_VFO_CURR) + { + HAMLIB_TRACE; + *txvfo = rs->tx_vfo = priv->tx_vfo = (*split + && !transmitting) ? RIG_VFO_B : RIG_VFO_A; + } else { rig_debug(RIG_DEBUG_WARN, "%s(%d): unknown rx_vfo=%s\n", __func__, __LINE__, diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index ec2331ab8..bbbeac31b 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "idx_builtin.h" -#define BACKEND_VER "20240505" +#define BACKEND_VER "20240511" #define EOM_KEN ';' #define EOM_TH '\r' commit 3c4b1a83f8f5afa5af2c838bc5a3bb4c4ebb1d3e Author: Mike Black W9MDB <mdb...@ya...> Date: Sat May 11 12:51:25 2024 -0500 Change IC7100 so x25x26 always and update icom.c to detect probably better diff --git a/rigs/icom/ic7100.c b/rigs/icom/ic7100.c index 4499bfd9d..a7ff0288e 100644 --- a/rigs/icom/ic7100.c +++ b/rigs/icom/ic7100.c @@ -201,8 +201,8 @@ static const struct icom_priv_caps ic7100_priv_caps = .extcmds = ic7100_extcmds, .antack_len = 2, .ant_count = 2, - .x25x26_always = 0, - .x25x26_possibly = 1, + .x25x26_always = 1, + .x25x26_possibly = 0, .x1cx03_always = 0, .x1cx03_possibly = 1, .x1ax03_supported = 1, @@ -327,7 +327,7 @@ struct rig_caps ic7100_caps = RIG_MODEL(RIG_MODEL_IC7100), .model_name = "IC-7100", .mfg_name = "Icom", - .version = BACKEND_VER ".6", + .version = BACKEND_VER ".7", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 212a35c2f..131db64b9 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20240504" +#define BACKEND_VER "20240511" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit 37df9e93bd0267b2dd967ccb40741154430476cf Author: Mike Black W9MDB <mdb...@ya...> Date: Sat May 11 07:55:32 2024 -0500 Add RIG_OP_TUNE to Elecraftc K2 -- update docs a bit diff --git a/rigs/kenwood/k2.c b/rigs/kenwood/k2.c index 7e2142d86..0ebf14d12 100644 --- a/rigs/kenwood/k2.c +++ b/rigs/kenwood/k2.c @@ -38,7 +38,7 @@ RIG_LEVEL_STRENGTH|RIG_LEVEL_RFPOWER|RIG_LEVEL_KEYSPD) #define K2_VFO (RIG_VFO_A|RIG_VFO_B) -#define K2_VFO_OP (RIG_OP_UP|RIG_OP_DOWN) +#define K2_VFO_OP (RIG_OP_UP|RIG_OP_DOWN|RIG_OP_TUNE) #define K2_ANTS (RIG_ANT_1|RIG_ANT_2) @@ -99,6 +99,7 @@ int k2_open(RIG *rig); int k2_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); int k2_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); int k2_get_ext_level(RIG *rig, vfo_t vfo, hamlib_token_t token, value_t *val); +int k2_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op); /* Private function declarations */ int k2_probe_mdfw(RIG *rig, struct kenwood_priv_data *priv); @@ -118,7 +119,7 @@ struct rig_caps k2_caps = RIG_MODEL(RIG_MODEL_K2), .model_name = "K2", .mfg_name = "Elecraft", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".2", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -237,7 +238,7 @@ struct rig_caps k2_caps = .set_level = kenwood_set_level, .get_level = kenwood_get_level, .get_ext_level = k2_get_ext_level, - .vfo_op = kenwood_vfo_op, + .vfo_op = k2_vfo_op, .set_trn = kenwood_set_trn, .get_powerstat = kenwood_get_powerstat, .get_trn = kenwood_get_trn, @@ -804,3 +805,17 @@ int k2_pop_fw_lst(RIG *rig, const char *cmd) return RIG_OK; } +int k2_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) +{ + char buf[32]; + switch (op) + { + case RIG_OP_TUNE: // K2 + SNPRINTF(buf, sizeof(buf), "SWH20"); + break; + default: return kenwood_vfo_op(rig, vfo, op); + } + return kenwood_transaction(rig, buf, NULL, 0); +} + + diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 03057d144..a0a6c33a3 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -2495,7 +2495,7 @@ int k3_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) char buf[32]; switch (op) { - case RIG_OP_TUNE: // K2 KX2 K3 KX3 K4 + case RIG_OP_TUNE: // KX2 K3 KX3 K4 -- K2 needs SWH20 to it's in k2.c SNPRINTF(buf, sizeof(buf), "SWH16"); break; default: return kenwood_vfo_op(rig, vfo, op); commit 2d30291caa23b17b1177b3f219e5ba37d3be5f25 Merge: 64a119367 d71f7a938 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat May 11 07:52:41 2024 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 64a119367d1fd156088e865c7108ba8d85e600ad Author: Mike Black W9MDB <mdb...@ya...> Date: Sat May 11 07:42:20 2024 -0500 Add RIG_OP_TUNE to Elecraft KX2 K3 KX3 K4 diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 779fc504a..03057d144 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -52,7 +52,7 @@ RIG_LEVEL_NR|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_RAWSTR|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS) #define K3_VFO (RIG_VFO_A|RIG_VFO_B) -#define K3_VFO_OP (RIG_OP_UP|RIG_OP_DOWN) +#define K3_VFO_OP (RIG_OP_UP|RIG_OP_DOWN|RIG_OP_TUNE) #define K3_ANTS (RIG_ANT_1|RIG_ANT_2) #define K4_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3|RIG_ANT_4) @@ -161,6 +161,7 @@ int kx3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); int k3_set_func(RIG *rig, vfo_t vfo, setting_t func, int status); int k3_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status); +int k3_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op); int k3_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq, rmode_t mode); @@ -197,7 +198,7 @@ struct rig_caps k3_caps = RIG_MODEL(RIG_MODEL_K3), .model_name = "K3", .mfg_name = "Elecraft", - .version = BACKEND_VER ".27", + .version = BACKEND_VER ".28", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -334,7 +335,7 @@ struct rig_caps k3_caps = .get_level = k3_get_level, .set_ext_level = k3_set_ext_level, .get_ext_level = k3_get_ext_level, - .vfo_op = kenwood_vfo_op, + .vfo_op = k3_vfo_op, .set_trn = kenwood_set_trn, .get_trn = kenwood_get_trn, .set_powerstat = kenwood_set_powerstat, @@ -356,7 +357,7 @@ struct rig_caps k3s_caps = RIG_MODEL(RIG_MODEL_K3S), .model_name = "K3S", .mfg_name = "Elecraft", - .version = BACKEND_VER ".21", + .version = BACKEND_VER ".22", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -493,7 +494,7 @@ struct rig_caps k3s_caps = .get_level = k3_get_level, .set_ext_level = k3_set_ext_level, .get_ext_level = k3_get_ext_level, - .vfo_op = kenwood_vfo_op, + .vfo_op = k3_vfo_op, .set_trn = kenwood_set_trn, .get_trn = kenwood_get_trn, .set_powerstat = kenwood_set_powerstat, @@ -516,7 +517,7 @@ struct rig_caps k4_caps = RIG_MODEL(RIG_MODEL_K4), .model_name = "K4", .mfg_name = "Elecraft", - .version = BACKEND_VER ".28", + .version = BACKEND_VER ".29", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -658,7 +659,7 @@ struct rig_caps k4_caps = .get_level = k3_get_level, .set_ext_level = k3_set_ext_level, .get_ext_level = k3_get_ext_level, - .vfo_op = kenwood_vfo_op, + .vfo_op = k3_vfo_op, .set_trn = kenwood_set_trn, .get_trn = kenwood_get_trn, .set_powerstat = kenwood_set_powerstat, @@ -680,7 +681,7 @@ struct rig_caps kx3_caps = RIG_MODEL(RIG_MODEL_KX3), .model_name = "KX3", .mfg_name = "Elecraft", - .version = BACKEND_VER ".19", + .version = BACKEND_VER ".20", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -816,7 +817,7 @@ struct rig_caps kx3_caps = .get_level = kx3_get_level, .set_ext_level = k3_set_ext_level, .get_ext_level = k3_get_ext_level, - .vfo_op = kenwood_vfo_op, + .vfo_op = k3_vfo_op, .set_trn = kenwood_set_trn, .get_trn = kenwood_get_trn, .set_powerstat = kenwood_set_powerstat, @@ -838,7 +839,7 @@ struct rig_caps kx2_caps = RIG_MODEL(RIG_MODEL_KX2), .model_name = "KX2", .mfg_name = "Elecraft", - .version = BACKEND_VER ".18", + .version = BACKEND_VER ".19", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -973,7 +974,7 @@ struct rig_caps kx2_caps = .get_level = kx3_get_level, .set_ext_level = k3_set_ext_level, .get_ext_level = k3_get_ext_level, - .vfo_op = kenwood_vfo_op, + .vfo_op = k3_vfo_op, .set_trn = kenwood_set_trn, .get_trn = kenwood_get_trn, .set_powerstat = kenwood_set_powerstat, @@ -2478,6 +2479,10 @@ int k3_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) SNPRINTF(buf, sizeof(buf), "AG%c", (status == 0) ? '/' : '0'); break; + case RIG_FUNC_TUNER: // K2 KX2 K3 KX3 K4 + SNPRINTF(buf, sizeof(buf), "SWH16"); + break; + default: return kenwood_set_func(rig, vfo, func, status); } @@ -2485,6 +2490,19 @@ int k3_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) return kenwood_transaction(rig, buf, NULL, 0); } +int k3_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) +{ + char buf[32]; + switch (op) + { + case RIG_OP_TUNE: // K2 KX2 K3 KX3 K4 + SNPRINTF(buf, sizeof(buf), "SWH16"); + break; + default: return kenwood_vfo_op(rig, vfo, op); + } + return kenwood_transaction(rig, buf, NULL, 0); +} + /* * Some functions, notably RIT and XIT On/Off status, can be queried * on the K3. Those functions are handled here and others are passed commit d71f7a93857a2eb1b551b13b5b6add03cbbe0b4e Author: Mike Black W9MDB <mdb...@ya...> Date: Sat May 11 07:42:20 2024 -0500 Add RIG_OP_TUNE to Elecraft K2 KX2 K3 KX3 K4 diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 779fc504a..03057d144 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -52,7 +52,7 @@ RIG_LEVEL_NR|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_RAWSTR|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS) #define K3_VFO (RIG_VFO_A|RIG_VFO_B) -#define K3_VFO_OP (RIG_OP_UP|RIG_OP_DOWN) +#define K3_VFO_OP (RIG_OP_UP|RIG_OP_DOWN|RIG_OP_TUNE) #define K3_ANTS (RIG_ANT_1|RIG_ANT_2) #define K4_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3|RIG_ANT_4) @@ -161,6 +161,7 @@ int kx3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); int k3_set_func(RIG *rig, vfo_t vfo, setting_t func, int status); int k3_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status); +int k3_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op); int k3_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq, rmode_t mode); @@ -197,7 +198,7 @@ struct rig_caps k3_caps = RIG_MODEL(RIG_MODEL_K3), .model_name = "K3", .mfg_name = "Elecraft", - .version = BACKEND_VER ".27", + .version = BACKEND_VER ".28", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -334,7 +335,7 @@ struct rig_caps k3_caps = .get_level = k3_get_level, .set_ext_level = k3_set_ext_level, .get_ext_level = k3_get_ext_level, - .vfo_op = kenwood_vfo_op, + .vfo_op = k3_vfo_op, .set_trn = kenwood_set_trn, .get_trn = kenwood_get_trn, .set_powerstat = kenwood_set_powerstat, @@ -356,7 +357,7 @@ struct rig_caps k3s_caps = RIG_MODEL(RIG_MODEL_K3S), .model_name = "K3S", .mfg_name = "Elecraft", - .version = BACKEND_VER ".21", + .version = BACKEND_VER ".22", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -493,7 +494,7 @@ struct rig_caps k3s_caps = .get_level = k3_get_level, .set_ext_level = k3_set_ext_level, .get_ext_level = k3_get_ext_level, - .vfo_op = kenwood_vfo_op, + .vfo_op = k3_vfo_op, .set_trn = kenwood_set_trn, .get_trn = kenwood_get_trn, .set_powerstat = kenwood_set_powerstat, @@ -516,7 +517,7 @@ struct rig_caps k4_caps = RIG_MODEL(RIG_MODEL_K4), .model_name = "K4", .mfg_name = "Elecraft", - .version = BACKEND_VER ".28", + .version = BACKEND_VER ".29", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -658,7 +659,7 @@ struct rig_caps k4_caps = .get_level = k3_get_level, .set_ext_level = k3_set_ext_level, .get_ext_level = k3_get_ext_level, - .vfo_op = kenwood_vfo_op, + .vfo_op = k3_vfo_op, .set_trn = kenwood_set_trn, .get_trn = kenwood_get_trn, .set_powerstat = kenwood_set_powerstat, @@ -680,7 +681,7 @@ struct rig_caps kx3_caps = RIG_MODEL(RIG_MODEL_KX3), .model_name = "KX3", .mfg_name = "Elecraft", - .version = BACKEND_VER ".19", + .version = BACKEND_VER ".20", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -816,7 +817,7 @@ struct rig_caps kx3_caps = .get_level = kx3_get_level, .set_ext_level = k3_set_ext_level, .get_ext_level = k3_get_ext_level, - .vfo_op = kenwood_vfo_op, + .vfo_op = k3_vfo_op, .set_trn = kenwood_set_trn, .get_trn = kenwood_get_trn, .set_powerstat = kenwood_set_powerstat, @@ -838,7 +839,7 @@ struct rig_caps kx2_caps = RIG_MODEL(RIG_MODEL_KX2), .model_name = "KX2", .mfg_name = "Elecraft", - .version = BACKEND_VER ".18", + .version = BACKEND_VER ".19", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -973,7 +974,7 @@ struct rig_caps kx2_caps = .get_level = kx3_get_level, .set_ext_level = k3_set_ext_level, .get_ext_level = k3_get_ext_level, - .vfo_op = kenwood_vfo_op, + .vfo_op = k3_vfo_op, .set_trn = kenwood_set_trn, .get_trn = kenwood_get_trn, .set_powerstat = kenwood_set_powerstat, @@ -2478,6 +2479,10 @@ int k3_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) SNPRINTF(buf, sizeof(buf), "AG%c", (status == 0) ? '/' : '0'); break; + case RIG_FUNC_TUNER: // K2 KX2 K3 KX3 K4 + SNPRINTF(buf, sizeof(buf), "SWH16"); + break; + default: return kenwood_set_func(rig, vfo, func, status); } @@ -2485,6 +2490,19 @@ int k3_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) return kenwood_transaction(rig, buf, NULL, 0); } +int k3_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op) +{ + char buf[32]; + switch (op) + { + case RIG_OP_TUNE: // K2 KX2 K3 KX3 K4 + SNPRINTF(buf, sizeof(buf), "SWH16"); + break; + default: return kenwood_vfo_op(rig, vfo, op); + } + return kenwood_transaction(rig, buf, NULL, 0); +} + /* * Some functions, notably RIT and XIT On/Off status, can be queried * on the K3. Those functions are handled here and others are passed commit 09fbc4cb64895925e3a00ec8d314f6b3e275ad7f Author: Mike Black W9MDB <mdb...@ya...> Date: Thu May 9 17:09:40 2024 -0500 Restore Xiegu G90 x25/x26 command detection. Works find on Base 1.79 App 1.80 https://github.com/Hamlib/Hamlib/issues/1547 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 5660a9823..7dd23c42e 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -9751,6 +9751,7 @@ static void icom_set_x25x26_ability(RIG *rig, int status) if (!icom_is_x25x26_potentially_supported(rig)) { // No change for rigs that don't support these commands anyway + rig_debug(RIG_DEBUG_VERBOSE, "%s: Hamlib thinks rig does not support x25/x26 command\n", __func__); return; } diff --git a/rigs/icom/xiegu.c b/rigs/icom/xiegu.c index 3fc04385b..fad83abdc 100644 --- a/rigs/icom/xiegu.c +++ b/rigs/icom/xiegu.c @@ -147,6 +147,7 @@ int xiegu_rig_open(RIG *rig) if (retval == RIG_OK) { + dump_hex(id,id_len); iid = (((int)id[2]) << 8) + id[3]; rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu Radio ID=0x%04x\n", __func__, iid); switch(iid) @@ -551,7 +552,7 @@ static struct icom_priv_caps g90_priv_caps = 0, /* no XCHG */ ic7200_ts_sc_list, .x25x26_always = 0, - .x25x26_possibly = 0, // Firmware G90 v20240504.8 doesn't work well -- see https://github.com/Hamlib/Hamlib/issues/1547 + .x25x26_possibly = 1, // Firmware G90 v20240504.8 doesn't work well -- see https://github.com/Hamlib/Hamlib/issues/1547 .x1cx03_always = 0, .x1cx03_possibly = 0, .x1ax03_supported = 0, @@ -564,7 +565,7 @@ struct rig_caps g90_caps = RIG_MODEL(RIG_MODEL_G90), .model_name = "G90", .mfg_name = "Xiegu", - .version = BACKEND_VER ".9", + .version = BACKEND_VER ".10", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -599,8 +600,7 @@ struct rig_caps g90_caps = .max_xit = Hz(9999), .max_ifshift = Hz(0), /* TODO */ .vfo_ops = X108G_VFO_OPS, -// Disabling targetable_vfo as G90 firmare update has brokne it see https://github.com/Hamlib/Hamlib/issues/1547 -// .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, + .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, .scan_ops = X108G_SCAN_OPS, .transceive = RIG_TRN_RIG, .bank_qty = 5, commit cf91e96333979368a0bde89d5c31b7ed4f39bce5 Author: Addison Schuhardt <ad...@sc...> Date: Thu Apr 11 00:17:06 2024 -0700 Refactoring GPIO push-to-talk logic to use libgpiod rather than the deprecated/broken sysfs method. TODO: I'm not familiar with autoconf to set up linking to libgpiod correctly, so I'd like to ask someone else to do that. Fixes #1538 diff --git a/configure.ac b/configure.ac index d07ec9b9a..3a6af4e55 100644 --- a/configure.ac +++ b/configure.ac @@ -529,6 +529,9 @@ AS_IF([test x"${cf_with_xml_support}" = "xyes"], [ AC_SUBST([LIBXML2_LIBS]) AC_SUBST([LIBXML2_CFLAGS]) +# TODO: I don't know how to use autoconf +LIBS="$LIBS -lgpiod" + ## ----------------- ## ## Language bindings ## diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index fc360c692..a03890f8e 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -2340,6 +2340,7 @@ typedef struct hamlib_port { int fd; /*!< File descriptor */ void *handle; /*!< handle for USB */ + void *gpio; /*!< handle for GPIO */ int write_delay; /*!< Delay between each byte sent out, in mS */ int post_write_delay; /*!< Delay between each commands send out, in mS */ diff --git a/src/gpio.c b/src/gpio.c index e5fcfb597..88bfd305f 100644 --- a/src/gpio.c +++ b/src/gpio.c @@ -19,135 +19,91 @@ * */ -#include <string.h> +#include "gpio.h" + #include <errno.h> -#include <unistd.h> -#include <sys/types.h> -#include <sys/stat.h> #include <fcntl.h> +#include <string.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <unistd.h> +#include <gpiod.h> -#include "gpio.h" +#ifndef GPIOD_PATH +// This is what's used on the Raspberry Pi 4; I'm not sure about others +#define GPIO_CHIP_NAME "gpiochip0" +#endif +#define GPIO_CHIP_CONSUMER "Hamlib" int gpio_open(hamlib_port_t *port, int output, int on_value) { - char pathname[HAMLIB_FILPATHLEN * 2]; - FILE *fexp, *fdir; - int fd; - char *dir; + struct gpiod_chip *chip; + struct gpiod_line *line; port->parm.gpio.on_value = on_value; - SNPRINTF(pathname, HAMLIB_FILPATHLEN, "/sys/class/gpio/export"); - fexp = fopen(pathname, "w"); + chip = gpiod_chip_open_by_name(GPIO_CHIP_NAME); - if (!fexp) + if (!chip) { - rig_debug(RIG_DEBUG_ERR, - "Export GPIO%s (using %s): %s\n", - port->pathname, - pathname, - strerror(errno)); + rig_debug(RIG_DEBUG_ERR, "Failed to open GPIO chip %s: %s\n", GPIO_CHIP_NAME, strerror(errno)); return -RIG_EIO; } - fprintf(fexp, "%s\n", port->pathname); - fclose(fexp); - - SNPRINTF(pathname, - sizeof(pathname), - "/sys/class/gpio/gpio%s/direction", - port->pathname); - fdir = fopen(pathname, "w"); - - if (!fdir) + line = gpiod_chip_get_line(chip, atoi(port->pathname)); + if (!line) { - rig_debug(RIG_DEBUG_ERR, - "GPIO%s direction (using %s): %s\n", - port->pathname, - pathname, - strerror(errno)); + rig_debug(RIG_DEBUG_ERR, "Failed to acquire GPIO%s: %s\n", port->pathname, strerror(errno)); + gpiod_chip_close(chip); return -RIG_EIO; } - dir = output ? "out" : "in"; - rig_debug(RIG_DEBUG_VERBOSE, "Setting direction of GPIO%s to %s\n", - port->pathname, dir); - fprintf(fdir, "%s\n", dir); - fclose(fdir); - - SNPRINTF(pathname, - sizeof(pathname), - "/sys/class/gpio/gpio%s/value", - port->pathname); - fd = open(pathname, O_RDWR); - - if (fd < 0) + if ((output && gpiod_line_request_output(line, GPIO_CHIP_CONSUMER, 0) < 0) || + (!output && gpiod_line_request_input(line, GPIO_CHIP_CONSUMER) < 0)) { - rig_debug(RIG_DEBUG_ERR, - "GPIO%s opening value file %s: %s\n", - port->pathname, - pathname, - strerror(errno)); + rig_debug(RIG_DEBUG_ERR, "Failed to set GPIO%s to %s mode: %s\n", + port->pathname, (output ? "OUTPUT" : "INPUT"), strerror(errno)); + gpiod_line_release(line); + gpiod_chip_close(chip); return -RIG_EIO; } - port->fd = fd; - return fd; -} + port->gpio = line; + return RIG_OK; +} int gpio_close(hamlib_port_t *port) { - int retval; - char pathname[HAMLIB_FILPATHLEN * 2]; - FILE *fexp; - - retval = close(port->fd); - - SNPRINTF(pathname, HAMLIB_FILPATHLEN, "/sys/class/gpio/unexport"); - fexp = fopen(pathname, "w"); - - if (!fexp) - { - rig_debug(RIG_DEBUG_ERR, - "Export GPIO%s (using %s): %s\n", - port->pathname, - pathname, - strerror(errno)); - return -RIG_EIO; - } - - fprintf(fexp, "%s\n", port->pathname); - fclose(fexp); - return retval; + gpiod_line_close_chip((struct gpiod_line*)port->gpio); + return RIG_OK; } - int gpio_ptt_set(hamlib_port_t *port, ptt_t pttx) { - char *val; + int result = 0; port->parm.gpio.value = pttx != RIG_PTT_OFF; - if ((port->parm.gpio.value && port->parm.gpio.on_value) - || (!port->parm.gpio.value && !port->parm.gpio.on_value)) + if ((port->parm.gpio.value && port->parm.gpio.on_value) || + (!port->parm.gpio.value && !port->parm.gpio.on_value)) { - val = "1\n"; + result = gpiod_line_set_value((struct gpiod_line*)port->gpio, 1); } else { - val = "0\n"; + result = gpiod_line_set_value((struct gpiod_line*)port->gpio, 0); } - if (write(port->fd, val, strlen(val)) <= 0) + if (result) { + rig_debug(RIG_DEBUG_ERR, "Failed to set the value of GPIO%s: %s\n", port->pathname, strerror(errno)); return -RIG_EIO; } return RIG_OK; } - int gpio_ptt_get(hamlib_port_t *port, ptt_t *pttx) { if (port->parm.gpio.value) @@ -164,21 +120,15 @@ int gpio_ptt_get(hamlib_port_t *port, ptt_t *pttx) int gpio_dcd_get(hamlib_port_t *port, dcd_t *dcdx) { - char val; - int port_value; - - lseek(port->fd, 0, SEEK_SET); - - if (read(port->fd, &val, sizeof(val)) <= 0) + int val = gpiod_line_get_value((struct gpiod_line*)port->gpio); + if (val < 0) { - return -RIG_EIO; + rig_debug(RIG_DEBUG_ERR, "Failed to read the value of GPIO%s: %s\n", port->pathname, strerror(errno)); } rig_debug(RIG_DEBUG_VERBOSE, "DCD GPIO pin value: %c\n", val); - port_value = val - '0'; - - if (port_value == port->parm.gpio.on_value) + if (val == port->parm.gpio.on_value) { *dcdx = RIG_DCD_ON; } ----------------------------------------------------------------------- Summary of changes: rigs/icom/ic7100.c | 6 +++--- rigs/icom/icom.c | 1 + rigs/icom/icom.h | 2 +- rigs/icom/xiegu.c | 8 ++++---- rigs/kenwood/k2.c | 21 ++++++++++++++++++--- rigs/kenwood/k3.c | 40 +++++++++++++++++++++++++++++----------- rigs/kenwood/kenwood.c | 7 +++++++ rigs/kenwood/kenwood.h | 2 +- simulators/simelecraft.c | 19 +++++++++++++++++-- 9 files changed, 81 insertions(+), 25 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2024-05-08 21:00:10
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via 8221961de2e24121482e72959c77c27edaa74740 (commit) from 02a5f70200e589249bf8958e6d4b4a3aa094e00a (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 8221961de2e24121482e72959c77c27edaa74740 Author: Christoph Nadig <hb...@us...> Date: Wed May 8 11:02:13 2024 +0200 Fix for setting power on Elecraft TRXs (currently the power set is off by a factor of 10 if no PA is attached). I also included a change to k3_max_power to take the current band into account again. These values have changed in firmware upgrades in the past but have been stable for quite a while now, so I think they should be considered again. Best Regards, Chris, HB9ZHK diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 53aab4f94..779fc504a 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -1835,15 +1835,12 @@ static int k3_get_maxpower(RIG *rig) { maxpower = 110; } - -// Elecraft makes max power pretty variable -// So we will stick with 15W or 110W and scale everything to that -#if 0 else if (RIG_IS_KX2 || RIG_IS_KX3) { int bandnum = -1; - retval = kenwood_safe_transaction(rig, "BN", levelbuf, KENWOOD_MAX_BUF_LEN, 4); + char levelbuf[KENWOOD_MAX_BUF_LEN]; + int retval = kenwood_safe_transaction(rig, "BN", levelbuf, KENWOOD_MAX_BUF_LEN, 4); if (retval != RIG_OK) { return retval; } @@ -1877,8 +1874,6 @@ static int k3_get_maxpower(RIG *rig) } } -#endif - rig_debug(RIG_DEBUG_TRACE, "%s: maxpower=%d\n", __func__, maxpower); return maxpower; } @@ -1899,6 +1894,7 @@ int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { char levelbuf[16]; int kenwood_val; + float pwr; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -1998,9 +1994,9 @@ int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) break; case RIG_LEVEL_RFPOWER: - kenwood_val = (int)(val.f * k3_get_maxpower(rig)); - SNPRINTF(levelbuf, sizeof(levelbuf), "PC%03d%s", kenwood_val, - kenwood_val > 15 ? "1" : "0"); + pwr = val.f * k3_get_maxpower(rig); + SNPRINTF(levelbuf, sizeof(levelbuf), "PC%03.f%c", pwr > 15.0 ? pwr : 10.0 * pwr, + pwr > 15.0 ? '1' : '0'); break; default: ----------------------------------------------------------------------- Summary of changes: rigs/kenwood/k3.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2024-05-08 10:06: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 02a5f70200e589249bf8958e6d4b4a3aa094e00a (commit) via e9fa4de2aeffb637b76a1440cc8207d242ec809a (commit) via fd69cb0487c491133a2cc1f231c73096b3369cc4 (commit) via 85d9d8d62c2575a0314d403c08f3e10d23dfa2f0 (commit) via fadf83a42c35e95b7c8a64037aeb08923cc92761 (commit) via 95f2e9b54678b0d83178ec3de6e0902db214fbfc (commit) via c2b8f2b4fe87b17568101a776305bd9e2af76405 (commit) via 42c900cb8a8ee1733aa39c6b808fa5bb2dd1118a (commit) via 9bcb4c4771649468dfafd4eb47da5c7c813b0dc2 (commit) via 44317e542bca8922a7cc69a68bee0560e9466540 (commit) via 424a34c504c90ae8839f076b23cfaed424b70980 (commit) via 74c96da18a6f4ee6159c4459b9614bbb7eaec14f (commit) via cc9bb6f0b54eaddf90fb6e1d32f1f0787b6eec04 (commit) via a5fa04f8847d94d18b17e2a7e51a0b0df2fdd663 (commit) via 85f78862863f24ff842edae95024b3d8409e360a (commit) via baeb484ddf1ae2a7aff811a0788f75c0762c87cc (commit) via 4e600a9ed67c6e627c495deeacbb65872f8eaec0 (commit) via 8002d470508135ce4b70c40e8b736ff436e9b7fc (commit) via 105c6b8d3942646d35a7af09d52e1cb73a5a8c8b (commit) via d683955811377ae1e47db526ae8d6a46928a1abf (commit) via e67c80f1217953f1bff20bd4483e48df3a266e03 (commit) via 594df4b31de374e1066dd27ddb510640f59d9531 (commit) via 8f1b6851e787a72f617e5e139f2a046413b5a5b7 (commit) via c7635ee3b14e7ec2c7ccba9bbb3ea81aa56685f2 (commit) via 94d753860b194b234324195681484e2efcc5d711 (commit) via 7b44297543ff0ff1c2b11b71fa17ecf33477e05b (commit) via abee6a3cb9f93c9456fbae8bcd3d44c9f22f07d1 (commit) from d47fb672c82aebce342cba8f0dd3b496ec536b9a (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 02a5f70200e589249bf8958e6d4b4a3aa094e00a Author: Mike Black W9MDB <mdb...@ya...> Date: Tue May 7 16:47:32 2024 -0500 Update some things for G90 diff --git a/rigs/icom/xiegu.c b/rigs/icom/xiegu.c index 8ec5ec7e9..3fc04385b 100644 --- a/rigs/icom/xiegu.c +++ b/rigs/icom/xiegu.c @@ -151,7 +151,8 @@ int xiegu_rig_open(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu Radio ID=0x%04x\n", __func__, iid); switch(iid) { - case 0x0090: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "G90/G90S");break; + case 0x0070: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "G90");break; + case 0x0090: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "G90S");break; case 0x0106: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "G106/G106C");break; case 0x6100: case 0xa400: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "X6100");break; @@ -181,7 +182,7 @@ struct rig_caps x108g_caps = RIG_MODEL(RIG_MODEL_X108G), .model_name = "X108G", .mfg_name = "Xiegu", - .version = BACKEND_VER ".2", + .version = BACKEND_VER ".3", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -570,7 +571,7 @@ struct rig_caps g90_caps = .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, .port_type = RIG_PORT_SERIAL, - .serial_rate_min = 300, + .serial_rate_min = 19200, .serial_rate_max = 19200, .serial_data_bits = 8, .serial_stop_bits = 1, commit e9fa4de2aeffb637b76a1440cc8207d242ec809a Author: Mike Black W9MDB <mdb...@ya...> Date: Mon May 6 06:58:52 2024 -0500 Disable TARGETABLE for G90 due to firmware bug https://github.com/Hamlib/Hamlib/issues/1547 diff --git a/rigs/icom/xiegu.c b/rigs/icom/xiegu.c index 2acee5a81..8ec5ec7e9 100644 --- a/rigs/icom/xiegu.c +++ b/rigs/icom/xiegu.c @@ -598,7 +598,8 @@ struct rig_caps g90_caps = .max_xit = Hz(9999), .max_ifshift = Hz(0), /* TODO */ .vfo_ops = X108G_VFO_OPS, - .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, +// Disabling targetable_vfo as G90 firmare update has brokne it see https://github.com/Hamlib/Hamlib/issues/1547 +// .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, .scan_ops = X108G_SCAN_OPS, .transceive = RIG_TRN_RIG, .bank_qty = 5, commit fd69cb0487c491133a2cc1f231c73096b3369cc4 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon May 6 06:35:40 2024 -0500 Have icom rigs fallback to old get mode when x26 has beeen disabled https://github.com/Hamlib/Hamlib/issues/1547 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index d30b70ed8..5660a9823 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2254,8 +2254,9 @@ static int icom_get_mode_x26(RIG *rig, vfo_t vfo, int *mode_len, const struct icom_priv_caps *priv_caps = rig->caps->priv; int retval; - if (priv->x26cmdfails > 0 && !priv_caps->x25x26_always) + if (priv->x26cmdfails != 0 && priv_caps->x25x26_always==0) { + rig_debug(RIG_DEBUG_WARN, "%s: x26cmdfails=%d, x25x26_always=%d\n", __func__, priv->x26cmdfails, priv_caps->x25x26_always); return -RIG_ENAVAIL; } @@ -2610,13 +2611,20 @@ static int icom_get_mode_without_data(RIG *rig, vfo_t vfo, rmode_t *mode, { retval = icom_get_mode_x26(rig, vfo, &mode_len, modebuf); - // mode_len=5, modebuf=26 01 01 01 01 - // last 3 bytes are mode, datamode, filter (1-3) - priv_data->datamode = modebuf[3]; - *width = 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; + if (retval == RIG_OK) + { + // mode_len=5, modebuf=26 01 01 01 01 + // last 3 bytes are mode, datamode, filter (1-3) + priv_data->datamode = modebuf[3]; + *width = 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 if (retval == -RIG_ENAVAIL) // In case it's been disabled + { + retval = icom_transaction(rig, C_RD_MODE, -1, NULL, 0, modebuf, &mode_len); + } } else { commit 85d9d8d62c2575a0314d403c08f3e10d23dfa2f0 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun May 5 22:17:17 2024 -0500 Make ignoring morse handler more generic diff --git a/src/rig.c b/src/rig.c index a898034de..f42aace5a 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1494,8 +1494,8 @@ int HAMLIB_API rig_open(RIG *rig) if (skip_init) { return RIG_OK; } #if defined(HAVE_PTHREAD) - // Some models don't support CW - if (rig->caps->rig_model != RIG_MODEL_SDRCONSOLE) + // Some models don't support CW so don't need morse handler + if (rig->caps->send_morse) { status = morse_data_handler_start(rig); commit fadf83a42c35e95b7c8a64037aeb08923cc92761 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun May 5 17:28:29 2024 -0500 Update kenwood.h version diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index c8d57dbcf..ec2331ab8 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "idx_builtin.h" -#define BACKEND_VER "20240413" +#define BACKEND_VER "20240505" #define EOM_KEN ';' #define EOM_TH '\r' commit 95f2e9b54678b0d83178ec3de6e0902db214fbfc Author: Mike Black W9MDB <mdb...@ya...> Date: Sun May 5 17:19:22 2024 -0500 Change Xeigu G90 to not use 0x25/x26 since it misbehaves on latest firmware and is not documented either diff --git a/rigs/icom/xiegu.c b/rigs/icom/xiegu.c index 97efc7c0b..2acee5a81 100644 --- a/rigs/icom/xiegu.c +++ b/rigs/icom/xiegu.c @@ -543,12 +543,27 @@ struct rig_caps x6100_caps = .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; +static struct icom_priv_caps g90_priv_caps = +{ + 0xa4, /* default address */ + 0, /* 731 mode */ + 0, /* no XCHG */ + ic7200_ts_sc_list, + .x25x26_always = 0, + .x25x26_possibly = 0, // Firmware G90 v20240504.8 doesn't work well -- see https://github.com/Hamlib/Hamlib/issues/1547 + .x1cx03_always = 0, + .x1cx03_possibly = 0, + .x1ax03_supported = 0, + .mode_with_filter = 1, + .data_mode_supported = 1 +}; + struct rig_caps g90_caps = { RIG_MODEL(RIG_MODEL_G90), .model_name = "G90", .mfg_name = "Xiegu", - .version = BACKEND_VER ".7", + .version = BACKEND_VER ".9", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -667,7 +682,7 @@ struct rig_caps g90_caps = .set_conf = icom_set_conf, .get_conf = icom_get_conf, - .priv = (void *)& x108g_priv_caps, + .priv = (void *)& g90_priv_caps, .rig_init = icom_init, .rig_cleanup = icom_cleanup, .rig_open = xiegu_rig_open, commit c2b8f2b4fe87b17568101a776305bd9e2af76405 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun May 5 16:03:50 2024 -0500 Improve SDRCONSOLE behavior diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 64c80e267..e0f029721 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -1115,11 +1115,15 @@ int kenwood_open(RIG *rig) } /* driver mismatch */ - rig_debug(RIG_DEBUG_VERBOSE, + // SDRCONSOLE identifies as TS-2000 -- even though it's a sub/superset + if (rig->caps->rig_model == RIG_MODEL_SDRCONSOLE && kenwood_id_string_list[i].model != 2014) + { + rig_debug(RIG_DEBUG_VERBOSE, "%s: not the right driver apparently (found %u, asked for %d, checked %s)\n", __func__, rig->caps->rig_model, kenwood_id_string_list[i].model, rig->caps->model_name); + } // we continue to search for other matching IDs/models } diff --git a/src/rig.c b/src/rig.c index cdb3d8e88..a898034de 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1494,14 +1494,18 @@ int HAMLIB_API rig_open(RIG *rig) if (skip_init) { return RIG_OK; } #if defined(HAVE_PTHREAD) - status = morse_data_handler_start(rig); - - if (status < 0) + // Some models don't support CW + if (rig->caps->rig_model != RIG_MODEL_SDRCONSOLE) { - rig_debug(RIG_DEBUG_ERR, "%s: cw_data_handler_start failed: %s\n", __func__, + status = morse_data_handler_start(rig); + + if (status < 0) + { + rig_debug(RIG_DEBUG_ERR, "%s: cw_data_handler_start failed: %s\n", __func__, rigerror(status)); - port_close(rp, rp->type.rig); - RETURNFUNC2(status); + port_close(rp, rp->type.rig); + RETURNFUNC2(status); + } } #endif commit 42c900cb8a8ee1733aa39c6b808fa5bb2dd1118a Author: Mike Black W9MDB <mdb...@ya...> Date: Sat May 4 22:57:25 2024 -0500 Fix default filter_width in icom.c diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 17d774329..d30b70ed8 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2699,7 +2699,7 @@ static int icom_get_mode_without_data(RIG *rig, vfo_t vfo, rmode_t *mode, * The DSP filter width can be read only for the selected VFO, so use cached width for other VFOs. */ - pbwidth_t filter_width; + pbwidth_t filter_width = 1; if (vfo == rig->state.current_vfo) { diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 8d17cfb34..212a35c2f 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20240422" +#define BACKEND_VER "20240504" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit 9bcb4c4771649468dfafd4eb47da5c7c813b0dc2 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat May 4 17:36:02 2024 -0500 Fix micom set_freq to read ack back and get freq offsets diff --git a/rigs/motorola/micom.c b/rigs/motorola/micom.c index b66d99c51..7d26a30f4 100644 --- a/rigs/motorola/micom.c +++ b/rigs/motorola/micom.c @@ -92,10 +92,16 @@ static int micom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) set_transaction_active(rig); rig_flush(rp); retval = write_block(rp, rxcmd, sizeof(rxcmd)); + micom_read_frame(rig, reply, sizeof(reply)); if (retval == RIG_OK) retval = write_block(rp, cmd2, sizeof(cmd2)); + micom_read_frame(rig, reply, sizeof(reply)); if (retval == RIG_OK) retval = write_block(rp, cmd3, sizeof(cmd3)); + micom_read_frame(rig, reply, sizeof(reply)); if (retval == RIG_OK) retval = write_block(rp, cmd4, sizeof(cmd4)); + micom_read_frame(rig, reply, sizeof(reply)); if (retval == RIG_OK) retval = write_block(rp, cmd5, sizeof(cmd5)); + micom_read_frame(rig, reply, sizeof(reply)); + micom_read_frame(rig, reply, sizeof(reply)); if (retval != RIG_OK) { @@ -163,7 +169,7 @@ static int micom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) micom_read_frame(rig, reply, sizeof(reply)); write_block(rp, ack, sizeof(ack)); set_transaction_inactive(rig); - *freq = (reply[5] << 24) | (reply[6] << 16) | (reply[7] << 8) | reply[8]; + *freq = (reply[4] << 24) | (reply[5] << 16) | (reply[6] << 8) | reply[7]; RETURNFUNC(RIG_OK); } @@ -189,7 +195,7 @@ struct rig_caps micom_caps = RIG_MODEL(RIG_MODEL_MICOM2), .model_name = "Micom 2/3", .mfg_name = "Micom", - .version = "20240503.1", + .version = "20240504.0", .copyright = "LGPL", .status = RIG_STATUS_ALPHA, .rig_type = RIG_TYPE_TRANSCEIVER, commit 44317e542bca8922a7cc69a68bee0560e9466540 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat May 4 08:44:19 2024 -0500 Make ft891 power level work like ft991 which supposedly is the same according to JA1NLX diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index 7a576e688..cbba6e96f 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -130,7 +130,7 @@ struct rig_caps ft891_caps = RIG_MODEL(RIG_MODEL_FT891), .model_name = "FT-891", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".9", + .version = NEWCAT_VER ".10", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, diff --git a/rigs/yaesu/ft891.h b/rigs/yaesu/ft891.h index 58c3c294f..f61fcb247 100644 --- a/rigs/yaesu/ft891.h +++ b/rigs/yaesu/ft891.h @@ -69,13 +69,18 @@ RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\ RIG_OP_TO_VFO|RIG_OP_FROM_VFO) -// Borrowed from FLRig -- Thanks to Dave W1HKJ +// borrowed from FT991 #define FT891_RFPOWER_METER_CAL \ { \ - 2, \ + 7, \ { \ {0, 0.0f}, \ - {100, 100.0f}, \ + {10, 0.8f}, \ + {50, 8.0f}, \ + {100, 26.0f}, \ + {150, 54.0f}, \ + {200, 92.0f}, \ + {250, 140.0f}, \ } \ } commit 424a34c504c90ae8839f076b23cfaed424b70980 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri May 3 17:16:25 2024 -0500 More work on micom get_freq diff --git a/rigs/motorola/micom.c b/rigs/motorola/micom.c index 7c60bcd7e..b66d99c51 100644 --- a/rigs/motorola/micom.c +++ b/rigs/motorola/micom.c @@ -137,6 +137,7 @@ static int micom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) { hamlib_port_t *rp = RIGPORT(rig); unsigned char cmd[6] = { 0x24, 0x01, 0x18, 0x06, 0x06, 0x03 }; + unsigned char ack[6] = { 0x24, 0x01, 0x18, 0xf3, 0xff, 0x03 }; unsigned char reply[11]; int retval; @@ -153,7 +154,14 @@ static int micom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) return retval; } + // expecting 24 01 80 fe 98 03 -- an ack packet? micom_read_frame(rig, reply, sizeof(reply)); + if (reply[3] != 0xfe) + { + rig_debug(RIG_DEBUG_ERR, "%s: unknown packet...expected byte 4 = 0xfe\n", __func__); + } + micom_read_frame(rig, reply, sizeof(reply)); + write_block(rp, ack, sizeof(ack)); set_transaction_inactive(rig); *freq = (reply[5] << 24) | (reply[6] << 16) | (reply[7] << 8) | reply[8]; RETURNFUNC(RIG_OK); @@ -181,7 +189,7 @@ struct rig_caps micom_caps = RIG_MODEL(RIG_MODEL_MICOM2), .model_name = "Micom 2/3", .mfg_name = "Micom", - .version = "20240503.0", + .version = "20240503.1", .copyright = "LGPL", .status = RIG_STATUS_ALPHA, .rig_type = RIG_TYPE_TRANSCEIVER, commit 74c96da18a6f4ee6159c4459b9614bbb7eaec14f Author: Mike Black W9MDB <mdb...@ya...> Date: Fri May 3 07:52:55 2024 -0500 Fix micom get_freq diff --git a/rigs/motorola/micom.c b/rigs/motorola/micom.c index ff8a96bb6..7c60bcd7e 100644 --- a/rigs/motorola/micom.c +++ b/rigs/motorola/micom.c @@ -41,16 +41,26 @@ static int micom_open(RIG *rig) RETURNFUNC(RIG_OK); } +// returns bytes read +// format has length in byte[1] plus 5 bytes 0x24/len/cmd at start and checksum+0x03 at end +// So a data "length" of 5 is 10 bytes for example static int micom_read_frame(RIG *rig, unsigned char *buf, int maxlen) { hamlib_port_t *rp = RIGPORT(rig); - int retval; + int bytes; //const char stopset[1] = {0x03}; ENTERFUNC; - retval = read_block(rp, buf, 4); - retval = read_block(rp, buf, buf[1]+1); - rig_debug(RIG_DEBUG_VERBOSE, "%s: retval=%d\n", __func__, retval); - RETURNFUNC(retval); + bytes = read_block(rp, buf, 3); + if (bytes+buf[1]+2 > maxlen) + { + rig_debug(RIG_DEBUG_ERR, "%s: buffer overrun...expected max of %d, got %d\n", + __func__, maxlen, bytes+buf[1]+2); + dump_hex(buf,bytes); + RETURNFUNC(-RIG_EPROTO); + } + bytes += read_block(rp, &buf[3], buf[1]+2); + dump_hex(buf,bytes); + RETURNFUNC(bytes); } /* Example of set of commands that works @@ -129,7 +139,6 @@ static int micom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) unsigned char cmd[6] = { 0x24, 0x01, 0x18, 0x06, 0x06, 0x03 }; unsigned char reply[11]; int retval; - int ifreq; cmd[4] = checksum(cmd,4); set_transaction_active(rig); @@ -146,8 +155,7 @@ static int micom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) micom_read_frame(rig, reply, sizeof(reply)); set_transaction_inactive(rig); - ifreq = (reply[5] << 24) | (reply[6] << 16) | (reply[7] << 8) | reply[8]; - *freq = ifreq * 1000; + *freq = (reply[5] << 24) | (reply[6] << 16) | (reply[7] << 8) | reply[8]; RETURNFUNC(RIG_OK); } @@ -173,7 +181,7 @@ struct rig_caps micom_caps = RIG_MODEL(RIG_MODEL_MICOM2), .model_name = "Micom 2/3", .mfg_name = "Micom", - .version = "20240502.0", + .version = "20240503.0", .copyright = "LGPL", .status = RIG_STATUS_ALPHA, .rig_type = RIG_TYPE_TRANSCEIVER, diff --git a/simulators/simmicom.c b/simulators/simmicom.c index 70f5b0019..1cfb6a4d4 100644 --- a/simulators/simmicom.c +++ b/simulators/simmicom.c @@ -15,6 +15,7 @@ struct ip_mreq #include <string.h> #include <unistd.h> #include "../include/hamlib/rig.h" +#include "../src/misc.h" #define BUFSIZE 256 @@ -114,6 +115,10 @@ again: { case 0x06: printf("Report receiver freq\n"); + unsigned char cmd[11] = { 0x24,0x06,0x18,0x05,0x01,0x00,0x38,0xea,0x50,0xba,0x03}; + dump_hex(cmd, 11); + int n = write(fd, cmd, sizeof(cmd)); + printf("%d bytes sent\n", n); break; case 0x13: printf("PTT On\n"); @@ -121,6 +126,9 @@ again: case 0x14: printf("PTT Off\n"); break; + case 0x36: + printf("Key request\n"); + break; default: printf("Unknown cmd=%02x\n", buf[3]); } commit cc9bb6f0b54eaddf90fb6e1d32f1f0787b6eec04 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu May 2 08:20:02 2024 -0500 Another attempt at micom get/set freq diff --git a/rigs/motorola/micom.c b/rigs/motorola/micom.c index c86f28485..ff8a96bb6 100644 --- a/rigs/motorola/micom.c +++ b/rigs/motorola/micom.c @@ -45,18 +45,30 @@ static int micom_read_frame(RIG *rig, unsigned char *buf, int maxlen) { hamlib_port_t *rp = RIGPORT(rig); int retval; - const char stopset[1] = {0x03}; + //const char stopset[1] = {0x03}; ENTERFUNC; - retval = read_string_direct(rp, buf, maxlen, stopset, 1, 0, 12); + retval = read_block(rp, buf, 4); + retval = read_block(rp, buf, buf[1]+1); rig_debug(RIG_DEBUG_VERBOSE, "%s: retval=%d\n", __func__, retval); RETURNFUNC(retval); } +/* Example of set of commands that works +24 06 18 05 01 00 38 ea 50 ba 03 15 +24 05 18 36 fe 7b ef 01 e0 03 15 +24 05 18 36 ff 7b ef 01 e1 03 15 +24 05 18 36 df 7b ef 01 c1 03 15 +24 05 18 36 ff 7b ef 01 e1 03 +*/ static int micom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { hamlib_port_t *rp = RIGPORT(rig); - unsigned char rxcmd[11] = { 0x24, 0x06, 0x18, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03 }; - unsigned char txcmd[11] = { 0x24, 0x05, 0x81, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03 }; + unsigned char rxcmd[12] = { 0x24, 0x06, 0x18, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x15 }; + unsigned char cmd2[11] = { 0x24, 0x05, 0x18, 0x36, 0xfe, 0x7b, 0xef, 0x01, 0xe0, 0x03, 0x15 }; + unsigned char cmd3[11] = { 0x24, 0x05, 0x18, 0x36, 0xfe, 0x7b, 0xef, 0x01, 0xe1, 0x03, 0x15 }; + unsigned char cmd4[11] = { 0x24, 0x05, 0x18, 0x36, 0xdf, 0x7b, 0xef, 0x01, 0xc1, 0x03, 0x15 }; + unsigned char cmd5[10] = { 0x24, 0x05, 0x18, 0x36, 0xff, 0x7b, 0xef, 0x01, 0xe1, 0x03 }; + //unsigned char txcmd[11] = { 0x24, 0x05, 0x81, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03 }; unsigned int ifreq = freq; unsigned char reply[11]; int retval; @@ -69,8 +81,11 @@ static int micom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) set_transaction_active(rig); rig_flush(rp); -#if 0 retval = write_block(rp, rxcmd, sizeof(rxcmd)); + if (retval == RIG_OK) retval = write_block(rp, cmd2, sizeof(cmd2)); + if (retval == RIG_OK) retval = write_block(rp, cmd3, sizeof(cmd3)); + if (retval == RIG_OK) retval = write_block(rp, cmd4, sizeof(cmd4)); + if (retval == RIG_OK) retval = write_block(rp, cmd5, sizeof(cmd5)); if (retval != RIG_OK) { @@ -82,13 +97,11 @@ static int micom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) micom_read_frame(rig, reply, sizeof(reply)); -#endif -#if 0 +#if 0 // this method doesn't work txcmd[5] = (ifreq >> 16) & 0xff; txcmd[6] = (ifreq >> 8) & 0xff; txcmd[7] = ifreq & 0xff; txcmd[8] = checksum(txcmd, 8); -#endif txcmd[5] = (ifreq >> 24) & 0xff; txcmd[6] = (ifreq >> 16) & 0xff; txcmd[7] = (ifreq >> 8) & 0xff; @@ -105,7 +118,7 @@ static int micom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) return retval; } - micom_read_frame(rig, reply, sizeof(reply)); +#endif set_transaction_inactive(rig); return retval; } @@ -160,7 +173,7 @@ struct rig_caps micom_caps = RIG_MODEL(RIG_MODEL_MICOM2), .model_name = "Micom 2/3", .mfg_name = "Micom", - .version = "20240429.0", + .version = "20240502.0", .copyright = "LGPL", .status = RIG_STATUS_ALPHA, .rig_type = RIG_TYPE_TRANSCEIVER, commit a5fa04f8847d94d18b17e2a7e51a0b0df2fdd663 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed May 1 16:33:17 2024 -0500 Add another flush to micom.c diff --git a/rigs/motorola/micom.c b/rigs/motorola/micom.c index 0179efebd..c86f28485 100644 --- a/rigs/motorola/micom.c +++ b/rigs/motorola/micom.c @@ -120,6 +120,7 @@ static int micom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) cmd[4] = checksum(cmd,4); set_transaction_active(rig); + rig_flush(rp); retval = write_block(rp, cmd, sizeof(cmd)); if (retval != RIG_OK) @@ -172,6 +173,7 @@ struct rig_caps micom_caps = .serial_stop_bits = 2, .serial_parity = RIG_PARITY_ODD, .serial_handshake = RIG_HANDSHAKE_NONE, + .timeout = 500, .rig_open = micom_open, .set_freq = micom_set_freq, .get_freq = micom_get_freq, commit 85f78862863f24ff842edae95024b3d8409e360a Author: Mike Black W9MDB <mdb...@ya...> Date: Wed May 1 16:29:48 2024 -0500 Another attempt at micom set_freq diff --git a/rigs/motorola/micom.c b/rigs/motorola/micom.c index ad2d6e428..0179efebd 100644 --- a/rigs/motorola/micom.c +++ b/rigs/motorola/micom.c @@ -56,8 +56,8 @@ static int micom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { hamlib_port_t *rp = RIGPORT(rig); unsigned char rxcmd[11] = { 0x24, 0x06, 0x18, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03 }; - unsigned char txcmd[10] = { 0x24, 0x05, 0x18, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x03 }; - unsigned int ifreq = freq / 1000; + unsigned char txcmd[11] = { 0x24, 0x05, 0x81, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03 }; + unsigned int ifreq = freq; unsigned char reply[11]; int retval; @@ -83,10 +83,17 @@ static int micom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) micom_read_frame(rig, reply, sizeof(reply)); #endif +#if 0 txcmd[5] = (ifreq >> 16) & 0xff; txcmd[6] = (ifreq >> 8) & 0xff; txcmd[7] = ifreq & 0xff; txcmd[8] = checksum(txcmd, 8); +#endif + txcmd[5] = (ifreq >> 24) & 0xff; + txcmd[6] = (ifreq >> 16) & 0xff; + txcmd[7] = (ifreq >> 8) & 0xff; + txcmd[8] = ifreq & 0xff; + txcmd[9] = checksum(rxcmd, 9); retval = write_block(rp, txcmd, sizeof(txcmd)); micom_read_frame(rig, reply, sizeof(reply)); commit baeb484ddf1ae2a7aff811a0788f75c0762c87cc Author: Mike Black W9MDB <mdb...@ya...> Date: Wed May 1 08:34:01 2024 -0500 Change micom to odd parity diff --git a/rigs/motorola/micom.c b/rigs/motorola/micom.c index b4f7ad077..ad2d6e428 100644 --- a/rigs/motorola/micom.c +++ b/rigs/motorola/micom.c @@ -46,8 +46,10 @@ static int micom_read_frame(RIG *rig, unsigned char *buf, int maxlen) hamlib_port_t *rp = RIGPORT(rig); int retval; const char stopset[1] = {0x03}; + ENTERFUNC; retval = read_string_direct(rp, buf, maxlen, stopset, 1, 0, 12); - return retval; + rig_debug(RIG_DEBUG_VERBOSE, "%s: retval=%d\n", __func__, retval); + RETURNFUNC(retval); } static int micom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) @@ -161,7 +163,7 @@ struct rig_caps micom_caps = .serial_rate_max = 9600, .serial_data_bits = 8, .serial_stop_bits = 2, - .serial_parity = RIG_PARITY_EVEN, + .serial_parity = RIG_PARITY_ODD, .serial_handshake = RIG_HANDSHAKE_NONE, .rig_open = micom_open, .set_freq = micom_set_freq, commit 4e600a9ed67c6e627c495deeacbb65872f8eaec0 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Apr 30 22:41:06 2024 -0500 For Micom see if setting transmit freq is all we need -- setting Rx freq, then Tx isn't working diff --git a/rigs/motorola/micom.c b/rigs/motorola/micom.c index 8773e1edb..b4f7ad077 100644 --- a/rigs/motorola/micom.c +++ b/rigs/motorola/micom.c @@ -57,6 +57,7 @@ static int micom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) unsigned char txcmd[10] = { 0x24, 0x05, 0x18, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x03 }; unsigned int ifreq = freq / 1000; unsigned char reply[11]; + int retval; rxcmd[5] = (ifreq >> 24) & 0xff; rxcmd[6] = (ifreq >> 16) & 0xff; @@ -66,7 +67,8 @@ static int micom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) set_transaction_active(rig); rig_flush(rp); - int retval = write_block(rp, rxcmd, sizeof(rxcmd)); +#if 0 + retval = write_block(rp, rxcmd, sizeof(rxcmd)); if (retval != RIG_OK) { @@ -78,6 +80,7 @@ static int micom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) micom_read_frame(rig, reply, sizeof(reply)); +#endif txcmd[5] = (ifreq >> 16) & 0xff; txcmd[6] = (ifreq >> 8) & 0xff; txcmd[7] = ifreq & 0xff; commit 8002d470508135ce4b70c40e8b736ff436e9b7fc Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Apr 30 17:28:37 2024 -0500 Fix micom set_freq for correct checksum diff --git a/rigs/motorola/micom.c b/rigs/motorola/micom.c index ca9a01239..8773e1edb 100644 --- a/rigs/motorola/micom.c +++ b/rigs/motorola/micom.c @@ -106,6 +106,7 @@ static int micom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) int retval; int ifreq; + cmd[4] = checksum(cmd,4); set_transaction_active(rig); retval = write_block(rp, cmd, sizeof(cmd)); @@ -149,7 +150,7 @@ struct rig_caps micom_caps = .version = "20240429.0", .copyright = "LGPL", .status = RIG_STATUS_ALPHA, - .rig_type = RIG_TYPE_OTHER, + .rig_type = RIG_TYPE_TRANSCEIVER, .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, .ptt_type = RIG_PTT_RIG, .port_type = RIG_PORT_SERIAL, @@ -158,8 +159,10 @@ struct rig_caps micom_caps = .serial_data_bits = 8, .serial_stop_bits = 2, .serial_parity = RIG_PARITY_EVEN, + .serial_handshake = RIG_HANDSHAKE_NONE, .rig_open = micom_open, .set_freq = micom_set_freq, .get_freq = micom_get_freq, - .set_ptt = micom_set_ptt + .set_ptt = micom_set_ptt, + .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; commit 105c6b8d3942646d35a7af09d52e1cb73a5a8c8b Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Apr 30 17:28:03 2024 -0500 Add simmicom.c diff --git a/simulators/Makefile.am b/simulators/Makefile.am index 12c290686..74fb40224 100644 --- a/simulators/Makefile.am +++ b/simulators/Makefile.am @@ -8,7 +8,7 @@ DISTCLEANFILES = bin_PROGRAMS = -check_PROGRAMS = simelecraft simicgeneric simkenwood simyaesu simic9100 simic9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simtmd700 simrotorez simspid simft817 simts590 simft847 simic7300 simic7000 simic7100 simic7200 simatd578 simic905 simts450 simic7600 simic7610 simic705 simts950 simts990 simic7851 simftdx101 simxiegug90 simqrplabs simft818 simic275 simtrusdx simft1000 simtmd710 simts890 simxiegux108g simxiegux6100 simic910 simft450 simelecraftk4 +check_PROGRAMS = simelecraft simicgeneric simkenwood simyaesu simic9100 simic9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simtmd700 simrotorez simspid simft817 simts590 simft847 simic7300 simic7000 simic7100 simic7200 simatd578 simic905 simts450 simic7600 simic7610 simic705 simts950 simts990 simic7851 simftdx101 simxiegug90 simqrplabs simft818 simic275 simtrusdx simft1000 simtmd710 simts890 simxiegux108g simxiegux6100 simic910 simft450 simelecraftk4 simmicom simelecraft_SOURCES = simelecraft.c simkenwood_SOURCES = simkenwood.c diff --git a/simulators/simmicom.c b/simulators/simmicom.c new file mode 100644 index 000000000..70f5b0019 --- /dev/null +++ b/simulators/simmicom.c @@ -0,0 +1,130 @@ +// can run this using rigctl/rigctld and socat pty devices +// gcc -o simspid simspid.c +#define _XOPEN_SOURCE 700 +// since we are POSIX here we need this +#if 0 +struct ip_mreq +{ + int dummy; +}; +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <fcntl.h> +#include <string.h> +#include <unistd.h> +#include "../include/hamlib/rig.h" + +#define BUFSIZE 256 + +float freqA = 14074000; +float freqB = 14074500; +char tx_vfo = '0'; +char rx_vfo = '0'; +char modeA = '1'; +char modeB = '1'; +int width_main = 500; +int width_sub = 700; + + +int +getmyline(int fd, unsigned char *buf) +{ + int i = 0; + int n = 0; + memset(buf, 0, BUFSIZE); + + n = read(fd, buf, 4); + + if (n <= 0) { sleep(1); return 0;} + + int bytesToRead = buf[1] + 2; //; len does not include cksum, or eom + n += read(fd, &buf[4], bytesToRead); + printf("n=%d:", n); + + for (i = 0; i < n; ++i) + { + printf(" %02x", buf[i]); + } + + printf("\n"); + return n; +} + +#if defined(WIN32) || defined(_WIN32) +int openPort(char *comport) // doesn't matter for using pts devices +{ + int fd; + fd = open(comport, O_RDWR); + + if (fd < 0) + { + perror(comport); + } + + return fd; +} + +#else +int openPort(char *comport) // doesn't matter for using pts devices +{ + int fd = posix_openpt(O_RDWR); + char *name = ptsname(fd); + + if (name == NULL) + { + perror("pstname"); + return -1; + } + + printf("name=%s\n", name); + + if (fd == -1 || grantpt(fd) == -1 || unlockpt(fd) == -1) + { + perror("posix_openpt"); + return -1; + } + + return fd; +} +#endif + + + +int main(int argc, char *argv[]) +{ + unsigned char buf[256]; + + +again: + int fd = openPort(argv[1]); + + while (1) + { + int bytes = getmyline(fd, buf); + + if (bytes == 0) + { + close(fd); + goto again; + } + + switch (buf[3]) + { + case 0x06: + printf("Report receiver freq\n"); + break; + case 0x13: + printf("PTT On\n"); + break; + case 0x14: + printf("PTT Off\n"); + break; + + default: printf("Unknown cmd=%02x\n", buf[3]); + } + } + + return 0; +} commit d683955811377ae1e47db526ae8d6a46928a1abf Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Apr 30 10:39:30 2024 -0500 Fix set_freq for micom.c diff --git a/rigs/motorola/micom.c b/rigs/motorola/micom.c index adb88f06a..ca9a01239 100644 --- a/rigs/motorola/micom.c +++ b/rigs/motorola/micom.c @@ -81,7 +81,7 @@ static int micom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) txcmd[5] = (ifreq >> 16) & 0xff; txcmd[6] = (ifreq >> 8) & 0xff; txcmd[7] = ifreq & 0xff; - rxcmd[8] = checksum(txcmd, 8); + txcmd[8] = checksum(txcmd, 8); retval = write_block(rp, txcmd, sizeof(txcmd)); micom_read_frame(rig, reply, sizeof(reply)); commit e67c80f1217953f1bff20bd4483e48df3a266e03 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Apr 29 23:40:35 2024 -0500 Add get_freq and set_freq for micom diff --git a/rigs/motorola/micom.c b/rigs/motorola/micom.c index 43ad9b11f..adb88f06a 100644 --- a/rigs/motorola/micom.c +++ b/rigs/motorola/micom.c @@ -23,7 +23,17 @@ #include <misc.h> #include <iofunc.h> -static freq_t freqA = 14074000; +// char* to start of checksum for len bytes +unsigned int checksum(unsigned char *buf, int len) +{ + int checksum = 0; + int i; + + // simple 1-byte checksum + for (i = 0; i < len; ++i) { checksum += buf[i]; } + + return checksum & 0xff; +} static int micom_open(RIG *rig) { @@ -31,15 +41,86 @@ static int micom_open(RIG *rig) RETURNFUNC(RIG_OK); } +static int micom_read_frame(RIG *rig, unsigned char *buf, int maxlen) +{ + hamlib_port_t *rp = RIGPORT(rig); + int retval; + const char stopset[1] = {0x03}; + retval = read_string_direct(rp, buf, maxlen, stopset, 1, 0, 12); + return retval; +} + static int micom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { - freqA = freq; - RETURNFUNC(RIG_OK); + hamlib_port_t *rp = RIGPORT(rig); + unsigned char rxcmd[11] = { 0x24, 0x06, 0x18, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03 }; + unsigned char txcmd[10] = { 0x24, 0x05, 0x18, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x03 }; + unsigned int ifreq = freq / 1000; + unsigned char reply[11]; + + rxcmd[5] = (ifreq >> 24) & 0xff; + rxcmd[6] = (ifreq >> 16) & 0xff; + rxcmd[7] = (ifreq >> 8) & 0xff; + rxcmd[8] = ifreq & 0xff; + rxcmd[9] = checksum(rxcmd, 9); + + set_transaction_active(rig); + rig_flush(rp); + int retval = write_block(rp, rxcmd, sizeof(rxcmd)); + + if (retval != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: write_block err: %s\n", __func__, + rigerror(retval)); + set_transaction_inactive(rig); + return retval; + } + + micom_read_frame(rig, reply, sizeof(reply)); + + txcmd[5] = (ifreq >> 16) & 0xff; + txcmd[6] = (ifreq >> 8) & 0xff; + txcmd[7] = ifreq & 0xff; + rxcmd[8] = checksum(txcmd, 8); + retval = write_block(rp, txcmd, sizeof(txcmd)); + micom_read_frame(rig, reply, sizeof(reply)); + + if (retval != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: write_block err: %s\n", __func__, + rigerror(retval)); + set_transaction_inactive(rig); + return retval; + } + + micom_read_frame(rig, reply, sizeof(reply)); + set_transaction_inactive(rig); + return retval; } static int micom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) { - *freq = freqA; + hamlib_port_t *rp = RIGPORT(rig); + unsigned char cmd[6] = { 0x24, 0x01, 0x18, 0x06, 0x06, 0x03 }; + unsigned char reply[11]; + int retval; + int ifreq; + + set_transaction_active(rig); + retval = write_block(rp, cmd, sizeof(cmd)); + + if (retval != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: write_block err: %s\n", __func__, + rigerror(retval)); + set_transaction_inactive(rig); + return retval; + } + + micom_read_frame(rig, reply, sizeof(reply)); + set_transaction_inactive(rig); + ifreq = (reply[5] << 24) | (reply[6] << 16) | (reply[7] << 8) | reply[8]; + *freq = ifreq * 1000; RETURNFUNC(RIG_OK); } @@ -48,17 +129,16 @@ static int micom_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) hamlib_port_t *rp = RIGPORT(rig); unsigned char on[] = { 0x24, 0x02, 0x81, 0x13, 0x01, 0xBB, 0x03 }; unsigned char off[] = { 0x24, 0x02, 0x81, 0x14, 0x01, 0xBC, 0x03 }; + int retval; + set_transaction_active(rig); rig_flush(rp); - int retval = write_block(rp, ptt ? on : off, sizeof(on)); - if (retval != RIG_OK) - { - set_transaction_inactive(rig); - RETURNFUNC(retval); - } + retval = write_block(rp, ptt ? on : off, sizeof(on)); + + set_transaction_inactive(rig); - return RIG_OK; + return retval; } struct rig_caps micom_caps = @@ -66,7 +146,7 @@ struct rig_caps micom_caps = RIG_MODEL(RIG_MODEL_MICOM2), .model_name = "Micom 2/3", .mfg_name = "Micom", - .version = "20240428.0", + .version = "20240429.0", .copyright = "LGPL", .status = RIG_STATUS_ALPHA, .rig_type = RIG_TYPE_OTHER, commit 594df4b31de374e1066dd27ddb510640f59d9531 Merge: c7635ee3b 8f1b6851e Author: Michael Black <mdb...@ya...> Date: Sun Apr 28 17:06:20 2024 -0500 Merge pull request #1544 from N0NB/update_win_build_scripts Sync local build scripts with main repository commit 8f1b6851e787a72f617e5e139f2a046413b5a5b7 Author: Nate Bargmann <n0...@n0...> Date: Sun Apr 28 16:23:35 2024 -0500 Sync local build scripts with main repository Updates for including libgcc* provided by MinGW in Debian 11 and Debian 12 (untested). Include other updates added to the build virtual machine along the way. diff --git a/scripts/build-w32.sh b/scripts/build-w32.sh index de7f17607..8414faf1f 100755 --- a/scripts/build-w32.sh +++ b/scripts/build-w32.sh @@ -14,14 +14,17 @@ BUILD_DIR=~/builds # Set this to LibUSB archive extracted in $BUILD_DIR -LIBUSB_VER=libusb-1.0.22 +LIBUSB_VER=libusb-1.0.24 -# Set to the correct HOST_ARCH= line for your minGW installation +# Set to the correct HOST_ARCH= line for your MinGW installation HOST_ARCH=i686-w64-mingw32 -# Set to the strip name for your version of minGW +# Set to the strip name for your version of MinGW HOST_ARCH_STRIP=i686-w64-mingw32-strip +# Set to the dlltool name for your version of MinGW +HOST_ARCH_DLLTOOL=i686-w64-mingw32-dlltool + # Error return codes. See /usr/include/sysexits.h EX_USAGE=64 EX_NOINPUT=66 @@ -176,6 +179,10 @@ program is not considered a "derivative work" when using the published Hamlib API and normal linking to the front-end library, and may be of a license of your choosing. +As of 08 Sep 2022 a .lib file is generated using the MinGW dlltool utility. +If this file does not work for your project, follow the steps in the following +section: + For linking the library with MS Visual C++ 2003, from the directory you installed Hamlib run the following commands to generate the libhamlib-4.lib file needed for linking with your MSVC project: @@ -186,15 +193,12 @@ c:\Program Files\Microsoft Visual C++ Toolkit 2003\bin\link.exe /lib /machine:i3 To do the same for Visual Studio 2017: cd lib\msvc -"c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Tools\MSVC\14.16.27023\bin\Hostx64\x86\bin\link.exe" /lib /machine:i386 /def:libhamlib-4.def +c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Tools\MSVC\14.16.27023\bin\Hostx64\x86\bin\link.exe /lib /machine:i386 /def:libhamlib-4.def -and for VS 2019: +For VS 2019: cd lib\msvc -"c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\Hostx64\x86\bin\link.exe" /lib /machine:i386 /def:libhamlib-4.def - -cd lib/msvc -"c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\bin\Hostx64\x86\link.exe" /lib /machine:i386 /def:libhamlib-4.def +c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\Hostx64\x86\bin\link.exe /lib /machine:i386 /def:libhamlib-4.def NOTE: feedback is requested on the previous two command examples! @@ -212,6 +216,7 @@ Please report problems or success to ham...@li... Cheers, Stephane Fillod - F8CFE +Mike Black - W9MDB Nate Bargmann - N0NB http://www.hamlib.org @@ -232,9 +237,9 @@ make -j 4 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 -#todos ${ZIP_DIR}/lib/msvc/libhamlib-4.def +todos ${ZIP_DIR}/lib/msvc/libhamlib-4.def cp -a ${INST_DIR}/include/hamlib ${ZIP_DIR}/include/. -#todos ${ZIP_DIR}/include/hamlib/*.h +todos ${ZIP_DIR}/include/hamlib/*.h # C++ binding is useless on w32 because of ABI for f in *class.h @@ -287,4 +292,21 @@ then cp -a ${FILE} ${ZIP_DIR}/bin/. fi +# Required for MinGW with GCC 10 (Debian 11) +FILE="/usr/lib/gcc/i686-w64-mingw32/10-posix/libgcc_s_dw2-1.dll" +if test -f "$FILE" +then + cp -a ${FILE} ${ZIP_DIR}/bin/. +fi + +# Required for MinGW with GCC 12 (Debian 12) +FILE="/usr/lib/gcc/i686-w64-mingw32/12-posix/libgcc_s_dw2-1.dll" +if test -f "$FILE" +then + cp -a ${FILE} ${ZIP_DIR}/bin/. +fi + +# Generate .lib file for MSVC +${HOST_ARCH_DLLTOOL} --input-def ${ZIP_DIR}/lib/msvc/libhamlib-4.def --output-lib ${ZIP_DIR}/lib/msvc/libhamlib-4.lib + /usr/bin/zip -r ${HL_FILENAME}.zip $(basename ${ZIP_DIR}) diff --git a/scripts/build-w64.sh b/scripts/build-w64.sh index eb302f135..fff9b6241 100755 --- a/scripts/build-w64.sh +++ b/scripts/build-w64.sh @@ -14,14 +14,17 @@ BUILD_DIR=~/builds # Set this to LibUSB archive extracted in $BUILD_DIR -LIBUSB_VER=libusb-1.0.22 +LIBUSB_VER=libusb-1.0.24 -# Set to the correct HOST_ARCH= line for your minGW installation +# Set to the correct HOST_ARCH= line for your MinGW installation HOST_ARCH=x86_64-w64-mingw32 -# Set to the strip name for your version of minGW +# Set to the strip name for your version of MinGW HOST_ARCH_STRIP=x86_64-w64-mingw32-strip +# Set to the dlltool name for your version of MinGW +HOST_ARCH_DLLTOOL=x86_64-w64-mingw32-dlltool + # Error return codes. See /usr/include/sysexits.h EX_USAGE=64 EX_NOINPUT=66 @@ -176,6 +179,10 @@ program is not considered a "derivative work" when using the published Hamlib API and normal linking to the front-end library, and may be of a license of your choosing. +As of 08 Sep 2022 a .lib file is generated using the MinGW dlltool utility. +If this file does not work for your project, follow the steps in the following +section: + For linking the library with MS Visual C++ 2003, from the directory you installed Hamlib run the following commands to generate the libhamlib-4.lib file needed for linking with your MSVC project: @@ -196,6 +203,11 @@ c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.2 NOTE: feedback is requested on the previous two command examples as these do not appear to be correct to generate a 64 bit libhamlib-4.lib file! +For VS 2022: + +cd lib/msvc +c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\bin\Hostx64\x86\link.exe /lib /machine:i386 /def:libhamlib-4.def + The published Hamlib API may be found at: http://hamlib.sourceforge.net/manuals/4.1/index.html @@ -210,6 +222,7 @@ Please report problems or success to ham...@li... Cheers, Stephane Fillod - F8CFE +Mike Black - W9MDB Nate Bargmann - N0NB http://www.hamlib.org @@ -285,4 +298,21 @@ then cp -a ${FILE} ${ZIP_DIR}/bin/. fi +# Required for MinGW with GCC 10 (Debian 11) +FILE="/usr/lib/gcc/i686-w64-mingw32/10-posix/libgcc_s_dw2-1.dll" +if test -f "$FILE" +then + cp -a ${FILE} ${ZIP_DIR}/bin/. +fi + +# Required for MinGW with GCC 12 (Debian 12) +FILE="/usr/lib/gcc/i686-w64-mingw32/12-posix/libgcc_s_dw2-1.dll" +if test -f "$FILE" +then + cp -a ${FILE} ${ZIP_DIR}/bin/. +fi + +# Generate .lib file for MSVC +${HOST_ARCH_DLLTOOL} --input-def ${ZIP_DIR}/lib/msvc/libhamlib-4.def --output-lib ${ZIP_DIR}/lib/msvc/libhamlib-4.lib + /usr/bin/zip -r ${HL_FILENAME}.zip $(basename ${ZIP_DIR}) commit c7635ee3b14e7ec2c7ccba9bbb3ea81aa56685f2 Merge: 7b4429754 94d753860 Author: Nate Bargmann <n0...@n0...> Date: Sun Apr 28 15:49:15 2024 -0500 Merge pull request #1543 from N0NB/update_win_build_scripts REALLY include README.md in archive commit 94d753860b194b234324195681484e2efcc5d711 Author: Nate Bargmann <n0...@n0...> Date: Sun Apr 28 15:47:08 2024 -0500 REALLY include README.md in archive Teach me not to test before committing and pushing... diff --git a/Makefile.am b/Makefile.am index 7dff7c0d0..398b1f812 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,7 +6,7 @@ aclocal_DATA = hamlib.m4 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = hamlib.pc -EXTRA_DIST = PLAN LICENSE hamlib.m4 hamlib.pc.in README.developer \ +EXTRA_DIST = PLAN LICENSE hamlib.m4 hamlib.pc.in README.md README.developer \ README.betatester README.freqranges README.multicast README.osx \ Android.mk commit 7b44297543ff0ff1c2b11b71fa17ecf33477e05b Merge: d47fb672c abee6a3cb Author: Nate Bargmann <n0...@n0...> Date: Sun Apr 28 15:36:03 2024 -0500 Merge pull request #1542 from N0NB/update_win_build_scripts Distribute README.md instead of README commit abee6a3cb9f93c9456fbae8bcd3d44c9f22f07d1 Author: Nate Bargmann <n0...@n0...> Date: Sun Apr 28 15:31:16 2024 -0500 Distribute README.md instead of README README.md has replaced README as the main introductory file. diff --git a/Makefile.am b/Makefile.am index b854d504c..7dff7c0d0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,7 +11,7 @@ EXTRA_DIST = PLAN LICENSE hamlib.m4 hamlib.pc.in README.developer \ Android.mk doc_DATA = ChangeLog COPYING COPYING.LIB LICENSE \ - README README.betatester README.developer + README.md README.betatester README.developer SUBDIRS = macros include lib security \ $(BACKEND_LIST) \ ----------------------------------------------------------------------- Summary of changes: Makefile.am | 4 +- rigs/icom/icom.c | 26 ++++-- rigs/icom/icom.h | 2 +- rigs/icom/xiegu.c | 29 +++++-- rigs/kenwood/kenwood.c | 6 +- rigs/kenwood/kenwood.h | 2 +- rigs/motorola/micom.c | 162 +++++++++++++++++++++++++++++++---- rigs/yaesu/ft891.c | 2 +- rigs/yaesu/ft891.h | 11 ++- scripts/build-w32.sh | 44 +++++++--- scripts/build-w64.sh | 36 +++++++- simulators/Makefile.am | 2 +- simulators/{simspid.c => simmicom.c} | 48 +++++++---- src/rig.c | 16 ++-- 14 files changed, 313 insertions(+), 77 deletions(-) copy simulators/{simspid.c => simmicom.c} (63%) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2024-04-28 19:57:39
|
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 d47fb672c82aebce342cba8f0dd3b496ec536b9a (commit) via 2638eeb774ed5c162c6ab492cb3af3328cec1402 (commit) via 92e82a25d2ebbbf776c4f9aa58a37dde8fc15554 (commit) via fe0d47acef9dd5a7401e4a4162fc5195e6f7a0c7 (commit) via 86afa90739b3b4427646a555670c431683bc1bc8 (commit) via 25f58afb72e993e2c51435c47ba0126d50971317 (commit) via d7e0b214f7bcea8855f0b5570d48b06a69bf5a7e (commit) via e9a9424eedd44ed4f8b908dfb23e3e7899bf1eb5 (commit) via 93bd44c3d56ac7d406ef0d90dc47ace1d813fec9 (commit) via b182ca2d51740d5dcaa126b52d4f208003b9cc86 (commit) via 6a98b0b9cb8128c09ecf4cf7374bbefd09170aaf (commit) via c70502ea34fd319f41d6f4d9c4ee22e30b3db846 (commit) via f8a67d716e54ed9ea816920f25fefbea3594571f (commit) via 2b275531559f2158a2aaf5e7534b352dac708ec8 (commit) via 08aac883775c8cd89d682682f2e3b49d796e2a35 (commit) via c31497918f8511ad01e1dd749e7df94a00332db2 (commit) via d9b57bc7a8a5cf0f93c6792a58f7db1273992199 (commit) via 90545a192e94ebb01021c05273f5c3d8e196c2be (commit) via dce80d264a5cd093707c0e6720e18dff77f68665 (commit) via 4c111da0d1b7206050ca719a9ff3c97e84aaa260 (commit) via d9b589d25499ca823777130a854768b4533cc0a6 (commit) via 95b0af114f10defbcfbb4f1b1d9b97c7f99ee5b8 (commit) via 9e42ca2052d6b3ade2d30400b952ed8c34147aa7 (commit) via 331143fa173eb7bd1bd44aae60544155fcd97a1f (commit) via a6ad5f0928b23a0717426e708dd4d1fe3b8a9592 (commit) via b42aa75dd8251721345e89926e0bd4140fa2accb (commit) via 6cfdb9d4eddf8b135a3961e5d41912a6c1152348 (commit) via bddd7e1a7d984bb1edac14724afb1921174ed31c (commit) via 35b0bb086bcb7342ee38820231c673eb402fc127 (commit) via 0ba199448bf49b32b776cfdeb4ae140f3ac532d9 (commit) via 3dac2efb48a3781fbeea73a60335bf8c1466e401 (commit) via 63fa818fd7a5f2beb650a5f6dac8c48c9534d49d (commit) via 878243aff35f3e42191a916c857f8857deb61dfd (commit) via 00ceb6e72f1f5c4d58afc090bae5c327dccfd97c (commit) via 279362f40347d92c5623702297c48621334df7e3 (commit) via 9a7dda25c88848531cb96834eab8d8851a020c65 (commit) from 41de3425d24edcbd448e0231692eeacc58909521 (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 d47fb672c82aebce342cba8f0dd3b496ec536b9a Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Apr 28 11:44:05 2024 -0500 Fix serial port type for Micom diff --git a/rigs/motorola/micom.c b/rigs/motorola/micom.c index f815c80c2..43ad9b11f 100644 --- a/rigs/motorola/micom.c +++ b/rigs/motorola/micom.c @@ -72,13 +72,12 @@ struct rig_caps micom_caps = .rig_type = RIG_TYPE_OTHER, .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, .ptt_type = RIG_PTT_RIG, - .dcd_type = RIG_DCD_RIG, - .port_type = RIG_PORT_NONE, + .port_type = RIG_PORT_SERIAL, .serial_rate_min = 9600, .serial_rate_max = 9600, .serial_data_bits = 8, .serial_stop_bits = 2, - .serial_parity = RIG_PARITY_ODD, + .serial_parity = RIG_PARITY_EVEN, .rig_open = micom_open, .set_freq = micom_set_freq, .get_freq = micom_get_freq, commit 2638eeb774ed5c162c6ab492cb3af3328cec1402 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Apr 28 11:33:23 2024 -0500 Fix ptt type for Micom 2/3 and change from Motorola to Micom diff --git a/rigs/motorola/micom.c b/rigs/motorola/micom.c index 8168b0650..f815c80c2 100644 --- a/rigs/motorola/micom.c +++ b/rigs/motorola/micom.c @@ -65,13 +65,13 @@ struct rig_caps micom_caps = { RIG_MODEL(RIG_MODEL_MICOM2), .model_name = "Micom 2/3", - .mfg_name = "Motorola", - .version = "20240423.0", + .mfg_name = "Micom", + .version = "20240428.0", .copyright = "LGPL", .status = RIG_STATUS_ALPHA, .rig_type = RIG_TYPE_OTHER, .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, - .ptt_type = RIG_PTT_NONE, + .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, .port_type = RIG_PORT_NONE, .serial_rate_min = 9600, commit 92e82a25d2ebbbf776c4f9aa58a37dde8fc15554 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Apr 26 17:35:18 2024 -0500 Fix possible null argument in rig_test_2038 diff --git a/src/misc.c b/src/misc.c index 2ea94e6d5..e7bdb2c02 100644 --- a/src/misc.c +++ b/src/misc.c @@ -3104,7 +3104,7 @@ int rig_test_2038(RIG *rig) if (s == NULL) { failed = 1; } else rig_debug(RIG_DEBUG_VERBOSE, "%s: time_t 2038 test = 0x%08lx:%s", __func__, x, - s); + s == NULL ? "NULL" : s); #endif commit fe0d47acef9dd5a7401e4a4162fc5195e6f7a0c7 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Apr 24 12:33:14 2024 -0500 Fix motorola Makefile.am diff --git a/rigs/motorola/Makefile.am b/rigs/motorola/Makefile.am index baa2ff0c4..d47e60a7e 100644 --- a/rigs/motorola/Makefile.am +++ b/rigs/motorola/Makefile.am @@ -1,4 +1,4 @@ -RSSRC = motorola.c micom.c +RSSRC = motorola.c micom.c motorola.h noinst_LTLIBRARIES = libhamlib-motorola.la libhamlib_motorola_la_SOURCES = $(RSSRC) commit 86afa90739b3b4427646a555670c431683bc1bc8 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Apr 24 12:21:30 2024 -0500 Add Android.mk for motorola diff --git a/rigs/motorola/Android.mk b/rigs/motorola/Android.mk new file mode 100644 index 000000000..17ba6f97b --- /dev/null +++ b/rigs/motorola/Android.mk @@ -0,0 +1,12 @@ +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := motorola.c micom.c +LOCAL_MODULE := motorola + +LOCAL_CFLAGS := +LOCAL_C_INCLUDES := android include src +LOCAL_LDLIBS := -lhamlib -Lobj/local/$(TARGET_ARCH_ABI) + +include $(BUILD_STATIC_LIBRARY) commit 25f58afb72e993e2c51435c47ba0126d50971317 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Apr 24 12:07:10 2024 -0500 Update motorola diff --git a/rigs/motorola/Makefile.am b/rigs/motorola/Makefile.am new file mode 100644 index 000000000..baa2ff0c4 --- /dev/null +++ b/rigs/motorola/Makefile.am @@ -0,0 +1,6 @@ +RSSRC = motorola.c micom.c + +noinst_LTLIBRARIES = libhamlib-motorola.la +libhamlib_motorola_la_SOURCES = $(RSSRC) + +EXTRA_DIST = Android.mk diff --git a/rigs/motorola/README.txt b/rigs/motorola/README.txt new file mode 100644 index 000000000..0f7ccd9cc --- /dev/null +++ b/rigs/motorola/README.txt @@ -0,0 +1,106 @@ +Received from George Csahanin W2DB + +PS- + +Here are some of the code from the head project: + +//Control data strings +/////byte volumestr[8] = { + ///// 0x24,0x03,0x18,0x2b,0x00,0x00,0x6A,0x03}; +byte squelchOff[8] = { + 0x24,0x03,0x18,0x09,0x00,0x00,0x48,0x03}; +byte squelchOn[8] = { + 0x24,0x03,0x18,0x09,0x00,0x01,0x49,0x03}; +byte volume[8] = { + 0x24,0x03,0x18,0x2B,0x00,0x00,0x6A,0x03}; // volume level 0 in hex +byte reportVol[7] = { + 0x24,0x01,0x18,0x2C,0x69,0x03}; +byte button1[10] = { + 0x24,0x05,0x18,0x36,0xFF,0x79,0xEF,0x01,0xDF,0x03}; // keypad button 1 +byte button2[10] = { + 0x24,0x05,0x18,0x36,0xFF,0x3B,0xEF,0x01,0xA1,0x03}; // keypad button 2 +byte button3[10] = { + 0x24,0x05,0x18,0x36,0xFF,0x7B,0xE7,0x01,0xD9,0x03}; // keypad button 3 +byte button4[10] = { + 0x24,0x05,0x18,0x36,0xFF,0x5B,0xEF,0x01,0xC1,0x03}; // keypad button 4 +byte button5[10] = { + 0x24,0x05,0x18,0x36,0xFF,0x7B,0xEB,0x01,0xDD,0x03}; // keypad button 5 +byte button6[10] = { + 0x24,0x05,0x18,0x36,0xFF,0x7B,0x6F,0x01,0x61,0x03}; // keypad button 6 +byte button7[10] = { + 0x24,0x05,0x18,0x36,0xFF,0x7B,0xAF,0x01,0xA1,0x03}; // keypad button 7 +byte button8[10] = { + 0x24,0x05,0x18,0x36,0xF7,0x7B,0xEF,0x01,0xD9,0x03}; // keypad button 8 +byte button9[10] = { + 0x24,0x05,0x18,0x36,0xFF,0x7A,0xEF,0x01,0xE0,0x03}; // keypad button 9 +byte button0[10] = { + 0x24,0x05,0x18,0x36,0x7F,0x7B,0xEF,0x01,0x61,0x03}; // keypad button 0 +byte buttonAsterisk[10] = { + 0x24,0x05,0x18,0x36,0xFB,0x7B,0xEF,0x01,0xDD,0x03}; // keypad button * +byte buttonPound[10] = { + 0x24,0x05,0x18,0x36,0xFF,0x6B,0xEF,0x01,0xD1,0x03}; // keypad button # +byte buttonMENU[10] = { + 0x24,0x05,0x18,0x36,0xFF,0x7B,0xEF,0x00,0xE0,0x03}; // keypad button MENU +byte buttonPesc[10] = { + 0x24,0x05,0x18,0x36,0xEF,0x7B,0xEF,0x01,0xD1,0x03}; // keypad button Pesc +byte buttonEnter[10] = { + 0x24,0x05,0x18,0x36,0xFF,0x7B,0xED,0x01,0xDF,0x03}; // keypad button +Enter +byte colorKey[10] = { +}; // keypad button for color or other use +byte moreKey[10] = { + 0x24,0x05,0x18,0x36,0xFD,0x7B,0xEF,0x01,0xDF,0x03}; // more key +byte fOneKey[10] = { + 0x24,0x05,0x18,0x36,0xBF,0x7B,0xEF,0x01,0xA1,0x03}; // soft key F1 +byte fTwoKey[10] = { + 0x24,0x05,0x18,0x36,0xFF,0x73,0xEF,0x01,0xD9,0x03}; // soft key F2 +byte fThreeKey[10] = { + 0x24,0x05,0x18,0x36,0xFF,0x7B,0xEE,0x01,0xE0,0x03}; //soft key F3 +byte fFourKey[10] = { + 0x24,0x05,0x18,0x36,0xFF,0x7B,0xCF,0x01,0xc1,0x03}; // soft key F4 +byte buttonRelease[10] = { + 0x24,0x05,0x18,0x36,0xFF,0x7B,0xEF,0x01,0xE1,0x03}; // button release +command +byte arrowUp[10] = { + 0x24,0x05,0x18,0x36,0xFE,0x7B,0xEF,0x01,0xE0,0x03}; // up button command +byte arrowDown[10] = { + 0x24,0x05,0x18,0x36,0xDF,0x7B,0xEF,0x01,0xC1,0x03}; // down button +command +byte GetData[9] = { + 0x24,0x04,0x18,0x29,0x00,0x01,0x2E,0x98,0x03}; // enable special reports +//byte txACK[6] = { +// 0x24,0x01,0x10,0xF3,0x28,0x03}; // ack to radio +byte pttEngage[7] = { + 0x24, 0x02, 0x81, 0x13, 0x01, 0xBB, 0x03}; +byte pttRelease[7] = { + 0x24, 0x02, 0x81, 0x14, 0x01, 0xBC, 0x03}; +byte acknowledge[6] = { + 0x24,0x01,0x10,0xF3,0x28,0x03}; // ack to radio from head +byte radioack[6] = { + 0x24,0x01,0x80,0xF3,0x98,0x03}; // ack from radio to head +//byte rxACK[6] = { +// 0x24,0x01,0x80,0xF3,0x98,0x03}; // ack from radio + + + //---------FREQUENCY(LINE1)----------------------------- + if ((opCode == 0x2E && subopCode == 0x03) && (checkSum == true)) + { + //EXAMPLE FREQUENCY PACKET 24 0F 81 2E 03 02 6E 46 20 20 38 2C 39 +39 32 2E 39 38 82 03 (display 0, 1) + char freqLine[10]; + for(int i=5, j=0; i<=15; i++, j++) { + freqLine[j] = rxdata[i]; + freqLine[j+1] = '\0'; + } + + LCD.sendString(freqLine,0,1); + + } + +//---------------------MENU(LINE0)------------------------------ + if (opCode == 0x2E && subopCode == 0x02) + { + //EXAMPLE MENU PACKET 24 09 81 2E 02 02 55 4D 45 4E 55 20 8A 03 +(display 0, 0) + + diff --git a/rigs/motorola/motorola.c b/rigs/motorola/motorola.c new file mode 100644 index 000000000..192b2b977 --- /dev/null +++ b/rigs/motorola/motorola.c @@ -0,0 +1,32 @@ +/* + * Hamlib Motorola backend - main file + * Copyright (c) 2024 Michael Black W9MDB + * + * + * 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 + * + */ + +#include "motorola.h" +#include <register.h> + +DECLARE_INITRIG_BACKEND(motorola) +{ + rig_debug(RIG_DEBUG_VERBOSE, "%s: _init called\n", __func__); + + rig_register(&micom_caps); + + return RIG_OK; +} diff --git a/rigs/motorola/motorola.h b/rigs/motorola/motorola.h new file mode 100644 index 000000000..db6790b1f --- /dev/null +++ b/rigs/motorola/motorola.h @@ -0,0 +1,8 @@ +#ifndef _MOTOROLA_H +#define _MOTOROLADUMMY_H 1 + +#include "hamlib/rig.h" + +extern struct rig_caps micom_caps; + +#endif // _MOTOROLA_H commit d7e0b214f7bcea8855f0b5570d48b06a69bf5a7e Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Apr 24 12:06:36 2024 -0500 Add fake freq set/get for micom diff --git a/rigs/motorola/micom.c b/rigs/motorola/micom.c new file mode 100644 index 000000000..8168b0650 --- /dev/null +++ b/rigs/motorola/micom.c @@ -0,0 +1,86 @@ +/* + * Hamlib Motorola Micom backend - main file + * Copyright (c) 2024 Michael Black W9MDB + * + * + * 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 + * + */ + +#include <hamlib/rig.h> +#include <misc.h> +#include <iofunc.h> + +static freq_t freqA = 14074000; + +static int micom_open(RIG *rig) +{ + ENTERFUNC; + RETURNFUNC(RIG_OK); +} + +static int micom_set_freq(RIG *rig, vfo_t vfo, freq_t freq) +{ + freqA = freq; + RETURNFUNC(RIG_OK); +} + +static int micom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) +{ + *freq = freqA; + RETURNFUNC(RIG_OK); +} + +static int micom_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) +{ + hamlib_port_t *rp = RIGPORT(rig); + unsigned char on[] = { 0x24, 0x02, 0x81, 0x13, 0x01, 0xBB, 0x03 }; + unsigned char off[] = { 0x24, 0x02, 0x81, 0x14, 0x01, 0xBC, 0x03 }; + + rig_flush(rp); + int retval = write_block(rp, ptt ? on : off, sizeof(on)); + + if (retval != RIG_OK) + { + set_transaction_inactive(rig); + RETURNFUNC(retval); + } + + return RIG_OK; +} + +struct rig_caps micom_caps = +{ + RIG_MODEL(RIG_MODEL_MICOM2), + .model_name = "Micom 2/3", + .mfg_name = "Motorola", + .version = "20240423.0", + .copyright = "LGPL", + .status = RIG_STATUS_ALPHA, + .rig_type = RIG_TYPE_OTHER, + .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, + .ptt_type = RIG_PTT_NONE, + .dcd_type = RIG_DCD_RIG, + .port_type = RIG_PORT_NONE, + .serial_rate_min = 9600, + .serial_rate_max = 9600, + .serial_data_bits = 8, + .serial_stop_bits = 2, + .serial_parity = RIG_PARITY_ODD, + .rig_open = micom_open, + .set_freq = micom_set_freq, + .get_freq = micom_get_freq, + .set_ptt = micom_set_ptt +}; commit e9a9424eedd44ed4f8b908dfb23e3e7899bf1eb5 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Apr 24 12:06:00 2024 -0500 Adding motorola rig diff --git a/configure.ac b/configure.ac index d07ec9b9a..cfcd2eb1f 100644 --- a/configure.ac +++ b/configure.ac @@ -66,7 +66,7 @@ dnl added to AC_CONFIG_FILES near the end of this file. See README.developer 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/codan 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 rigs/gomspace rigs/mds rigs/anytone" +RIG_BACKEND_LIST="rigs/adat rigs/alinco rigs/aor rigs/barrett rigs/codan 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 rigs/gomspace rigs/mds rigs/anytone rigs/motorola" ROT_BACKEND_LIST="rotators/amsat rotators/apex rotators/ars rotators/celestron rotators/cnctrk rotators/grbltrk rotators/easycomm rotators/ether6 rotators/flir rotators/fodtrack rotators/gs232a rotators/heathkit rotators/m2 rotators/meade rotators/rotorez rotators/sartek rotators/saebrtrack rotators/spid rotators/ts7400 rotators/prosistel rotators/ioptron rotators/satel rotators/radant" # Amplifiers are all in the amplifiers directory AMP_BACKEND_LIST="amplifiers/elecraft amplifiers/gemini amplifiers/expert" @@ -932,6 +932,7 @@ rigs/yaesu/Makefile rigs/gomspace/Makefile rigs/mds/Makefile rigs/anytone/Makefile +rigs/motorola/Makefile tests/Makefile scripts/Makefile android/Makefile diff --git a/include/hamlib/riglist.h b/include/hamlib/riglist.h index 4f09e4991..4059f9e14 100644 --- a/include/hamlib/riglist.h +++ b/include/hamlib/riglist.h @@ -672,6 +672,13 @@ #define RIG_BACKEND_ANYTONE "AnyTone" #define RIG_MODEL_ATD578UVIII RIG_MAKE_MODEL(RIG_ANYTONE, 1) +/* + * Motorola rigs + */ +#define RIG_MOTOROLA 38 +#define RIG_BACKEND_MOTOROLA "Motorola" +#define RIG_MODEL_MICOM2 RIG_MAKE_MODEL(RIG_MOTOROLA, 1) + //! @endcond diff --git a/src/register.c b/src/register.c index a47adf10d..157e99911 100644 --- a/src/register.c +++ b/src/register.c @@ -90,6 +90,7 @@ DEFINE_INITRIG_BACKEND(codan); DEFINE_INITRIG_BACKEND(gomspace); DEFINE_INITRIG_BACKEND(mds); DEFINE_INITRIG_BACKEND(anytone); +DEFINE_INITRIG_BACKEND(motorola); //! @endcond #ifdef HAVE_WINRADIO @@ -150,6 +151,7 @@ static struct { RIG_GOMSPACE, RIG_BACKEND_GOMSPACE, RIG_FUNCNAM(gomspace) }, { RIG_MDS, RIG_BACKEND_MDS, RIG_FUNCNAMA(mds) }, { RIG_ANYTONE, RIG_BACKEND_ANYTONE, RIG_FUNCNAMA(anytone) }, + { RIG_MOTOROLA, RIG_BACKEND_MOTOROLA, RIG_FUNCNAMA(motorola) }, { 0, NULL }, /* end */ }; commit 93bd44c3d56ac7d406ef0d90dc47ace1d813fec9 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Apr 23 11:19:24 2024 -0500 Update simts890.c diff --git a/simulators/simts890.c b/simulators/simts890.c index cd9f53643..22c44c891 100644 --- a/simulators/simts890.c +++ b/simulators/simts890.c @@ -28,7 +28,7 @@ int vfo, vfo_tx, ptt, ptt_data, ptt_mic, ptt_tune; int operatingband; int split; int modeMain = 2; -int modeSub = 2; +int modeSub = 1; int keyspd = 20; int sl=3, sh=3; int nr=0; @@ -163,7 +163,7 @@ int main(int argc, char *argv[]) if (getmyline(fd, buf) > 0) { - // printf("Cmd:\"%s\"\n", buf); +// printf("Cmd:\"%s\"\n", buf); } @@ -200,7 +200,7 @@ int main(int argc, char *argv[]) } else if (strcmp(buf, "NB1;") == 0) { - hl_usleep(mysleep * 100); + hl_usleep(mysleep * 20); sprintf(buf,"NB1%d;", nb1); write(fd, buf, strlen(buf)); } @@ -211,7 +211,7 @@ int main(int argc, char *argv[]) } else if (strcmp(buf, "NB2;") == 0) { - hl_usleep(mysleep * 100); + hl_usleep(mysleep * 20); sprintf(buf,"NB2%d;", nb2); write(fd, buf, strlen(buf)); } @@ -351,6 +351,7 @@ int main(int argc, char *argv[]) SNPRINTF(buf, sizeof(buf), SFformat, tmpvfo, tmpvfo == 0 ? freqa : freqb, tmpvfo == 0 ? modeA : modeB); + printf("SF buf=%s\n", buf); write(fd, buf, strlen(buf)); } else if (strncmp(buf, "SF", 2) == 0) @@ -455,6 +456,7 @@ int main(int argc, char *argv[]) } else if (strncmp(buf, "CB;", 3) == 0) { + printf("No CB command!\n"); sprintf(buf, "CB%d;", operatingband); write(fd, buf, strlen(buf)); } @@ -503,23 +505,27 @@ int main(int argc, char *argv[]) sprintf(buf, "RM2%04d;", 10); write(fd, buf, strlen(buf)); } - else if (strcmp(buf, "SL;") == 0) + else if (strcmp(buf, "SL0;") == 0) { sprintf(buf,"SL0%02d;", sl); + printf("R: %s\n", buf); write(fd, buf, strlen(buf)); } - else if (strcmp(buf, "SH;") == 0) + else if (strcmp(buf, "SH0;") == 0) { - sprintf(buf,"SH0%02d;", sh); + sprintf(buf,"SH0%03d;", sh); + printf("R: %s\n", buf); write(fd, buf, strlen(buf)); } - else if (strncmp(buf, "SL", 2) == 0) + else if (strncmp(buf, "SL0", 3) == 0) { - sscanf(&buf[3],"%d", &sl); + printf("Cmd: %s\n", buf); + sscanf(buf,"SL0%3d", &sl); } - else if (strncmp(buf, "SH", 2) == 0) + else if (strncmp(buf, "SH0", 3) == 0) { - sscanf(&buf[3],"%d", &sh); + printf("Cmd: %s\n", buf); + sscanf("SH0%3d","%d", &sh); } else if (strcmp(buf, "NR;") == 0) { commit b182ca2d51740d5dcaa126b52d4f208003b9cc86 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Apr 22 22:47:18 2024 -0500 Fix kachina set_ptt diff --git a/rigs/kachina/kachina.c b/rigs/kachina/kachina.c index ed4fa979a..71cb8655f 100644 --- a/rigs/kachina/kachina.c +++ b/rigs/kachina/kachina.c @@ -176,7 +176,7 @@ int kachina_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) { char c = ptt == 0 ? 0x00 : 0x01; - int retval = kachina_trans_n(rig, 'X', &c , 1); + int retval = kachina_trans_n(rig, 'x', &c , 1); return retval; } commit 6a98b0b9cb8128c09ecf4cf7374bbefd09170aaf Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Apr 22 17:48:59 2024 -0500 Rest of commit -- if setting FM width to other than 7000/10000/15000 cache will show requested width until next poll https://github.com/Hamlib/Hamlib/issues/1533 diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 5a4d58f60..d939de897 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -765,6 +765,17 @@ void icom2rig_mode(RIG *rig, unsigned char md, int pd, rmode_t *mode, pbwidth_t *width) { rig_debug(RIG_DEBUG_TRACE, "%s: mode=0x%02x, pd=%d\n", __func__, md, pd); + + // Some rigs return fixed with for FM mode + if ((RIG_IS_IC7300 || RIG_IS_IC9700) && (md == S_FM || md == S_WFM)) + { + *mode = RIG_MODE_FM; + if (*width == 1) *width = 15000; + else if (*width == 2) *width = 10000; + else *width = 7000; + return; + } + *width = RIG_PASSBAND_NORMAL; switch (md) diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 1ea70cae8..1c0ac833a 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -37,21 +37,21 @@ static int ic7300_set_parm(RIG *rig, setting_t parm, value_t val); static int ic7300_get_parm(RIG *rig, setting_t parm, value_t *val); int ic7300_set_clock(RIG *rig, int year, int month, int day, int hour, - int min, int sec, double msec, int utc_offset); + int min, int sec, double msec, int utc_offset); int ic7300_get_clock(RIG *rig, int *year, int *month, int *day, - int *hour, - int *min, int *sec, double *msec, int *utc_offset); + int *hour, + int *min, int *sec, double *msec, int *utc_offset); int ic9700_set_clock(RIG *rig, int year, int month, int day, int hour, - int min, int sec, double msec, int utc_offset); + int min, int sec, double msec, int utc_offset); int ic9700_get_clock(RIG *rig, int *year, int *month, int *day, - int *hour, - int *min, int *sec, double *msec, int *utc_offset); + int *hour, + int *min, int *sec, double *msec, int *utc_offset); int ic9700_set_vfo(RIG *rig, vfo_t vfo); #define IC7300_ALL_RX_MODES (RIG_MODE_FM|RIG_MODE_PKTFM|RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|RIG_MODE_PKTAM) -#define IC7300_1HZ_TS_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|RIG_MODE_PKTAM) +#define IC7300_1HZ_TS_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTAM) #define IC7300_NOT_TS_MODES (IC7300_ALL_RX_MODES &~IC7300_1HZ_TS_MODES) #define IC7300_OTHER_TX_MODES (RIG_MODE_FM|RIG_MODE_PKTFM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR) commit c70502ea34fd319f41d6f4d9c4ee22e30b3db846 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Apr 22 17:32:48 2024 -0500 Fix IC7300/9700 FM filter set -- now honors FM widths of 7000,10000, and 15000 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 7746f971d..17d774329 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2048,7 +2048,7 @@ pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode) RETURNFUNC2(RIG_OK); } -int icom_set_dsp_flt(RIG *rig, rmode_t mode, pbwidth_t width) +int icom_set_dsp_flt(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { int retval, rfstatus; unsigned char ackbuf[MAXFRAMELEN]; @@ -2113,13 +2113,6 @@ int icom_set_dsp_flt(RIG *rig, rmode_t mode, pbwidth_t width) flt_idx = width <= 500 ? ((width + 49) / 50) - 1 : ((width + 99) / 100) + 4; } - else if (mode & (RIG_MODE_FM | RIG_MODE_PKTFM)) - { - if (width <= 7000) width = 7000; - else if (width <= 10000) width = 10000; - else width=15000; - RETURNFUNC(RIG_OK); - } else { rig_debug(RIG_DEBUG_VERBOSE, "%s: unknown mode=%s\n", __func__, @@ -2249,7 +2242,7 @@ static int icom_set_mode_without_data(RIG *rig, vfo_t vfo, rmode_t mode, RETURNFUNC2(retval); } - icom_set_dsp_flt(rig, mode, width); + icom_set_dsp_flt(rig, vfo, mode, width); RETURNFUNC2(RIG_OK); } @@ -2316,6 +2309,12 @@ static int icom_set_mode_x26(RIG *rig, vfo_t vfo, rmode_t mode, // Skip filter selection, because at least IC-7300 has a bug defaulting to filter 2 when changing mode // Tested on IC-7300 and IC-9700 buf[2] = priv->filter; + if (mode == RIG_MODE_FM || mode == RIG_MODE_WFM) + { + // we use the passed in filter for FM mode widths + buf[2] = filter; + } + //rig_debug(RIG_DEBUG_TRACE, "%s: mode=%ld, filters usbd=%d, usb=%d, cw=%d\n", // __func__, mode, priv->filter_usbd, priv->filter_usb, priv->filter_cw); @@ -2474,7 +2473,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) retval = RIG_OK; } - if (retval == RIG_OK && mode != current_mode) + if (retval == RIG_OK && (mode != current_mode || width != RIG_PASSBAND_NOCHANGE)) { unsigned char datamode[2]; unsigned char mode_icom; // Not used, we only need the width @@ -2509,6 +2508,14 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (datamode[0] == 0) { datamode[1] = 0; } // the only good combo possible according to manual + // we need to let FM mode widths through here with datamode[1] set to FM width + if((RIG_IS_IC7300 || RIG_IS_IC9700) && (mode == RIG_MODE_FM || mode == RIG_MODE_WFM)) + { + if (width <= 7000) datamode[1] = 3; + else if (width <= 10000) datamode[1] = 2; + else datamode[1] = 1; + } + rig_debug(RIG_DEBUG_TRACE, "%s(%d) mode_icom=%d, datamode=%d, filter=%d\n", __func__, __LINE__, mode_icom, datamode[0], datamode[1]); @@ -2554,7 +2561,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (((width != RIG_PASSBAND_NOCHANGE) && (width != current_width)) || (priv->filter_usbd > 0 || priv->filter_usb > 0 || priv->filter_cw > 0 || priv->filter_fm > 0)) { - icom_set_dsp_flt(rig, mode, width); + icom_set_dsp_flt(rig, vfo, mode, width); } else { @@ -2606,7 +2613,7 @@ static int icom_get_mode_without_data(RIG *rig, vfo_t vfo, rmode_t *mode, // 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]; + *width = 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; @@ -2660,9 +2667,15 @@ static int icom_get_mode_without_data(RIG *rig, vfo_t vfo, rmode_t *mode, } else { + // we use width to pass in FM width for some rigs to i2r_mode icom2rig_mode(rig, modebuf[1], mode_len == 2 ? modebuf[2] : -1, mode, width); } + if ((RIG_IS_IC7300 || RIG_IS_IC9700) && (*mode == RIG_MODE_FM || *mode == RIG_MODE_PKTFM)) + { + // we already have width from icom2rig_mode + RETURNFUNC2(RIG_OK); + } // The following rigs do not support querying filter width if ((RIG_IS_IC910) || @@ -2690,7 +2703,8 @@ static int icom_get_mode_without_data(RIG *rig, vfo_t vfo, rmode_t *mode, if (vfo == rig->state.current_vfo) { - filter_width = icom_get_dsp_flt(rig, *mode); + if (!((RIG_IS_IC7300 || RIG_IS_IC9700) && (*mode == RIG_MODE_FM || *mode == RIG_MODE_PKTFM))) // can't do this in FM mode + filter_width = icom_get_dsp_flt(rig, *mode); } else { @@ -2705,10 +2719,10 @@ static int icom_get_mode_without_data(RIG *rig, vfo_t vfo, rmode_t *mode, *width = filter_width; - if (*mode == RIG_MODE_FM) + if (*mode == RIG_MODE_FM || *mode == RIG_MODE_PKTFM) { *width = 12000; // some default to 12000 - if (RIG_IS_IC7300) + if (RIG_IS_IC7300 || RIG_IS_IC9700) { if (priv_data->filter == 1) *width = 15000; else if (priv_data->filter == 2) *width = 10000; diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 7b26379cc..8d17cfb34 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20240415" +#define BACKEND_VER "20240422" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit f8a67d716e54ed9ea816920f25fefbea3594571f Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Apr 22 11:27:29 2024 -0500 Some progress getting SB4100 to work https://github.com/Hamlib/Hamlib/issues/1541 diff --git a/rigs/barrett/4100.c b/rigs/barrett/4100.c index 1724ec7ac..8b8d1db04 100644 --- a/rigs/barrett/4100.c +++ b/rigs/barrett/4100.c @@ -47,12 +47,12 @@ extern int barret950_get_freq(RIG *rig, vfo_t vfo, freq_t freq); */ static const char *barrett4100_get_info(RIG *rig) { - char *response = NULL; + static char *response; int retval; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - retval = barrett_transaction(rig, "M:MIB GM", 0, &response); + retval = barrett_transaction2(rig, "M:MIB GM", 64, &response); if (retval == RIG_OK) { @@ -64,7 +64,7 @@ static const char *barrett4100_get_info(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "MIB GM: %s\n", response); } - retval = barrett_transaction(rig, "M:FF GM", 0, &response); + retval = barrett_transaction2(rig, "M:FF GM", 0, &response); if (retval == RIG_OK) { @@ -73,10 +73,10 @@ static const char *barrett4100_get_info(RIG *rig) } else { - rig_debug(RIG_DEBUG_VERBOSE, "FF GM: %s\n", response); + rig_debug(RIG_DEBUG_VERBOSE, "M:MIB GM: %s\n", response); } - retval = barrett_transaction(rig, "M:FF BWA", 0, &response); + retval = barrett_transaction2(rig, "M:FF BWA", 0, &response); if (retval == RIG_OK) { @@ -88,7 +88,7 @@ static const char *barrett4100_get_info(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "FF BWA: %s\n", response); } - retval = barrett_transaction(rig, "M:FF GRFA", 0, &response); + retval = barrett_transaction2(rig, "M:FF GRFA", 0, &response); if (retval == RIG_OK) { @@ -108,22 +108,24 @@ static int barrett4100_open(RIG *rig) int retval; char *response; ENTERFUNC; - retval = barrett_transaction2(rig, "M:REMOTE SENTER2,1", 0, &response); + retval = barrett_transaction2(rig, "M:REMOTE SENTER2,1", 3, &response); - if (retval != RIG_OK || response[0] != 's') + rig_debug(RIG_DEBUG_ERR, "%s: back from REMOTE SENTER2: got %d\n", __func__, retval); + if (response[0] != 's') { rig_debug(RIG_DEBUG_ERR, "%s: REMOTE SENTER2 error: got %s\n", __func__, response); } - barrett4100_get_info(rig); + //barrett4100_get_info(rig); + rig_debug(RIG_DEBUG_VERBOSE, "%s: success, ret=%d\n", __func__, retval); RETURNFUNC(RIG_OK); } static int barrett4100_close(RIG *rig) { char *response; - int retval = barrett_transaction2(rig, "M:REMOTE SENTER0", 0, &response); + int retval = barrett_transaction2(rig, "M:REMOTE SENTER0", 18, &response); if (retval != RIG_OK) { @@ -231,6 +233,7 @@ int barrett4100_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) rig_debug(RIG_DEBUG_VERBOSE, "%s(%d); response=%s\n", __func__, __LINE__, response); + return retval; } @@ -238,7 +241,7 @@ struct rig_caps barrett4100_caps = { RIG_MODEL(RIG_MODEL_BARRETT_4100), .model_name = "4100", - .mfg_name = "Barrett", + .mfg_name = "Rhode&Schwarz", .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_BETA, diff --git a/rigs/barrett/barrett.c b/rigs/barrett/barrett.c index 0dad6cd72..da5cd9074 100644 --- a/rigs/barrett/barrett.c +++ b/rigs/barrett/barrett.c @@ -53,6 +53,15 @@ DECLARE_INITRIG_BACKEND(barrett) return RIG_OK; } +void barrett_flush(RIG *rig) +{ + hamlib_port_t *rp = RIGPORT(rig); + int timesave = rig->state.timeout; + rig->state.timeout = 0; + rig_flush(rp); + rig->state.timeout = timesave; +} + // this version is for 4100 int barrett_transaction2(RIG *rig, char *cmd, int expected, char **result) @@ -60,8 +69,16 @@ int barrett_transaction2(RIG *rig, char *cmd, int expected, char **result) char cmd_buf[MAXCMDLEN]; struct barrett_priv_data *priv = STATE(rig)->priv; int retval; + hamlib_port_t *rp = RIGPORT(rig); SNPRINTF(cmd_buf, sizeof(cmd_buf), "%c%s%s", 0x0a, cmd, EOM); + barrett_flush(rig); + retval = write_block(rp, (unsigned char *) cmd_buf, strlen(cmd_buf)); + if (retval < 0) + { + rig_debug(RIG_DEBUG_ERR, "%s(%d): error in write_block\n", __func__, __LINE__); + return retval; + } retval = read_block(RIGPORT(rig), (unsigned char *) priv->ret_data, expected); if (retval < 0) @@ -69,6 +86,15 @@ int barrett_transaction2(RIG *rig, char *cmd, int expected, char **result) rig_debug(RIG_DEBUG_ERR, "%s(%d): error in read_block\n", __func__, __LINE__); return retval; } + rig_debug(RIG_DEBUG_VERBOSE, "%s(%d): %d bytes read\n", __func__, __LINE__, retval); + if (priv->ret_data[0] == 0x13) // we'll return from the 1st good char + { + *result = &(priv->ret_data[1]); + } + else // some commands like IAL don't give XOFF but XON is there -- is this a bug? + { + *result = &(priv->ret_data[0]); + } return retval; } @@ -92,7 +118,7 @@ int barrett_transaction(RIG *rig, char *cmd, int expected, char **result) SNPRINTF(cmd_buf, sizeof(cmd_buf), "%s%s", cmd, EOM); } - rig_flush(rp); + barrett_flush(rig); retval = write_block(rp, (unsigned char *) cmd_buf, strlen(cmd_buf)); if (retval < 0) @@ -715,7 +741,7 @@ int barrett_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) default: return -RIG_ENIMPL; } - rig_flush(rp); + barrett_flush(rig); retval = write_block(rp, (unsigned char *) cmd_buf, strlen(cmd_buf)); if (retval < 0) diff --git a/rigs/barrett/barrett.h b/rigs/barrett/barrett.h index f778acc5a..0a82bbd3d 100644 --- a/rigs/barrett/barrett.h +++ b/rigs/barrett/barrett.h @@ -24,7 +24,7 @@ #include "hamlib/rig.h" -#define BACKEND_VER "20220113" +#define BACKEND_VER "20240422" #define EOM "\x0d" #define TRUE 1 commit 2b275531559f2158a2aaf5e7534b352dac708ec8 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Apr 22 11:26:57 2024 -0500 Make rig_flush_force in rig.c timeout immediately https://github.com/Hamlib/Hamlib/issues/1541 diff --git a/src/rig.c b/src/rig.c index e19f0cfee..cdb3d8e88 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1569,7 +1569,10 @@ int HAMLIB_API rig_open(RIG *rig) memcpy(&rs->rigport_deprecated, rp, sizeof(hamlib_port_t_deprecated)); memcpy(&rs->pttport_deprecated, pttp, sizeof(hamlib_port_t_deprecated)); memcpy(&rs->dcdport_deprecated, dcdp, sizeof(hamlib_port_t_deprecated)); + int timesave = rig->state.timeout; + rig->state.timeout = 0; rig_flush_force(rp, 1); + rig->state.timeout = timesave; #if defined(HAVE_PTHREAD) enum multicast_item_e items = RIG_MULTICAST_POLL | RIG_MULTICAST_TRANSCEIVE commit 08aac883775c8cd89d682682f2e3b49d796e2a35 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Apr 20 15:09:09 2024 -0500 Add set_ptt for kachina 505dsp diff --git a/rigs/kachina/505dsp.c b/rigs/kachina/505dsp.c index 0640f5e7a..73a209189 100644 --- a/rigs/kachina/505dsp.c +++ b/rigs/kachina/505dsp.c @@ -62,7 +62,7 @@ struct rig_caps k505dsp_caps = .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_COMPUTER, - .ptt_type = RIG_PTT_NONE, + .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, .port_type = RIG_PORT_SERIAL, .serial_rate_min = 9600, @@ -151,6 +151,7 @@ struct rig_caps k505dsp_caps = .set_freq = kachina_set_freq, .set_mode = kachina_set_mode, + .set_ptt = kachina_set_ptt, .get_level = kachina_get_level, .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS diff --git a/rigs/kachina/kachina.c b/rigs/kachina/kachina.c index 4ce343918..ed4fa979a 100644 --- a/rigs/kachina/kachina.c +++ b/rigs/kachina/kachina.c @@ -169,12 +169,16 @@ int kachina_set_freq(RIG *rig, vfo_t vfo, freq_t freq) /* transmit frequency */ retval = kachina_trans_n(rig, 'T', (char *) freqbuf, 4); - if (retval != RIG_OK) - { - return retval; - } + return retval; +} - return RIG_OK; +int kachina_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) +{ + char c = ptt == 0 ? 0x00 : 0x01; + + int retval = kachina_trans_n(rig, 'X', &c , 1); + + return retval; } /* diff --git a/rigs/kachina/kachina.h b/rigs/kachina/kachina.h index 4fafe56a1..cce933baf 100644 --- a/rigs/kachina/kachina.h +++ b/rigs/kachina/kachina.h @@ -24,10 +24,11 @@ #include <hamlib/rig.h> -#define BACKEND_VER "20061007" +#define BACKEND_VER "20240420" int kachina_set_freq(RIG *rig, vfo_t vfo, freq_t freq); int kachina_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); +int kachina_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt); int kachina_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); extern struct rig_caps k505dsp_caps; commit c31497918f8511ad01e1dd749e7df94a00332db2 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Apr 19 16:42:10 2024 -0500 Add VFO Ops to rigmatrix.c and colorize things a bit diff --git a/tests/rigmatrix.c b/tests/rigmatrix.c index fab0dc011..72e8e182f 100644 --- a/tests/rigmatrix.c +++ b/tests/rigmatrix.c @@ -32,7 +32,7 @@ #include <hamlib/rig.h> #include "misc.h" -static setting_t bitmap_func, bitmap_level, bitmap_parm; +static setting_t bitmap_func, bitmap_level, bitmap_parm, bitmap_vfo_ops; int create_png_range(const freq_range_t rx_range_list[], const freq_range_t tx_range_list[], int num); @@ -99,10 +99,11 @@ int print_caps_sum(struct rig_caps *caps, void *data) "<TD><A HREF=\"#setlevel%u\">levels</A></TD>" "<TD><A HREF=\"#getparm%u\">parms</A></TD>" "<TD><A HREF=\"#setparm%u\">parms</A></TD>" + "<TD><A HREF=\"#op%u\">ops</A></TD>" "</TR>\n", caps->rig_model, caps->rig_model, caps->rig_model, caps->rig_model, caps->rig_model, caps->rig_model, - caps->rig_model, caps->rig_model, caps->rig_model); + caps->rig_model, caps->rig_model, caps->rig_model, caps->rig_model); return 1; /* !=0, we want them all ! */ } @@ -215,7 +216,7 @@ int print_caps_parameters(struct rig_caps *caps, void *data) } /* used by print_caps_caps and print_caps_level */ -#define print_yn(fn) printf("<TD>%c</TD>", (fn) ? 'Y':'N') +#define print_yn(fn) printf("<TD>%s</TD>", (fn) ? "<font color=\"00AA00\"><strong>Y</strong><font>":"<font color=\"#CCCCCC\">N<font>") /* * backend functions defined @@ -303,6 +304,43 @@ int print_caps_parm(struct rig_caps *caps, void *data) return 1; } +/* + * VFO Ops capabilities + */ +int print_caps_vfo_ops(struct rig_caps *caps, void *data) +{ + setting_t vfo_ops; + int i; + + if (!data) + { + return 0; + } + + // Only set for these + vfo_ops = (*(int *)data) ? caps->vfo_ops : caps->vfo_ops; + + printf("<A NAME=\"%s%u\"><TR><TD>%s</TD>", + (*(int *)data) ? "op" : "op", + caps->rig_model, + caps->model_name); + + /* + * bitmap_vfo_ops: only those who have a label + */ + for (i = 0; i < RIG_SETTING_MAX; i++) + { + if (rig_idx2setting(i) & bitmap_vfo_ops) + { + print_yn(vfo_ops & rig_idx2setting(i)); + } + } + + printf("</TR></A>\n"); + + return 1; +} + /* * Get/Set level abilities @@ -647,6 +685,7 @@ int main(int argc, char *argv[]) "<TD>Set level</TD>" "<TD>Get parm</TD>" "<TD>Set parm</TD>" + "<TD>VFO Ops</TD>" "</TR>\n"); rig_list_foreach(print_caps_sum, NULL); printf("</TABLE>\n"); @@ -821,6 +860,40 @@ int main(int argc, char *argv[]) printf("<P>"); + bitmap_vfo_ops = 0; + prntbuf[0] = '\0'; + pbuf = prntbuf; + + for (i = 0; i < RIG_SETTING_MAX; i++) + { + setting_t op = rig_idx2setting(i); + const char *s = rig_strvfop(op); + + if (!s) + { + continue; + } + + bitmap_vfo_ops |= op; + nbytes = strlen("<TD></TD>") + strlen(s) + 1; + nbytes_total += nbytes; + pbuf += snprintf(pbuf, sizeof(pbuf) - nbytes_total, "<TD>%s</TD>", s); + + if (strlen(pbuf) > sizeof(pbuf) + nbytes) + { + printf("Buffer overflow in %s\n", __func__); + } + } + + printf("VFO Ops"); + printf("<TABLE BORDER=1>\n"); + printf("<TR><TD>Model</TD>%s</TR>\n", prntbuf); + set_or_get = 0; + rig_list_foreach(print_caps_vfo_ops, &set_or_get); + printf("</TABLE>\n"); + + printf("<P>"); + time(&gentime); printf("Rigmatrix generated %s\n", ctime(&gentime)); commit d9b57bc7a8a5cf0f93c6792a58f7db1273992199 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Apr 19 16:41:37 2024 -0500 Align dummy rigs diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index 239a8a3d6..9f8da3406 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -2564,7 +2564,6 @@ struct rig_caps dummy_caps = .get_info = dummy_get_info, - .set_ptt = dummy_set_ptt, .get_ptt = dummy_get_ptt, .get_dcd = dummy_get_dcd, @@ -2620,12 +2619,12 @@ struct rig_caps dummy_no_vfo_caps = RIG_MODEL(RIG_MODEL_DUMMY_NOVFO), .model_name = "Dummy No VFO", .mfg_name = "Hamlib", - .version = "20220510.0", + .version = "20240409.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, - .targetable_vfo = RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, - .ptt_type = RIG_PTT_RIG, + .targetable_vfo = RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_SPECTRUM, + .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_RIG, .port_type = RIG_PORT_NONE, .has_get_func = DUMMY_FUNC, @@ -2734,7 +2733,6 @@ struct rig_caps dummy_no_vfo_caps = .get_info = dummy_get_info, - .set_ptt = dummy_set_ptt, .get_ptt = dummy_get_ptt, .get_dcd = dummy_get_dcd, commit 90545a192e94ebb01021c05273f5c3d8e196c2be Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Apr 19 10:34:20 2024 -0500 Hopefully fix Barrett 4100 protocol diff --git a/rigs/barrett/4100.c b/rigs/barrett/4100.c index e1a2bc77e..1724ec7ac 100644 --- a/rigs/barrett/4100.c +++ b/rigs/barrett/4100.c @@ -108,7 +108,7 @@ static int barrett4100_open(RIG *rig) int retval; char *response; ENTERFUNC; - retval = barrett_transaction2(rig, "M:REMOTE SENTER2", 0, &response); + retval = barrett_transaction2(rig, "M:REMOTE SENTER2,1", 0, &response); if (retval != RIG_OK || response[0] != 's') { @@ -193,7 +193,13 @@ int barrett4100_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) } else { - sscanf(response, "gRFA1,%*d,%lf,%*d", freq); + int n = sscanf(response, "gRF%lf", freq); + //int n = sscanf(response, "gRFA1,%*d,%lf,%*d", freq); + if (n != 1) + { + rig_debug(RIG_DEBUG_ERR, "%s(%d): unable to parse freq from '%s'\n", __func__, __LINE__, response); + return -RIG_EPROTO; + } } return retval; @@ -233,7 +239,7 @@ struct rig_caps barrett4100_caps = RIG_MODEL(RIG_MODEL_BARRETT_4100), .model_name = "4100", .mfg_name = "Barrett", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, commit dce80d264a5cd093707c0e6720e18dff77f68665 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Apr 18 11:28:38 2024 -0500 Update FLRig version diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 5fd955baf..f18101ca7 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -143,7 +143,7 @@ struct rig_caps flrig_caps = RIG_MODEL(RIG_MODEL_FLRIG), .model_name = "", .mfg_name = "FLRig", - .version = "20240325.0", + .version = "20240418.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 4c111da0d1b7206050ca719a9ff3c97e84aaa260 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Apr 18 11:22:41 2024 -0500 Add small delay when setting VFO in FLRig to allow GUI to catch up diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index bd247191e..5fd955baf 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -1305,6 +1305,8 @@ static int flrig_set_freq(RIG *rig, vfo_t vfo, freq_t freq) retval = flrig_transaction(rig, cmd, cmd_arg, NULL, 0); + hl_usleep(100*1000); // FLRig needs a moment to update the active VFO + if (retval != RIG_OK) { RETURNFUNC2(retval); commit d9b589d25499ca823777130a854768b4533cc0a6 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Apr 18 11:22:25 2024 -0500 Fix unflushed data in get_lock diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 1a682a66d..86544598b 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -2790,6 +2790,8 @@ int netrigctl_get_lock_mode(RIG *rig, int *lock) char cmdbuf[256]; char buf[BUF_MAX]; int ret; + hamlib_port_t *rp = RIGPORT(rig); + SNPRINTF(cmdbuf, sizeof(cmdbuf), "\\get_lock_mode\n"); ret = netrigctl_transaction(rig, cmdbuf, strlen(cmdbuf), buf); @@ -2799,6 +2801,7 @@ int netrigctl_get_lock_mode(RIG *rig, int *lock) } sscanf(buf, "%d", lock); + ret = read_string(rp, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1); return (RIG_OK); } @@ -2819,7 +2822,7 @@ struct rig_caps netrigctl_caps = RIG_MODEL(RIG_MODEL_NETRIGCTL), .model_name = "NET rigctl", .mfg_name = "Hamlib", - .version = "20240304.0", + .version = "20240418.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, commit 95b0af114f10defbcfbb4f1b1d9b97c7f99ee5b8 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Apr 15 14:49:49 2024 -0500 Fix rigmatrix.c with new non-const rig_caps diff --git a/tests/rigmatrix.c b/tests/rigmatrix.c index d1dbdab83..fab0dc011 100644 --- a/tests/rigmatrix.c +++ b/tests/rigmatrix.c @@ -37,7 +37,7 @@ static setting_t bitmap_func, bitmap_level, bitmap_parm; int create_png_range(const freq_range_t rx_range_list[], const freq_range_t tx_range_list[], int num); -int print_caps_sum(const struct rig_caps *caps, void *data) +int print_caps_sum(struct rig_caps *caps, void *data) { printf("<TR><TD><A HREF=\"support/model%u.txt\">%s</A></TD><TD>%s</TD>" @@ -111,7 +111,7 @@ int print_caps_sum(const struct rig_caps *caps, void *data) /* * IO params et al. */ -int print_caps_parameters(const struct rig_caps *caps, void *data) +int print_caps_parameters(struct rig_caps *caps, void *data) { printf("<A NAME=\"parms%u\"><TR><TD>%s</TD><TD>", caps->rig_model, @@ -222,7 +222,7 @@ int print_caps_parameters(const struct rig_caps *caps, void *data) * * TODO: add new API calls! */ -int print_caps_caps(const struct rig_caps *caps, void *data) +int print_caps_caps(struct rig_caps *caps, void *data) { printf("<A NAME=\"caps%u\"><TR><TD>%s</TD>", caps->rig_model, @@ -270,7 +270,7 @@ int print_caps_caps(const struct rig_caps *caps, void *data) /* * Get/Set parm abilities */ -int print_caps_parm(const struct rig_caps *caps, void *data) +int print_caps_parm(struct rig_caps *caps, void *data) { setting_t parm; int i; @@ -307,7 +307,7 @@ int print_caps_parm(const struct rig_caps *caps, void *data) /* * Get/Set level abilities */ -int print_caps_level(const struct rig_caps *caps, void *data) +int print_caps_level(struct rig_caps *caps, void *data) { setting_t level; int i; @@ -344,7 +344,7 @@ int print_caps_level(const struct rig_caps *caps, void *data) /* * Get/Set func abilities */ -int print_caps_func(const struct rig_caps *caps, void *data) +int print_caps_func(struct rig_caps *caps, void *data) { setting_t func; int i; @@ -383,7 +383,7 @@ int print_caps_func(const struct rig_caps *caps, void *data) * * FIXME: default output pics is for region2: add region 1 too! */ -int print_caps_range(const struct rig_caps *caps, void *data) +int print_caps_range(struct rig_caps *caps, void *data) { create_png_range(caps->rx_range_list2, caps->tx_range_list2, caps->rig_model); commit 9e42ca2052d6b3ade2d30400b952ed8c34147aa7 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Apr 15 08:13:55 2024 -0500 Add IC756 IC756PROII and IC756PROIII to execeptions on get/set_mode diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index a59d456cd..7746f971d 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2223,6 +2223,9 @@ static int icom_set_mode_without_data(RIG *rig, vfo_t vfo, rmode_t mode, || RIG_IS_IC375 || RIG_IS_IC726 || RIG_IS_IC475 + || RIG_IS_IC756 + || RIG_IS_IC756PROII + || RIG_IS_IC756PROIII || RIG_IS_IC910 || RIG_IS_IC7000) { @@ -2668,6 +2671,8 @@ static int icom_get_mode_without_data(RIG *rig, vfo_t vfo, rmode_t *mode, (RIG_IS_IC706MKII) || (RIG_IS_IC706MKIIG) || (RIG_IS_IC756) || + (RIG_IS_IC756PROII) || + (RIG_IS_IC756PROIII) || (RIG_IS_ICR30)) { RETURNFUNC2(RIG_OK); diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 3c5d5e81a..7b26379cc 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -35,7 +35,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20240303" +#define BACKEND_VER "20240415" #define ICOM_IS_ID31 rig_is_model(rig, RIG_MODEL_ID31) #define ICOM_IS_ID51 rig_is_model(rig, RIG_MODEL_ID51) commit 331143fa173eb7bd1bd44aae60544155fcd97a1f Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Apr 13 22:50:38 2024 -0500 Change TS890 to use SF command for mode get/set diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index b3cff5e6c..64c80e267 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2443,7 +2443,47 @@ int kenwood_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) rig_debug(RIG_DEBUG_VERBOSE, "%s: kmode=%d, cmode=%c, datamode=%c\n", __func__, kmode, c, data_mode); - if (RIG_IS_TS990S || RIG_IS_TS890S) + if (RIG_IS_TS890S) + { + char sf[20]; + // TS890 has SF command -- unique so far + if (vfo == RIG_VFO_A) + { + err = kenwood_transaction(rig, "SF0;", sf, sizeof(sf)); + if (err != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: SF0; failed: %s\n", __func__, rigerror(err)); + return err; + } + sf[14] = c; + err = kenwood_transaction(rig, sf, NULL, 0); + if (err != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: %s failed: %s\n", __func__, sf, rigerror(err)); + return err; + } + return RIG_OK; + } + else + { + err = kenwood_transaction(rig, "SF1;", sf, sizeof(sf)); + if (err != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: SF0; failed: %s\n", __func__, rigerror(err)); + return err; + } + sf[14] = c; + err = kenwood_transaction(rig, sf, NULL, 0); + if (err != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: %s failed: %s\n", __func__, sf, rigerror(err)); + return err; + } + return RIG_OK; + } + + } + else if (RIG_IS_TS990S) { /* The TS990s has targetable read mode but can only set the mode of the current VFO :( So we need to toggle the operating VFO @@ -2711,9 +2751,10 @@ static int kenwood_get_filter_width(RIG *rig, rmode_t mode, pbwidth_t *width) */ int kenwood_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) { - char cmd[4]; - char modebuf[10]; + char cmd[5]; + char modebuf[20]; int offs; + int len = 6; int retval; int kmode; @@ -2736,8 +2777,22 @@ int kenwood_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) STATE(rig)->current_vfo = RIG_VFO_A; RETURNFUNC2(RIG_OK); } - - if (RIG_IS_TS990S || RIG_IS_TS890S) + if (RIG_IS_TS890S) + { + len = 16; + // TS890 has SF command -- unique so far + if (vfo == RIG_VFO_A) + { + strcpy(cmd,"SF0;"); + offs = 14; + } + else + { + strcpy(cmd,"SF1;"); + offs = 14; + } + } + else if (RIG_IS_TS990S) { char c; @@ -2780,7 +2835,7 @@ int kenwood_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) } } - retval = kenwood_safe_transaction(rig, cmd, modebuf, 6, offs + 1); + retval = kenwood_safe_transaction(rig, cmd, modebuf, len, offs + 1); if (retval != RIG_OK) { commit a6ad5f0928b23a0717426e708dd4d1fe3b8a9592 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Apr 13 15:23:53 2024 -0500 Fix TS890 set_vfo in set_mode diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 619fa1709..b3cff5e6c 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2472,7 +2472,7 @@ int kenwood_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) } else // RIG_IS_TS890 { - err = kenwood_set_vfo(rig, curr_vfo); + err = kenwood_set_vfo(rig, vfo); } if (err != RIG_OK) { RETURNFUNC2(err); } commit b42aa75dd8251721345e89926e0bd4140fa2accb Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Apr 13 07:36:02 2024 -0500 astyle kenwood.c diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 1127cd4dd..619fa1709 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -194,12 +194,12 @@ tone_t kenwood42_ctcss_list[] = */ tone_t kenwood51_ctcss_list[] = { - 670 , 693, 719, 744, 770, 797, 825, 854, 885, 915, /* 0- 9 */ - 948 , 974, 1000, 1035, 1072, 1109, 1148, 1188, 1230, 1273, /* 10-19 */ - 1318, 1365, 1413, 1462, 1514, 1567, 1598, 1622, 1655, 1679, /* 20-29 */ - 1713, 1738, 1773, 1799, 1835, 1862, 1899, 1928, 1966, 1995, /* 30-39 */ - 2035, 2065, 2107, 2181, 2257, 2291, 2336, 2418, 2503, 2541, /* 40-49 */ - 17500, 0 /* 50-99 */ + 670, 693, 719, 744, 770, 797, 825, 854, 885, 915, /* 0- 9 */ + 948, 974, 1000, 1035, 1072, 1109, 1148, 1188, 1230, 1273, /* 10-19 */ + 1318, 1365, 1413, 1462, 1514, 1567, 1598, 1622, 1655, 1679, /* 20-29 */ + 1713, 1738, 1773, 1799, 1835, 1862, 1899, 1928, 1966, 1995, /* 30-39 */ + 2035, 2065, 2107, 2181, 2257, 2291, 2336, 2418, 2503, 2541, /* 40-49 */ + 17500, 0 /* 50-99 */ }; /* Token definitions for .cfgparams in rig_caps @@ -1745,13 +1745,13 @@ int kenwood_get_split_vfo_if(RIG *rig, vfo_t rxvfo, split_t *split, { HAMLIB_TRACE; *txvfo = rs->tx_vfo = priv->tx_vfo = (*split - && !transmitting) ? RIG_VFO_B : RIG_VFO_A; + && !transmitting) ? RIG_VFO_B : RIG_VFO_A; } else if (rs->rx_vfo == RIG_VFO_B) { HAMLIB_TRACE; *txvfo = rs->tx_vfo = priv->tx_vfo = (*split - && !transmitting) ? RIG_VFO_B : RIG_VFO_A; + && !transmitting) ? RIG_VFO_B : RIG_VFO_A; } else { @@ -1841,7 +1841,7 @@ int kenwood_get_vfo_if(RIG *rig, vfo_t *vfo) { case '0': *vfo = rs->rx_vfo = rs->tx_vfo = priv->tx_vfo = - split_and_transmitting ? RIG_VFO_B : RIG_VFO_A; + split_and_transmitting ? RIG_VFO_B : RIG_VFO_A; if (priv->info[32] == '1') { priv->tx_vfo = rs->tx_vfo = RIG_VFO_B; } @@ -2417,8 +2417,9 @@ int kenwood_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (RIG_IS_TS990S) { - if (mode == RIG_MODE_PKTUSB) mode = RIG_MODE_USBD1; - if (mode == RIG_MODE_PKTLSB) mode = RIG_MODE_LSBD1; + if (mode == RIG_MODE_PKTUSB) { mode = RIG_MODE_USBD1; } + + if (mode == RIG_MODE_PKTLSB) { mode = RIG_MODE_LSBD1; } } kmode = rmode2kenwood(mode, caps->mode_table); @@ -2451,19 +2452,28 @@ int kenwood_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) RIG_TARGETABLE_MODE since the toggle is not required for reading the mode. */ vfo_t curr_vfo; - if (RIG_IS_TS990S) + + if (RIG_IS_TS990S) + { err = kenwood_get_vfo_main_sub(rig, &curr_vfo); - else // RIG_IS_TS890 + } + else // RIG_IS_TS890... [truncated message content] |
From: n0nb <n0...@us...> - 2024-04-01 19:36: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 41de3425d24edcbd448e0231692eeacc58909521 (commit) via a4cd6deb9ddcbbf3f259a52937c0b2e1d094009a (commit) via de719760445da30809786a6e7f096d29594ba805 (commit) via 59fca440a537e5b858e92e67e5b8c6fd8e240aef (commit) via 7b8f263b213da1649750fc4b38324096f769766f (commit) via 0353fdcae07f9c5d4eb87f700da86d6042c019de (commit) via e2b5a3bcb5170662460180742c329c13fdd994f7 (commit) via 00dbd6a6df87733cbea105bf3d924ebe32ecebd2 (commit) via ce4e9bfdf06ae67da2fbb7fcee285e742e6d9c5c (commit) via 9f997d799d7c132b5d7c0d18f85785bad5141595 (commit) via 55d5f8b64a259664374778f2f1e7ef6eb24def8d (commit) via 0a0118b7977974d6fc5bdf951b0a216e4987540b (commit) via 295ad7475762ab2a4b0d8eb0923e3e255ae84500 (commit) via 2d0b8b807d220c10e49ba9c0f94b408ac3fd9d68 (commit) via 4b436479d1667f1ee3f9f50db07a2a3fc9bdb7e4 (commit) via 406b947134502996a1eca14a98b53716b86b5cec (commit) via 53b01d829ed7ebaf1742353117db1646051a9330 (commit) via 896230beeda0bbda4f551a754d47dcd0e7683f80 (commit) via 8ebffd20b6afab1977729735947dcd1c6d40dfa6 (commit) from dc375c6d005c1c143a7088e5792d10d6638e29f0 (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 41de3425d24edcbd448e0231692eeacc58909521 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Mar 31 12:22:02 2024 -0500 Fix hamlib_version in netrigctl_open and blank agc_levels from FLRig diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 207ca9083..1a682a66d 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -889,6 +889,11 @@ static int netrigctl_open(RIG *rig) p = strtok(NULL, ";"); } } + else if (strcmp(setting, "hamlib_version") == 0) + { + printf("rigctld: %s\n", value); + } + else { diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 02ee83d7c..aa4c7de98 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -4705,7 +4705,7 @@ declare_proto_rig(dump_state) fprintf(fout, "rig_model=%d\n", rig->caps->rig_model); fprintf(fout, "rigctld_version=%s\n", hamlib_version2); rig_sprintf_agc_levels(rig, buf, sizeof(buf)); - fprintf(fout, "agc_levels=%s\n", buf); + if (strlen(buf) > 0) fprintf(fout, "agc_levels=%s\n", buf); if (rig->caps->ctcss_list) { commit a4cd6deb9ddcbbf3f259a52937c0b2e1d094009a Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Mar 31 12:21:55 2024 -0500 Update simic7000.c diff --git a/simulators/simic7000.c b/simulators/simic7000.c index 6f4b3ccc0..61808432e 100644 --- a/simulators/simic7000.c +++ b/simulators/simic7000.c @@ -132,6 +132,8 @@ void frameParse(int fd, unsigned char *frame, int len) { case 0x03: + if (frame[5] != 0xfd) + { //from_bcd(frameackbuf[2], (civ_731_mode ? 4 : 5) * 2); if (current_vfo == RIG_VFO_A || current_vfo == RIG_VFO_MAIN) { @@ -149,6 +151,18 @@ void frameParse(int fd, unsigned char *frame, int len) if (powerstat) { n = write(fd, frame, 11); + dump_hex(frame, 11); + } + else + { + if (current_vfo==RIG_VFO_A) + freqA = from_bcd(&frame[5], (civ_731_mode ? 4 : 5) * 2); + else + freqB = from_bcd(&frame[5], (civ_731_mode ? 4 : 5) * 2); + frame[4] = 0xfb; + frame[5] = 0xfd; + n = write(fd, frame, 6); + } } break; @@ -410,8 +424,8 @@ void frameParse(int fd, unsigned char *frame, int len) { printf("0x05 0x00 0x92 received\n"); transceive = frame[8]; - frame[6] = 0xfb; - frame[7] = 0xfd; + frame[4] = 0xfb; + frame[5] = 0xfd; n = write(fd, frame, 8); } else commit de719760445da30809786a6e7f096d29594ba805 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Mar 30 23:40:59 2024 -0500 Fix CPU usage with rigctlcom in sleep.c Hopefully doesn't affect other things too much diff --git a/src/sleep.c b/src/sleep.c index b3d2d34a2..bf1dc5454 100644 --- a/src/sleep.c +++ b/src/sleep.c @@ -62,7 +62,7 @@ int hl_usleep(rig_useconds_t usec) tv1.tv_sec = (time_t) delay; tv1.tv_nsec = (long)((delay - tv1.tv_sec) * 1e+9); tv2.tv_sec = 0; - tv2.tv_nsec = 10; + tv2.tv_nsec = 1000000; // rig_debug(RIG_DEBUG_CACHE,"usec=%ld, sleep_time=%f, tv1=%ld,%ld\n", usec, sleep_time, (long)tv1.tv_sec, // (long)tv1.tv_nsec); @@ -194,7 +194,7 @@ int main() { char buf[256]; time(&rawtime); - hl_usleep(1000000 * 1000); // test 1s sleep + hl_usleep(1000000); // test 1s sleep date_strget(buf, sizeof(buf), 0); printf("%s\n", buf); time(&rawtime); commit 59fca440a537e5b858e92e67e5b8c6fd8e240aef Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Mar 30 17:21:29 2024 -0500 Fix rigctld CPU usage when client impolitely disconnects diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 9dabe4dcd..02ee83d7c 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -575,6 +575,8 @@ static int scanfc(FILE *fin, const char *format, void *p) if (ret < 1) { rig_debug(RIG_DEBUG_TRACE, "%s: ret=%d\n", __func__, ret); } + if (errno == 22) return -22; + if (ferror(fin)) { rig_debug(RIG_DEBUG_ERR, "%s: errno=%d, %s\n", __func__, errno, strerror(errno)); } return ret; commit 7b8f263b213da1649750fc4b38324096f769766f Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Mar 30 10:06:08 2024 -0500 Reduce verbosity in netrigctl.c diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index d3b1e9b08..207ca9083 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -635,7 +635,7 @@ static int netrigctl_open(RIG *rig) ret = read_string(rp, (unsigned char *) buf, BUF_MAX, "\n", 1, 0, 1); strtok(buf, "\r\n"); // chop the EOL -rig_debug(RIG_DEBUG_ERR, "## %s\n", buf); + rig_debug(RIG_DEBUG_VERBOSE, "## %s\n", buf); if (ret <= 0) { RETURNFUNC((ret < 0) ? ret : -RIG_EPROTO); commit 0353fdcae07f9c5d4eb87f700da86d6042c019de Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Mar 29 22:23:36 2024 -0500 Reduce debug in flrig diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index ecdf3c0c1..a4c38d1b3 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -1831,7 +1831,7 @@ static int flrig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) if (strstr(p, "k")) { *width = *width * 1000; } - rig_debug(RIG_DEBUG_ERR, "%s: p=%s, *width=%d\n", __func__, p, (int)(*width)); + rig_debug(RIG_DEBUG_TRACE, "%s: p=%s, *width=%d\n", __func__, p, (int)(*width)); if (strcmp(p, "FIXED") == 0) { commit e2b5a3bcb5170662460180742c329c13fdd994f7 Merge: 00dbd6a6d ce4e9bfdf Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Mar 29 17:10:07 2024 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 00dbd6a6df87733cbea105bf3d924ebe32ecebd2 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Mar 29 17:09:38 2024 -0500 Fix rigctlcom.s IF command for CW Skimmer use and others that might use IF command diff --git a/tests/rigctlcom.c b/tests/rigctlcom.c index cadcb6904..2716b98fe 100644 --- a/tests/rigctlcom.c +++ b/tests/rigctlcom.c @@ -224,7 +224,7 @@ int main(int argc, char *argv[]) char conf_parms[MAXCONFLEN] = ""; int status; - printf("rigctlcom Version 1.4\n"); + printf("rigctlcom Version 1.5\n"); while (1) { @@ -807,7 +807,7 @@ static int handle_ts2000(void *arg) char response[64]; char *fmt = // cppcheck-suppress * - "IF%011"PRIll" %1d%1d%1d%02d%1d%1"PRIll"%1d%1d%1d%1d%02d%1d;"; + "IF%011"PRIll"%04d %1d%1d%1d%02d%1d%1"PRIll"%1d%1d%1d%1d%02d%1d;"; if (retval != RIG_OK) { commit ce4e9bfdf06ae67da2fbb7fcee285e742e6d9c5c Merge: 55d5f8b64 9f997d799 Author: Michael Black <mdb...@ya...> Date: Thu Mar 28 15:46:13 2024 -0500 Merge pull request #1532 from GeoBaltz/rp8 More pointer conversions commit 9f997d799d7c132b5d7c0d18f85785bad5141595 Author: George Baltz N3GB <Geo...@gm...> Date: Thu Mar 28 16:26:21 2024 -0400 Fix incorrect port read for elevation Add missing port parameters for rotp2 Remove funky character(^B) from simrotorez.c so `file` and `more` think it is plain text. Dunno if this works on the real H/W, but at least the simulator can get and set az/el position without errors. diff --git a/rotators/rotorez/rotorez.c b/rotators/rotorez/rotorez.c index ec4e559ca..819675870 100644 --- a/rotators/rotorez/rotorez.c +++ b/rotators/rotorez/rotorez.c @@ -667,7 +667,7 @@ static int rotorez_rot_get_position(ROT *rot, azimuth_t *azimuth, //TODO: Should this be rotp or rotp2???? //err = read_block(&rs->rotport, (unsigned char *) az, AZ_READ_LEN); - err = read_block(rotp, (unsigned char *) az, AZ_READ_LEN); + err = read_block(rotp2, (unsigned char *) az, AZ_READ_LEN); if (err != AZ_READ_LEN) { diff --git a/simulators/simrotorez.c b/simulators/simrotorez.c index aa1ebc6ea..95f21262f 100644 --- a/simulators/simrotorez.c +++ b/simulators/simrotorez.c @@ -102,7 +102,7 @@ int main(int argc, char *argv[]) int flag = 0; while (1) - { + { int bytes; if (!flag) bytes = getmyline(fd, buf); else bytes = getmyline(fd2, buf); diff --git a/src/rotator.c b/src/rotator.c index 166fe7a6a..5dd492b18 100644 --- a/src/rotator.c +++ b/src/rotator.c @@ -266,12 +266,12 @@ ROT *HAMLIB_API rot_init(rot_model_t rot_model) rotp2 = ROTPORT2(rot); rs->comm_state = 0; - rotp->type.rig = caps->port_type; /* default from caps */ + rotp->type.rig = rotp2->type.rig = caps->port_type; /* default from caps */ - rotp->write_delay = caps->write_delay; - rotp->post_write_delay = caps->post_write_delay; - rotp->timeout = caps->timeout; - rotp->retry = caps->retry; + rotp->write_delay = rotp2->write_delay = caps->write_delay; + rotp->post_write_delay = rotp2->post_write_delay = caps->post_write_delay; + rotp->timeout = rotp2->timeout = caps->timeout; + rotp->retry = rotp2->retry = caps->retry; switch (caps->port_type) { commit 55d5f8b64a259664374778f2f1e7ef6eb24def8d Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Mar 26 16:59:57 2024 -0500 Really fix FLRig get_bwA return code diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index fc3080436..ecdf3c0c1 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -1769,10 +1769,11 @@ static int flrig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) cmdp = "rig.get_bwA"; retval = flrig_transaction(rig, cmdp, NULL, value, sizeof(value)); - if (strlen(value) == 0) + if (strlen(value) == 0) // sometimes we get a null reply here -- OK...deal with it { rig_debug(RIG_DEBUG_WARN, "%s: empty value return cached bandwidth\n", __func__); *width = rig->state.cache.widthMainA; + RETURNFUNC(RIG_OK); } if (retval == RIG_OK && strstr(value, "NONE")) commit 0a0118b7977974d6fc5bdf951b0a216e4987540b Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Mar 26 16:25:20 2024 -0500 Fix FLrig get_bwA and get_bwB to return cached value if FLRig returns empty value diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index f8992de77..fc3080436 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -1769,11 +1769,18 @@ static int flrig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) cmdp = "rig.get_bwA"; retval = flrig_transaction(rig, cmdp, NULL, value, sizeof(value)); + if (strlen(value) == 0) + { + rig_debug(RIG_DEBUG_WARN, "%s: empty value return cached bandwidth\n", __func__); + *width = rig->state.cache.widthMainA; + } + if (retval == RIG_OK && strstr(value, "NONE")) { priv->has_get_bwA = priv->has_get_bwB = 0; *width = 0; rig_debug(RIG_DEBUG_VERBOSE, "%s: does not have rig.get_bwA/B\n", __func__); + RETURNFUNC(RIG_OK); } if (retval != RIG_OK || strstr(value, "NONE")) @@ -1787,6 +1794,12 @@ static int flrig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) cmdp = "rig.get_bwB"; retval = flrig_transaction(rig, cmdp, NULL, value, sizeof(value)); + if (strlen(value) == 0) + { + rig_debug(RIG_DEBUG_WARN, "%s: empty value return cached bandwidth\n", __func__); + *width = rig->state.cache.widthMainA; + RETURNFUNC(RIG_OK); + } if (retval == RIG_OK && strlen(value) == 0) { rig_debug(RIG_DEBUG_VERBOSE, "%s: does not have rig.get_bwB\n", __func__); commit 295ad7475762ab2a4b0d8eb0923e3e255ae84500 Author: George Baltz N3GB <Geo...@gm...> Date: Tue Mar 26 02:04:53 2024 -0400 Add macros for amplifier and rotator state pointers. diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 7f3607bcf..9ecb99d46 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -2491,6 +2491,8 @@ typedef hamlib_port_t port_t; #define ROTPORT(r) (&r->state.rotport) #define ROTPORT2(r) (&r->state.rotport2) #define STATE(r) (&r->state) +#define AMPSTATE(a) (&(a)->state) +#define ROTSTATE(r) (&(r)->state) /* Then when the rigport address is stored as a pointer somewhere else(say, * in the rig structure itself), the definition could be changed to * #define RIGPORT(r) r->somewhereelse @@ -2506,6 +2508,8 @@ typedef hamlib_port_t port_t; #define HAMLIB_ROTPORT(r) ((hamlib_port_t *)rot_data_pointer(r, RIG_PTRX_ROTPORT)) #define HAMLIB_ROTPORT2(r) ((hamlib_port_t *)rot_data_pointer(r, RIG_PTRX_ROTPORT2)) #define HAMLIB_STATE(r) ((struct rig_state *)rig_data_pointer(r, RIG_PTRX_STATE)) +#define HAMLIB_AMPSTATE(a) ((struct amp_state *)amp_data_pointer(a, RIG_PTRX_AMPSTATE)) +#define HAMLIB_ROTSTATE(r) ((struct rot_state *)rot_data_pointer(r, RIG_PTRX_ROTSTATE)) #endif typedef enum { @@ -2518,6 +2522,8 @@ typedef enum { RIG_PTRX_ROTPORT, RIG_PTRX_ROTPORT2, RIG_PTRX_STATE, + RIG_PTRX_AMPSTATE, + RIG_PTRX_ROTSTATE, // New entries go directly above this line==================== RIG_PTRX_MAXIMUM } rig_ptrx_t; diff --git a/src/amp_conf.c b/src/amp_conf.c index e6a734a5a..434c9e72d 100644 --- a/src/amp_conf.c +++ b/src/amp_conf.c @@ -44,7 +44,7 @@ /* - * Configuration options available in the amp->state struct. + * Configuration options available in the amp_state struct. */ static const struct confparams ampfrontend_cfg_params[] = { @@ -112,7 +112,7 @@ int frontamp_set_conf(AMP *amp, hamlib_token_t token, const char *val) hamlib_port_t *ampp = AMPPORT(amp); int val_i; - rs = &->state; + rs = AMPSTATE(amp); amp_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); diff --git a/src/amp_settings.c b/src/amp_settings.c index ffd399c23..749c42904 100644 --- a/src/amp_settings.c +++ b/src/amp_settings.c @@ -75,7 +75,7 @@ setting_t HAMLIB_API amp_has_set_level(AMP *amp, setting_t level) return 0; } - return (amp->state.has_set_level & level); + return (AMPSTATE(amp)->has_set_level & level); } /** @@ -108,7 +108,7 @@ setting_t HAMLIB_API amp_has_get_level(AMP *amp, setting_t level) return 0; } - return (amp->state.has_get_level & level); + return (AMPSTATE(amp)->has_get_level & level); } /*! @} */ diff --git a/src/amplifier.c b/src/amplifier.c index 896f71f9c..aa41d650c 100644 --- a/src/amplifier.c +++ b/src/amplifier.c @@ -65,7 +65,7 @@ #include "token.h" //! @cond Doxygen_Suppress -#define CHECK_AMP_ARG(r) (!(r) || !(r)->caps || !(r)->state.comm_state) +#define CHECK_AMP_ARG(r) (!(r) || !(r)->caps || !AMPSTATE(r)->comm_state) //! @endcond /* @@ -224,7 +224,7 @@ AMP *HAMLIB_API amp_init(amp_model_t amp_model) /** * \todo Read the Preferences here! */ - rs = &->state; + rs = AMPSTATE(amp); //TODO allocate and link new ampport // For now, use the embedded one @@ -285,8 +285,8 @@ AMP *HAMLIB_API amp_init(amp_model_t amp_model) // Now we have to copy our new rig state hamlib_port structure to the deprecated one // Clients built on older 4.X versions will use the old structure // Clients built on newer 4.5 versions will use the new structure - memcpy(&->state.ampport_deprecated, ap, - sizeof(amp->state.ampport_deprecated)); + memcpy(&rs->ampport_deprecated, ap, + sizeof(rs->ampport_deprecated)); return amp; } @@ -324,7 +324,7 @@ int HAMLIB_API amp_open(AMP *amp) } caps = amp->caps; - rs = &->state; + rs = AMPSTATE(amp); if (rs->comm_state) { @@ -419,8 +419,8 @@ int HAMLIB_API amp_open(AMP *amp) if (status != RIG_OK) { - memcpy(&->state.ampport_deprecated, ap, - sizeof(amp->state.ampport_deprecated)); + memcpy(&rs->ampport_deprecated, ap, + sizeof(rs->ampport_deprecated)); return status; } } @@ -443,8 +443,8 @@ int HAMLIB_API amp_open(AMP *amp) ser_set_rts(ap, 0); } - memcpy(&->state.ampport_deprecated, ap, - sizeof(amp->state.ampport_deprecated)); + memcpy(&rs->ampport_deprecated, ap, + sizeof(rs->ampport_deprecated)); return RIG_OK; } @@ -488,7 +488,7 @@ int HAMLIB_API amp_close(AMP *amp) } caps = amp->caps; - rs = &->state; + rs = AMPSTATE(amp); if (!rs->comm_state) { @@ -571,7 +571,7 @@ int HAMLIB_API amp_cleanup(AMP *amp) /* * check if they forgot to close the amp */ - if (amp->state.comm_state) + if (AMPSTATE(amp)->comm_state) { amp_close(amp); } @@ -969,6 +969,8 @@ void * HAMLIB_API amp_data_pointer(AMP *amp, rig_ptrx_t idx) { case RIG_PTRX_AMPPORT: return AMPPORT(amp); + case RIG_PTRX_AMPSTATE: + return AMPSTATE(amp); default: amp_debug(RIG_DEBUG_ERR, "%s: Invalid data index=%d\n", __func__, idx); return NULL; diff --git a/src/rot_conf.c b/src/rot_conf.c index 89a616382..6d96b4be9 100644 --- a/src/rot_conf.c +++ b/src/rot_conf.c @@ -45,7 +45,7 @@ /* - * Configuration options available in the rot->state struct. + * Configuration options available in the rot_state struct. */ static const struct confparams rotfrontend_cfg_params[] = { @@ -143,7 +143,7 @@ int frontrot_set_conf(ROT *rot, hamlib_token_t token, const char *val) hamlib_port_t *rotp = ROTPORT(rot); int val_i; - rs = &rot->state; + rs = ROTSTATE(rot); rot_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -412,7 +412,7 @@ int frontrot_get_conf(ROT *rot, hamlib_token_t token, char *val, int val_len) hamlib_port_t *rotp = ROTPORT(rot); const char *s; - rs = &rot->state; + rs = ROTSTATE(rot); rot_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); diff --git a/src/rot_settings.c b/src/rot_settings.c index a75c55844..bee4a8f29 100644 --- a/src/rot_settings.c +++ b/src/rot_settings.c @@ -47,7 +47,7 @@ #ifndef DOC_HIDDEN -# define CHECK_ROT_ARG(r) (!(r) || !(r)->caps || !(r)->state.comm_state) +# define CHECK_ROT_ARG(r) (!(r) || !(r)->caps || !(ROTSTATE(r)->comm_state)) #endif /* !DOC_HIDDEN */ @@ -255,7 +255,7 @@ setting_t HAMLIB_API rot_has_get_level(ROT *rot, setting_t level) return 0; } - return (rot->state.has_get_level & level); + return (ROTSTATE(rot)->has_get_level & level); } @@ -293,7 +293,7 @@ setting_t HAMLIB_API rot_has_set_level(ROT *rot, setting_t level) return 0; } - return (rot->state.has_set_level & level); + return (ROTSTATE(rot)->has_set_level & level); } @@ -330,7 +330,7 @@ setting_t HAMLIB_API rot_has_get_parm(ROT *rot, setting_t parm) return 0; } - return (rot->state.has_get_parm & parm); + return (ROTSTATE(rot)->has_get_parm & parm); } @@ -367,7 +367,7 @@ setting_t HAMLIB_API rot_has_set_parm(ROT *rot, setting_t parm) return 0; } - return (rot->state.has_set_parm & parm); + return (ROTSTATE(rot)->has_set_parm & parm); } @@ -404,7 +404,7 @@ setting_t HAMLIB_API rot_has_get_func(ROT *rot, setting_t func) return 0; } - return (rot->state.has_get_func & func); + return (ROTSTATE(rot)->has_get_func & func); } @@ -440,7 +440,7 @@ setting_t HAMLIB_API rot_has_set_func(ROT *rot, setting_t func) return 0; } - return (rot->state.has_set_func & func); + return (ROTSTATE(rot)->has_set_func & func); } diff --git a/src/rotator.c b/src/rotator.c index b1db5c478..166fe7a6a 100644 --- a/src/rotator.c +++ b/src/rotator.c @@ -89,7 +89,7 @@ # define DEFAULT_PARALLEL_PORT "/dev/parport0" #endif -#define CHECK_ROT_ARG(r) (!(r) || !(r)->caps || !(r)->state.comm_state) +#define CHECK_ROT_ARG(r) (!(r) || !(r)->caps || !(ROTSTATE(r)->comm_state)) /* @@ -258,7 +258,7 @@ ROT *HAMLIB_API rot_init(rot_model_t rot_model) /** * \todo Read the Preferences here! */ - rs = &rot->state; + rs = ROTSTATE(rot); //TODO Allocate new rotport[2] // For now, use the embedded ones @@ -345,8 +345,8 @@ ROT *HAMLIB_API rot_init(rot_model_t rot_model) // Now we have to copy our new rig state hamlib_port structure to the deprecated one // Clients built on older 4.X versions will use the old structure // Clients built on newer 4.5 versions will use the new structure - memcpy(&rot->state.rotport_deprecated, rotp, - sizeof(rot->state.rotport_deprecated)); + memcpy(&rs->rotport_deprecated, rotp, + sizeof(rs->rotport_deprecated)); return rot; } @@ -386,7 +386,7 @@ int HAMLIB_API rot_open(ROT *rot) } caps = rot->caps; - rs = &rot->state; + rs = ROTSTATE(rot); if (rs->comm_state) { @@ -520,8 +520,8 @@ int HAMLIB_API rot_open(ROT *rot) if (status != RIG_OK) { - memcpy(&rot->state.rotport_deprecated, rotp, - sizeof(rot->state.rotport_deprecated)); + memcpy(&rs->rotport_deprecated, rotp, + sizeof(rs->rotport_deprecated)); return status; } } @@ -544,8 +544,8 @@ int HAMLIB_API rot_open(ROT *rot) ser_set_rts(rotp, 0); } - memcpy(&rot->state.rotport_deprecated, rotp, - sizeof(rot->state.rotport_deprecated)); + memcpy(&rs->rotport_deprecated, rotp, + sizeof(rs->rotport_deprecated)); return RIG_OK; } @@ -580,7 +580,7 @@ int HAMLIB_API rot_close(ROT *rot) } caps = rot->caps; - rs = &rot->state; + rs = ROTSTATE(rot); if (!rs->comm_state) { @@ -632,8 +632,8 @@ int HAMLIB_API rot_close(ROT *rot) rs->comm_state = 0; - memcpy(&rot->state.rotport_deprecated, rotp, - sizeof(rot->state.rotport_deprecated)); + memcpy(&rs->rotport_deprecated, rotp, + sizeof(rs->rotport_deprecated)); return RIG_OK; } @@ -667,7 +667,7 @@ int HAMLIB_API rot_cleanup(ROT *rot) /* * check if they forgot to close the rot */ - if (rot->state.comm_state) + if (ROTSTATE(rot)->comm_state) { rot_close(rot); } @@ -726,11 +726,11 @@ int HAMLIB_API rot_set_position(ROT *rot, return -RIG_EINVAL; } - azimuth += rot->state.az_offset; - elevation += rot->state.el_offset; - caps = rot->caps; - rs = &rot->state; + rs = ROTSTATE(rot); + + azimuth += rs->az_offset; + elevation += rs->el_offset; rot_debug(RIG_DEBUG_VERBOSE, "%s: south_zero=%d \n", __func__, rs->south_zero); @@ -801,7 +801,7 @@ int HAMLIB_API rot_get_position(ROT *rot, } caps = rot->caps; - rs = &rot->state; + rs = ROTSTATE(rot); if (caps->get_position == NULL) { @@ -820,8 +820,8 @@ int HAMLIB_API rot_get_position(ROT *rot, rot_debug(RIG_DEBUG_VERBOSE, "%s: south adj to az=%.2f\n", __func__, az); } - *azimuth = az - rot->state.az_offset; - *elevation = el - rot->state.el_offset; + *azimuth = az - rs->az_offset; + *elevation = el - rs->el_offset; return RIG_OK; } @@ -1057,6 +1057,8 @@ void * HAMLIB_API rot_data_pointer(ROT *rot, rig_ptrx_t idx) return ROTPORT(rot); case RIG_PTRX_ROTPORT2: return ROTPORT2(rot); + case RIG_PTRX_ROTSTATE: + return ROTSTATE(rot); default: rot_debug(RIG_DEBUG_ERR, "%s: Invalid data index=%d\n", __func__, idx); return NULL; commit 2d0b8b807d220c10e49ba9c0f94b408ac3fd9d68 Author: George Baltz N3GB <Geo...@gm...> Date: Sun Mar 17 03:43:25 2024 -0400 Pointerize all state references in rigs/kenwood/* diff --git a/rigs/kenwood/ic10.c b/rigs/kenwood/ic10.c index 38d8fad08..ac57db4b8 100644 --- a/rigs/kenwood/ic10.c +++ b/rigs/kenwood/ic10.c @@ -67,7 +67,7 @@ int ic10_cmd_trim(char *data, int data_len) /** * ic10_transaction - * Assumes rig!=NULL rig->state!=NULL rig->caps!=NULL + * Assumes rig!=NULL STATE(rig)!=NULL rig->caps!=NULL **/ int ic10_transaction(RIG *rig, const char *cmd, int cmd_len, char *data, int *data_len) @@ -99,7 +99,7 @@ transaction: if (!data) { char buffer[50]; - const struct kenwood_priv_data *priv = rig->state.priv; + const struct kenwood_priv_data *priv = STATE(rig)->priv; if (RIG_OK != (retval = write_block(rp, (unsigned char *) priv->verify_cmd, strlen(priv->verify_cmd)))) @@ -451,7 +451,7 @@ int ic10_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (vfo == RIG_VFO_CURR) { - tvfo = rig->state.current_vfo; + tvfo = STATE(rig)->current_vfo; } else { diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 19b54fabe..2562e01fc 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -234,7 +234,7 @@ struct confparams kenwood_cfg_params[] = /** * kenwood_transaction - * Assumes rig!=NULL rig->state!=NULL rig->caps!=NULL + * Assumes rig!=NULL STATE(rig)!=NULL rig->caps!=NULL * * Parameters: * cmdstr: Command to be sent to the rig. cmdstr can also be NULL, @@ -262,7 +262,7 @@ int kenwood_transaction(RIG *rig, const char *cmdstr, char *data, char *cmd; int len; int retry_read = 0; - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; struct kenwood_priv_caps *caps = kenwood_caps(rig); struct rig_state *rs; struct hamlib_port *rp; /* Pointer to rigport structure */ @@ -285,7 +285,7 @@ int kenwood_transaction(RIG *rig, const char *cmdstr, char *data, RETURNFUNC2(-RIG_EINVAL); } - rs = &rig->state; + rs = STATE(rig); rp = RIGPORT(rig); rs->transaction_active = 1; @@ -396,7 +396,7 @@ transaction_write: if (!datasize && strncmp(cmdstr, "KY", 2) != 0) { - rig->state.transaction_active = 0; + rs->transaction_active = 0; // there are some commands that have problems with immediate follow-up // so we'll just ignore them @@ -749,7 +749,7 @@ int kenwood_safe_transaction(RIG *rig, const char *cmd, char *buf, // QRPLABS can't seem top decide if they give 37 or 38 bytes for IF command if (strncmp(cmd, "IF", 2) == 0 && rig->caps->rig_model == RIG_MODEL_QRPLABS) { break; } - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; rig_debug(RIG_DEBUG_ERR, "%s: wrong answer; len for cmd %s: expected = %d, got %d\n", @@ -809,14 +809,14 @@ int kenwood_init(RIG *rig) rig_debug(RIG_DEBUG_VERBOSE, "%s called, version %s/%s\n", __func__, BACKEND_VER, rig->caps->version); - rig->state.priv = calloc(1, sizeof(struct kenwood_priv_data)); + STATE(rig)->priv = calloc(1, sizeof(struct kenwood_priv_data)); - if (rig->state.priv == NULL) + if (STATE(rig)->priv == NULL) { RETURNFUNC2(-RIG_ENOMEM); } - priv = rig->state.priv; + priv = STATE(rig)->priv; memset(priv, 0x00, sizeof(struct kenwood_priv_data)); @@ -878,15 +878,15 @@ int kenwood_cleanup(RIG *rig) { ENTERFUNC; - free(rig->state.priv); - rig->state.priv = NULL; + free(STATE(rig)->priv); + STATE(rig)->priv = NULL; RETURNFUNC(RIG_OK); } int kenwood_open(RIG *rig) { - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; struct kenwood_priv_caps *caps = kenwood_caps(rig); int err, i; char *idptr; @@ -900,7 +900,7 @@ int kenwood_open(RIG *rig) priv->question_mark_response_means_rejected = 0; - if (rig->state.auto_power_on) + if (STATE(rig)->auto_power_on) { // Ensure rig is on rig_set_powerstat(rig, 1); @@ -923,7 +923,7 @@ int kenwood_open(RIG *rig) err = rig_get_powerstat(rig, &powerstat); if (err == RIG_OK && powerstat == 0 && priv->poweron == 0 - && rig->state.auto_power_on) + && STATE(rig)->auto_power_on) { priv->has_ps = 1; rig_debug(RIG_DEBUG_TRACE, "%s: got PS0 so powerup\n", __func__); @@ -1074,7 +1074,7 @@ int kenwood_open(RIG *rig) __func__, kenwood_id_string_list[i].id); // current vfo is rx_vfo - rig_get_vfo(rig, &rig->state.rx_vfo); + rig_get_vfo(rig, &STATE(rig)->rx_vfo); if (kenwood_id_string_list[i].model == rig->caps->rig_model) { @@ -1138,7 +1138,7 @@ int kenwood_open(RIG *rig) int kenwood_close(RIG *rig) { - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; ENTERFUNC; @@ -1151,7 +1151,7 @@ int kenwood_close(RIG *rig) it's not supported */ } - if (rig->state.auto_power_off) + if (STATE(rig)->auto_power_off) { rig_debug(RIG_DEBUG_TRACE, "%s: got PS1 so powerdown\n", __func__); rig_set_powerstat(rig, 0); @@ -1186,7 +1186,7 @@ int kenwood_get_id(RIG *rig, char *buf) */ int kenwood_get_if(RIG *rig) { - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; struct kenwood_priv_caps *caps = kenwood_caps(rig); int retval; int post_write_delay_save = 0; @@ -1196,8 +1196,8 @@ int kenwood_get_if(RIG *rig) // Malachite has a 400ms delay but some get commands can work with no delay if (RIG_IS_MALACHITE) { - post_write_delay_save = rig->state.post_write_delay; - rig->state.post_write_delay = 0; + post_write_delay_save = STATE(rig)->post_write_delay; + STATE(rig)->post_write_delay = 0; } retval = kenwood_safe_transaction(rig, "IF", priv->info, @@ -1205,7 +1205,7 @@ int kenwood_get_if(RIG *rig) if (RIG_IS_MALACHITE) { - rig->state.post_write_delay = post_write_delay_save; + STATE(rig)->post_write_delay = post_write_delay_save; } RETURNFUNC(retval); @@ -1222,7 +1222,7 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo) char cmdbuf[12]; int retval; char vfo_function; - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; ENTERFUNC; rig_debug(RIG_DEBUG_VERBOSE, @@ -1243,7 +1243,7 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo) #if 0 - if (rig->state.current_vfo == vfo) + if (STATE(rig)->current_vfo == vfo) { rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo already is %s...skipping\n", __func__, rig_strvfo(vfo)); @@ -1267,19 +1267,19 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo) break; case RIG_VFO_TX: - vfo_function = rig->state.tx_vfo == RIG_VFO_B ? '1' : '0'; + vfo_function = STATE(rig)->tx_vfo == RIG_VFO_B ? '1' : '0'; break; #if 0 // VFO_RX really should NOT be VFO_CURR as VFO_CURR could be either VFO case RIG_VFO_RX: - vfo_function = rig->state.rx_vfo == RIG_VFO_B ? '1' : '0'; + vfo_function = STATE(rig)->rx_vfo == RIG_VFO_B ? '1' : '0'; break; #endif case RIG_VFO_CURR: HAMLIB_TRACE; - rig->state.current_vfo = RIG_VFO_CURR; + STATE(rig)->current_vfo = RIG_VFO_CURR; RETURNFUNC2(RIG_OK); default: @@ -1344,7 +1344,7 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo) } HAMLIB_TRACE; - rig->state.current_vfo = vfo; + STATE(rig)->current_vfo = vfo; /* if FN command then there's no FT or FR */ /* If split mode on, the don't change TxVFO */ @@ -1473,7 +1473,7 @@ int kenwood_get_vfo_main_sub(RIG *rig, vfo_t *vfo) */ int kenwood_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo) { - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; char cmdbuf[12]; int retval; unsigned char vfo_function; @@ -1496,7 +1496,7 @@ int kenwood_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo) RETURNFUNC2(kenwood_transaction(rig, cmdbuf, NULL, 0)); } - if (vfo == RIG_VFO_CURR) { vfo = rig->state.current_vfo; } + if (vfo == RIG_VFO_CURR) { vfo = STATE(rig)->current_vfo; } if (vfo == RIG_VFO_TX || vfo == RIG_VFO_RX) { vfo = vfo_fixup(rig, vfo, split); } @@ -1640,7 +1640,7 @@ int kenwood_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo) */ int kenwood_set_split(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo) { - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; char cmdbuf[6]; int retval; @@ -1674,7 +1674,8 @@ int kenwood_get_split_vfo_if(RIG *rig, vfo_t rxvfo, split_t *split, { int transmitting; int retval; - struct kenwood_priv_data *priv = rig->state.priv; + struct rig_state *rs = STATE(rig); + struct kenwood_priv_data *priv = rs->priv; ENTERFUNC; @@ -1694,13 +1695,13 @@ int kenwood_get_split_vfo_if(RIG *rig, vfo_t rxvfo, split_t *split, { *split = RIG_SPLIT_ON; *txvfo = RIG_VFO_SUB; - priv->tx_vfo = rig->state.tx_vfo = *txvfo; + priv->tx_vfo = rs->tx_vfo = *txvfo; } else { *split = RIG_SPLIT_OFF; *txvfo = RIG_VFO_MAIN; - priv->tx_vfo = rig->state.tx_vfo = *txvfo; + priv->tx_vfo = rs->tx_vfo = *txvfo; } } @@ -1740,35 +1741,35 @@ int kenwood_get_split_vfo_if(RIG *rig, vfo_t rxvfo, split_t *split, switch (priv->info[30]) { case '0': - if (rig->state.rx_vfo == RIG_VFO_A) + if (rs->rx_vfo == RIG_VFO_A) { HAMLIB_TRACE; - *txvfo = rig->state.tx_vfo = priv->tx_vfo = (*split + *txvfo = rs->tx_vfo = priv->tx_vfo = (*split && !transmitting) ? RIG_VFO_B : RIG_VFO_A; } - else if (rig->state.rx_vfo == RIG_VFO_B) + else if (rs->rx_vfo == RIG_VFO_B) { HAMLIB_TRACE; - *txvfo = rig->state.tx_vfo = priv->tx_vfo = (*split + *txvfo = rs->tx_vfo = priv->tx_vfo = (*split && !transmitting) ? RIG_VFO_B : RIG_VFO_A; } else { rig_debug(RIG_DEBUG_WARN, "%s(%d): unknown rx_vfo=%s\n", __func__, __LINE__, - rig_strvfo(rig->state.rx_vfo)); + rig_strvfo(rs->rx_vfo)); *txvfo = RIG_VFO_A; // pick a default - rig->state.rx_vfo = priv->tx_vfo = RIG_VFO_A; + rs->rx_vfo = priv->tx_vfo = RIG_VFO_A; } break; case '1': - if (rig->state.rx_vfo == RIG_VFO_A) + if (rs->rx_vfo == RIG_VFO_A) { HAMLIB_TRACE; *txvfo = priv->tx_vfo = (*split && !transmitting) ? RIG_VFO_A : RIG_VFO_B; } - else if (rig->state.rx_vfo == RIG_VFO_B) + else if (rs->rx_vfo == RIG_VFO_B) { HAMLIB_TRACE; *txvfo = priv->tx_vfo = (*split && !transmitting) ? RIG_VFO_B : RIG_VFO_A; @@ -1776,9 +1777,9 @@ int kenwood_get_split_vfo_if(RIG *rig, vfo_t rxvfo, split_t *split, else { rig_debug(RIG_DEBUG_WARN, "%s(%d): unknown rx_vfo=%s\n", __func__, __LINE__, - rig_strvfo(rig->state.rx_vfo)); + rig_strvfo(rs->rx_vfo)); *txvfo = RIG_VFO_A; // pick a default - rig->state.rx_vfo = RIG_VFO_A; + rs->rx_vfo = RIG_VFO_A; } break; @@ -1812,7 +1813,8 @@ int kenwood_get_vfo_if(RIG *rig, vfo_t *vfo) { int retval; int split_and_transmitting; - struct kenwood_priv_data *priv = rig->state.priv; + struct rig_state *rs = STATE(rig); + struct kenwood_priv_data *priv = rs->priv; ENTERFUNC; @@ -1838,10 +1840,10 @@ int kenwood_get_vfo_if(RIG *rig, vfo_t *vfo) switch (priv->info[30]) { case '0': - *vfo = rig->state.rx_vfo = rig->state.tx_vfo = priv->tx_vfo = + *vfo = rs->rx_vfo = rs->tx_vfo = priv->tx_vfo = split_and_transmitting ? RIG_VFO_B : RIG_VFO_A; - if (priv->info[32] == '1') { priv->tx_vfo = rig->state.tx_vfo = RIG_VFO_B; } + if (priv->info[32] == '1') { priv->tx_vfo = rs->tx_vfo = RIG_VFO_B; } break; @@ -1876,13 +1878,13 @@ int kenwood_set_freq(RIG *rig, vfo_t vfo, freq_t freq) vfo_t tvfo; freq_t tfreq = 0; int err; - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s freq=%.0f\n", __func__, rig_strvfo(vfo), freq); tvfo = (vfo == RIG_VFO_CURR - || vfo == RIG_VFO_VFO) ? rig->state.current_vfo : vfo; + || vfo == RIG_VFO_VFO) ? STATE(rig)->current_vfo : vfo; rig_debug(RIG_DEBUG_TRACE, "%s: tvfo=%s\n", __func__, rig_strvfo(tvfo)); @@ -1897,7 +1899,7 @@ int kenwood_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // Malchite is so slow we don't do the get_freq // And when we have detected Doppler operations we just set the freq all the time // This should provide stable timing for set_ptt operation so relay delays are consistent - if (!RIG_IS_MALACHITE && rig->state.doppler == 0) + if (!RIG_IS_MALACHITE && STATE(rig)->doppler == 0) { rig_get_freq(rig, tvfo, &tfreq); @@ -1995,7 +1997,7 @@ int kenwood_set_freq(RIG *rig, vfo_t vfo, freq_t freq) int kenwood_get_freq_if(RIG *rig, vfo_t vfo, freq_t *freq) { - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; char freqbuf[50]; int retval; @@ -2030,7 +2032,7 @@ int kenwood_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) int retval; unsigned char vfo_letter = '\0'; vfo_t tvfo; - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; ENTERFUNC; @@ -2040,7 +2042,7 @@ int kenwood_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) } tvfo = (vfo == RIG_VFO_CURR - || vfo == RIG_VFO_VFO) ? rig->state.current_vfo : vfo; + || vfo == RIG_VFO_VFO) ? STATE(rig)->current_vfo : vfo; if (RIG_VFO_CURR == tvfo) { @@ -2109,7 +2111,7 @@ int kenwood_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) { int retval; char buf[7]; - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; ENTERFUNC; @@ -2145,7 +2147,7 @@ int kenwood_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) int rit_enabled; int xit_enabled; shortfreq_t curr_rit; - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; rig_debug(RIG_DEBUG_VERBOSE, "%s called: vfo=%s, rit=%ld\n", __func__, @@ -2354,13 +2356,13 @@ int kenwood_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) int err; int datamode = 0; int needdata; - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; struct kenwood_priv_caps *caps = kenwood_caps(rig); rig_debug(RIG_DEBUG_VERBOSE, "%s called, vfo=%s, mode=%s, width=%d, curr_vfo=%s\n", __func__, rig_strvfo(vfo), rig_strrmode(mode), (int)width, - rig_strvfo(rig->state.current_vfo)); + rig_strvfo(STATE(rig)->current_vfo)); // we wont' set opposite VFO if the mode is the same as requested // setting VFOB mode requires split modifications which cause VFO flashing @@ -2515,7 +2517,7 @@ int kenwood_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (vfo == RIG_VFO_CURR) { HAMLIB_TRACE; - vfo = rig->state.current_vfo; + vfo = STATE(rig)->current_vfo; } if ((vfo & (RIG_VFO_A | RIG_VFO_MAIN)) && ((priv->datamodeA == 0 && datamode) @@ -2689,11 +2691,11 @@ int kenwood_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) int retval; int kmode; - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; struct kenwood_priv_caps *caps = kenwood_caps(rig); rig_debug(RIG_DEBUG_VERBOSE, "%s called, curr_vfo=%s\n", __func__, - rig_strvfo(rig->state.current_vfo)); + rig_strvfo(STATE(rig)->current_vfo)); if (!mode || !width) { @@ -2705,7 +2707,7 @@ int kenwood_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) /* only need to get it if it has to be initialized */ if (priv->curr_mode > 0 && priv->is_emulation && vfo == RIG_VFO_B) { - rig->state.current_vfo = RIG_VFO_A; + STATE(rig)->current_vfo = RIG_VFO_A; RETURNFUNC2(RIG_OK); } @@ -2844,7 +2846,7 @@ int kenwood_get_mode_if(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) { int err; struct kenwood_priv_caps *caps = kenwood_caps(rig); - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; ENTERFUNC; @@ -2956,7 +2958,7 @@ static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min, // we batch these commands together for speed char *cmd; int n; - struct rig_state *rs = &rig->state; + struct rig_state *rs = STATE(rig); struct hamlib_port *rp = RIGPORT(rig); ENTERFUNC; @@ -3184,7 +3186,8 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { char levelbuf[16]; int i, kenwood_val, len, result; - struct kenwood_priv_data *priv = rig->state.priv; + struct rig_state *rs = STATE(rig); + struct kenwood_priv_data *priv = rs->priv; struct kenwood_priv_caps *caps = kenwood_caps(rig); gran_t *level_info; @@ -3331,9 +3334,9 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { int foundit = 0; - for (i = 0; i < HAMLIB_MAXDBLSTSIZ && rig->state.attenuator[i]; i++) + for (i = 0; i < HAMLIB_MAXDBLSTSIZ && rs->attenuator[i]; i++) { - if (val.i == rig->state.attenuator[i]) + if (val.i == rs->attenuator[i]) { SNPRINTF(levelbuf, sizeof(levelbuf), "RA%0*d", len, i + 1); foundit = 1; @@ -3360,9 +3363,9 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { int foundit = 0; - for (i = 0; i < HAMLIB_MAXDBLSTSIZ && rig->state.preamp[i]; i++) + for (i = 0; i < HAMLIB_MAXDBLSTSIZ && rs->preamp[i]; i++) { - if (val.i == rig->state.preamp[i]) + if (val.i == rs->preamp[i]) { SNPRINTF(levelbuf, sizeof(levelbuf), "PA%01d", i + 1); foundit = 1; @@ -3565,7 +3568,8 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) int retval; int lvl; int i, ret, agclevel, len, value; - struct kenwood_priv_data *priv = rig->state.priv; + struct rig_state *rs = STATE(rig); + struct kenwood_priv_data *priv = rs->priv; struct kenwood_priv_caps *caps = kenwood_caps(rig); gran_t *level_info; @@ -3728,7 +3732,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { for (i = 0; i < lvl && i < HAMLIB_MAXDBLSTSIZ; i++) { - if (rig->state.attenuator[i] == 0) + if (rs->attenuator[i] == 0) { rig_debug(RIG_DEBUG_ERR, "%s: " "unexpected att level %d\n", @@ -3742,7 +3746,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) RETURNFUNC(-RIG_EINTERNAL); } - val->i = rig->state.attenuator[i - 1]; + val->i = rs->attenuator[i - 1]; } break; @@ -3765,7 +3769,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) for (i = 0; i < lvl && i < HAMLIB_MAXDBLSTSIZ; i++) { - if (rig->state.preamp[i] == 0) + if (rs->preamp[i] == 0) { rig_debug(RIG_DEBUG_ERR, "%s: " "unexpected preamp level %d\n", @@ -3779,7 +3783,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) RETURNFUNC(-RIG_EINTERNAL); } - val->i = rig->state.preamp[i - 1]; + val->i = rs->preamp[i - 1]; } else { @@ -4500,11 +4504,11 @@ int kenwood_set_ctcss_tone_tn(RIG *rig, vfo_t vfo, tone_t tone) /* * kenwood_get_ctcss_tone - * Assumes rig->state.priv != NULL + * Assumes STATE(rig)->priv != NULL */ int kenwood_get_ctcss_tone(RIG *rig, vfo_t vfo, tone_t *tone) { - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; struct rig_caps *caps; char tonebuf[3]; int i, retval; @@ -4891,7 +4895,7 @@ int kenwood_get_ant(RIG *rig, vfo_t vfo, ant_t dummy, value_t *option, */ int kenwood_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) { - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; int retval; ENTERFUNC; @@ -5128,7 +5132,7 @@ int kenwood_set_powerstat(RIG *rig, powerstat_t status) { int retval; struct hamlib_port *rp = RIGPORT(rig); - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; if ((priv->is_k3 || priv->is_k3s) && status == RIG_POWER_ON) { @@ -5195,7 +5199,7 @@ int kenwood_get_powerstat(RIG *rig, powerstat_t *status) char pwrbuf[6]; int result; struct hamlib_port *rp = RIGPORT(rig); - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; ENTERFUNC; @@ -5433,7 +5437,7 @@ int kenwood_stop_morse(RIG *rig, vfo_t vfo) int kenwood_send_voice_mem(RIG *rig, vfo_t vfo, int bank) { char cmd[16]; - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; ENTERFUNC; #if 0 // don't really need to turn on the list @@ -5477,7 +5481,7 @@ int kenwood_send_voice_mem(RIG *rig, vfo_t vfo, int bank) int kenwood_stop_voice_mem(RIG *rig, vfo_t vfo) { char cmd[16]; - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; ENTERFUNC; if (rig->caps->rig_model == RIG_MODEL_TS2000 @@ -5648,7 +5652,7 @@ int kenwood_get_mem_if(RIG *rig, vfo_t vfo, int *ch) { int err; char buf[4]; - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; ENTERFUNC; @@ -5887,7 +5891,7 @@ int kenwood_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan) int kenwood_set_ext_parm(RIG *rig, hamlib_token_t token, value_t val) { - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; char buf[4]; ENTERFUNC; @@ -5920,7 +5924,7 @@ int kenwood_set_ext_parm(RIG *rig, hamlib_token_t token, value_t val) int kenwood_get_ext_parm(RIG *rig, hamlib_token_t token, value_t *val) { int err; - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; ENTERFUNC; diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index eb6aee8e0..b512a3308 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -334,7 +334,7 @@ extern struct rig_caps trudx_caps; static int inline kenwood_simple_transaction(RIG *rig, const char *cmd, size_t expected) { - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; return kenwood_safe_transaction(rig, cmd, priv->info, KENWOOD_MAX_BUF_LEN, expected); } diff --git a/rigs/kenwood/ts450s.c b/rigs/kenwood/ts450s.c index e5e393512..51aba0836 100644 --- a/rigs/kenwood/ts450s.c +++ b/rigs/kenwood/ts450s.c @@ -94,8 +94,8 @@ int ts450_open(RIG *rig) if (err != RIG_OK) { rig_debug(RIG_DEBUG_VERBOSE, "%s: tone unit not detected\n", __func__); - rig->state.has_set_func &= ~RIG_FUNC_TONE; - rig->state.has_get_func &= ~RIG_FUNC_TONE; + STATE(rig)->has_set_func &= ~RIG_FUNC_TONE; + STATE(rig)->has_get_func &= ~RIG_FUNC_TONE; } RIGPORT(rig)->retry = maxtries; diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index f9034ad7b..eb194d1ac 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -823,7 +823,7 @@ static int ts480_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) { int retval; char buf[7]; - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; ENTERFUNC; @@ -1207,7 +1207,7 @@ int ts480_init(RIG *rig) return retval; } - priv = (struct kenwood_priv_data *) rig->state.priv; + priv = (struct kenwood_priv_data *) STATE(rig)->priv; priv->ag_format = 2; priv->micgain_min = 0; @@ -2167,7 +2167,7 @@ int malachite_init(RIG *rig) retval = kenwood_init(rig); - priv = rig->state.priv; + priv = STATE(rig)->priv; priv->no_id = 1; // the Malchite doesn't like the ID; verify cmd @@ -2178,20 +2178,20 @@ int malachite_init(RIG *rig) int malachite_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) { - int post_write_delay_save = rig->state.post_write_delay; - rig->state.post_write_delay = 0; + int post_write_delay_save = STATE(rig)->post_write_delay; + STATE(rig)->post_write_delay = 0; int retval = kenwood_get_mode(rig, vfo, mode, width); - rig->state.post_write_delay = post_write_delay_save; + STATE(rig)->post_write_delay = post_write_delay_save; return retval; } int malachite_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) { - int post_write_delay_save = rig->state.post_write_delay; + int post_write_delay_save = STATE(rig)->post_write_delay; ENTERFUNC; - rig->state.post_write_delay = 0; + STATE(rig)->post_write_delay = 0; int retval = kenwood_get_freq(rig, vfo, freq); - rig->state.post_write_delay = post_write_delay_save; + STATE(rig)->post_write_delay = post_write_delay_save; RETURNFUNC(retval); } @@ -2212,13 +2212,13 @@ int malachite_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // Malachite has a bug where it takes two freq set to make it work // under band changes -- so we just do this all the time retval = kenwood_set_freq(rig, vfo, freq + 1); - rig->state.post_write_delay = 250; // need a bit more time on band change + STATE(rig)->post_write_delay = 250; // need a bit more time on band change if (retval != RIG_OK) { RETURNFUNC(retval); } } else { - rig->state.post_write_delay = 125; + STATE(rig)->post_write_delay = 125; } retval = kenwood_set_freq(rig, vfo, freq); diff --git a/rigs/kenwood/ts570.c b/rigs/kenwood/ts570.c index dc676250d..fd1f57519 100644 --- a/rigs/kenwood/ts570.c +++ b/rigs/kenwood/ts570.c @@ -351,7 +351,7 @@ ts570_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) int i; for (i = 0; i < HAMLIB_MAXDBLSTSIZ; i++) - if (kenwood_val == rig->state.preamp[i]) + if (kenwood_val == STATE(rig)->preamp[i]) { SNPRINTF(levelbuf, sizeof(levelbuf), "PA%01d", i + 1); break; /* found - stop searching */ @@ -475,7 +475,7 @@ ts570_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) for (i = 0; i < levelint && i < HAMLIB_MAXDBLSTSIZ; i++) { - if (rig->state.preamp[i] == 0) + if (STATE(rig)->preamp[i] == 0) { rig_debug(RIG_DEBUG_ERR, "%s: unexpected att level %d\n", __func__, (int)levelint); @@ -488,7 +488,7 @@ ts570_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return -RIG_EINTERNAL; } - val->i = rig->state.preamp[i - 1]; + val->i = STATE(rig)->preamp[i - 1]; } break; diff --git a/rigs/kenwood/ts590.c b/rigs/kenwood/ts590.c index 84903494c..f38b46418 100644 --- a/rigs/kenwood/ts590.c +++ b/rigs/kenwood/ts590.c @@ -326,7 +326,7 @@ static int ts590_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) char cmd[32], ackbuf[32]; int retval; - if (vfo == RIG_VFO_CURR) { vfo = rig->state.current_vfo; } + if (vfo == RIG_VFO_CURR) { vfo = STATE(rig)->current_vfo; } if (vfo == RIG_VFO_TX || vfo == RIG_VFO_RX) { vfo = vfo_fixup(rig, vfo, CACHE(rig)->split); } @@ -541,7 +541,7 @@ static int ts590_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) static int ts590_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; char levelbuf[16]; int kenwood_val; int result; @@ -731,7 +731,7 @@ static int ts590_read_meters(RIG *rig, int *swr, int *comp, int *alc) static int ts590_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; char ackbuf[50]; size_t ack_len, ack_len_expected; int levelint = 0; @@ -1148,7 +1148,7 @@ static int ts590_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) { int retval; char buf[7]; - struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_data *priv = STATE(rig)->priv; ENTERFUNC; diff --git a/rigs/kenwood/tx500.c b/rigs/kenwood/tx500.c index f8b8184f0..43d422b32 100644 --- a/rigs/kenwood/tx500.c +++ b/rigs/kenwood/tx500.c @@ -854,7 +854,7 @@ int ts2000_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (lvl > 9) { - val->i = rig->state.preamp[0]; + val->i = STATE(rig)->preamp[0]; } break; @@ -885,7 +885,7 @@ int ts2000_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (lvl > 99) { - val->i = rig->state.attenuator[0]; /* Since the TS-2000 only has one step on the attenuator */ + val->i = STATE(rig)->attenuator[0]; /* Since the TS-2000 only has one step on the attenuator */ } break; diff --git a/rigs/kenwood/xg3.c b/rigs/kenwood/xg3.c index e8c8526fc..271bebca2 100644 --- a/rigs/kenwood/xg3.c +++ b/rigs/kenwood/xg3.c @@ -197,12 +197,12 @@ int xg3_init(RIG *rig) return -RIG_ENOMEM; } - rig->state.priv = (void *)priv; + STATE(rig)->priv = (void *)priv; RIGPORT(rig)->type.rig = RIG_PORT_SERIAL; // Tried set_trn to turn transceiver on/off but turning it on isn't enabled in hamlib for some reason // So we use PTT instead -// rig->state.transceive = RIG_TRN_RIG; // this allows xg3_set_trn to be called - rig->state.current_vfo = RIG_VFO_A; +// STATE(rig)->transceive = RIG_TRN_RIG; // this allows xg3_set_trn to be called + STATE(rig)->current_vfo = RIG_VFO_A; // priv->last_vfo = RIG_VFO_A; // priv->ptt = RIG_PTT_ON; // priv->powerstat = RIG_POWER_ON; @@ -352,7 +352,7 @@ int xg3_get_vfo(RIG *rig, vfo_t *vfo) return -RIG_EINVAL; } - *vfo = rig->state.current_vfo; // VFOA or MEM + *vfo = STATE(rig)->current_vfo; // VFOA or MEM return RIG_OK; } @@ -372,7 +372,7 @@ int xg3_set_vfo(RIG *rig, vfo_t vfo) // We don't actually set the vfo on the XG3 // But we need this so we can set frequencies on the band buttons - rig->state.current_vfo = vfo; + STATE(rig)->current_vfo = vfo; return RIG_OK; } @@ -388,7 +388,7 @@ int xg3_set_freq(RIG *rig, vfo_t vfo, freq_t freq) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); tvfo = (vfo == RIG_VFO_CURR || - vfo == RIG_VFO_VFO) ? rig->state.current_vfo : vfo; + vfo == RIG_VFO_VFO) ? STATE(rig)->current_vfo : vfo; switch (tvfo) { @@ -440,7 +440,7 @@ int xg3_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) } tvfo = (vfo == RIG_VFO_CURR || - vfo == RIG_VFO_VFO) ? rig->state.current_vfo : vfo; + vfo == RIG_VFO_VFO) ? STATE(rig)->current_vfo : vfo; rp = RIGPORT(rig); switch (tvfo) commit 4b436479d1667f1ee3f9f50db07a2a3fc9bdb7e4 Author: George Baltz N3GB <Geo...@gm...> Date: Sat Mar 16 11:25:46 2024 -0400 More pointers to state diff --git a/rigs/kenwood/elecraft.c b/rigs/kenwood/elecraft.c index 05b32835f..dc2e8c6cb 100644 --- a/rigs/kenwood/elecraft.c +++ b/rigs/kenwood/elecraft.c @@ -96,10 +96,10 @@ int elecraft_open(RIG *rig) { int err; char buf[KENWOOD_MAX_BUF_LEN]; - struct kenwood_priv_data *priv = rig->state.priv; char *model = "Unknown"; - struct rig_state *rs = &rig->state; + struct rig_state *rs = STATE(rig); struct hamlib_port *rp = RIGPORT(rig); + struct kenwood_priv_data *priv = rs->priv; rig_debug(RIG_DEBUG_VERBOSE, "%s called, rig version=%s\n", __func__, rig->caps->version); @@ -395,7 +395,7 @@ int elecraft_open(RIG *rig) int elecraft_close(RIG *rig) { - const struct kenwood_priv_data *priv = rig->state.priv; + const struct kenwood_priv_data *priv = STATE(rig)->priv; if (priv->save_k2_ext_lvl >= 0) { @@ -622,12 +622,12 @@ int elecraft_get_vfo_tq(RIG *rig, vfo_t *vfo) rig_debug(RIG_DEBUG_ERR, "%s: unable to parse TQ '%s'\n", __func__, splitbuf); } - *vfo = rig->state.tx_vfo = RIG_VFO_A; + *vfo = STATE(rig)->tx_vfo = RIG_VFO_A; - if (tq && ft == 1) { *vfo = rig->state.tx_vfo = RIG_VFO_B; } - else if (tq && ft =... [truncated message content] |
From: n0nb <n0...@us...> - 2024-03-25 22:26:59
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via dc375c6d005c1c143a7088e5792d10d6638e29f0 (commit) via 624e00dcb4d95c7cbb2b6d5f7c4fa2f237106573 (commit) via 31ea63b2f3f2ba476f65e43b35a4d841179ce1bd (commit) via c3429084fb2ff9d4d5e8efcc06411063566234c7 (commit) via 12ae80c0c5a9b02fd2bae405ae836eef6421e26a (commit) via 7a7b52b89c015d812748ba7ddebe83704d4fed7a (commit) via 1881b2e20618889150dfd47a22b1a4f99afd1886 (commit) via 1b3481ba9517662d4e9859c93a0b5f8108a5e755 (commit) via f51e7ef760300c3711b4e640b8c4a0e071656b55 (commit) via 2feb4cc65cd3cde925f3f872d09c912cd339b3eb (commit) via 538d41b9e8c7dfe9a80e4410b2eab7af9cf956d7 (commit) via 9331f9e5f40844ed3e9249e37d20916baa28e570 (commit) via 68bcae6ee86ed0b495575fd2da8f70953c311be7 (commit) from 1de9a5cede92b4847a32966c6b087ca91b74d113 (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 dc375c6d005c1c143a7088e5792d10d6638e29f0 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Mar 25 14:46:26 2024 -0500 Fix rig_get_split_vfo -- was almost always using cache diff --git a/src/rig.c b/src/rig.c index 3db6567e7..e19f0cfee 100644 --- a/src/rig.c +++ b/src/rig.c @@ -5825,7 +5825,7 @@ int HAMLIB_API rig_get_split_vfo(RIG *rig, struct rig_cache *cachep = CACHE(rig); int retcode; int cache_ms; - int use_cache; + int use_cache = 0; if (CHECK_RIG_ARG(rig)) { @@ -5854,6 +5854,7 @@ int HAMLIB_API rig_get_split_vfo(RIG *rig, if (caps->get_split_vfo == NULL || use_cache) { + rig_debug(RIG_DEBUG_TRACE, "%s: ?get_split_vfo=%d use_cache=%d\n", __func__, caps->get_split_vfo != NULL, use_cache); // if we can't get the vfo we will return whatever we have cached *split = cachep->split; *tx_vfo = cachep->split_vfo; commit 624e00dcb4d95c7cbb2b6d5f7c4fa2f237106573 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Mar 25 11:29:18 2024 -0500 Fix FLRig reading of bandwith when FIXED or "k" is read back diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index f61c96cd5..5afa4c6e0 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -1811,9 +1811,11 @@ static int flrig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) *width = atoi(p); - if (strstr(p, "k")) { *width *= 10000; } + if (strstr(p, "k")) { *width = *width * 1000; } - if (strcmp(p, "FIXED")) + rig_debug(RIG_DEBUG_ERR, "%s: p=%s, *width=%d\n", __func__, p, (int)(*width)); + + if (strcmp(p, "FIXED") == 0) { switch (*mode) { commit 31ea63b2f3f2ba476f65e43b35a4d841179ce1bd Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Mar 25 10:23:40 2024 -0500 Fix IC7300 bandwidth reading for AM/BM ....still need to fix setting bandwidth for AM/FM diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 98d010e60..58a45a25d 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -50,11 +50,11 @@ int ic9700_get_clock(RIG *rig, int *year, int *month, int *day, int ic9700_set_vfo(RIG *rig, vfo_t vfo); -#define IC7300_ALL_RX_MODES (RIG_MODE_FM|RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|RIG_MODE_PKTAM) +#define IC7300_ALL_RX_MODES (RIG_MODE_FM|RIG_MODE_PKTFM|RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|RIG_MODE_PKTAM) #define IC7300_1HZ_TS_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|RIG_MODE_PKTAM) #define IC7300_NOT_TS_MODES (IC7300_ALL_RX_MODES &~IC7300_1HZ_TS_MODES) -#define IC7300_OTHER_TX_MODES (RIG_MODE_FM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR) +#define IC7300_OTHER_TX_MODES (RIG_MODE_FM|RIG_MODE_PKTFM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR) #define IC7300_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_PKTAM) #define IC7300_FUNCS (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_SBKIN|RIG_FUNC_FBKIN|RIG_FUNC_NR|RIG_FUNC_MON|RIG_FUNC_MN|RIG_FUNC_ANF|RIG_FUNC_LOCK|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_SCOPE|RIG_FUNC_TUNER|RIG_FUNC_TRANSCEIVE|RIG_FUNC_SPECTRUM|RIG_FUNC_SPECTRUM_HOLD|RIG_FUNC_SEND_MORSE|RIG_FUNC_SEND_VOICE_MEM|RIG_FUNC_OVF_STATUS) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index e6e1bb6a4..a59d456cd 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -440,6 +440,7 @@ struct icom_addr #define TOK_FILTER_USBD TOKEN_BACKEND(5) #define TOK_FILTER_USB TOKEN_BACKEND(6) #define TOK_FILTER_CW TOKEN_BACKEND(7) +#define TOK_FILTER_FM TOKEN_BACKEND(8) const struct confparams icom_cfg_params[] = { @@ -474,6 +475,10 @@ const struct confparams icom_cfg_params[] = TOK_FILTER_CW, "filter_cw", "Filter to use CW", "Filter to use for CW/CWR when setting mode", "0", RIG_CONF_NUMERIC, {.n = {0, 3, 1}} }, + { + TOK_FILTER_FM, "filter_fm", "Filter to use FM", "Filter to use for FM/PKTFM when setting mode", + "0", RIG_CONF_NUMERIC, {.n = {0, 3, 1}} + }, {RIG_CONF_END, NULL,} }; @@ -1977,9 +1982,9 @@ pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode) } // TODO: Skip for Xiegu G90 too???? - if (mode == RIG_MODE_FM || mode == RIG_MODE_FMN - || RIG_MODEL_X108G == rig->caps->rig_model - || RIG_MODEL_X5105 == rig->caps->rig_model) + if (RIG_MODEL_X108G == rig->caps->rig_model + || RIG_MODEL_X5105 == rig->caps->rig_model + || RIG_MODEL_G90 == rig->caps->rig_model) { priv->no_1a_03_cmd = ENUM_1A_03_NO; } @@ -1992,7 +1997,7 @@ pbwidth_t icom_get_dsp_flt(RIG *rig, rmode_t mode) retval = icom_transaction(rig, C_CTL_MEM, fw_sub_cmd, 0, 0, resbuf, &res_len); - if (-RIG_ERJCTED == retval) + if (-RIG_ERJCTED == retval && !RIG_IS_IC7300) { if (priv->no_1a_03_cmd == ENUM_1A_03_UNK) { @@ -2108,6 +2113,13 @@ int icom_set_dsp_flt(RIG *rig, rmode_t mode, pbwidth_t width) flt_idx = width <= 500 ? ((width + 49) / 50) - 1 : ((width + 99) / 100) + 4; } + else if (mode & (RIG_MODE_FM | RIG_MODE_PKTFM)) + { + if (width <= 7000) width = 7000; + else if (width <= 10000) width = 10000; + else width=15000; + RETURNFUNC(RIG_OK); + } else { rig_debug(RIG_DEBUG_VERBOSE, "%s: unknown mode=%s\n", __func__, @@ -2311,17 +2323,22 @@ static int icom_set_mode_x26(RIG *rig, vfo_t vfo, rmode_t mode, buf[2] = priv->filter_usbd; } - if (priv->filter_usb > 0 && (mode == RIG_MODE_USB || mode == RIG_MODE_LSB)) + else if (priv->filter_usb > 0 && (mode == RIG_MODE_USB || mode == RIG_MODE_LSB)) { rig_debug(RIG_DEBUG_TRACE, "%s: filter usb=%d\n", __func__, priv->filter_usb); buf[2] = priv->filter_usb; } - if (priv->filter_cw > 0 && (mode == RIG_MODE_CW || mode == RIG_MODE_CWR)) + else if (priv->filter_cw > 0 && (mode == RIG_MODE_CW || mode == RIG_MODE_CWR)) { rig_debug(RIG_DEBUG_TRACE, "%s: filter cw=%d\n", __func__, priv->filter_cw); buf[2] = priv->filter_cw; } + else if (priv->filter_fm > 0 && (mode == RIG_MODE_FM || mode == RIG_MODE_PKTFM)) + { + rig_debug(RIG_DEBUG_TRACE, "%s: filter fm=%d\n", __func__, priv->filter_fm); + buf[2] = priv->filter_fm; + } int vfo_number = icom_get_vfo_number_x25x26(rig, vfo); @@ -2532,7 +2549,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) } if (((width != RIG_PASSBAND_NOCHANGE) && (width != current_width)) - || (priv->filter_usbd > 0 || priv->filter_usb > 0 || priv->filter_cw > 0)) + || (priv->filter_usbd > 0 || priv->filter_usb > 0 || priv->filter_cw > 0 || priv->filter_fm > 0)) { icom_set_dsp_flt(rig, mode, width); } @@ -2609,7 +2626,7 @@ static int icom_get_mode_without_data(RIG *rig, vfo_t vfo, rmode_t *mode, { priv_data->filter = 0; - if (mode_len == 2) { priv_data->filter = modebuf[2]; } + if (mode_len == 1) { priv_data->filter = modebuf[2]; } rig_debug(RIG_DEBUG_TRACE, "%s(%d): modebuf[0]=0x%02x, modebuf[1]=0x%02x, mode_len=%d\n", __func__, @@ -2683,7 +2700,16 @@ static int icom_get_mode_without_data(RIG *rig, vfo_t vfo, rmode_t *mode, *width = filter_width; - if (*mode == RIG_MODE_FM) { *width = 12000; } + if (*mode == RIG_MODE_FM) + { + *width = 12000; // some default to 12000 + if (RIG_IS_IC7300) + { + if (priv_data->filter == 1) *width = 15000; + else if (priv_data->filter == 2) *width = 10000; + else if (priv_data->filter == 3) *width = 7000; + } + } RETURNFUNC2(RIG_OK); } @@ -5089,6 +5115,15 @@ int icom_set_conf(RIG *rig, hamlib_token_t token, const char *val) break; + case TOK_FILTER_FM: + priv->filter_fm = atoi(val); + + if (priv->filter_fm > 3) { priv->filter_fm = 3; } + + if (priv->filter_fm < 1) { priv->filter_fm = 1; } + + break; + default: RETURNFUNC(-RIG_EINVAL); } diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 0f4c80d8e..3c5d5e81a 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -296,6 +296,7 @@ struct icom_priv_data int filter_usbd; /*!< Filter number to use for USBD/LSBD when setting mode */ int filter_usb; /*!< Filter number to use for USB/LSB when setting mode */ int filter_cw; /*!< Filter number to use for CW/CWR when setting mode */ + int filter_fm; /*!< Filter number to use for CW/CWR when setting mode */ }; extern const struct ts_sc_list r8500_ts_sc_list[]; commit c3429084fb2ff9d4d5e8efcc06411063566234c7 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Mar 25 10:22:48 2024 -0500 Allow FLRig to use "k" values for bandwidth diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index be53202b5..f61c96cd5 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -143,7 +143,7 @@ struct rig_caps flrig_caps = RIG_MODEL(RIG_MODEL_FLRIG), .model_name = "", .mfg_name = "FLRig", - .version = "20240302.0", + .version = "20240325.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1808,15 +1808,19 @@ static int flrig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) /* we might get two values and then we want the 2nd one */ if (strchr(value, '|') != NULL) { p = strchr(value, '|') + 1; } + *width = atoi(p); + + if (strstr(p, "k")) { *width *= 10000; } + if (strcmp(p, "FIXED")) { - switch(*mode) + switch (*mode) { - case RIG_MODE_PKTAM: - case RIG_MODE_AM: - case RIG_MODE_PKTFM: - case RIG_MODE_FM: *width = 10000;break; + case RIG_MODE_PKTAM: + case RIG_MODE_AM: + case RIG_MODE_PKTFM: + case RIG_MODE_FM: *width = 10000; break; } } } commit 12ae80c0c5a9b02fd2bae405ae836eef6421e26a Merge: 1881b2e20 7a7b52b89 Author: Michael Black <mdb...@ya...> Date: Sun Mar 24 22:36:03 2024 -0500 Merge pull request #1529 from DJ3CE/k3kx3_swr Add SWR get_level to K3 (KX3, KX2) commit 7a7b52b89c015d812748ba7ddebe83704d4fed7a Author: Cedric DJ3CE <dj...@da...> Date: Fri Jan 12 01:45:28 2024 +0100 Add SWR get_level to K3 (KX3, KX2) Capabilities, level_gran and k3_get_level diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 19fff8297..eb70d37c0 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -63,7 +63,8 @@ #define KX3_LEVEL_ALL (RIG_LEVEL_ATT|RIG_LEVEL_PREAMP|RIG_LEVEL_AGC|RIG_LEVEL_SQL|\ RIG_LEVEL_STRENGTH|RIG_LEVEL_RFPOWER|RIG_LEVEL_KEYSPD|\ RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_MICGAIN|RIG_LEVEL_COMP|\ - RIG_LEVEL_NR|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_RAWSTR|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS) + RIG_LEVEL_NR|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_RAWSTR|RIG_LEVEL_RFPOWER_METER|\ + RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_SWR) /* * Elecraft K3/K3S extra level definitions @@ -2313,6 +2314,18 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; + case RIG_LEVEL_SWR: + retval = kenwood_safe_transaction(rig, "SW", levelbuf, sizeof(levelbuf), 5); + + if (retval != RIG_OK) + { + return retval; + } + + sscanf(levelbuf + 2, "%d", &val->i); + val->f = (float) val->i / 10.0f; + break; + default: return kenwood_get_level(rig, vfo, level, val); } diff --git a/rigs/kenwood/level_gran_elecraft.h b/rigs/kenwood/level_gran_elecraft.h index ad36095ca..4e3a24498 100644 --- a/rigs/kenwood/level_gran_elecraft.h +++ b/rigs/kenwood/level_gran_elecraft.h @@ -27,4 +27,5 @@ [LVL_COMP] = { .min = { .f = .0 }, .max = { .f = 1 }, .step = { .f = 1.0f/100.0f } }, [LVL_VOXGAIN] = { .min = { .f = .0 }, .max = { .f = 1 }, .step = { .f = 1.0f/100.0f } }, [LVL_ALC] = { .min = { .f = .0 }, .max = { .f = 1 }, .step = { .f = 1.0f/100.0f } }, + [LVL_SWR] = { .min = { .f = 1.0 }, .max = { .f = 99.9 }, .step = { .f = 1.0f/10.0f } }, commit 1881b2e20618889150dfd47a22b1a4f99afd1886 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Mar 23 11:52:26 2024 -0500 Fix FT1000MP rig_set_freq to set cache diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index 02897bb14..2a7f48f6a 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -313,7 +313,7 @@ struct rig_caps ft1000mp_caps = RIG_MODEL(RIG_MODEL_FT1000MP), .model_name = "FT-1000MP", .mfg_name = "Yaesu", - .version = "20240323.0", + .version = "20240323.1", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -849,14 +849,19 @@ static int ft1000mp_set_freq(RIG *rig, vfo_t vfo, freq_t freq) vfo = rig->state.current_vfo; } + // round freq to 10Hz intervals due to rig restriction + freq = round(freq / 10.0) * 10.0; + switch (vfo) { case RIG_VFO_A: cmd_index = FT1000MP_NATIVE_FREQA_SET; + CACHE(rig)->freqMainA = freq; break; case RIG_VFO_B: cmd_index = FT1000MP_NATIVE_FREQB_SET; + CACHE(rig)->freqMainB = freq; break; case RIG_VFO_MEM: @@ -874,9 +879,6 @@ static 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; - to_bcd(p->p_cmd, freq / 10, 8); /* store bcd format in in p_cmd */ rig_debug(RIG_DEBUG_TRACE, "%s: freq = %"PRIfreq" Hz\n", __func__, @@ -885,6 +887,7 @@ static int ft1000mp_set_freq(RIG *rig, vfo_t vfo, freq_t freq) cmd = p->p_cmd; /* get native sequence */ write_block(RIGPORT(rig), cmd, YAESU_CMD_LENGTH); + RETURNFUNC(RIG_OK); } commit 1b3481ba9517662d4e9859c93a0b5f8108a5e755 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Mar 23 09:57:15 2024 -0500 Fix FT-1000MP get_freq diff --git a/NEWS b/NEWS index 1cd13356e..47caff7a4 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ Version 5.x -- future * Change FT1000MP Mark V model names to align with FT1000MP Version 4.6 + * Added SDR Radio SDRConsole -- TS-2000 is now hardware flow control so need separate entry * Added --set-conf=filter_usb, filter_usbd, and filter_cw to allow Icom rigs set mode to set filter number too * Added macros for applications to obtain pointers to Hamlib structures(issues #1445, #1420, #487). Internal conversion is still a WIP, but use of these macros will make the final cutover transparent to applications. diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index 084a9c7c4..02897bb14 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -313,7 +313,7 @@ struct rig_caps ft1000mp_caps = RIG_MODEL(RIG_MODEL_FT1000MP), .model_name = "FT-1000MP", .mfg_name = "Yaesu", - .version = "20240229.0", + .version = "20240323.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -939,8 +939,6 @@ static int ft1000mp_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) *freq = CACHE(rig)->freqMainB; } - return RIG_OK; - RETURNFUNC(RIG_OK); } commit f51e7ef760300c3711b4e640b8c4a0e071656b55 Author: Mike Black W9MDB <mdb...@ya...> Date: Sat Mar 23 08:46:56 2024 -0500 Add SDRConsole rig entry since TS-2000 is now hardware flow control by default diff --git a/include/hamlib/riglist.h b/include/hamlib/riglist.h index 85fdc4fe2..4f09e4991 100644 --- a/include/hamlib/riglist.h +++ b/include/hamlib/riglist.h @@ -204,6 +204,7 @@ #define RIG_MODEL_FX4 RIG_MAKE_MODEL(RIG_KENWOOD,53) #define RIG_MODEL_THETIS RIG_MAKE_MODEL(RIG_KENWOOD, 54) #define RIG_MODEL_TRUSDX RIG_MAKE_MODEL(RIG_KENWOOD, 55) +#define RIG_MODEL_SDRCONSOLE RIG_MAKE_MODEL(RIG_KENWOOD, 56) /* * Icom diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 4ff44d1cb..19b54fabe 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -6190,6 +6190,7 @@ DECLARE_INITRIG_BACKEND(kenwood) rig_register(&kx3_caps); rig_register(&k4_caps); rig_register(&xg3_caps); + rig_register(&sdrconsole_caps); rig_register(&ts440_caps); rig_register(&ts940_caps); diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 7e97593ae..eb6aee8e0 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -291,6 +291,7 @@ extern struct rig_caps kx3_caps; extern struct rig_caps k4_caps; extern struct rig_caps xg3_caps; extern struct rig_caps trc80_caps; +extern struct rig_caps sdrconsole_caps; extern struct rig_caps thd7a_caps; extern struct rig_caps thd72a_caps; diff --git a/rigs/kenwood/ts2000.c b/rigs/kenwood/ts2000.c index a1e2bf999..5e127407e 100644 --- a/rigs/kenwood/ts2000.c +++ b/rigs/kenwood/ts2000.c @@ -1915,3 +1915,249 @@ struct rig_caps ts2000_caps = .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; +/* + * SDRConsole TS-2000 rig capabilities + * SDRConsole does not use hardware flow control for example + */ +struct rig_caps sdrconsole_caps = +{ + RIG_MODEL(RIG_MODEL_SDRCONSOLE), + .model_name = "SDRConsole", + .mfg_name = "SDR Radio", + .version = BACKEND_VER ".2", + .copyright = "LGPL", + .status = RIG_STATUS_STABLE, + .rig_type = RIG_TYPE_TRANSCEIVER, + .ptt_type = RIG_PTT_RIG, + .dcd_type = RIG_DCD_RIG, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 1200, + .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, /* ms */ + .timeout = 200, + .retry = 3, + + .has_get_func = TS2000_FUNC_ALL, + .has_set_func = TS2000_FUNC_ALL, + .has_get_level = TS2000_LEVEL_GET, + .has_set_level = TS2000_LEVEL_SET, + .has_get_parm = RIG_PARM_NONE, + .has_set_parm = RIG_PARM_NONE, + .level_gran = + { +#include "level_gran_kenwood.h" + [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 30 }, .step = { .i = 1 } }, + [LVL_KEYSPD] = {.min = {.i = 10}, .max = {.i = 60}, .step = {.i = 1}}, + [LVL_CWPITCH] = {.min = {.i = 400}, .max = {.i = 1000}, .step = {.i = 50}}, + [LVL_BKIN_DLYMS] = {.min = {.i = 0}, .max = {.i = 1000}, .step = {.i = 50}}, + [LVL_SLOPE_LOW] = {.min = {.i = 0}, .max = {.i = 1000}, .step = {.i = 10}}, + [LVL_SLOPE_HIGH] = {.min = {.i = 0}, .max = {.i = 5000}, .step = {.i = 10}}, + }, + .parm_gran = {}, + .vfo_ops = TS2000_VFO_OPS, + .scan_ops = TS2000_SCAN_OP, + .ctcss_list = ts2000_ctcss_list, + .dcs_list = ts2000_dcs_list, + .preamp = { 12, RIG_DBLST_END, }, + .attenuator = { 12, RIG_DBLST_END, }, + .max_rit = kHz(20), + .max_xit = kHz(20), + .max_ifshift = kHz(1), + .targetable_vfo = RIG_TARGETABLE_FREQ, + .transceive = RIG_TRN_RIG, + .agc_level_count = 5, + .agc_levels = { RIG_AGC_OFF, RIG_AGC_SLOW, RIG_AGC_MEDIUM, RIG_AGC_FAST, RIG_AGC_SUPERFAST }, + .bank_qty = 0, + .chan_desc_sz = 7, + + .chan_list = { + { 0, 299, RIG_MTYPE_MEM, TS2000_MEM_CAP }, + { 1, 3, RIG_MTYPE_MORSE }, + RIG_CHAN_END, + }, + + .rx_range_list1 = { + {kHz(300), MHz(60), TS2000_ALL_MODES, -1, -1, TS2000_MAINVFO, TS2000_ANTS}, + {MHz(144), MHz(146), TS2000_ALL_MODES, -1, -1, TS2000_MAINVFO}, + {MHz(430), MHz(440), TS2000_ALL_MODES, -1, -1, TS2000_MAINVFO}, + {MHz(144), MHz(146), TS2000_ALL_MODES, -1, -1, TS2000_SUBVFO}, + {MHz(430), MHz(440), TS2000_ALL_MODES, -1, -1, TS2000_SUBVFO}, + RIG_FRNG_END, + }, /* rx range */ + .tx_range_list1 = { + {kHz(1830), kHz(1850), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, + {kHz(1830), kHz(1850), TS2000_AM_TX_MODES, 2000, 25000, TS2000_MAINVFO, TS2000_ANTS}, + {kHz(3500), kHz(3800), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, + {kHz(3500), kHz(3800), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(7), kHz(7100), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(7), kHz(7100), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(10.1), MHz(10.15), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(10.1), MHz(10.15), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(14), kHz(14350), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(14), kHz(14350), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, + {kHz(18068), kHz(18168), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, + {kHz(18068), kHz(18168), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(21), kHz(21450), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(21), kHz(21450), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, + {kHz(24890), kHz(24990), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, + {kHz(24890), kHz(24990), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(28), kHz(29700), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(28), kHz(29700), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(50), MHz(50.2), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(50), MHz(50.2), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(144), MHz(146), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO}, + {MHz(144), MHz(146), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO}, + {MHz(430), MHz(440), TS2000_OTHER_TX_MODES, W(5), W(50), TS2000_MAINVFO}, + {MHz(430), MHz(440), TS2000_AM_TX_MODES, W(5), W(12.5), TS2000_MAINVFO}, + RIG_FRNG_END, + }, /* tx range */ + + .rx_range_list2 = { + {kHz(300), MHz(60), TS2000_ALL_MODES, -1, -1, TS2000_MAINVFO, TS2000_ANTS}, + {MHz(142), MHz(152), TS2000_ALL_MODES, -1, -1, TS2000_MAINVFO}, + {MHz(420), MHz(450), TS2000_ALL_MODES, -1, -1, TS2000_MAINVFO}, + {MHz(118), MHz(174), TS2000_ALL_MODES, -1, -1, TS2000_SUBVFO}, + {MHz(220), MHz(512), TS2000_ALL_MODES, -1, -1, TS2000_SUBVFO}, + RIG_FRNG_END, + }, /* rx range */ + .tx_range_list2 = { + {kHz(1800), MHz(2), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, + {kHz(1800), MHz(2), TS2000_AM_TX_MODES, 2000, 25000, TS2000_MAINVFO, TS2000_ANTS}, + {kHz(3500), MHz(4), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, + {kHz(3500), MHz(4), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(7), kHz(7300), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(7), kHz(7300), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(10.1), MHz(10.15), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(10.1), MHz(10.15), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(14), kHz(14350), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(14), kHz(14350), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, + {kHz(18068), kHz(18168), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, + {kHz(18068), kHz(18168), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(21), kHz(21450), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(21), kHz(21450), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, + {kHz(24890), kHz(24990), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, + {kHz(24890), kHz(24990), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(28), kHz(29700), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(28), kHz(29700), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(50), MHz(54), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(50), MHz(54), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO, TS2000_ANTS}, + {MHz(144), MHz(148), TS2000_OTHER_TX_MODES, W(5), W(100), TS2000_MAINVFO}, + {MHz(144), MHz(148), TS2000_AM_TX_MODES, W(5), W(25), TS2000_MAINVFO}, + {MHz(430), MHz(450), TS2000_OTHER_TX_MODES, W(5), W(50), TS2000_MAINVFO}, + {MHz(430), MHz(450), TS2000_AM_TX_MODES, W(5), W(12.5), TS2000_MAINVFO}, + RIG_FRNG_END, + }, /* tx range */ + + .tuning_steps = { + {RIG_MODE_SSB | RIG_MODE_CW | RIG_MODE_RTTY, 1}, + {TS2000_ALL_MODES, 10}, + {TS2000_ALL_MODES, 100}, + {TS2000_ALL_MODES, kHz(1)}, + {TS2000_ALL_MODES, kHz(2.5)}, + {TS2000_ALL_MODES, kHz(5)}, + {RIG_MODE_AM | RIG_MODE_FM, kHz(6.25)}, + {TS2000_ALL_MODES, kHz(10)}, + {RIG_MODE_AM | RIG_MODE_FM, kHz(12.5)}, + {RIG_MODE_AM | RIG_MODE_FM, kHz(12.5)}, + {RIG_MODE_AM | RIG_MODE_FM, kHz(15)}, + {RIG_MODE_AM | RIG_MODE_FM, kHz(20)}, + {RIG_MODE_AM | RIG_MODE_FM, kHz(25)}, + {RIG_MODE_AM | RIG_MODE_FM, kHz(30)}, + {RIG_MODE_AM | RIG_MODE_FM, kHz(50)}, + {RIG_MODE_AM | RIG_MODE_FM, kHz(100)}, + {TS2000_ALL_MODES, MHz(1)}, + {TS2000_ALL_MODES, 0}, /* any tuning step */ + RIG_TS_END, + }, + + /* mode/filter list, remember: order matters! */ + .filters = { + {RIG_MODE_SSB, kHz(2.2)}, + {RIG_MODE_CW | RIG_MODE_CWR, Hz(200)}, + {RIG_MODE_CW | RIG_MODE_CWR, Hz(50)}, + {RIG_MODE_CW | RIG_MODE_CWR, Hz(1000)}, + {RIG_MODE_CW | RIG_MODE_CWR, Hz(80)}, + {RIG_MODE_CW | RIG_MODE_CWR, Hz(100)}, + {RIG_MODE_CW | RIG_MODE_CWR, Hz(150)}, + {RIG_MODE_CW | RIG_MODE_CWR, Hz(300)}, + {RIG_MODE_CW | RIG_MODE_CWR, Hz(400)}, + {RIG_MODE_CW | RIG_MODE_CWR, Hz(500)}, + {RIG_MODE_CW | RIG_MODE_CWR, Hz(600)}, + {RIG_MODE_CW | RIG_MODE_CWR, Hz(2000)}, + {RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(500)}, + {RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(250)}, + {RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(1000)}, + {RIG_MODE_RTTY | RIG_MODE_RTTYR, Hz(1500)}, + {RIG_MODE_AM, kHz(6)}, + {RIG_MODE_AM, kHz(2.4)}, + {RIG_MODE_FM, kHz(12)}, + {RIG_MODE_FM, kHz(6)}, + RIG_FLT_END, + }, + + .str_cal = TS2000_STR_CAL, + .swr_cal = TS2000_SWR_CAL, + + .ext_tokens = ts2000_ext_tokens, + .extfuncs = ts2000_ext_funcs, + .extlevels = ts2000_ext_levels, + + .priv = (void *)& ts2000_priv_caps, + + .rig_init = ts2000_init, + .rig_open = kenwood_open, + .rig_close = kenwood_close, + .rig_cleanup = kenwood_cleanup, + .set_freq = kenwood_set_freq, + .get_freq = kenwood_get_freq, + .set_rit = ts2000_set_rit, + .get_rit = ts2000_get_rit, + .set_xit = ts2000_set_rit, + .get_xit = ts2000_get_rit, + .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, + .set_ctcss_tone = kenwood_set_ctcss_tone_tn, + .get_ctcss_tone = kenwood_get_ctcss_tone, + .set_ctcss_sql = kenwood_set_ctcss_sql, + .get_ctcss_sql = kenwood_get_ctcss_sql, + .get_ptt = kenwood_get_ptt, + .set_ptt = kenwood_set_ptt, + .get_dcd = kenwood_get_dcd, + .set_func = ts2000_set_func, + .get_func = ts2000_get_func, + .set_level = ts2000_set_level, + .get_level = ts2000_get_level, + .set_ext_func = ts2000_set_ext_func, + .get_ext_func = ts2000_get_ext_func, + .set_ext_level = ts2000_set_ext_level, + .get_ext_level = ts2000_get_ext_level, + .set_ant = kenwood_set_ant, + .get_ant = kenwood_get_ant, + .send_morse = kenwood_send_morse, + .wait_morse = rig_wait_morse, + .send_voice_mem = kenwood_send_voice_mem, + .stop_voice_mem = kenwood_stop_voice_mem, + .vfo_op = kenwood_vfo_op, + .scan = kenwood_scan, + .set_mem = kenwood_set_mem, + .get_mem = kenwood_get_mem, + .get_channel = ts2000_get_channel, + .set_channel = ts2000_set_channel, + .set_trn = kenwood_set_trn, + .get_trn = kenwood_get_trn, + .set_powerstat = kenwood_set_powerstat, + .get_powerstat = kenwood_get_powerstat, + .get_info = kenwood_get_info, + .reset = kenwood_reset, + + .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS +}; diff --git a/simulators/simic705.c b/simulators/simic705.c index e6bad1bb0..c0579d53e 100644 --- a/simulators/simic705.c +++ b/simulators/simic705.c @@ -37,8 +37,8 @@ int keyspd = 85; // 85=20WPM // we make B different from A to ensure we see a difference at startup float freqA = 14074000; float freqB = 14074500; -mode_t modeA = RIG_MODE_PKTUSB; -mode_t modeB = RIG_MODE_PKTUSB; +mode_t modeA = RIG_MODE_FM; +mode_t modeB = RIG_MODE_FM; int datamodeA = 0; int datamodeB = 0; pbwidth_t widthA = 0; @@ -110,6 +110,7 @@ void frameParse(int fd, unsigned char *frame, int len) return; } +printf("Here#1\n"); dumphex(frame, len); if (frame[0] != 0xfe && frame[1] != 0xfe) diff --git a/src/conf.c b/src/conf.c index 8302f89a2..5e00e8d38 100644 --- a/src/conf.c +++ b/src/conf.c @@ -1452,6 +1452,7 @@ int HAMLIB_API rig_set_conf(RIG *rig, hamlib_token_t token, const char *val) */ int HAMLIB_API rig_get_conf(RIG *rig, hamlib_token_t token, char *val) { + printf("tokendid=%lx, %s\n", token, val); return rig_get_conf2(rig, token, val, 128); } commit 2feb4cc65cd3cde925f3f872d09c912cd339b3eb Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Mar 21 17:04:37 2024 -0500 Fix IC7700 get_mode_without_data diff --git a/rigs/icom/ic7700.c b/rigs/icom/ic7700.c index f9be28d1d..b9b1edc43 100644 --- a/rigs/icom/ic7700.c +++ b/rigs/icom/ic7700.c @@ -277,7 +277,7 @@ struct rig_caps ic7700_caps = RIG_MODEL(RIG_MODEL_IC7700), .model_name = "IC-7700", .mfg_name = "Icom", - .version = BACKEND_VER ".4", + .version = BACKEND_VER ".5", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 921259642..e6e1bb6a4 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2578,7 +2578,7 @@ static int icom_get_mode_without_data(RIG *rig, vfo_t vfo, rmode_t *mode, // Use command 0x26 to get selected/unselected or Main/Sub VFO mode, data mode and filter width // IC-7800 can set, but not read with 0x26 (although manual states otherwise?) - if ((rs->targetable_vfo & RIG_TARGETABLE_MODE) && !RIG_IS_IC7800 + if ((rs->targetable_vfo & RIG_TARGETABLE_MODE) && !RIG_IS_IC7800 && !RIG_IS_IC7700 && !force_vfo_swap) { retval = icom_get_mode_x26(rig, vfo, &mode_len, modebuf); commit 538d41b9e8c7dfe9a80e4410b2eab7af9cf956d7 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Mar 19 17:51:03 2024 -0500 Fix Xiegu X6100 https://github.com/Hamlib/Hamlib/issues/1499 diff --git a/rigs/icom/xiegu.c b/rigs/icom/xiegu.c index 9fa3142dd..97efc7c0b 100644 --- a/rigs/icom/xiegu.c +++ b/rigs/icom/xiegu.c @@ -139,6 +139,10 @@ int xiegu_rig_open(RIG *rig) int cmd = 0x19; int subcmd = 0x00; unsigned short iid; + + retval = icom_rig_open(rig); + if (retval != RIG_OK) return retval; + retval = icom_transaction(rig, cmd, subcmd, NULL, 0, id, &id_len); if (retval == RIG_OK) @@ -149,12 +153,13 @@ int xiegu_rig_open(RIG *rig) { case 0x0090: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "G90/G90S");break; case 0x0106: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "G106/G106C");break; - case 0x6100: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "X6100");break; + case 0x6100: + case 0xa400: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "X6100");break; default: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "Unknown");break; } } - return icom_rig_open(rig); + return retval; } /* @@ -349,7 +354,7 @@ struct rig_caps x108g_caps = static struct icom_priv_caps x6100_priv_caps = { - 0x70, /* default address */ + 0xa4, /* default address */ 0, /* 731 mode */ 0, /* no XCHG */ ic7200_ts_sc_list, commit 9331f9e5f40844ed3e9249e37d20916baa28e570 Author: Mike Black W9MDB <mdb...@ya...> Date: Tue Mar 19 16:19:52 2024 -0500 Fix TS890S to not give an error for STRENGTH or WATTS but return 0 as appropriate diff --git a/rigs/kenwood/ts890s.c b/rigs/kenwood/ts890s.c index 2b8ca60c7..ede63c181 100644 --- a/rigs/kenwood/ts890s.c +++ b/rigs/kenwood/ts890s.c @@ -322,7 +322,16 @@ int kenwood_ts890_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if ((ptt == RIG_PTT_OFF) != (level == RIG_LEVEL_STRENGTH)) { /* We're sorry, the number you have dialed is not in service */ - return -RIG_ENAVAIL; + if (level == RIG_LEVEL_RFPOWER_METER_WATTS) + { + val->f = 0; + } + else + { + val->i = 0; + } + + return RIG_OK; } /* Find out which meter type is in use */ @@ -482,7 +491,7 @@ struct rig_caps ts890s_caps = RIG_MODEL(RIG_MODEL_TS890S), .model_name = "TS-890S", .mfg_name = "Kenwood", - .version = BACKEND_VER ".14", + .version = BACKEND_VER ".15", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 68bcae6ee86ed0b495575fd2da8f70953c311be7 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Mar 18 17:24:07 2024 -0500 Some improvements on codan rigs diff --git a/rigs/codan/codan.c b/rigs/codan/codan.c index 6f9fc1cb8..f1fe2b51a 100644 --- a/rigs/codan/codan.c +++ b/rigs/codan/codan.c @@ -151,8 +151,8 @@ int codan_init(RIG *rig) int codan_open(RIG *rig) { char *results = NULL; - codan_transaction(rig, "scan off\r", 1, &results); - codan_transaction(rig, "echo off", 1, &results); + codan_transaction(rig, "\recho off", 1, &results); + codan_transaction(rig, "ver", 1, &results); //codan_transaction(rig, "prompt time", 1, &results); codan_transaction(rig, "login", 1, &results); diff --git a/rigs/codan/codan.h b/rigs/codan/codan.h index cd02ac1c0..ad334276a 100644 --- a/rigs/codan/codan.h +++ b/rigs/codan/codan.h @@ -24,9 +24,9 @@ #include "hamlib/rig.h" -#define BACKEND_VER "20211228" +#define BACKEND_VER "20240318" -#define EOM "\x0d" +#define EOM "\x0a" #define TRUE 1 #define FALSE 0 // For the current implemented command set 64 is long enough ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + include/hamlib/riglist.h | 1 + rigs/codan/codan.c | 4 +- rigs/codan/codan.h | 4 +- rigs/dummy/flrig.c | 20 +-- rigs/icom/ic7300.c | 4 +- rigs/icom/ic7700.c | 2 +- rigs/icom/icom.c | 55 +++++++-- rigs/icom/icom.h | 1 + rigs/icom/xiegu.c | 11 +- rigs/kenwood/k3.c | 15 ++- rigs/kenwood/kenwood.c | 1 + rigs/kenwood/kenwood.h | 1 + rigs/kenwood/level_gran_elecraft.h | 1 + rigs/kenwood/ts2000.c | 246 +++++++++++++++++++++++++++++++++++++ rigs/kenwood/ts890s.c | 13 +- rigs/yaesu/ft1000mp.c | 13 +- simulators/simic705.c | 5 +- src/conf.c | 1 + src/rig.c | 3 +- 20 files changed, 363 insertions(+), 39 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2024-03-17 16:02:46
|
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 1de9a5cede92b4847a32966c6b087ca91b74d113 (commit) via 0e572f631b8f4d75984f5b8f03b83ddce36eaf50 (commit) via 84d5f367f6b6631114e12fcf84e9b949411b1e55 (commit) via 6d257841a6e79dcb16b0e9efe1c1a9007904255f (commit) via 8449ac3c436065cbca6886a7ad469d1229268fdf (commit) via 1045620313669792c24f49df570d66a596faf95b (commit) via b9e59f205e029147c0e9fac12cc457c47582a954 (commit) via 6220da1eaf73d212b4d082035ef9de3ab8598522 (commit) via f119f5976aaa49fd7eca4997fbbd7b38796b49bf (commit) via 96ec37a276fd773b1a14f699bc033c4c2ef75a74 (commit) via 789d863f9779160ea6b204e84db1aaae29a702ae (commit) via c7665cb7d115acc12f57144c4f3431196241852f (commit) via aa0d83df959ec7dcd76546be45a72a17552db98f (commit) via 609065775c49da604d38b46b3fee601910d06e5d (commit) via 5ab1122139e4227fe124124fea6c4a8e9386db24 (commit) via 24135bd7d704dbf61c1f3cdf674cbb4159c59045 (commit) via b358cdbd2eb04ee89c6c6819775fb2adc8bbb039 (commit) via f3b8330331b145f893868a97420d5c6f428d2939 (commit) via 61211976872a798b709416a6671622cb93d4ed29 (commit) via 15a2b5a0dc3e40a57aac485b63499a1a06992255 (commit) via b9df1c7bda84092ab114838078b58a5133ef7eba (commit) via 4f3e40f3c6ec6b9a6e4dc72c31399f799f62e199 (commit) via bafb88432aced418aaaab73d70099eabbc0c6b1d (commit) via 2212c47ad7660f8228246ae4d8f72cf84e1cfc86 (commit) via f122f6422b86da02f8b101e55266acc253d0ae47 (commit) via 0868edbd659284f84290f2503680e52ec0342941 (commit) via dc38d19449a0a7e0c97298a46876887e484fb80c (commit) via c74b3c10c657aa14880eb860baf4cc540cc7e5eb (commit) via a96a97ae3ce24df355cf2cc774b8da4034bd2857 (commit) via 7831dfc311cec469e7d0dfc9af2574e05cd9fe88 (commit) via bb9b1f1783f23a415f22863de7b63611021f0c0a (commit) via 12404aa8a6498e871b664993a1320e433069f70e (commit) via cef2525d0f09ee6557736cdd7c98aeb6abf5924c (commit) via 728db84c0c1d0ec22a096ee1bcfba1182fed8df1 (commit) via 07f8023d17f96ffc2898d5713a33221ce494301c (commit) via 55db73894fb71b3fcb3a676dc421cd88a419806f (commit) via 0fdc78c6043ebb3f9dd0df9b2d913ddfabe9e02f (commit) via 0f74a23b142e8e3ec33ed0907fb9c0c1798baeb7 (commit) via 7f02c35562da9946c4ab398eeb781deaeac1b171 (commit) via a8f7da8fc4e325ac5a87ad7f665e43e54d00233b (commit) via c15f5b0da01ee8308d94d42bac71ecb501a3782b (commit) via c6371a14a1786f8ed2eb00e121efb200287cd2fd (commit) via 65d2023b95695e14493024246ceec7013c44fb32 (commit) via c68ef118e9cbb10807e9f1eebf0823e60624a7e1 (commit) via 25ee5d65d592e80f7471806c2959ded06ece1b69 (commit) via eaae02ef008e117d8ad5f2568776a6c2b393a193 (commit) via 45db5d32c3cb61cbf0ac0ffd0d482cf0f57df126 (commit) via 7bda13f0e0f7a257b9e36fe7b13dee3ceb3a42c7 (commit) via b65997a24929edfa4809e7912413ddb25ebfacac (commit) via 7ee8c358cd056ff5f5ccc965da605f3329f7d6c3 (commit) via 5f92b19ef4882da83bbbfcf30ea61384ca9b7791 (commit) via 5089949f100ed31f8e321d84221b90efbc2793af (commit) via 83f5655a9fec53811250e8d20d2c04342700b304 (commit) via 1b2f6a84f7a2b322593eead90f3f278008ee8464 (commit) via 9f87279b0b2b3e9dad4391f4daae657ed6b33806 (commit) via c1f8b091abe305dadbf9a08777532bd1b9ce23ad (commit) via 3967e41fcf2463a5b11fea12f4527b44d47d06d6 (commit) via 2849a756762fd73ced678de01958ed73b1c1eb4b (commit) via fff8e83c111ff7476c4accae27d99b849da39530 (commit) via c23948c8f4711e6d2dc8422bf904a912c2579d42 (commit) via 911692c715f658600d4c5c1a90aea3cc24b222f2 (commit) via db6dc9251330e953423cfeaba79825858f2bde41 (commit) via 8ff07c47f9d0c3cf13aaed05dfcc9607933ba014 (commit) via f247ee20888acb9dfb66f9e4455fbc14a2d41d36 (commit) via 878117ab1f342d0e04b7bbd9998accb30665bbee (commit) from 8cc6ce131926b49a2a6bd5e1b1268f98fa00fc78 (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 1de9a5cede92b4847a32966c6b087ca91b74d113 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Mar 17 09:01:58 2024 -0500 Fix compile warning on rig_debug messages https://github.com/Hamlib/Hamlib/issues/1525 diff --git a/rigs/kenwood/elecraft.c b/rigs/kenwood/elecraft.c index e349882cb..05b32835f 100644 --- a/rigs/kenwood/elecraft.c +++ b/rigs/kenwood/elecraft.c @@ -457,12 +457,12 @@ int verify_kenwood_id(RIG *rig, char *id) if (strcmp("017", idptr) != 0) { - rig_debug(RIG_DEBUG_VERBOSE, "%s: Rig (%s) is not a K2 or K3\n", __func__, id); + rig_debug(RIG_DEBUG_VERBOSE, "%s: Rig (%.4095s) is not a K2 or K3\n", __func__, id); // return -RIG_EPROTO; } else { - rig_debug(RIG_DEBUG_VERBOSE, "%s: Rig ID is %s\n", __func__, id); + rig_debug(RIG_DEBUG_VERBOSE, "%s: Rig ID is %.4095s\n", __func__, id); } return RIG_OK; diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 41e21f89d..4ff44d1cb 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -270,7 +270,7 @@ int kenwood_transaction(RIG *rig, const char *cmdstr, char *data, if (datasize > 0 && datasize < (cmdstr ? strlen(cmdstr) : 0)) { rig_debug(RIG_DEBUG_WARN, - "%s called cmd=%s datasize=%d, datasize < cmd length?\n", __func__, + "%s called cmd=%.4095s datasize=%d, datasize < cmd length?\n", __func__, cmdstr ? cmdstr : "(NULL)", (int)datasize); } diff --git a/rigs/winradio/g313-posix.c b/rigs/winradio/g313-posix.c index 4ee963d7d..1fb7ac798 100644 --- a/rigs/winradio/g313-posix.c +++ b/rigs/winradio/g313-posix.c @@ -553,7 +553,7 @@ int g313_set_conf(RIG *rig, hamlib_token_t token, const char *val) case TOK_SHM_AUDIO: if (len > (FIFO_PATHNAME_SIZE - 1)) { - rig_debug(RIG_DEBUG_WARN, "%s: set audio_path %s is too long\n", __func__, val); + rig_debug(RIG_DEBUG_WARN, "%s: set audio_path %.4095s is too long\n", __func__, val); return -RIG_EINVAL; } @@ -566,7 +566,7 @@ int g313_set_conf(RIG *rig, hamlib_token_t token, const char *val) case TOK_SHM_IF: if (len > (FIFO_PATHNAME_SIZE - 1)) { - rig_debug(RIG_DEBUG_WARN, "%s: set if_path %s is too long\n", __func__, val); + rig_debug(RIG_DEBUG_WARN, "%s: set if_path %.4095s is too long\n", __func__, val); return -RIG_EINVAL; } @@ -579,7 +579,7 @@ int g313_set_conf(RIG *rig, hamlib_token_t token, const char *val) case TOK_SHM_SPECTRUM: if (len > (FIFO_PATHNAME_SIZE - 1)) { - rig_debug(RIG_DEBUG_WARN, "%s: set spectrum_path %s is too long\n", __func__, + rig_debug(RIG_DEBUG_WARN, "%s: set spectrum_path %.4095s is too long\n", __func__, val); return -RIG_EINVAL; } commit 0e572f631b8f4d75984f5b8f03b83ddce36eaf50 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Mar 17 08:53:53 2024 -0500 Update simft897.c diff --git a/simulators/simft897.c b/simulators/simft897.c index f473f96d9..892d39fde 100644 --- a/simulators/simft897.c +++ b/simulators/simft897.c @@ -129,7 +129,11 @@ again: case 0xF5: printf("FREQ\n"); break; - case 0x81: printf("VFO TOGGLE\n"); break; + case 0x81: + rx_vfo = rx_vfo == 0? 1: 0; + printf("VFO TOGGLE to %dE\n", rx_vfo); + break; + case 0x02: printf("SPLIT ON\n"); break; @@ -147,7 +151,14 @@ again: case 0xE7: printf("READ RX STATUS\n"); break; - case 0xF7: printf("READ TX STATUS\n"); break; + case 0xF7: + printf("READ TX STATUS\n"); + buf[0] = 0x01; + buf[1] = 0x40; + buf[2] = 0x74; + buf[3] = 0x00; + buf[4] = 0x03; n = write(fd, buf, 5); + break; case 0x03: printf("READ RX STATUS\n"); commit 84d5f367f6b6631114e12fcf84e9b949411b1e55 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Mar 15 22:51:19 2024 -0500 Fix compile warning on testrig.c diff --git a/tests/testrig.c b/tests/testrig.c index 212d356fa..e73a4cd79 100644 --- a/tests/testrig.c +++ b/tests/testrig.c @@ -80,7 +80,7 @@ int main(int argc, const char *argv[]) uint64_t levels = rig_get_caps_int(my_rig->caps->rig_model, RIG_CAPS_HAS_GET_LEVEL); - printf("HAS_GET_LEVEL=0x%8llx, SWR=%8llx,true=%d\n", levels, + printf("HAS_GET_LEVEL=0x%8lx, SWR=%8llx,true=%d\n", levels, levels & RIG_LEVEL_SWR, (levels & RIG_LEVEL_SWR) == RIG_LEVEL_SWR); char val[256]; commit 6d257841a6e79dcb16b0e9efe1c1a9007904255f Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Mar 15 16:46:14 2024 -0500 Fix some memory leaks in rigctl_parse.c diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index e92fb5660..5c6a24b76 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -1175,12 +1175,14 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc, if (!input_line) { fprintf_flush(fout, "\n"); + free(rp_hist_buf); return (RIGCTL_PARSE_END); } /* Q or q to quit */ if (!(strncasecmp(input_line, "q", 1))) { + free(rp_hist_buf); return (RIGCTL_PARSE_END); } @@ -1189,12 +1191,14 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc, { usage_rig(fout); fflush(fout); + free(rp_hist_buf); return (RIG_OK); } /* '#' for comment */ if (!(strncmp(input_line, "#", 1))) { + free(rp_hist_buf); return (RIG_OK); } @@ -1203,6 +1207,7 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc, { fprintf(fout, "? for help, q to quit.\n"); fflush(fout); + free(rp_hist_buf); return (RIG_OK); } @@ -1227,6 +1232,7 @@ readline_repeat: { /* Oops! Invoke GDB!! */ fprintf_flush(fout, "\n"); + free(rp_hist_buf); return (RIGCTL_PARSE_END); } @@ -1286,6 +1292,7 @@ readline_repeat: { fprintf(stderr, "Valid multiple character command names contain alphanumeric characters plus '_'\n"); + free(rp_hist_buf); return (RIG_OK); } } @@ -1295,12 +1302,14 @@ readline_repeat: /* Single '\' entered, prompt again */ else if ((*parsed_input[0] == '\\') && (strlen(parsed_input[0]) == 1)) { + free(rp_hist_buf); return (RIG_OK); } /* Multiple characters but no leading '\' */ else { fprintf(stderr, "Precede multiple character command names with '\\'\n"); + free(rp_hist_buf); return (RIG_OK); } @@ -1317,6 +1326,7 @@ readline_repeat: fprintf(stderr, "Command '%c' not found!\n", cmd); } + free(rp_hist_buf); return (RIG_OK); } @@ -1342,6 +1352,7 @@ readline_repeat: if (!input_line) { fprintf_flush(fout, "\n"); + free(rp_hist_buf); return (RIGCTL_PARSE_END); } @@ -1350,6 +1361,7 @@ readline_repeat: { fprintf(fout, "? for help, q to quit.\n"); fflush(fout); + free(rp_hist_buf); return (RIG_OK); } @@ -1365,6 +1377,7 @@ readline_repeat: else { fprintf_flush(fout, "\n"); + free(rp_hist_buf); return (RIGCTL_PARSE_END); } } @@ -1444,6 +1457,7 @@ readline_repeat: { fprintf(fout, "? for help, q to quit.\n"); fflush(fout); + free(rp_hist_buf); return (RIG_OK); } @@ -1454,6 +1468,7 @@ readline_repeat: else { fprintf_flush(fout, "\n"); + free(rp_hist_buf); return (RIGCTL_PARSE_END); } } @@ -1506,6 +1521,7 @@ readline_repeat: { fprintf(fout, "? for help, q to quit.\n"); fflush(fout); + free(rp_hist_buf); return (RIG_OK); } @@ -1518,6 +1534,7 @@ readline_repeat: else { fprintf_flush(fout, "\n"); + free(rp_hist_buf); return (RIGCTL_PARSE_END); } } @@ -1572,6 +1589,7 @@ readline_repeat: { fprintf(fout, "? for help, q to quit.\n"); fflush(fout); + free(rp_hist_buf); return (RIG_OK); } @@ -1584,6 +1602,7 @@ readline_repeat: else { fprintf_flush(fout, "\n"); + free(rp_hist_buf); return (RIGCTL_PARSE_END); } } @@ -1638,6 +1657,7 @@ readline_repeat: { fprintf(fout, "? for help, q to quit.\n"); fflush(fout); + free(rp_hist_buf); return (RIG_OK); } @@ -1650,6 +1670,7 @@ readline_repeat: else { fprintf_flush(fout, "\n"); + free(rp_hist_buf); return (RIGCTL_PARSE_END); } } commit 8449ac3c436065cbca6886a7ad469d1229268fdf Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Mar 15 07:29:03 2024 -0500 Update simulators diff --git a/simulators/Makefile.am b/simulators/Makefile.am index 2ea8fee66..12c290686 100644 --- a/simulators/Makefile.am +++ b/simulators/Makefile.am @@ -8,7 +8,7 @@ DISTCLEANFILES = bin_PROGRAMS = -check_PROGRAMS = simelecraft simicgeneric simkenwood simyaesu simic9100 simic9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simtmd700 simrotorez simspid simft817 simts590 simft847 simic7300 simic7000 simic7100 simic7200 simatd578 simic905 simts450 simic7600 simic7610 simic705 simts950 simts990 simic7851 simftdx101 simxiegug90 simqrplabs simft818 simic275 simtrusdx simft1000 simtmd710 simts890 simxiegux108g simxiegux6100 simic910 simft450 +check_PROGRAMS = simelecraft simicgeneric simkenwood simyaesu simic9100 simic9700 simft991 simftdx1200 simftdx3000 simjupiter simpowersdr simid5100 simft736 simftdx5000 simtmd700 simrotorez simspid simft817 simts590 simft847 simic7300 simic7000 simic7100 simic7200 simatd578 simic905 simts450 simic7600 simic7610 simic705 simts950 simts990 simic7851 simftdx101 simxiegug90 simqrplabs simft818 simic275 simtrusdx simft1000 simtmd710 simts890 simxiegux108g simxiegux6100 simic910 simft450 simelecraftk4 simelecraft_SOURCES = simelecraft.c simkenwood_SOURCES = simkenwood.c diff --git a/simulators/simelecraft.c b/simulators/simelecraft.c index 9296d7dbc..10fbee1f2 100644 --- a/simulators/simelecraft.c +++ b/simulators/simelecraft.c @@ -35,6 +35,8 @@ int rxattenuatorB = 0; int keyspd = 20; int ai = 0; int dt = 0; +int modea = 2; +int modeb = 2; // ID 0310 == 310, Must drop leading zero typedef enum nc_rigid_e @@ -122,14 +124,13 @@ int main(int argc, char *argv[]) char *pbuf; int n; int fd = openPort(argv[1]); - int modea = 3, modeb = 3; int freqa = 14074000, freqb = 14073500; while (1) { buf[0] = 0; - if ((n = getmyline(fd, buf)) > 0) { printf("Cmd:%s, len=%d\n", buf, n); } + if ((n = getmyline(fd, buf)) > 0) { if (strstr(buf,"BW")) printf("Cmd:%s, len=%d\n", buf, n); } else {continue; } if (strcmp(buf, "RM5;") == 0) diff --git a/simulators/simelecraft.c b/simulators/simelecraftk4.c similarity index 93% copy from simulators/simelecraft.c copy to simulators/simelecraftk4.c index 9296d7dbc..1aa4cad2f 100644 --- a/simulators/simelecraft.c +++ b/simulators/simelecraftk4.c @@ -19,14 +19,14 @@ struct ip_mreq #define BUFSIZE 256 -float freqA = 14074000; -float freqB = 14074500; +int freqA = 14074000; +int freqB = 14074500; int afgain = 180; int rfgain = 190; int micgain = 30; int noiseblanker = 0; -int bandwidthA = 2200; -int bandwidthB = 2400; +int bandwidthA = 200; +int bandwidthB = 200; int ifshift = 0; int preampA = 0; int preampB = 0; @@ -35,6 +35,9 @@ int rxattenuatorB = 0; int keyspd = 20; int ai = 0; int dt = 0; +int modeA = 2; +int modeB = 2; +// int freqa = 14074000, freqb = 14073500; // ID 0310 == 310, Must drop leading zero typedef enum nc_rigid_e @@ -122,14 +125,12 @@ int main(int argc, char *argv[]) char *pbuf; int n; int fd = openPort(argv[1]); - int modea = 3, modeb = 3; - int freqa = 14074000, freqb = 14073500; while (1) { buf[0] = 0; - if ((n = getmyline(fd, buf)) > 0) { printf("Cmd:%s, len=%d\n", buf, n); } + if ((n = getmyline(fd, buf)) > 0) { if (strstr(buf,"BW0")) printf("Cmd:%s, len=%d\n", buf, n); } else {continue; } if (strcmp(buf, "RM5;") == 0) @@ -317,37 +318,37 @@ int main(int argc, char *argv[]) } else if (strcmp(buf, "MD;") == 0) { - SNPRINTF(buf, sizeof(buf), "MD%d;", modea); + SNPRINTF(buf, sizeof(buf), "MD%d;", modeA); WRITE(fd, buf, strlen(buf)); } else if (strcmp(buf, "MD$;") == 0) { - SNPRINTF(buf, sizeof(buf), "MD$%d;", modeb); + SNPRINTF(buf, sizeof(buf), "MD$%d;", modeB); WRITE(fd, buf, strlen(buf)); } else if (strncmp(buf, "MD", 2) == 0) { - if (buf[2] == '$') { sscanf(buf, "MD$%d;", &modeb); } - else { sscanf(buf, "MD%d;", &modea); } + if (buf[2] == '$') { sscanf(buf, "MD$%d;", &modeB); } + else { sscanf(buf, "MD%d;", &modeA); } } else if (strcmp(buf, "FA;") == 0) { - SNPRINTF(buf, sizeof(buf), "FA%011d;", freqa); + SNPRINTF(buf, sizeof(buf), "FA%011d;", freqA); WRITE(fd, buf, strlen(buf)); } else if (strcmp(buf, "FB;") == 0) { - SNPRINTF(buf, sizeof(buf), "FB%011d;", freqb); + SNPRINTF(buf, sizeof(buf), "FB%011d;", freqB); WRITE(fd, buf, strlen(buf)); } else if (strncmp(buf, "FA", 2) == 0) { - sscanf(buf, "FA%d", &freqa); + sscanf(buf, "FA%d", &freqA); } else if (strncmp(buf, "FB", 2) == 0) { - sscanf(buf, "FB%d", &freqb); + sscanf(buf, "FB%d", &freqB); } else if (strncmp(buf, "FR;", 3) == 0) { diff --git a/simulators/simic910.c b/simulators/simic910.c index 9038f09c8..4b539de50 100644 --- a/simulators/simic910.c +++ b/simulators/simic910.c @@ -28,7 +28,7 @@ struct ip_mreq #define BUFSIZE 256 -#define X25 +//#define X25 int civ_731_mode = 0; vfo_t current_vfo = RIG_VFO_A; commit 1045620313669792c24f49df570d66a596faf95b Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Mar 15 07:27:19 2024 -0500 Return error on bad read_icom_frame diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 946040c73..5a4d58f60 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -301,6 +301,12 @@ again2: buf[0] = 0; frm_len = read_icom_frame(rp, buf, sizeof(buf)); + if (frm_len <= 0) + { + set_transaction_inactive(rig); + return frm_len; + } + if (frm_len > 4 && memcmp(buf, sendbuf, frm_len) == 0) { priv->serial_USB_echo_off = 0; commit b9e59f205e029147c0e9fac12cc457c47582a954 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Mar 14 22:43:10 2024 -0500 Fix compile error https://github.com/Hamlib/Hamlib/issues/1524 diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 59c9b3663..e92fb5660 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -101,7 +101,7 @@ extern int read_history(); #define ARG_OUT (ARG_OUT1|ARG_OUT2|ARG_OUT3|ARG_OUT4|ARG_OUT5) static int chk_vfo_executed; -char rigctld_password[64]; +char rigctld_password[65]; int is_passwordOK; int is_rigctld; extern int lock_mode; // used by rigctld commit 6220da1eaf73d212b4d082035ef9de3ab8598522 Merge: f119f5976 96ec37a27 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Mar 14 17:10:39 2024 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit f119f5976aaa49fd7eca4997fbbd7b38796b49bf Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Mar 14 17:09:36 2024 -0500 Fix build warning https://github.com/Hamlib/Hamlib/issues/1524 diff --git a/src/rig.c b/src/rig.c index f7bc8961f..3db6567e7 100644 --- a/src/rig.c +++ b/src/rig.c @@ -999,10 +999,10 @@ int HAMLIB_API rig_open(RIG *rig) { rig_debug(RIG_DEBUG_VERBOSE, "%s: cwd=%s\n", __func__, cwd); char *path = calloc(1, 4096); - extern char *settings_file; + extern char settings_file[4096]; const char *xdgpath = getenv("XDG_CONFIG_HOME"); - settings_file = "hamlib_settings"; + strcpy(settings_file,"hamlib_settings"); if (xdgpath) { commit 96ec37a276fd773b1a14f699bc033c4c2ef75a74 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Mar 14 17:09:36 2024 -0500 Fix build warning diff --git a/src/rig.c b/src/rig.c index f7bc8961f..3db6567e7 100644 --- a/src/rig.c +++ b/src/rig.c @@ -999,10 +999,10 @@ int HAMLIB_API rig_open(RIG *rig) { rig_debug(RIG_DEBUG_VERBOSE, "%s: cwd=%s\n", __func__, cwd); char *path = calloc(1, 4096); - extern char *settings_file; + extern char settings_file[4096]; const char *xdgpath = getenv("XDG_CONFIG_HOME"); - settings_file = "hamlib_settings"; + strcpy(settings_file,"hamlib_settings"); if (xdgpath) { commit 789d863f9779160ea6b204e84db1aaae29a702ae Merge: 5ab112213 c7665cb7d Author: Michael Black <mdb...@ya...> Date: Sun Mar 10 09:04:26 2024 -0500 Merge pull request #1523 from GeoBaltz/rp7 Convert all cache references to pointers commit c7665cb7d115acc12f57144c4f3431196241852f Author: George Baltz N3GB <Geo...@gm...> Date: Sat Mar 9 21:23:01 2024 -0500 All struct rig_cache referenced converted to pointers. diff --git a/tests/rigctlcom.c b/tests/rigctlcom.c index f1a285576..cadcb6904 100644 --- a/tests/rigctlcom.c +++ b/tests/rigctlcom.c @@ -665,7 +665,7 @@ static rmode_t ts2000_get_mode() { rmode_t mode; pbwidth_t width; - rig_get_mode(my_rig, vfo_fixup(my_rig, RIG_VFO_A, my_rig->state.cache.split), + rig_get_mode(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split), &mode, &width); kwidth = width; #if 0 @@ -802,8 +802,8 @@ static int handle_ts2000(void *arg) int p13 = 0; // P13(1) Tone dummy value for now int p14 = 0; // P14(2) Tone Freq dummy value for now int p15 = 0; // P15(1) Shift status dummy value for now - int retval = rig_get_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_A, - my_rig->state.cache.split), &freq); + int retval = rig_get_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split), + &freq); char response[64]; char *fmt = // cppcheck-suppress * @@ -815,8 +815,8 @@ static int handle_ts2000(void *arg) } mode = ts2000_get_mode(); - retval = rig_get_ptt(my_rig, vfo_fixup(my_rig, RIG_VFO_A, - my_rig->state.cache.split), &ptt); + retval = rig_get_ptt(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split), + &ptt); if (retval != RIG_OK) { @@ -900,8 +900,8 @@ static int handle_ts2000(void *arg) freq_t freq = 0; char response[32]; - int retval = rig_get_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_A, - my_rig->state.cache.split), &freq); + int retval = rig_get_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split), + &freq); if (retval != RIG_OK) { @@ -917,8 +917,8 @@ static int handle_ts2000(void *arg) { char response[32]; freq_t freq = 0; - int retval = rig_get_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_B, - my_rig->state.cache.split), &freq); + int retval = rig_get_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split), + &freq); if (retval != RIG_OK) { @@ -941,7 +941,7 @@ static int handle_ts2000(void *arg) { char response[32]; - rig_set_ptt(my_rig, vfo_fixup(my_rig, RIG_VFO_A, my_rig->state.cache.split), 0); + rig_set_ptt(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split), 0); SNPRINTF(response, sizeof(response), "RX0;"); return write_block2((void *)__func__, &my_com, response, strlen(response)); } @@ -972,8 +972,7 @@ static int handle_ts2000(void *arg) } else if (strcmp(arg, "TX;") == 0) { - return rig_set_ptt(my_rig, vfo_fixup(my_rig, RIG_VFO_A, - my_rig->state.cache.split), 1); + return rig_set_ptt(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split), 1); } else if (strcmp(arg, "AI0;") == 0) { @@ -987,13 +986,11 @@ static int handle_ts2000(void *arg) } else if (strcmp(arg, "FR0;") == 0) { - return rig_set_vfo(my_rig, vfo_fixup(my_rig, RIG_VFO_A, - my_rig->state.cache.split)); + return rig_set_vfo(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split)); } else if (strcmp(arg, "FR1;") == 0) { - return rig_set_vfo(my_rig, vfo_fixup(my_rig, RIG_VFO_B, - my_rig->state.cache.split)); + return rig_set_vfo(my_rig, vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split)); } else if (strcmp(arg, "FR;") == 0) { @@ -1013,8 +1010,8 @@ static int handle_ts2000(void *arg) } - if (vfo == vfo_fixup(my_rig, RIG_VFO_A, my_rig->state.cache.split)) { nvfo = 0; } - else if (vfo == vfo_fixup(my_rig, RIG_VFO_B, my_rig->state.cache.split)) { nvfo = 1; } + if (vfo == vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split)) { nvfo = 0; } + else if (vfo == vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split)) { nvfo = 1; } else { retval = -RIG_EPROTO; @@ -1029,7 +1026,7 @@ static int handle_ts2000(void *arg) else if (strcmp(arg, "FT;") == 0) { char response[32]; - vfo_t vfo, vfo_curr = vfo_fixup(my_rig, RIG_VFO_A, my_rig->state.cache.split); + vfo_t vfo, vfo_curr = vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split); split_t split; int nvfo = 0; int retval = rig_get_split_vfo(my_rig, vfo_curr, &split, &vfo); @@ -1042,8 +1039,8 @@ static int handle_ts2000(void *arg) } - if (vfo == vfo_fixup(my_rig, RIG_VFO_A, my_rig->state.cache.split)) { nvfo = 0; } - else if (vfo == vfo_fixup(my_rig, RIG_VFO_B, my_rig->state.cache.split)) { nvfo = 1; } + if (vfo == vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split)) { nvfo = 0; } + else if (vfo == vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split)) { nvfo = 1; } else { retval = -RIG_EPROTO; @@ -1092,9 +1089,8 @@ static int handle_ts2000(void *arg) { char response[32]; int valA; - int retval = rig_get_func(my_rig, vfo_fixup(my_rig, RIG_VFO_A, - my_rig->state.cache.split), RIG_FUNC_AIP, - &valA); + int retval = rig_get_func(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split), + RIG_FUNC_AIP, &valA); int valB; if (retval != RIG_OK) @@ -1112,9 +1108,8 @@ static int handle_ts2000(void *arg) return retval; } - retval = rig_get_func(my_rig, vfo_fixup(my_rig, RIG_VFO_B, - my_rig->state.cache.split), RIG_FUNC_AIP, - &valB); + retval = rig_get_func(my_rig, vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split), + RIG_FUNC_AIP, &valB); if (retval != RIG_OK) { @@ -1139,8 +1134,8 @@ static int handle_ts2000(void *arg) (char *)arg); } - retval = rig_set_func(my_rig, vfo_fixup(my_rig, RIG_VFO_A, - my_rig->state.cache.split), RIG_FUNC_AIP, valA); + retval = rig_set_func(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split), + RIG_FUNC_AIP, valA); if (retval != RIG_OK) { @@ -1149,8 +1144,8 @@ static int handle_ts2000(void *arg) return retval; } - retval = rig_set_func(my_rig, vfo_fixup(my_rig, RIG_VFO_B, - my_rig->state.cache.split), RIG_FUNC_AIP, valB); + retval = rig_set_func(my_rig, vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split), + RIG_FUNC_AIP, valB); if (retval != RIG_OK) { @@ -1515,7 +1510,7 @@ static int handle_ts2000(void *arg) } else if (strcmp(arg, "DC;") == 0) { - vfo_t vfo, vfo_curr = vfo_fixup(my_rig, RIG_VFO_A, my_rig->state.cache.split); + vfo_t vfo, vfo_curr = vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split); split_t split; char response[32]; int retval = rig_get_split_vfo(my_rig, vfo_curr, &split, &vfo); @@ -1534,7 +1529,7 @@ static int handle_ts2000(void *arg) } else if (strncmp(arg, "DC", 2) == 0) { - vfo_t vfo_curr = vfo_fixup(my_rig, RIG_VFO_A, my_rig->state.cache.split); + vfo_t vfo_curr = vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split); split_t split; int isplit; int retval; @@ -1565,15 +1560,13 @@ static int handle_ts2000(void *arg) } else if (strcmp(arg, "FT0;") == 0) { - return rig_set_split_vfo(my_rig, vfo_fixup(my_rig, RIG_VFO_A, - my_rig->state.cache.split), vfo_fixup(my_rig, - RIG_VFO_A, my_rig->state.cache.split), 0); + return rig_set_split_vfo(my_rig, vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split), + vfo_fixup(my_rig, RIG_VFO_A, CACHE(my_rig)->split), 0); } else if (strcmp(arg, "FT1;") == 0) { - return rig_set_split_vfo(my_rig, vfo_fixup(my_rig, RIG_VFO_B, - my_rig->state.cache.split), vfo_fixup(my_rig, - RIG_VFO_B, my_rig->state.cache.split), 0); + return rig_set_split_vfo(my_rig, vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split), + vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split), 0); } else if (strncmp(arg, "FA0", 3) == 0) { @@ -1583,16 +1576,14 @@ static int handle_ts2000(void *arg) if (mapa2b) { vfo = RIG_VFO_B; } sscanf((char *)arg + 2, "%"SCNfreq, &freq); - return rig_set_freq(my_rig, vfo_fixup(my_rig, vfo, - my_rig->state.cache.split), freq); + return rig_set_freq(my_rig, vfo_fixup(my_rig, vfo, CACHE(my_rig)->split), freq); } else if (strncmp(arg, "FB0", 3) == 0) { freq_t freq; sscanf((char *)arg + 2, "%"SCNfreq, &freq); - return rig_set_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_B, - my_rig->state.cache.split), freq); + return rig_set_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_B, CACHE(my_rig)->split), freq); } else if (strncmp(arg, "MD", 2) == 0) { commit aa0d83df959ec7dcd76546be45a72a17552db98f Author: George Baltz N3GB <Geo...@gm...> Date: Sat Mar 9 14:25:59 2024 -0500 Use pointers for all cache references in rigs/* diff --git a/rigs/kenwood/ts2000.c b/rigs/kenwood/ts2000.c index 817156439..a1e2bf999 100644 --- a/rigs/kenwood/ts2000.c +++ b/rigs/kenwood/ts2000.c @@ -692,7 +692,7 @@ static int ts2000_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return RIG_OK; case RIG_LEVEL_STRENGTH: - if (rig->state.cache.ptt != RIG_PTT_OFF) + if (CACHE(rig)->ptt != RIG_PTT_OFF) { val->i = -9 * 6; break; @@ -879,7 +879,7 @@ static int ts2000_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) int raw_value; char read_vfo_num; - if (rig->state.cache.ptt == RIG_PTT_OFF) + if (CACHE(rig)->ptt == RIG_PTT_OFF) { val->f = 0; break; diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index 3cd3579c1..f9034ad7b 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -581,7 +581,7 @@ kenwood_ts480_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return RIG_OK; case RIG_LEVEL_STRENGTH: - if (rig->state.cache.ptt != RIG_PTT_OFF) + if (CACHE(rig)->ptt != RIG_PTT_OFF) { val->i = -9 * 6; break; @@ -708,7 +708,7 @@ kenwood_ts480_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { int raw_value; - if (rig->state.cache.ptt == RIG_PTT_OFF) + if (CACHE(rig)->ptt == RIG_PTT_OFF) { val->f = 0; break; @@ -2198,15 +2198,16 @@ int malachite_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) int malachite_set_freq(RIG *rig, vfo_t vfo, freq_t freq) { int retval; + struct rig_cache *cachep = CACHE(rig); ENTERFUNC; rig_debug(RIG_DEBUG_TRACE, "%s: freqMainA=%g, freq=%g\n", __func__, - rig->state.cache.freqMainA, freq); + cachep->freqMainA, freq); - if ((rig->state.cache.freqMainA < 400000000 && freq >= 400000000) - || (rig->state.cache.freqMainA >= 400000000 && freq < 400000000) - || rig->state.cache.freqMainA == 0) + if ((cachep->freqMainA < 400000000 && freq >= 400000000) + || (cachep->freqMainA >= 400000000 && freq < 400000000) + || cachep->freqMainA == 0) { // Malachite has a bug where it takes two freq set to make it work // under band changes -- so we just do this all the time diff --git a/rigs/kenwood/ts590.c b/rigs/kenwood/ts590.c index a995182e3..84903494c 100644 --- a/rigs/kenwood/ts590.c +++ b/rigs/kenwood/ts590.c @@ -240,7 +240,7 @@ static int ts590_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (!sf_fails) { SNPRINTF(cmd, sizeof(cmd), "SF%d%011.0f%c", vfo == RIG_VFO_A ? 0 : 1, - vfo == RIG_VFO_A ? rig->state.cache.freqMainA : rig->state.cache.freqMainB, + vfo == RIG_VFO_A ? CACHE(rig)->freqMainA : CACHE(rig)->freqMainB, c); retval = kenwood_transaction(rig, cmd, NULL, 0); } @@ -328,7 +328,7 @@ static int ts590_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) if (vfo == RIG_VFO_CURR) { vfo = rig->state.current_vfo; } - if (vfo == RIG_VFO_TX || vfo == RIG_VFO_RX) { vfo = vfo_fixup(rig, vfo, rig->state.cache.split); } + if (vfo == RIG_VFO_TX || vfo == RIG_VFO_RX) { vfo = vfo_fixup(rig, vfo, CACHE(rig)->split); } retval = RIG_OK; @@ -875,7 +875,7 @@ static int ts590_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return RIG_OK; case RIG_LEVEL_STRENGTH: - if (rig->state.cache.ptt != RIG_PTT_OFF) + if (CACHE(rig)->ptt != RIG_PTT_OFF) { val->i = -9 * 6; break; @@ -1022,7 +1022,7 @@ static int ts590_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) int raw_value; - if (rig->state.cache.ptt == RIG_PTT_OFF) + if (CACHE(rig)->ptt == RIG_PTT_OFF) { val->f = 0; break; diff --git a/rigs/yaesu/ft100.c b/rigs/yaesu/ft100.c index e243f0341..47623ddeb 100644 --- a/rigs/yaesu/ft100.c +++ b/rigs/yaesu/ft100.c @@ -914,7 +914,7 @@ int ft100_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) { unsigned char cmd_index; - int split = rig->state.cache.split; + int split = CACHE(rig)->split; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -971,8 +971,8 @@ int ft100_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { int ret; - int split = rig->state.cache.split; - int ptt = rig->state.cache.ptt; + int split = CACHE(rig)->split; + int ptt = CACHE(rig)->ptt; FT100_METER_INFO ft100_meter; diff --git a/rigs/yaesu/ft1000d.c b/rigs/yaesu/ft1000d.c index bf99876ce..bb67ec7c0 100644 --- a/rigs/yaesu/ft1000d.c +++ b/rigs/yaesu/ft1000d.c @@ -4121,11 +4121,11 @@ static int ft1000_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) if (vfo == RIG_VFO_A) { - *freq = rig->state.cache.freqMainA; + *freq = CACHE(rig)->freqMainA; } else { - *freq = rig->state.cache.freqMainB; + *freq = CACHE(rig)->freqMainB; } return RIG_OK; @@ -4135,11 +4135,11 @@ static int ft1000_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) { if (vfo == RIG_VFO_A) { - *mode = rig->state.cache.modeMainA; + *mode = CACHE(rig)->modeMainA; } else { - *mode = rig->state.cache.modeMainB; + *mode = CACHE(rig)->modeMainB; } return RIG_OK; @@ -4153,7 +4153,7 @@ static int ft1000_get_vfo(RIG *rig, vfo_t *vfo) static int ft1000_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) { - *ptt = rig->state.cache.ptt; + *ptt = CACHE(rig)->ptt; return RIG_OK; } diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index 7e171da55..084a9c7c4 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -932,11 +932,11 @@ static int ft1000mp_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) if (vfo == RIG_VFO_A) { - *freq = rig->state.cache.freqMainA; + *freq = CACHE(rig)->freqMainA; } else { - *freq = rig->state.cache.freqMainB; + *freq = CACHE(rig)->freqMainB; } return RIG_OK; @@ -1818,8 +1818,8 @@ static int ft1000mp_set_split_freq_mode(RIG *rig, vfo_t vfo, freq_t freq, if (retval == RIG_OK) { - rig->state.cache.freqMainB = freq; - rig->state.cache.modeMainB = mode; + CACHE(rig)->freqMainB = freq; + CACHE(rig)->modeMainB = mode; } RETURNFUNC(retval); @@ -1842,8 +1842,8 @@ static int ft1000mp_get_split_freq_mode(RIG *rig, vfo_t vfo, freq_t *freq, if (retval == RIG_OK) { - rig->state.cache.freqMainB = *freq; - rig->state.cache.modeMainB = *mode; + CACHE(rig)->freqMainB = *freq; + CACHE(rig)->modeMainB = *mode; } RETURNFUNC(retval); diff --git a/rigs/yaesu/ft736.c b/rigs/yaesu/ft736.c index 69cf8d2e6..68f62d43a 100644 --- a/rigs/yaesu/ft736.c +++ b/rigs/yaesu/ft736.c @@ -298,7 +298,7 @@ int ft736_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) { rig_debug(RIG_DEBUG_VERBOSE, "%s: called\n", __func__); - if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) { *freq = rig->state.cache.freqMainA; } + if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) { *freq = CACHE(rig)->freqMainA; } else { rig_get_cache_freq(rig, vfo, freq, NULL); } return RIG_OK; diff --git a/rigs/yaesu/ft747.c b/rigs/yaesu/ft747.c index 52f951565..74a45c7d0 100644 --- a/rigs/yaesu/ft747.c +++ b/rigs/yaesu/ft747.c @@ -579,18 +579,19 @@ int ft747_set_freq(RIG *rig, vfo_t vfo, freq_t freq) int ft747_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) { struct ft747_priv_data *p; + struct rig_cache *cachep = CACHE(rig); freq_t f; int ret; rig_debug(RIG_DEBUG_VERBOSE, "%s: called vfo=%s, freqMainA=%.0f, freqMainB=%.0f\n", __func__, - rig_strvfo(vfo), rig->state.cache.freqMainA, rig->state.cache.freqMainB); + rig_strvfo(vfo), cachep->freqMainA, cachep->freqMainB); - if (vfo == RIG_VFO_CURR) { vfo = rig->state.cache.vfo; } + if (vfo == RIG_VFO_CURR) { vfo = cachep->vfo; } - if (rig->state.cache.ptt == RIG_PTT_ON) + if (cachep->ptt == RIG_PTT_ON) { - *freq = RIG_VFO_B ? rig->state.cache.freqMainB : rig->state.cache.freqMainA; + *freq = RIG_VFO_B ? cachep->freqMainB : cachep->freqMainA; return RIG_OK; } @@ -1005,7 +1006,7 @@ static int ft747_get_update_data(RIG *rig) p = (struct ft747_priv_data *)rig->state.priv; rigport = RIGPORT(rig); - if (rig->state.cache.ptt == RIG_PTT_ON + if (CACHE(rig)->ptt == RIG_PTT_ON || !rig_check_cache_timeout(&p->status_tv, FT747_CACHE_TIMEOUT)) { return RIG_OK; diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index 950379e0b..4d239014f 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -988,16 +988,17 @@ static int ft817_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) { struct ft817_priv_data *p = (struct ft817_priv_data *) rig->state.priv; freq_t f1 = 0, f2 = 0; + struct rig_cache *cachep = CACHE(rig); int retries = RIGPORT(rig)->retry + 1; // +1 because, because 2 steps are needed even in best scenario rig_debug(RIG_DEBUG_VERBOSE, "%s: called, vfo=%s, ptt=%d, split=%d\n", __func__, - rig_strvfo(vfo), rig->state.cache.ptt, rig->state.cache.split); + rig_strvfo(vfo), cachep->ptt, cachep->split); // we can't query VFOB while in transmit and split mode - if (rig->state.cache.ptt && vfo == RIG_VFO_B && rig->state.cache.split) + if (cachep->ptt && vfo == RIG_VFO_B && cachep->split) { - *freq = rig->state.cache.freqMainB; + *freq = cachep->freqMainB; return RIG_OK; } @@ -2127,7 +2128,7 @@ static int ft817_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) return n; } - rig->state.cache.split = split; + CACHE(rig)->split = split; return RIG_OK; diff --git a/rigs/yaesu/ft857.c b/rigs/yaesu/ft857.c index 935a0b8ab..ace4e7874 100644 --- a/rigs/yaesu/ft857.c +++ b/rigs/yaesu/ft857.c @@ -615,14 +615,14 @@ int ft857_get_vfo(RIG *rig, vfo_t *vfo) // Some 857's cannot read so we'll just return the cached value if we've seen an error if (ignore) { - *vfo = rig->state.cache.vfo; + *vfo = CACHE(rig)->vfo; return RIG_OK; } if (ft857_read_eeprom(rig, 0x0068, &c) < 0) /* get vfo status */ { ignore = 1; - *vfo = rig->state.cache.vfo; + *vfo = CACHE(rig)->vfo; return RIG_OK; } diff --git a/rigs/yaesu/ft990v12.c b/rigs/yaesu/ft990v12.c index 1d165ee76..00eed8314 100644 --- a/rigs/yaesu/ft990v12.c +++ b/rigs/yaesu/ft990v12.c @@ -701,7 +701,7 @@ int ft990v12_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) else { // M0EZP: Uni use cache -// *freq = vfo == RIG_VFO_A ? rig->state.cache.freqMainA : rig->state.cache.freqMainB; +// *freq = vfo == RIG_VFO_A ? CACHE(rig)->freqMainA : CACHE(rig)->freqMainB; return (RIG_OK); } } diff --git a/rigs/yaesu/ft991.c b/rigs/yaesu/ft991.c index 47d9d484f..70e3e8b5f 100644 --- a/rigs/yaesu/ft991.c +++ b/rigs/yaesu/ft991.c @@ -458,7 +458,7 @@ ft991_set_split_freq(RIG *rig, vfo_t vfo, freq_t tx_freq) return (rval); } - if (rig->state.cache.freqMainB == tx_freq) + if (CACHE(rig)->freqMainB == tx_freq) { rig_debug(RIG_DEBUG_TRACE, "%s: freq %.0f already set on VFOB\n", __func__, tx_freq); @@ -635,7 +635,7 @@ static int ft991_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, return -RIG_EINVAL; } - if (rig->state.cache.modeMainB == tx_mode) + if (CACHE(rig)->modeMainB == tx_mode) { rig_debug(RIG_DEBUG_TRACE, "%s: mode %s already set on VFOB\n", __func__, rig_strrmode(tx_mode)); diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 6242a8b40..5b5665543 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -936,17 +936,18 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) char target_vfo; int err; struct rig_caps *caps; + struct rig_cache *cachep = CACHE(rig); struct newcat_priv_data *priv; int special_60m = 0; vfo_t vfo_mode; ENTERFUNC; - if (newcat_60m_exception(rig, freq, rig->state.cache.modeMainA)) + if (newcat_60m_exception(rig, freq, cachep->modeMainA)) { // we don't try to set freq on 60m for some rigs since we must be in memory mode // and we can't run split mode on 60M memory mode either - if (rig->state.cache.split == RIG_SPLIT_ON) + if (cachep->split == RIG_SPLIT_ON) { rig_set_split_vfo(rig, RIG_VFO_A, RIG_VFO_A, RIG_SPLIT_OFF); } @@ -1029,16 +1030,16 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // some rigs like FTDX101D cannot change non-TX vfo freq // but they can change the TX vfo - if ((is_ftdx101d || is_ftdx101mp) && rig->state.cache.ptt == RIG_PTT_ON) + if ((is_ftdx101d || is_ftdx101mp) && cachep->ptt == RIG_PTT_ON) { rig_debug(RIG_DEBUG_TRACE, "%s: ftdx101 check vfo OK, vfo=%s, tx_vfo=%s\n", __func__, rig_strvfo(vfo), rig_strvfo(rig->state.tx_vfo)); // when in split we can change VFOB but not VFOA - if (rig->state.cache.split == RIG_SPLIT_ON && target_vfo == '0') { return -RIG_ENTARGET; } + if (cachep->split == RIG_SPLIT_ON && target_vfo == '0') { return -RIG_ENTARGET; } // when not in split we can't change VFOA at all - if (rig->state.cache.split == RIG_SPLIT_OFF && target_vfo == '0') { return -RIG_ENTARGET; } + if (cachep->split == RIG_SPLIT_OFF && target_vfo == '0') { return -RIG_ENTARGET; } if (vfo != rig->state.tx_vfo) { return -RIG_ENTARGET; } } @@ -1077,7 +1078,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) and select the correct VFO before setting the frequency */ // Plus we can't do the VFO swap if transmitting - if (target_vfo == '1' && rig->state.cache.ptt == RIG_PTT_ON) { RETURNFUNC(-RIG_ENTARGET); } + if (target_vfo == '1' && cachep->ptt == RIG_PTT_ON) { RETURNFUNC(-RIG_ENTARGET); } SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "VS%c", cat_term); @@ -1147,7 +1148,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (newcat_valid_command(rig, "BS") && changing && !rig->state.disable_yaesu_bandselect // remove the split check here -- hopefully works OK - //&& !rig->state.cache.split + //&& !cachep->split // seems some rigs are problematic // && !(is_ftdx3000 || is_ftdx3000dm) // some rigs can't do BS command on 60M @@ -1331,8 +1332,8 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // just drop through } - rig_debug(RIG_DEBUG_ERR, "%s: is_ft991=%d, rig->state.cache.split=%d, vfo=%s\n", - __func__, is_ft991, rig->state.cache.split, rig_strvfo(vfo)); + rig_debug(RIG_DEBUG_ERR, "%s: is_ft991=%d, CACHE(rig)->split=%d, vfo=%s\n", + __func__, is_ft991, cachep->split, rig_strvfo(vfo)); if (priv->band_index < 0) { priv->band_index = newcat_band_index(freq); } @@ -1340,7 +1341,7 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // there are multiple bandstacks so we just use the 1st one if (is_ft991 && vfo == RIG_VFO_A && priv->band_index != newcat_band_index(freq)) { - if (rig->state.cache.split) + if (cachep->split) { // FT991/991A bandstack does not work in split mode // so for a VFOA change we stop split, change bands, change freq, enable split @@ -1493,16 +1494,17 @@ int newcat_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) int newcat_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { struct newcat_priv_data *priv; + struct rig_cache *cachep = CACHE(rig); int err; rmode_t tmode; pbwidth_t twidth; - split_t split_save = rig->state.cache.split; + split_t split_save = cachep->split; priv = (struct newcat_priv_data *)rig->state.priv; ENTERFUNC; - if (newcat_60m_exception(rig, rig->state.cache.freqMainA, mode)) { RETURNFUNC(RIG_OK); } // we don't set mode in this case + if (newcat_60m_exception(rig, cachep->freqMainA, mode)) { RETURNFUNC(RIG_OK); } // we don't set mode in this case if (!newcat_valid_command(rig, "MD")) { @@ -1571,11 +1573,11 @@ int newcat_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) { - rig->state.cache.modeMainA = mode; + cachep->modeMainA = mode; } else { - rig->state.cache.modeMainB = mode; + cachep->modeMainB = mode; } if (RIG_PASSBAND_NOCHANGE == width) { RETURNFUNC(err); } @@ -1705,7 +1707,7 @@ int newcat_set_vfo(RIG *rig, vfo_t vfo) rig_strvfo(vfo)); // we can't change VFO while transmitting - if (rig->state.cache.ptt == RIG_PTT_ON) { RETURNFUNC(RIG_OK); } + if (CACHE(rig)->ptt == RIG_PTT_ON) { RETURNFUNC(RIG_OK); } if (!newcat_valid_command(rig, command)) { @@ -2712,11 +2714,11 @@ int newcat_set_split_mode(RIG *rig, vfo_t vfo, rmode_t tx_mode, if (vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN) { - rig->state.cache.modeMainA = tx_mode; + CACHE(rig)->modeMainA = tx_mode; } else { - rig->state.cache.modeMainB = tx_mode; + CACHE(rig)->modeMainB = tx_mode; } @@ -2758,8 +2760,8 @@ int newcat_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) RETURNFUNC(err); } - if (newcat_60m_exception(rig, rig->state.cache.freqMainA, - rig->state.cache.modeMainA)) + if (newcat_60m_exception(rig, CACHE(rig)->freqMainA, + CACHE(rig)->modeMainA)) { rig_debug(RIG_DEBUG_VERBOSE, "%s: force set_split off since we're on 60M exception\n", __func__); @@ -4088,7 +4090,8 @@ static int band2rig(hamlib_band_t band) int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { - struct rig_state *state = &rig->state; + struct rig_state *state = STATE(rig); + struct rig_cache *cachep = CACHE(rig); struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; int err; int i; @@ -4300,9 +4303,9 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) rmode_t exclude = RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR; - if ((rig->state.tx_vfo == RIG_VFO_A && (rig->state.cache.modeMainA & exclude)) - || (rig->state.tx_vfo == RIG_VFO_B && (rig->state.cache.modeMainB & exclude)) - || (rig->state.tx_vfo == RIG_VFO_C && (rig->state.cache.modeMainC & exclude))) + if ((rig->state.tx_vfo == RIG_VFO_A && (cachep->modeMainA & exclude)) + || (rig->state.tx_vfo == RIG_VFO_B && (cachep->modeMainB & exclude)) + || (rig->state.tx_vfo == RIG_VFO_C && (cachep->modeMainC & exclude))) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig cannot set MG in CW/RTTY modes\n", __func__); @@ -4906,7 +4909,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) if (is_ftdx101d || is_ftdx101mp) { rmode_t curmode = rig->state.current_vfo == RIG_VFO_A ? - rig->state.cache.modeMainA : rig->state.cache.modeMainB; + cachep->modeMainA : cachep->modeMainB; float valf = val.f / level_info->step.f; switch (curmode) @@ -4960,7 +4963,8 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { - struct rig_state *state = &rig->state; + struct rig_state *state = STATE(rig); + struct rig_cache *cachep = CACHE(rig); struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; int err; int ret_data_len; @@ -5117,9 +5121,9 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) rmode_t exclude = RIG_MODE_CW | RIG_MODE_CWR | RIG_MODE_RTTY | RIG_MODE_RTTYR; - if ((rig->state.tx_vfo == RIG_VFO_A && (rig->state.cache.modeMainA & exclude)) - || (rig->state.tx_vfo == RIG_VFO_B && (rig->state.cache.modeMainB & exclude)) - || (rig->state.tx_vfo == RIG_VFO_C && (rig->state.cache.modeMainC & exclude))) + if ((rig->state.tx_vfo == RIG_VFO_A && (cachep->modeMainA & exclude)) + || (rig->state.tx_vfo == RIG_VFO_B && (cachep->modeMainB & exclude)) + || (rig->state.tx_vfo == RIG_VFO_C && (cachep->modeMainC & exclude))) { rig_debug(RIG_DEBUG_VERBOSE, "%s: rig cannot read MG in CW/RTTY modes\n", __func__); @@ -5502,7 +5506,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (is_ftdx101d || is_ftdx101mp) { rmode_t curmode = rig->state.current_vfo == RIG_VFO_A ? - rig->state.cache.modeMainA : rig->state.cache.modeMainB; + cachep->modeMainA : cachep->modeMainB; switch (curmode) { @@ -5544,7 +5548,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (is_ftdx101d || is_ftdx101mp) { rmode_t curmode = rig->state.current_vfo == RIG_VFO_A ? - rig->state.cache.modeMainA : rig->state.cache.modeMainB; + cachep->modeMainA : cachep->modeMainB; switch (curmode) { commit 609065775c49da604d38b46b3fee601910d06e5d Author: George Baltz N3GB <Geo...@gm...> Date: Fri Mar 8 10:28:03 2024 -0500 Update some of rigs/* to use pointer to cache Issue #536 diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index b61f24f8e..239a8a3d6 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -446,7 +446,7 @@ static int dummy_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (vfo == RIG_VFO_CURR) { vfo = priv->curr_vfo; } - if (vfo == RIG_VFO_CURR || vfo == RIG_VFO_TX) { vfo = vfo_fixup(rig, vfo, rig->state.cache.split); } + if (vfo == RIG_VFO_CURR || vfo == RIG_VFO_TX) { vfo = vfo_fixup(rig, vfo, CACHE(rig)->split); } // if needed for testing enable this to emulate a rig with 100hz resolution #if 0 @@ -534,6 +534,7 @@ static int dummy_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv; channel_t *curr = priv->curr; + struct rig_cache *cachep = CACHE(rig); char buf[16]; ENTERFUNC; @@ -542,7 +543,7 @@ static int dummy_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s %s %s\n", __func__, rig_strvfo(vfo), rig_strrmode(mode), buf); - vfo = vfo_fixup(rig, vfo, rig->state.cache.split); + vfo = vfo_fixup(rig, vfo, cachep->split); if (vfo == RIG_VFO_CURR) { vfo = priv->curr_vfo; } @@ -587,7 +588,7 @@ static int dummy_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) RETURNFUNC(-RIG_EINVAL); } - vfo = vfo_fixup(rig, vfo, rig->state.cache.split); + vfo = vfo_fixup(rig, vfo, cachep->split); if (RIG_PASSBAND_NOCHANGE == width) { RETURNFUNC(RIG_OK); } @@ -1085,7 +1086,7 @@ static int dummy_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) if (tx_vfo == RIG_VFO_NONE || tx_vfo == RIG_VFO_CURR) { tx_vfo = priv->curr_vfo; } - if (tx_vfo == RIG_VFO_CURR || tx_vfo == RIG_VFO_TX) { tx_vfo = vfo_fixup(rig, vfo, rig->state.cache.split); } + if (tx_vfo == RIG_VFO_CURR || tx_vfo == RIG_VFO_TX) { tx_vfo = vfo_fixup(rig, vfo, CACHE(rig)->split); } priv->split = split; priv->tx_vfo = tx_vfo; diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 9536beb35..98d010e60 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -2218,12 +2218,13 @@ int ic9700_set_vfo(RIG *rig, vfo_t vfo) int ack_len = sizeof(ackbuf); int retval; int vfo_is_main_or_sub = (vfo == RIG_VFO_MAIN) || (vfo == RIG_VFO_SUB); + struct rig_cache *cachep = CACHE(rig); ENTERFUNC; rig_debug(RIG_DEBUG_VERBOSE, "%s: vfo=%s\n", __func__, rig_strvfo(vfo)); - if (rig->state.cache.satmode && !vfo_is_main_or_sub) + if (cachep->satmode && !vfo_is_main_or_sub) { // Translate VFO A/B to Main/Sub in satellite mode if (vfo == RIG_VFO_A) @@ -2247,7 +2248,7 @@ int ic9700_set_vfo(RIG *rig, vfo_t vfo) } else if (vfo == RIG_VFO_B) { - if (rig->state.cache.satmode) + if (cachep->satmode) { rig_debug(RIG_DEBUG_WARN, "%s: cannot switch to VFOB when in satmode\n", __func__); @@ -2267,7 +2268,7 @@ int ic9700_set_vfo(RIG *rig, vfo_t vfo) return retval; } - if (rig->state.cache.satmode && vfo == RIG_VFO_MAIN_B) + if (cachep->satmode && vfo == RIG_VFO_MAIN_B) { rig_debug(RIG_DEBUG_WARN, "%s: cannot switch to VFOB when in satmode\n", __func__); // we return RIG_OK anyways as this should just be a bad request @@ -2290,7 +2291,7 @@ int ic9700_set_vfo(RIG *rig, vfo_t vfo) return retval; } - if (rig->state.cache.satmode && vfo == RIG_VFO_SUB_B) + if (cachep->satmode && vfo == RIG_VFO_SUB_B) { rig_debug(RIG_DEBUG_WARN, "%s: cannot switch to VFOB when in satmode\n", __func__); // we return RIG_OK anyways as this should just be a bad request diff --git a/rigs/icom/ic821h.c b/rigs/icom/ic821h.c index e8f4d33ea..3b6000f7a 100644 --- a/rigs/icom/ic821h.c +++ b/rigs/icom/ic821h.c @@ -64,10 +64,10 @@ int ic821h_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t tx_vfo) if (tx_vfo == RIG_VFO_MAIN) { - rig->state.cache.satmode = + CACHE(rig)->satmode = split; // we emulate satmode of other rigs since we apparently can't query rig_debug(RIG_DEBUG_TRACE, "%s: tx_vfo==MAIN so assuming sat mode=%d\n", - __func__, rig->state.cache.satmode); + __func__, CACHE(rig)->satmode); rig->state.tx_vfo = split == RIG_SPLIT_ON ? RIG_VFO_SUB : RIG_VFO_MAIN; // the IC821 seems to be backwards in satmode -- setting Main select Sub and vice versa retval = rig_set_vfo(rig, RIG_VFO_SUB); diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index a5894f681..921259642 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -934,7 +934,8 @@ static vfo_t icom_current_vfo(RIG *rig) freq_t freq_current, freq_other, f... [truncated message content] |
From: n0nb <n0...@us...> - 2024-02-20 13:11: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 8cc6ce131926b49a2a6bd5e1b1268f98fa00fc78 (commit) via 91ec3afcda5769d3d39f6684fa205e8a24130fc0 (commit) via 1657a0e673e37dc5c32b613b4f51d260998a1575 (commit) via 81dae00ea00be7c3976b564a320453c801e9fdd1 (commit) via 0902b32c457b9e6a2a879e6ecd550891a0560357 (commit) via 34d8b0eec3714a34fa466abbfd2c8fff374784f2 (commit) via 1ea597b6e133aa96c68d76e0bf0b229059ec22d3 (commit) via 4cadea95f8aa5e8c4ab23a6a393d38b96b8a1af6 (commit) via 7caef5398e7bda1460cf21e8a8ccc5a40856f9bb (commit) via 5d83ac767b0288498608134648b7802c6946116d (commit) via c471884122de94fa69fd76671eb8cb6ce9b932a8 (commit) via 47fcf999f063214027be7bbf9ac2115ba759cf2e (commit) via f12d653f6ceaa4dadeb17278239a73092d8a9802 (commit) via e1f23429821777b938a69b11f7589e5c0c191e51 (commit) via 972d792a4f82f010c9f8ef77e86ddc364dba7be1 (commit) via 2b22a42e732b586e64013fc1f88626adcec315d1 (commit) via 45e097d3a46e305bb3bf8c2ca46a1b8dbd7cd40f (commit) via 59aaf1f4c30e9efa729e9b3b5048c8d2e86a4225 (commit) via 59217b560ac1f65e642243f1e0196672c2d5d0de (commit) via 8d33869ca275e8445beb9a93fc51183d0296ac1e (commit) via a8cfff8bd34c1f3fb531bafae27f026760b740c1 (commit) via 916049b0a5fe790b1a292c75c44f7f31a9eb6385 (commit) via 6844722faab84e4cca03f405e91c5d6501ca9f6c (commit) via f5d6be3b3efe9781763df903d0c062e24b52e143 (commit) via 59e4ba1cdcd3f8789803ffbeac691cf79d71cd6c (commit) via 64c470a4e7e035a90e6b566eb95b3f8c68fdf48b (commit) via 3dd8c97b54ac58baed2e1cbd2c1cd55a53f200ff (commit) via e26e6cd7f28751448e7ba26a7f8c838c8dcb42b3 (commit) via 12552bff64b541f70ed1aee06e311e2b2a6716d6 (commit) via a2abc2541673e29caa3d9d44a8f52dff867facae (commit) via eb94ce2b940bea23e4be88751402e6728a83874d (commit) via 464eea58e720000b90dd19fe06f684d2a1c71fac (commit) via c7ab5c44afc0cb6f728860a2e25a8ad7aee25811 (commit) via 1e552b557fe99f9aa04b63dc4af01f81c0cade79 (commit) via f777179bc88b272f0bb0463a07c8f9f15662927b (commit) via 23d5d5324831ef710cebffbc23cc3dfe767cf4c4 (commit) via 02f0ad067a67453329e6e7690cee59f3f149f403 (commit) via 4a1fa678ea8adb0746e258180edc2ecadc0bf26f (commit) via b1d85e5aa1f9757a2afaa0b4ce00ebebb17bc4e2 (commit) via 1532a7d8dc4baea6b00ceb6868d572e66c69d44d (commit) via 3eb41c6400e5729e328c6c599a0b7fc6de4be630 (commit) via 96ee58436a9c3d029159fb6bdbe0db827bfc003a (commit) via bf8bf51bf404e8034088b8ef2dc20ad81ec45911 (commit) via 6bfccb3e929971185bf2f21e74d4a3a9af5a5454 (commit) via d42d505d226a0b8a64b1b0288da1488c3e34563f (commit) via 1093349564d1f65a41356d19db87f957a7f767ef (commit) via d77b0df70267fd086b42cbd180f16fb7ca5f6548 (commit) via 8757271437f39980ca738c8c1a9026dcc269c82d (commit) via ab8835e87e4b1578e925ee3d1e45bb6cf276727d (commit) via 9bfb0f5f7179582b1a62683b2520cb795a69dc02 (commit) via dab7cf1ee690c397fa9409c290df95a8e643acd8 (commit) via 904dfef9b96e8c0e2b61f600d27cbbfdb72231f4 (commit) via 0adaebd100ce58017f6d5fa7fc169de05ea7a58d (commit) via 09a90758444ac020a6a7c36fe4a5098fb82739ef (commit) via ade62105a30e978b371929b15b54b35260bcc331 (commit) via cff4faba533e84f66b29ef3117bd09b6e5ef0eeb (commit) via 697c0909350ecfcf28cfa80fe5e943c991976d12 (commit) via b6dc6110a61e53b91f2a44a41eb1857246b425d9 (commit) via 4ef5bd414293e310d2e161232adc3cae88d6b070 (commit) via a03a79c864148458339e2ec3d027beeab818d1b4 (commit) via 7436e4395f99614eb5a58d50cc5c9cf2474c80c0 (commit) via 7310f370c1ce7998909112ea91b8d61689f21da0 (commit) via d9bae6f46f4a9da3f579c4f247cb647cd5ba4b69 (commit) via 434f399d12f4452cd932adf75a1689984a366e84 (commit) via 68fca2c73d27bc91ba6b9ae0ba337ac7b0353b9b (commit) via 75a4d324de2e4cd6da9e792493661fb88451d165 (commit) via c969405c2602062751c40a2a9b3a8ce777fd54db (commit) via 270786320925964254921c7eb2ae6390a78c6dac (commit) via 35e49ffdfce5e17aacf84a48ab2fa93de1618d05 (commit) via 4fe6ea7cc4ce350e41b0139046ebe9cbedc152e3 (commit) via fff1bbc8cd14d74ab73996400339262800190b23 (commit) via b4ec8a427cd8e29ccea245570708a7af55337ef9 (commit) via 25a8d6586055da9ede363112ca0106716a450573 (commit) via 1ea95c94ee305f1a5cbf182dd773ea22413f8d4b (commit) via 9f6ca845722ca17a2b1deb89322b2e5f1d4257f2 (commit) via 8d59c9302f0fad49f6d8573f4015c1cc9f627242 (commit) via 793bc1a0dc4169f5edd5547e5600cc2e9174af3f (commit) via d29caa7cad63c7b8a74d0e2ec0308747dc77eb5d (commit) via 267f30d16b1fbeb338bbe9b3c5bf9036696d1552 (commit) via 6ef2c457e4f9eb1d4bb50f80083718503be68816 (commit) via 2efc2069f54a31f9826099cc03e57261b158f11a (commit) via 703d86a025821cb1ae87bef5e238eb0ccd3efaaf (commit) via c8e33010f672a6b5e7ef107817836d6319b2775e (commit) via 7fba4c012da025798ec81fed5d1f11f8515f2d84 (commit) via 10c002c13fbcad28aa611970b2c62428ff6df938 (commit) via a0f8251b64921be57edc0d391c99e2cd08655355 (commit) via 9ed13add011e41f76eb76624afa46e7a4da45b41 (commit) via fabfe61a457e2d184a855d77d057089d2bb143b2 (commit) via d8a9968fac650bd8402fdd21cf380c10a72c868b (commit) via 1b5fbc1d8b21d73f4e4e74d559ee278257823f0c (commit) via a4ff5a3e601ca7d1b3671ac575addfe47fcab2f5 (commit) via 83fa83586490976f2cfa71fd7974fb2e6b403ecf (commit) via ceebaeae35935d72dd1d2948098cd117f191cc7d (commit) via 0145588fd9cd58c08b1875a12ebacaeda11fa492 (commit) via 17b93213108e199e1217cf0f34696c9e4ef9569c (commit) via 75079d40a88651ca48298f332bc3b18c1b9757f4 (commit) via 5ad803d90cf898891f9c83c2bdbffa77006227ad (commit) via e42bb719b9692027addb0912c38508d0f1960d4e (commit) via a703c77c2d5225401c0523f5311da79da933319b (commit) via 74b07528982fc58c0b4c3ca1a8b2bf401794da8a (commit) via a52d0c5931f1e3b3d860f031c3bf146390f1376d (commit) via efeba2dfe0759704182e0072d35dd09a1e05b100 (commit) via 75cf467c1d2d314df747247efee28af5130d0b03 (commit) via 1bb469f90fcd04d27bd3ccac683e48fda3aae48d (commit) via 354606f46d6695978fea45efd1ef69caaeed8367 (commit) via 046f3b849caa9af7bf4828c7c569e873d4ebb22c (commit) via 05033171c379123b2af6e29bd9f586f77d5fdcd3 (commit) via 67aee821330f5374353b51cb1f7b0c02712a872f (commit) via e62dcd0b4a6e5acd500262187192f1b78de7c57f (commit) via 2cc68f4773c274d146083d74ac34a8b77658808d (commit) via c4733d9dc3fb4207b62fc5e7de18793bb7a75a4b (commit) via 66218e57f7179568a68b05d70fb17245f3868b6e (commit) via e4e12f3ce72d61799680b2648b9b3e4cf642e7cb (commit) via 1dfd17cc187f32ada47118b6d0be51a02b2a43a8 (commit) via 8bb5bcefb92a60751f8b7f198087f7fa0d1bac0b (commit) via 7d0c737e961cbb0103960a8c376c756952e18020 (commit) via 77aa5ddb551f66f064c5f8a6031fc73622ce8ed1 (commit) via eff0c7b6362bf13de8e65a31fd92c6cf95dbbe42 (commit) via 4b3a7514caa04e95ce0fca28ce6512f81f85fecf (commit) via d3917736227107af9c0d83a92f9a1042e1ad7552 (commit) via eb7634abfbc712ffdb6f837e4d50d97411267e73 (commit) via 051e671bfaad6b1450b5a35e4441d723d3c44e23 (commit) via 2358cba6a4df6172e560bbcccda5e1bde7706c1b (commit) via 1cc08d2f00a4d980e7ef120ed92ee22a9024cad4 (commit) via 3a414c3221630c0e2786b2809f340f9a222bb0e9 (commit) via 93b61d2c5e035eecd41772d010a072eb3bb71932 (commit) via 0dea8ed8bb276e59be05708378a2ffab7df8f02a (commit) via 8185a3562b5d3109d2c1c15cfec57e143458c140 (commit) via 00cb0eccdc666e101b64cb393891863522ca5d9a (commit) via 7b341a2ad6e9bf7488ecc75a57955c21869de73f (commit) via 7d5f540b9c367d2c3e7e6ef2f9b154e425c5fe44 (commit) via b78fa43b56855ee4b9ff913df501b5c3d5ef9c90 (commit) via dd974a25369a95f82316897071c5836b128908d6 (commit) via e2e723ec6098da211b907b5c1ee6c1fd11dc0b13 (commit) via 4a926ec503b6fc9b5148f0e7db4335393fe466e5 (commit) via 82f2b10275ccbea508f98d8c55d194f1cec50ada (commit) via c90c675add10dd2d32c371c85b4b8b9f4ad80f3d (commit) via 0ece468b49c9f5db72483fe87d366f55b557f346 (commit) via 4fa61a9a32a5666807a66135881887cd298cc9b8 (commit) via 89abbfeb3ae19d18894fd80d4e108576cb784cfe (commit) via f89e0f0388b339ae14614ada3a6fe3e3e678bd7b (commit) via 8ab8aafe4836288a1da736315b77ace5146d572c (commit) from 761f1d3b0024c4989935207a9e731c57eb2ccd8c (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 8cc6ce131926b49a2a6bd5e1b1268f98fa00fc78 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Feb 19 11:46:16 2024 -0600 Fix rigctlcom.c for Icom rigs and those that don't have get_vfo diff --git a/tests/rigctlcom.c b/tests/rigctlcom.c index 6de847c38..38422d742 100644 --- a/tests/rigctlcom.c +++ b/tests/rigctlcom.c @@ -667,7 +667,9 @@ static rmode_t ts2000_get_mode() pbwidth_t width; rig_get_mode(my_rig, vfo_fixup(my_rig, RIG_VFO_A, my_rig->state.cache.split), &mode, &width); - + rig_debug(RIG_DEBUG_ERR, "%s(%d): width=%ld\n", __func__, __LINE__, width); + kwidth = width; +#if 0 // Perhaps we should emulate a rig that has PKT modes instead?? int kwidth_ssb[] = { 10, 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 1000 }; int kwidth_am[] = { 10, 100, 200, 500 }; @@ -704,6 +706,7 @@ static rmode_t ts2000_get_mode() default: mode = 0; break; } +#endif return mode; } @@ -765,6 +768,7 @@ static int handle_ts2000(void *arg) int retval = rig_get_freq(my_rig, vfo_fixup(my_rig, RIG_VFO_A, my_rig->state.cache.split), &freq); char response[64]; + rig_debug(RIG_DEBUG_ERR, "%s(%d):\n", __func__, __LINE__); char *fmt = // cppcheck-suppress * "IF%011"PRIll"%04d+%05d%1d%1d%1d%02d%1d%1"PRIll"%1d%1d%1d%1d%02d%1d;"; @@ -774,15 +778,19 @@ static int handle_ts2000(void *arg) return retval; } + rig_debug(RIG_DEBUG_ERR, "%s(%d):\n", __func__, __LINE__); mode = ts2000_get_mode(); + rig_debug(RIG_DEBUG_ERR, "%s(%d):\n", __func__, __LINE__); retval = rig_get_ptt(my_rig, vfo_fixup(my_rig, RIG_VFO_A, my_rig->state.cache.split), &ptt); + rig_debug(RIG_DEBUG_ERR, "%s(%d):\n", __func__, __LINE__); if (retval != RIG_OK) { return retval; } + rig_debug(RIG_DEBUG_ERR, "%s(%d):\n", __func__, __LINE__); // we need to know split status -- don't care about the vfo retval = rig_get_split_vfo(my_rig, RIG_VFO_CURR, &split, &vfo); @@ -791,13 +799,19 @@ static int handle_ts2000(void *arg) return retval; } + rig_debug(RIG_DEBUG_ERR, "%s(%d):\n", __func__, __LINE__); retval = rig_get_vfo(my_rig, &vfo); if (retval != RIG_OK) { + vfo = RIG_VFO_A; +#if 0 // so we work with rigs (like Icom) that have no get_vfo + rig_debug(RIG_DEBUG_ERR, "%s(%d):\n", __func__, __LINE__); return retval; +#endif } + rig_debug(RIG_DEBUG_ERR, "%s(%d):\n", __func__, __LINE__); switch (vfo) { case RIG_VFO_A: @@ -818,6 +832,7 @@ static int handle_ts2000(void *arg) rig_debug(RIG_DEBUG_ERR, "%s: unexpected vfo=%d\n", __func__, vfo); } + rig_debug(RIG_DEBUG_ERR, "%s(%d):\n", __func__, __LINE__); SNPRINTF(response, sizeof(response), fmt, @@ -836,10 +851,12 @@ static int handle_ts2000(void *arg) p14, p15); + rig_debug(RIG_DEBUG_ERR, "%s(%d):\n", __func__, __LINE__); return write_block2((void *)__func__, &my_com, response, strlen(response)); } else if (strcmp(arg, "MD;") == 0) { + rig_debug(RIG_DEBUG_ERR, "%s(%d):\n", __func__, __LINE__); rmode_t mode = ts2000_get_mode(); char response[32]; commit 91ec3afcda5769d3d39f6684fa205e8a24130fc0 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Feb 19 10:42:25 2024 -0600 Fix get_vfo for Icom rigs in rigctlcom.c diff --git a/tests/rigctlcom.c b/tests/rigctlcom.c index 39692f2c2..6de847c38 100644 --- a/tests/rigctlcom.c +++ b/tests/rigctlcom.c @@ -962,9 +962,12 @@ static int handle_ts2000(void *arg) if (retval != RIG_OK) { + vfo = RIG_VFO_A; +#if 0 // so we work with rigs (like Icom) that have no get_vfo rig_debug(RIG_DEBUG_ERR, "%s: get vfo failed: %s\n", __func__, rigerror(retval)); return retval; +#endif } commit 1657a0e673e37dc5c32b613b4f51d260998a1575 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Feb 19 10:34:15 2024 -0600 Fix rigctlcom.c diff --git a/tests/rigctlcom.c b/tests/rigctlcom.c index 023952baa..39692f2c2 100644 --- a/tests/rigctlcom.c +++ b/tests/rigctlcom.c @@ -493,14 +493,16 @@ int main(int argc, char *argv[]) exit(2); } +#if 0 retcode = -RIG_ENIMPL; -// retcode = set_conf(my_rig, conf_parms); + retcode = set_conf(my_rig, conf_parms); if (retcode != RIG_OK) { fprintf(stderr, "Config parameter error: %s\n", rigerror(retcode)); exit(2); } +#endif if (my_model > 5 && !rig_file) { commit 81dae00ea00be7c3976b564a320453c801e9fdd1 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Feb 18 22:25:19 2024 -0600 Fix ID read for Xiegu rigs and add x25x26 possible https://github.com/Hamlib/Hamlib/issues/1499 diff --git a/rigs/icom/xiegu.c b/rigs/icom/xiegu.c index 5ca0fb316..a4ba8da57 100644 --- a/rigs/icom/xiegu.c +++ b/rigs/icom/xiegu.c @@ -131,6 +131,32 @@ static int x108g_rig_open(RIG *rig) RETURNFUNC(RIG_OK); } +int xiegu_rig_open(RIG *rig) +{ + int retval; + unsigned char id[4]; + int id_len = 2; + int cmd = 0x19; + int subcmd = 0x00; + unsigned short iid; + retval = icom_transaction(rig, cmd, subcmd, NULL, 0, id, &id_len); + + if (retval == RIG_OK) + { + iid = (((int)id[2]) << 8) + id[3]; + rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu Radio ID=0x%04x\n", __func__, iid); + switch(iid) + { + case 0x0090: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "G90/G90S");break; + case 0x0106: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "G106/G106C");break; + case 0x6100: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "X6100");break; + default: rig_debug(RIG_DEBUG_VERBOSE, "%s: Xiegu model %s\n", __func__, "Unknown");break; + } + } + + return icom_rig_open(rig); +} + /* * taken from IC-7000 rig capabilities. * @@ -328,7 +354,7 @@ static struct icom_priv_caps x6100_priv_caps = 0, /* no XCHG */ ic7200_ts_sc_list, .x25x26_always = 0, - .x25x26_possibly = 0, + .x25x26_possibly = 1, .x1cx03_always = 0, .x1cx03_possibly = 0, .x1ax03_supported = 0, @@ -341,7 +367,7 @@ struct rig_caps x6100_caps = RIG_MODEL(RIG_MODEL_X6100), .model_name = "X6100", .mfg_name = "Xiegu", - .version = BACKEND_VER ".4", + .version = BACKEND_VER ".5", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -463,7 +489,7 @@ struct rig_caps x6100_caps = .priv = (void *) &x6100_priv_caps, .rig_init = icom_init, .rig_cleanup = icom_cleanup, - .rig_open = icom_rig_open, + .rig_open = xiegu_rig_open, .rig_close = icom_rig_close, .set_freq = icom_set_freq, @@ -512,25 +538,6 @@ struct rig_caps x6100_caps = .hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS }; -int g90_rig_open(RIG *rig) -{ - int retval; - unsigned char id[2]; - int id_len = 2; - int cmd = 0x19; - int subcmd = 0x1d; - short iid; - retval = icom_transaction(rig, cmd, subcmd, NULL, 0, id, &id_len); - - if (retval == RIG_OK) - { - memcpy(&iid, id, 2); - rig_debug(RIG_DEBUG_VERBOSE, "Xiegu Radio ID=0x%04x\n", iid); - } - - return icom_rig_open(rig); -} - struct rig_caps g90_caps = { RIG_MODEL(RIG_MODEL_G90), @@ -658,7 +665,7 @@ struct rig_caps g90_caps = .priv = (void *)& x108g_priv_caps, .rig_init = icom_init, .rig_cleanup = icom_cleanup, - .rig_open = g90_rig_open, + .rig_open = xiegu_rig_open, .rig_close = icom_rig_close, .set_freq = icom_set_freq, @@ -833,7 +840,7 @@ struct rig_caps x5105_caps = .priv = (void *)& x108g_priv_caps, .rig_init = icom_init, .rig_cleanup = icom_cleanup, - .rig_open = icom_rig_open, + .rig_open = xiegu_rig_open, .rig_close = icom_rig_close, .set_freq = icom_set_freq, commit 0902b32c457b9e6a2a879e6ecd550891a0560357 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Feb 16 17:05:07 2024 -0600 Remove debug statement causing warning on mingw64 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 5ca4ffac8..e23cafce1 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2290,8 +2290,8 @@ static int icom_set_mode_x26(RIG *rig, vfo_t vfo, rmode_t mode, // Skip filter selection, because at least IC-7300 has a bug defaulting to filter 2 when changing mode // Tested on IC-7300 and IC-9700 buf[2] = priv->filter; - rig_debug(RIG_DEBUG_TRACE, "%s: mode=%ld, filters usbd=%d, usb=%d, cw=%d\n", - __func__, mode, priv->filter_usbd, priv->filter_usb, priv->filter_cw); + //rig_debug(RIG_DEBUG_TRACE, "%s: mode=%ld, filters usbd=%d, usb=%d, cw=%d\n", + // __func__, mode, priv->filter_usbd, priv->filter_usb, priv->filter_cw); if (priv->filter_usbd > 0 && (mode == RIG_MODE_PKTUSB || mode == RIG_MODE_PKTLSB)) commit 34d8b0eec3714a34fa466abbfd2c8fff374784f2 Author: Mike Black W9MDB <mdb...@ya...> Date: Fri Feb 16 09:17:50 2024 -0600 Update simts590.c diff --git a/simulators/simts590.c b/simulators/simts590.c index 4f6f350a1..ee2db59b6 100644 --- a/simulators/simts590.c +++ b/simulators/simts590.c @@ -115,7 +115,7 @@ int main(int argc, char *argv[]) { printf("%s\n", buf); hl_usleep(mysleep * 1000); - pbuf = "RM5100000;"; + pbuf = "RM50005;"; WRITE(fd, pbuf, strlen(pbuf)); } commit 1ea597b6e133aa96c68d76e0bf0b229059ec22d3 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Feb 15 09:25:39 2024 -0600 Move time_t test later so 32-bit check of 64-bit functions can work https://github.com/Hamlib/Hamlib/issues/1478 diff --git a/src/misc.c b/src/misc.c index bbab4946f..18723f8eb 100644 --- a/src/misc.c +++ b/src/misc.c @@ -2826,6 +2826,7 @@ char *date_strget(char *buf, int buflen, int localtime) struct tm result = { 0, 0, 0, 0, 0, 0, 0, 0, 0}; int mytimezone; + // 2038 failure here for 32-bit time_t t = time(NULL); if (localtime) @@ -3068,12 +3069,6 @@ int rig_test_2038(RIG *rig) __MSVCRT_VERSION__); #endif - if (sizeof(time_t) == 4) - { - rig_debug(RIG_DEBUG_TRACE, "%s: ctime is null, 2038 test failed\n", __func__); - return 1; - } - int failed = 0; #if defined(__MSVCRT_VERSION__) x = (__time64_t)((1UL << 31) - 1); @@ -3082,12 +3077,26 @@ int rig_test_2038(RIG *rig) if (strlen(s) == 0) { failed = 1; } + rig_debug(RIG_DEBUG_VERBOSE, "%s: MSVCRT 2038 test = 0x%08lx:%s\n", __func__, x, + s); + #else - x = (time_t)((1U << 31) - 1); + + if (sizeof(time_t) == 4) + { + rig_debug(RIG_DEBUG_TRACE, "%s: time_t is 4 bytes, 2038 test failed\n", + __func__); + return 1; + } + + x = (time_t)((1U << 63) - 1); char *s = ctime(&x); if (s == NULL) { failed = 1; } + rig_debug(RIG_DEBUG_VERBOSE, "%s: time_t 2038 test = 0x%08lx:%s", __func__, x, + s); + #endif if (failed) commit 4cadea95f8aa5e8c4ab23a6a393d38b96b8a1af6 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Feb 15 09:25:27 2024 -0600 Astyle cal.c diff --git a/src/cal.c b/src/cal.c index eeeeea3ab..38fcfed70 100644 --- a/src/cal.c +++ b/src/cal.c @@ -86,7 +86,10 @@ float HAMLIB_API rig_raw2val(int rawval, const cal_table_t *cal) } if (rawval == cal->table[i - 1].raw) - return cal->table[i-1].val; + { + return cal->table[i - 1].val; + } + if (i == 0) { return cal->table[0].val; commit 7caef5398e7bda1460cf21e8a8ccc5a40856f9bb Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Feb 15 09:24:58 2024 -0600 Return exact value for rig_raw2val when appropriate diff --git a/src/cal.c b/src/cal.c index 2083a522e..eeeeea3ab 100644 --- a/src/cal.c +++ b/src/cal.c @@ -85,6 +85,8 @@ float HAMLIB_API rig_raw2val(int rawval, const cal_table_t *cal) } } + if (rawval == cal->table[i - 1].raw) + return cal->table[i-1].val; if (i == 0) { return cal->table[0].val; commit 5d83ac767b0288498608134648b7802c6946116d Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Feb 15 09:08:42 2024 -0600 Update SDRUno information diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index 9bb1c403f..3cd3579c1 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -2006,12 +2006,11 @@ struct rig_caps sdruno_caps = RIG_MODEL(RIG_MODEL_SDRUNO), .model_name = "SDRUno", .mfg_name = "SDRPlay", - .version = BACKEND_VER ".2", + .version = BACKEND_VER ".3", .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, @@ -2036,26 +2035,6 @@ struct rig_caps sdruno_caps = 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 = { @@ -2063,28 +2042,6 @@ struct rig_caps sdruno_caps = 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}, - {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 2 */ .tuning_steps = { commit c471884122de94fa69fd76671eb8cb6ce9b932a8 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Feb 14 16:35:34 2024 -0600 Fix TS590 and TS890 RIG_LEVEL_RFPOWER_METER_WATTS diff --git a/rigs/kenwood/ts590.c b/rigs/kenwood/ts590.c index 7523b81a8..a995182e3 100644 --- a/rigs/kenwood/ts590.c +++ b/rigs/kenwood/ts590.c @@ -41,11 +41,11 @@ #define TS590_LEVEL_GET (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_MICGAIN|RIG_LEVEL_STRENGTH|RIG_LEVEL_KEYSPD|RIG_LEVEL_CWPITCH| \ RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_NR|RIG_LEVEL_PREAMP|RIG_LEVEL_COMP|RIG_LEVEL_ATT|RIG_LEVEL_VOXDELAY|RIG_LEVEL_VOXGAIN|RIG_LEVEL_BKIN_DLYMS| \ - RIG_LEVEL_SWR|RIG_LEVEL_COMP_METER|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_USB_AF|RIG_LEVEL_USB_AF_INPUT) + RIG_LEVEL_SWR|RIG_LEVEL_COMP_METER|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_USB_AF|RIG_LEVEL_USB_AF_INPUT) #define TS590_LEVEL_SET (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD|RIG_LEVEL_CWPITCH| \ RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_NR|RIG_LEVEL_PREAMP|RIG_LEVEL_COMP|RIG_LEVEL_ATT|RIG_LEVEL_VOXDELAY|RIG_LEVEL_VOXGAIN|RIG_LEVEL_BKIN_DLYMS| \ - RIG_LEVEL_METER|RIG_LEVEL_RFPOWER_METER_WATTS|RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_USB_AF|RIG_LEVEL_USB_AF_INPUT) + RIG_LEVEL_METER|RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_USB_AF|RIG_LEVEL_USB_AF_INPUT) #define TS590_FUNC_ALL (RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_NR|RIG_FUNC_NR|RIG_FUNC_BC|RIG_FUNC_BC2|RIG_FUNC_RIT|RIG_FUNC_XIT| \ RIG_FUNC_TUNER|RIG_FUNC_MON|RIG_FUNC_FBKIN|RIG_FUNC_LOCK) @@ -1013,6 +1013,13 @@ static int ts590_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_RFPOWER_METER: case RIG_LEVEL_RFPOWER_METER_WATTS: { + static cal_table_t power_meter = + { + 7, { { 0, 0}, { 3, 5}, { 6, 10}, { 8, 15}, {12, 25}, + { 17, 50}, { 30, 100} + } + }; + int raw_value; if (rig->state.cache.ptt == RIG_PTT_OFF) @@ -1030,13 +1037,16 @@ static int ts590_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) sscanf(ackbuf, "SM0%d", &raw_value); - val->f = (float) raw_value / 30.0f; +// val->f = (float) raw_value / 30.0f; if (level == RIG_LEVEL_RFPOWER_METER_WATTS) { - val->f *= 100; - if (val->f >= 10) val->f = roundf(val->f); - else val->f = roundf(val->f*10.0)/10.0; + val->f = roundf(rig_raw2val(raw_value, &power_meter)); + if (val->f < 10) + { + val->f = roundf(rig_raw2val(raw_value, &power_meter) * 10.0) / 10.0; + } + } break; @@ -1703,7 +1713,7 @@ struct rig_caps ts590_caps = RIG_MODEL(RIG_MODEL_TS590S), .model_name = "TS-590S", .mfg_name = "Kenwood", - .version = BACKEND_VER ".15", + .version = BACKEND_VER ".16", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -2097,7 +2107,7 @@ struct rig_caps ts590sg_caps = RIG_MODEL(RIG_MODEL_TS590SG), .model_name = "TS-590SG", .mfg_name = "Kenwood", - .version = BACKEND_VER ".9", + .version = BACKEND_VER ".10", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, diff --git a/rigs/kenwood/ts890s.c b/rigs/kenwood/ts890s.c index d9c28d829..2b8ca60c7 100644 --- a/rigs/kenwood/ts890s.c +++ b/rigs/kenwood/ts890s.c @@ -359,14 +359,7 @@ int kenwood_ts890_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) if (level == RIG_LEVEL_RFPOWER_METER_WATTS) { - if (val->f >= 10) - { - val->f = roundf(rig_raw2val(val->i, &power_meter)); - } - else - { - val->f = roundf(rig_raw2val(val->i, &power_meter) * 10.0) / 10.0; - } + val->f = roundf(rig_raw2val(val->i, &power_meter)); } else { commit 47fcf999f063214027be7bbf9ac2115ba759cf2e Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Feb 14 08:59:52 2024 -0600 Reduce debug error level for rig_test_2038 diff --git a/src/misc.c b/src/misc.c index b914e37d6..bbab4946f 100644 --- a/src/misc.c +++ b/src/misc.c @@ -3064,7 +3064,7 @@ int rig_test_2038(RIG *rig) __func__); #endif #if defined(__MSVCRT_VERSION__) - rig_debug(RIG_DEBUG_ERR, "%s: __MSVCRT_VERSION__=0x%04x\n", __func__, + rig_debug(RIG_DEBUG_TRACE, "%s: __MSVCRT_VERSION__=0x%04x\n", __func__, __MSVCRT_VERSION__); #endif commit f12d653f6ceaa4dadeb17278239a73092d8a9802 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Feb 14 07:55:42 2024 -0600 Try to fix MINGW time_t https://github.com/Hamlib/Hamlib/issues/1478 diff --git a/src/misc.c b/src/misc.c index 4d59cc5c0..b914e37d6 100644 --- a/src/misc.c +++ b/src/misc.c @@ -3076,7 +3076,7 @@ int rig_test_2038(RIG *rig) int failed = 0; #if defined(__MSVCRT_VERSION__) - x = (__time64_t)((1U << 31) - 1); + x = (__time64_t)((1UL << 31) - 1); char s[64]; _ctime64_s(s, sizeof(s), &x); commit e1f23429821777b938a69b11f7589e5c0c191e51 Author: Mike Black W9MDB <mdb...@ya...> Date: Wed Feb 14 07:11:20 2024 -0600 Promote all BETA to STABLE Promot all ALPHA to BETA diff --git a/amplifiers/elecraft/kpa1500.c b/amplifiers/elecraft/kpa1500.c index f2309b32c..f53d4c85a 100644 --- a/amplifiers/elecraft/kpa1500.c +++ b/amplifiers/elecraft/kpa1500.c @@ -62,7 +62,7 @@ const struct amp_caps kpa1500_amp_caps = .mfg_name = "Elecraft", .version = "20220710.0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .amp_type = AMP_TYPE_OTHER, .port_type = RIG_PORT_SERIAL, .serial_rate_min = 4800, diff --git a/amplifiers/expert/expert.c b/amplifiers/expert/expert.c index 35fdde367..756cb7b49 100644 --- a/amplifiers/expert/expert.c +++ b/amplifiers/expert/expert.c @@ -676,7 +676,7 @@ const struct amp_caps expert_amp_caps = .mfg_name = "Expert", .version = "20230328.0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .amp_type = AMP_TYPE_OTHER, .port_type = RIG_PORT_SERIAL, .serial_rate_min = 9600, diff --git a/amplifiers/gemini/dx1200.c b/amplifiers/gemini/dx1200.c index f0b41c654..a685453ba 100644 --- a/amplifiers/gemini/dx1200.c +++ b/amplifiers/gemini/dx1200.c @@ -62,7 +62,7 @@ const struct amp_caps gemini_amp_caps = .mfg_name = "Gemini", .version = "20230318.0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .amp_type = AMP_TYPE_OTHER, .port_type = RIG_PORT_NETWORK, .write_delay = 0, diff --git a/rigs/anytone/d578.c b/rigs/anytone/d578.c index cf7ec4214..ee29f9b95 100644 --- a/rigs/anytone/d578.c +++ b/rigs/anytone/d578.c @@ -33,7 +33,7 @@ struct rig_caps anytone_d578_caps = .mfg_name = "AnyTone", .version = BACKEND_VER ".0", .copyright = "Michael Black W9MDB: GNU LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/aor/ar2700.c b/rigs/aor/ar2700.c index 161ee0ebe..0245dd07b 100644 --- a/rigs/aor/ar2700.c +++ b/rigs/aor/ar2700.c @@ -87,7 +87,7 @@ struct rig_caps ar2700_caps = .mfg_name = "AOR", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_SCANNER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_RIG, diff --git a/rigs/aor/ar5000.c b/rigs/aor/ar5000.c index 73a8ffd9c..95c9b313e 100644 --- a/rigs/aor/ar5000.c +++ b/rigs/aor/ar5000.c @@ -252,7 +252,7 @@ struct rig_caps ar5000a_caps = .mfg_name = "AOR", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_SCANNER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_RIG, diff --git a/rigs/aor/ar8200.c b/rigs/aor/ar8200.c index c1a640fd3..17832f15e 100644 --- a/rigs/aor/ar8200.c +++ b/rigs/aor/ar8200.c @@ -91,7 +91,7 @@ struct rig_caps ar8200_caps = .mfg_name = "AOR", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_SCANNER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_RIG, diff --git a/rigs/barrett/4100.c b/rigs/barrett/4100.c index 814ae7b15..e1a2bc77e 100644 --- a/rigs/barrett/4100.c +++ b/rigs/barrett/4100.c @@ -235,7 +235,7 @@ struct rig_caps barrett4100_caps = .mfg_name = "Barrett", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, .ptt_type = RIG_PTT_RIG, diff --git a/rigs/dorji/dra818.c b/rigs/dorji/dra818.c index 065b0d305..8cf4e93e4 100644 --- a/rigs/dorji/dra818.c +++ b/rigs/dorji/dra818.c @@ -527,7 +527,7 @@ struct rig_caps dra818u_caps = .mfg_name = "Dorji", .version = "20191209.0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_RIG, @@ -631,7 +631,7 @@ struct rig_caps dra818v_caps = .mfg_name = "Dorji", .version = "20191209.0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_RIG, diff --git a/rigs/drake/r8b.c b/rigs/drake/r8b.c index 11fa4f1fe..a11a72bc3 100644 --- a/rigs/drake/r8b.c +++ b/rigs/drake/r8b.c @@ -85,7 +85,7 @@ struct rig_caps r8b_caps = .mfg_name = "Drake", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_RECEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/dummy/tci1x.c b/rigs/dummy/tci1x.c index a0aaaa635..15fae09cd 100644 --- a/rigs/dummy/tci1x.c +++ b/rigs/dummy/tci1x.c @@ -139,7 +139,7 @@ struct rig_caps tci1x_caps = .mfg_name = "Expert Elec", .version = "20211125.0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, .ptt_type = RIG_PTT_RIG, diff --git a/rigs/flexradio/dttsp.c b/rigs/flexradio/dttsp.c index de41b6ad5..50de1461a 100644 --- a/rigs/flexradio/dttsp.c +++ b/rigs/flexradio/dttsp.c @@ -162,7 +162,7 @@ struct rig_caps dttsp_rig_caps = .mfg_name = "DTTS Microwave Society", .version = "20200319.0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_COMPUTER, .targetable_vfo = RIG_TARGETABLE_ALL, .ptt_type = RIG_PTT_RIG, @@ -248,7 +248,7 @@ struct rig_caps dttsp_udp_rig_caps = .mfg_name = "DTTS Microwave Society", .version = "20200319.0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_COMPUTER, .targetable_vfo = RIG_TARGETABLE_ALL, .ptt_type = RIG_PTT_RIG, diff --git a/rigs/flexradio/sdr1k.c b/rigs/flexradio/sdr1k.c index e773d47bf..3489651d2 100644 --- a/rigs/flexradio/sdr1k.c +++ b/rigs/flexradio/sdr1k.c @@ -117,7 +117,7 @@ struct rig_caps sdr1k_rig_caps = .mfg_name = "Flex-radio", .version = "20200323.0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TUNER, .targetable_vfo = 0, .ptt_type = RIG_PTT_RIG, diff --git a/rigs/gomspace/gs100.c b/rigs/gomspace/gs100.c index 04d7097a3..ee3541bac 100644 --- a/rigs/gomspace/gs100.c +++ b/rigs/gomspace/gs100.c @@ -380,7 +380,7 @@ struct rig_caps GS100_caps = .mfg_name = "GOMSPACE", .version = "20211117.0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, .targetable_vfo = 0, .ptt_type = RIG_PTT_NONE, diff --git a/rigs/icmarine/icm700pro.c b/rigs/icmarine/icm700pro.c index 681ea4785..d1cd379dd 100644 --- a/rigs/icmarine/icm700pro.c +++ b/rigs/icmarine/icm700pro.c @@ -56,7 +56,7 @@ struct rig_caps icm700pro_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, diff --git a/rigs/icom/delta2.c b/rigs/icom/delta2.c index ec43e8ab0..e39f5017f 100644 --- a/rigs/icom/delta2.c +++ b/rigs/icom/delta2.c @@ -59,7 +59,7 @@ struct rig_caps delta2_caps = .mfg_name = "Ten-Tec", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/icom/ic271.c b/rigs/icom/ic271.c index dfa8d732a..b0dd0c336 100644 --- a/rigs/icom/ic271.c +++ b/rigs/icom/ic271.c @@ -56,7 +56,7 @@ struct rig_caps ic271_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/icom/ic2730.c b/rigs/icom/ic2730.c index 16ed41b01..f9fc56953 100644 --- a/rigs/icom/ic2730.c +++ b/rigs/icom/ic2730.c @@ -66,7 +66,7 @@ struct rig_caps ic2730_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_MOBILE, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, diff --git a/rigs/icom/ic471.c b/rigs/icom/ic471.c index b1e1ec20c..c8f07de1c 100644 --- a/rigs/icom/ic471.c +++ b/rigs/icom/ic471.c @@ -55,7 +55,7 @@ struct rig_caps ic471_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/icom/ic707.c b/rigs/icom/ic707.c index 4376094a4..1b4834760 100644 --- a/rigs/icom/ic707.c +++ b/rigs/icom/ic707.c @@ -61,7 +61,7 @@ struct rig_caps ic707_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/icom/ic728.c b/rigs/icom/ic728.c index 964b013ae..7e959580a 100644 --- a/rigs/icom/ic728.c +++ b/rigs/icom/ic728.c @@ -61,7 +61,7 @@ struct rig_caps ic728_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/icom/ic736.c b/rigs/icom/ic736.c index 979c336b6..48e4817f4 100644 --- a/rigs/icom/ic736.c +++ b/rigs/icom/ic736.c @@ -65,7 +65,7 @@ struct rig_caps ic736_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/icom/ic737.c b/rigs/icom/ic737.c index 8f1a8da64..c7f3b3f23 100644 --- a/rigs/icom/ic737.c +++ b/rigs/icom/ic737.c @@ -63,7 +63,7 @@ struct rig_caps ic737_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/icom/ic738.c b/rigs/icom/ic738.c index 354152d4a..c71fab5d1 100644 --- a/rigs/icom/ic738.c +++ b/rigs/icom/ic738.c @@ -65,7 +65,7 @@ struct rig_caps ic738_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/icom/ic7410.c b/rigs/icom/ic7410.c index bc8895310..d8e31510a 100644 --- a/rigs/icom/ic7410.c +++ b/rigs/icom/ic7410.c @@ -126,7 +126,7 @@ struct rig_caps ic7410_caps = .mfg_name = "Icom", .version = BACKEND_VER ".3", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, diff --git a/rigs/icom/ic775.c b/rigs/icom/ic775.c index 33d10113a..7e7d19d79 100644 --- a/rigs/icom/ic775.c +++ b/rigs/icom/ic775.c @@ -58,7 +58,7 @@ struct rig_caps ic775_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/icom/ic78.c b/rigs/icom/ic78.c index 977e0ee2a..a752f4ccc 100644 --- a/rigs/icom/ic78.c +++ b/rigs/icom/ic78.c @@ -69,7 +69,7 @@ struct rig_caps ic78_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_RIG, diff --git a/rigs/icom/ic820h.c b/rigs/icom/ic820h.c index e81dc1637..1d0bf11cf 100644 --- a/rigs/icom/ic820h.c +++ b/rigs/icom/ic820h.c @@ -57,7 +57,7 @@ struct rig_caps ic820h_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/icom/ic92d.c b/rigs/icom/ic92d.c index b0f3b6753..5d8c33f95 100644 --- a/rigs/icom/ic92d.c +++ b/rigs/icom/ic92d.c @@ -100,7 +100,7 @@ struct rig_caps ic92d_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_HANDHELD, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/icom/ic970.c b/rigs/icom/ic970.c index 333eb6337..d627347f6 100644 --- a/rigs/icom/ic970.c +++ b/rigs/icom/ic970.c @@ -52,7 +52,7 @@ struct rig_caps ic970_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/icom/icr30.c b/rigs/icom/icr30.c index 7ce95a322..16453423e 100644 --- a/rigs/icom/icr30.c +++ b/rigs/icom/icr30.c @@ -131,7 +131,7 @@ struct rig_caps icr30_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_RECEIVER | RIG_FLAG_HANDHELD, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_RIG, diff --git a/rigs/icom/icr7000.c b/rigs/icom/icr7000.c index 3636046b8..768054cca 100644 --- a/rigs/icom/icr7000.c +++ b/rigs/icom/icr7000.c @@ -181,7 +181,7 @@ struct rig_caps icr7100_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_RECEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_RIG, diff --git a/rigs/icom/icr71.c b/rigs/icom/icr71.c index 660fba2e8..8666acfe5 100644 --- a/rigs/icom/icr71.c +++ b/rigs/icom/icr71.c @@ -51,7 +51,7 @@ struct rig_caps icr71_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_RECEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/icom/icr72.c b/rigs/icom/icr72.c index 115a2abd5..4af798a4d 100644 --- a/rigs/icom/icr72.c +++ b/rigs/icom/icr72.c @@ -52,7 +52,7 @@ struct rig_caps icr72_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_RECEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_RIG, diff --git a/rigs/icom/icr8600.c b/rigs/icom/icr8600.c index e3a012b4c..446b77a7e 100644 --- a/rigs/icom/icr8600.c +++ b/rigs/icom/icr8600.c @@ -135,7 +135,7 @@ struct rig_caps icr8600_caps = .mfg_name = "Icom", .version = BACKEND_VER ".4", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_RECEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_RIG, diff --git a/rigs/icom/icr9000.c b/rigs/icom/icr9000.c index 33e9f4887..9767cebd9 100644 --- a/rigs/icom/icr9000.c +++ b/rigs/icom/icr9000.c @@ -69,7 +69,7 @@ struct rig_caps icr9000_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_RECEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_RIG, diff --git a/rigs/icom/icrx7.c b/rigs/icom/icrx7.c index 089c1d6b5..e46d0d8b5 100644 --- a/rigs/icom/icrx7.c +++ b/rigs/icom/icrx7.c @@ -56,7 +56,7 @@ struct rig_caps icrx7_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_RECEIVER | RIG_FLAG_HANDHELD, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_RIG, diff --git a/rigs/icom/id1.c b/rigs/icom/id1.c index d83efc844..3ee4bb907 100644 --- a/rigs/icom/id1.c +++ b/rigs/icom/id1.c @@ -74,7 +74,7 @@ struct rig_caps id1_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_MOBILE, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, diff --git a/rigs/icom/id31.c b/rigs/icom/id31.c index 9727c42b6..ffad0eaf1 100644 --- a/rigs/icom/id31.c +++ b/rigs/icom/id31.c @@ -82,7 +82,7 @@ struct rig_caps id31_caps = .mfg_name = "Icom", .version = BACKEND_VER ".1", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_HANDHELD, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, diff --git a/rigs/icom/id4100.c b/rigs/icom/id4100.c index e06694e95..f45de58bb 100644 --- a/rigs/icom/id4100.c +++ b/rigs/icom/id4100.c @@ -86,7 +86,7 @@ struct rig_caps id4100_caps = .mfg_name = "Icom", .version = BACKEND_VER ".1", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_MOBILE, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, diff --git a/rigs/icom/id51.c b/rigs/icom/id51.c index 729312a85..2688ba69b 100644 --- a/rigs/icom/id51.c +++ b/rigs/icom/id51.c @@ -89,7 +89,7 @@ struct rig_caps id51_caps = .mfg_name = "Icom", .version = BACKEND_VER ".1", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_HANDHELD, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, diff --git a/rigs/icom/id5100.c b/rigs/icom/id5100.c index 006bcdce3..9ad6fa4ff 100644 --- a/rigs/icom/id5100.c +++ b/rigs/icom/id5100.c @@ -530,7 +530,7 @@ struct rig_caps id5100_caps = .mfg_name = "Icom", .version = BACKEND_VER ".9", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_MOBILE, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, diff --git a/rigs/icom/perseus.c b/rigs/icom/perseus.c index e13ae8667..06aa1adaf 100644 --- a/rigs/icom/perseus.c +++ b/rigs/icom/perseus.c @@ -78,7 +78,7 @@ struct rig_caps perseus_caps = .mfg_name = "Microtelecom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_PCRECEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/jrc/nrd525.c b/rigs/jrc/nrd525.c index ca0c6ad4b..aaf798566 100644 --- a/rigs/jrc/nrd525.c +++ b/rigs/jrc/nrd525.c @@ -61,7 +61,7 @@ struct rig_caps nrd525_caps = .mfg_name = "JRC", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_RECEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/kachina/505dsp.c b/rigs/kachina/505dsp.c index 36e6ad37b..0640f5e7a 100644 --- a/rigs/kachina/505dsp.c +++ b/rigs/kachina/505dsp.c @@ -60,7 +60,7 @@ struct rig_caps k505dsp_caps = .mfg_name = "Kachina", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_COMPUTER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_RIG, diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index 41269c2f1..9bb1c403f 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -1449,7 +1449,7 @@ struct rig_caps trudx_caps = .mfg_name = "DL2MAN", .version = BACKEND_VER ".1", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_RIG_MICDATA, .dcd_type = RIG_DCD_RIG, diff --git a/rigs/kenwood/ts711.c b/rigs/kenwood/ts711.c index 8e3500c46..422e5ff71 100644 --- a/rigs/kenwood/ts711.c +++ b/rigs/kenwood/ts711.c @@ -101,7 +101,7 @@ struct rig_caps ts711_caps = .mfg_name = "Kenwood", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/kenwood/ts811.c b/rigs/kenwood/ts811.c index 043c78311..bfcdb1b2f 100644 --- a/rigs/kenwood/ts811.c +++ b/rigs/kenwood/ts811.c @@ -87,7 +87,7 @@ struct rig_caps ts811_caps = .mfg_name = "Kenwood", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, diff --git a/rigs/kenwood/ts930.c b/rigs/kenwood/ts930.c index 31a1e577e..f26542e5b 100644 --- a/rigs/kenwood/ts930.c +++ b/rigs/kenwood/ts930.c @@ -54,7 +54,7 @@ struct rig_caps ts930_caps = .mfg_name = "Kenwood", .version = BACKEND_VER ".1", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, diff --git a/rigs/kit/dds60.c b/rigs/kit/dds60.c index 6d7e98077..30ec93f1a 100644 --- a/rigs/kit/dds60.c +++ b/rigs/kit/dds60.c @@ -100,7 +100,7 @@ struct rig_caps dds60_caps = .mfg_name = "AmQRP", .version = "20200112.0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TUNER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/kit/dwt.c b/rigs/kit/dwt.c index fc21e6f6a..6f1d45844 100644 --- a/rigs/kit/dwt.c +++ b/rigs/kit/dwt.c @@ -549,7 +549,7 @@ struct rig_caps dwt_caps = .mfg_name = "Coding Technologies", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TUNER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/kit/hiqsdr.c b/rigs/kit/hiqsdr.c index e98aca072..5a58b10b9 100644 --- a/rigs/kit/hiqsdr.c +++ b/rigs/kit/hiqsdr.c @@ -105,7 +105,7 @@ struct rig_caps hiqsdr_caps = .mfg_name = "N2ADR", .version = "20200323.0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TUNER, .targetable_vfo = RIG_TARGETABLE_NONE, .ptt_type = RIG_PTT_RIG, diff --git a/rigs/kit/miniVNA.c b/rigs/kit/miniVNA.c index 7ef5e0ad9..5b73e8cde 100644 --- a/rigs/kit/miniVNA.c +++ b/rigs/kit/miniVNA.c @@ -61,7 +61,7 @@ struct rig_caps miniVNA_caps = .mfg_name = "mRS", .version = "20190817.0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TUNER, .port_type = RIG_PORT_SERIAL, .serial_rate_min = 115200, diff --git a/rigs/kit/pcrotor.c b/rigs/kit/pcrotor.c index fa52f4489..c1345a034 100644 --- a/rigs/kit/pcrotor.c +++ b/rigs/kit/pcrotor.c @@ -111,7 +111,7 @@ const struct rot_caps pcrotor_caps = .mfg_name = "WA6UFQ", .version = "20081013.0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_OTHER, .port_type = RIG_PORT_PARALLEL, .write_delay = 0, diff --git a/rigs/kit/si570avrusb.c b/rigs/kit/si570avrusb.c index 6367e3702..3f71e9258 100644 --- a/rigs/kit/si570avrusb.c +++ b/rigs/kit/si570avrusb.c @@ -475,7 +475,7 @@ struct rig_caps fasdr_caps = .mfg_name = "Funkamateur", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_FLAG_TUNER | RIG_FLAG_TRANSMITTER, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/kit/usrp.c b/rigs/kit/usrp.c index d389f2ca3..2e844788b 100644 --- a/rigs/kit/usrp.c +++ b/rigs/kit/usrp.c @@ -67,7 +67,7 @@ struct rig_caps usrp_caps = .mfg_name = "GNU Radio", .version = "0.1", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TUNER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/lowe/hf235.c b/rigs/lowe/hf235.c index ad7426db2..8b0a58b7f 100644 --- a/rigs/lowe/hf235.c +++ b/rigs/lowe/hf235.c @@ -50,7 +50,7 @@ struct rig_caps hf235_caps = .mfg_name = "Lowe", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, /* and only basic support */ + .status = RIG_STATUS_STABLE, /* and only basic support */ .rig_type = RIG_TYPE_RECEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/mds/4710.c b/rigs/mds/4710.c index d1cfacac7..b377f3847 100644 --- a/rigs/mds/4710.c +++ b/rigs/mds/4710.c @@ -7,7 +7,7 @@ struct rig_caps mds_4710_caps = .mfg_name = "MDS", .version = "20221114.0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/mds/9710.c b/rigs/mds/9710.c index b83a8c6d2..7abacdbdf 100644 --- a/rigs/mds/9710.c +++ b/rigs/mds/9710.c @@ -7,7 +7,7 @@ struct rig_caps mds_9710_caps = .mfg_name = "MDS", .version = "20221116.0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/racal/ra3702.c b/rigs/racal/ra3702.c index 5ed8aa3b2..d5d3e5c51 100644 --- a/rigs/racal/ra3702.c +++ b/rigs/racal/ra3702.c @@ -51,7 +51,7 @@ struct rig_caps ra3702_caps = .mfg_name = "Racal", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_BETA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_RECEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, diff --git a/rigs/racal/ra6790... [truncated message content] |
From: n0nb <n0...@us...> - 2024-01-18 17:54:27
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via 761f1d3b0024c4989935207a9e731c57eb2ccd8c (commit) via 48d3f3f7509034aaaf9ed2cd98ab4b486b62f85e (commit) from aec9348138c28a6b3d8569067e9c0717bf234843 (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 761f1d3b0024c4989935207a9e731c57eb2ccd8c Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Jan 18 09:18:49 2024 -0600 Add rest of RIG_FUNC_SYNC changes diff --git a/NEWS b/NEWS index 70fe9e26f..29fdbb15a 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ Version 5.x -- future * Change FT1000MP Mark V model names to align with FT1000MP Version 4.6 + * Added RIG_FUNC_SYNC for FTDX101D/MP * Added Barrett 4100 * Added DL2MAN (tr)uSDX -- needs refinement * Added Thetis entry -- derived from FlexRadio/Apache PowerSDR diff --git a/src/misc.c b/src/misc.c index 241765f32..c296e2972 100644 --- a/src/misc.c +++ b/src/misc.c @@ -740,6 +740,7 @@ static const struct { RIG_FUNC_SEND_MORSE, "SEND_MORSE" }, { RIG_FUNC_SEND_VOICE_MEM, "SEND_VOICE_MEM" }, { RIG_FUNC_OVF_STATUS, "OVF_STATUS" }, + { RIG_FUNC_SYNC, "SYNC" }, { RIG_FUNC_NONE, "" }, }; diff --git a/src/sprintflst.c b/src/sprintflst.c index ca87d8b6f..b6d70b125 100644 --- a/src/sprintflst.c +++ b/src/sprintflst.c @@ -177,6 +177,7 @@ int rig_sprintf_func(char *str, int nlen, setting_t func) if (!ms || !ms[0]) { + rig_debug(RIG_EINTERNAL, "%s: unknown RIG_FUNC=%x\n", __func__, i); continue; /* unknown, FIXME! */ } commit 48d3f3f7509034aaaf9ed2cd98ab4b486b62f85e Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Jan 18 07:56:30 2024 -0600 Add RIG_FUNC_SYNC -- only for FTDX101D/MP right now. diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 8044342c6..4e40e5c46 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -1273,7 +1273,7 @@ typedef uint64_t setting_t; #define RIG_FUNC_SEND_MORSE CONSTANT_64BIT_FLAG (45) /*!< \c SEND_MORSE -- Send specified characters using CW */ #define RIG_FUNC_SEND_VOICE_MEM CONSTANT_64BIT_FLAG (46) /*!< \c SEND_VOICE_MEM -- Transmit in SSB message stored in memory */ #define RIG_FUNC_OVF_STATUS CONSTANT_64BIT_FLAG (47) /*!< \c OVF -- Read overflow status 0=Off, 1=On */ -#define RIG_FUNC_BIT48 CONSTANT_64BIT_FLAG (48) /*!< \c available for future RIG_FUNC items */ +#define RIG_FUNC_SYNC CONSTANT_64BIT_FLAG (48) /*!< \c Synchronize VFOS -- FTDX101D/MP for now SY command */ #define RIG_FUNC_BIT49 CONSTANT_64BIT_FLAG (49) /*!< \c available for future RIG_FUNC items */ #define RIG_FUNC_BIT50 CONSTANT_64BIT_FLAG (50) /*!< \c available for future RIG_FUNC items */ #define RIG_FUNC_BIT51 CONSTANT_64BIT_FLAG (51) /*!< \c available for future RIG_FUNC items */ diff --git a/rigs/yaesu/ftdx101.h b/rigs/yaesu/ftdx101.h index fd830f1c5..64a433a3c 100644 --- a/rigs/yaesu/ftdx101.h +++ b/rigs/yaesu/ftdx101.h @@ -65,7 +65,8 @@ #define FTDX101_FUNCS (RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_LOCK|\ RIG_FUNC_MON|RIG_FUNC_NB|RIG_FUNC_NR|RIG_FUNC_VOX|\ RIG_FUNC_FBKIN|RIG_FUNC_COMP|RIG_FUNC_ANF|RIG_FUNC_MN|\ - RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER|RIG_FUNC_APF) + RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER|RIG_FUNC_APF|\ + RIG_FUNC_SYNC) /* TBC */ #define FTDX101_VFO_OPS (RIG_OP_TUNE|RIG_OP_CPY|RIG_OP_XCHG|\ diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index fa278e7f6..b579e1abb 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -6401,6 +6401,16 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) break; + case RIG_FUNC_SYNC: + if (!newcat_valid_command(rig, "SY")) + { + RETURNFUNC(-RIG_ENAVAIL); + } + + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "SY%d%c", status ? 1 : 0, + cat_term); + break; + default: RETURNFUNC(-RIG_EINVAL); } @@ -6694,6 +6704,15 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) break; + case RIG_FUNC_SYNC: + if (!newcat_valid_command(rig, "SY")) + { + RETURNFUNC(-RIG_ENAVAIL); + } + + SNPRINTF(priv->cmd_str, sizeof(priv->cmd_str), "SY%c", cat_term); + break; + default: RETURNFUNC(-RIG_EINVAL); } @@ -6808,6 +6827,10 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) break; + case RIG_FUNC_SYNC: + *status = (retfunc[0] == '1') ? 1 : 0; + break; + default: RETURNFUNC(-RIG_EINVAL); } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 43ffe73f2..dadf05f27 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20240113" +#define NEWCAT_VER "20240118" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 ----------------------------------------------------------------------- Summary of changes: NEWS | 1 + include/hamlib/rig.h | 2 +- rigs/yaesu/ftdx101.h | 3 ++- rigs/yaesu/newcat.c | 23 +++++++++++++++++++++++ rigs/yaesu/newcat.h | 2 +- src/misc.c | 1 + src/sprintflst.c | 1 + 7 files changed, 30 insertions(+), 3 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: n0nb <n0...@us...> - 2024-01-18 14:18:56
|
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 aec9348138c28a6b3d8569067e9c0717bf234843 (commit) from df64af4583a6e8fcac0494cd64a958ebb55ceff1 (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 aec9348138c28a6b3d8569067e9c0717bf234843 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Jan 18 07:39:56 2024 -0600 Add rig_band_changes to HAMLIB API diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 4a48d1c04..8044342c6 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -3846,6 +3846,7 @@ extern HAMLIB_EXPORT(char*) rig_date_strget(char *buf, int buflen, int localtime enum GPIO { GPIO1, GPIO2, GPIO3, GPIO4 }; extern HAMLIB_EXPORT(int) rig_cm108_get_bit(hamlib_port_t *p, enum GPIO gpio, int *bit); extern HAMLIB_EXPORT(int) rig_cm108_set_bit(hamlib_port_t *p, enum GPIO gpio, int bit); +extern HAMLIB_EXPORT(int) rig_band_changed(RIG *rig, hamlib_bandselect_t band); extern HAMLIB_EXPORT(void *) rig_data_pointer(RIG *rig, rig_ptrx_t idx); ----------------------------------------------------------------------- Summary of changes: include/hamlib/rig.h | 1 + 1 file changed, 1 insertion(+) hooks/post-receive -- Hamlib -- Ham radio control libraries |