hamlib-cvs-digest Mailing List for Ham Radio Control Libraries (Page 25)
Library to control radio transceivers and receivers
Brought to you by:
n0nb
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(57) |
Nov
(27) |
Dec
(25) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(41) |
Feb
(101) |
Mar
(60) |
Apr
(32) |
May
(32) |
Jun
(198) |
Jul
(95) |
Aug
(60) |
Sep
(48) |
Oct
(96) |
Nov
(27) |
Dec
(222) |
2002 |
Jan
(180) |
Feb
(46) |
Mar
(68) |
Apr
(11) |
May
(36) |
Jun
(34) |
Jul
(113) |
Aug
(42) |
Sep
(71) |
Oct
(65) |
Nov
(116) |
Dec
(40) |
2003 |
Jan
(32) |
Feb
(92) |
Mar
(29) |
Apr
(102) |
May
(21) |
Jun
(34) |
Jul
(3) |
Aug
(60) |
Sep
(30) |
Oct
(62) |
Nov
(57) |
Dec
(33) |
2004 |
Jan
(28) |
Feb
(46) |
Mar
(16) |
Apr
(14) |
May
(31) |
Jun
(21) |
Jul
(10) |
Aug
(80) |
Sep
(42) |
Oct
(11) |
Nov
(28) |
Dec
(13) |
2005 |
Jan
(35) |
Feb
(26) |
Mar
(20) |
Apr
(118) |
May
(2) |
Jun
(5) |
Jul
|
Aug
|
Sep
(5) |
Oct
(1) |
Nov
(13) |
Dec
(1) |
2006 |
Jan
(9) |
Feb
(25) |
Mar
(22) |
Apr
(6) |
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
(3) |
Oct
(46) |
Nov
(13) |
Dec
(7) |
2007 |
Jan
(9) |
Feb
(14) |
Mar
(3) |
Apr
|
May
(6) |
Jun
(1) |
Jul
|
Aug
(11) |
Sep
(7) |
Oct
(8) |
Nov
(41) |
Dec
(3) |
2008 |
Jan
(27) |
Feb
(16) |
Mar
(13) |
Apr
(23) |
May
(39) |
Jun
(4) |
Jul
(7) |
Aug
(1) |
Sep
(13) |
Oct
(52) |
Nov
(44) |
Dec
(55) |
2009 |
Jan
(72) |
Feb
(69) |
Mar
|
Apr
|
May
|
Jun
(13) |
Jul
(1) |
Aug
(6) |
Sep
(15) |
Oct
(11) |
Nov
(31) |
Dec
(20) |
2010 |
Jan
(24) |
Feb
(21) |
Mar
(22) |
Apr
(40) |
May
(38) |
Jun
(4) |
Jul
(2) |
Aug
(22) |
Sep
(19) |
Oct
(14) |
Nov
(5) |
Dec
(8) |
2011 |
Jan
(14) |
Feb
(36) |
Mar
(6) |
Apr
|
May
|
Jun
(23) |
Jul
(13) |
Aug
(8) |
Sep
(7) |
Oct
|
Nov
(3) |
Dec
(9) |
2012 |
Jan
(17) |
Feb
(13) |
Mar
(10) |
Apr
|
May
(1) |
Jun
(14) |
Jul
(4) |
Aug
(12) |
Sep
(2) |
Oct
(24) |
Nov
(14) |
Dec
(2) |
2013 |
Jan
(4) |
Feb
(3) |
Mar
(3) |
Apr
(3) |
May
(10) |
Jun
(4) |
Jul
(7) |
Aug
|
Sep
(15) |
Oct
(5) |
Nov
(1) |
Dec
(2) |
2014 |
Jan
|
Feb
(8) |
Mar
(1) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
(3) |
Oct
(7) |
Nov
(6) |
Dec
(3) |
2015 |
Jan
(4) |
Feb
(5) |
Mar
(8) |
Apr
(8) |
May
(2) |
Jun
|
Jul
(4) |
Aug
(7) |
Sep
(8) |
Oct
|
Nov
(6) |
Dec
(4) |
2016 |
Jan
(6) |
Feb
(26) |
Mar
(3) |
Apr
(10) |
May
(6) |
Jun
(5) |
Jul
(1) |
Aug
(4) |
Sep
(3) |
Oct
(4) |
Nov
(3) |
Dec
(10) |
2017 |
Jan
(11) |
Feb
(11) |
Mar
(2) |
Apr
(1) |
May
(7) |
Jun
(2) |
Jul
(11) |
Aug
(9) |
Sep
(5) |
Oct
(5) |
Nov
(1) |
Dec
(2) |
2018 |
Jan
(5) |
Feb
(2) |
Mar
(19) |
Apr
(7) |
May
(11) |
Jun
(3) |
Jul
(4) |
Aug
(10) |
Sep
(2) |
Oct
(8) |
Nov
(6) |
Dec
(9) |
2019 |
Jan
(9) |
Feb
(6) |
Mar
(2) |
Apr
(4) |
May
(6) |
Jun
(9) |
Jul
(6) |
Aug
(3) |
Sep
(5) |
Oct
(2) |
Nov
(8) |
Dec
(9) |
2020 |
Jan
(15) |
Feb
(1) |
Mar
(18) |
Apr
(33) |
May
(43) |
Jun
(87) |
Jul
(45) |
Aug
(8) |
Sep
(43) |
Oct
(3) |
Nov
(5) |
Dec
(42) |
2021 |
Jan
(116) |
Feb
(40) |
Mar
(58) |
Apr
(48) |
May
(29) |
Jun
(2) |
Jul
|
Aug
(22) |
Sep
(18) |
Oct
(1) |
Nov
|
Dec
(3) |
2022 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(2) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
(6) |
Nov
(2) |
Dec
(9) |
2023 |
Jan
(10) |
Feb
|
Mar
|
Apr
(10) |
May
(3) |
Jun
(1) |
Jul
(2) |
Aug
(4) |
Sep
(1) |
Oct
|
Nov
(2) |
Dec
(3) |
2024 |
Jan
(4) |
Feb
(1) |
Mar
(2) |
Apr
(2) |
May
(5) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(9) |
2025 |
Jan
(5) |
Feb
(5) |
Mar
|
Apr
(10) |
May
(20) |
Jun
(43) |
Jul
(24) |
Aug
(21) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael B. <mdb...@us...> - 2020-12-02 13:11: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 eb8082b1f882706f589b2d5ff605d9d130e597e4 (commit) via 1beecdd68573ce73eb4981067b22fd03434eacbb (commit) via f8790337d37256e1d8a3c228382f9dd7cc9cf0ce (commit) via 5fc36df24987133730f0458982846c4c30d26ed3 (commit) via dd3ed134dd636a6c642eb64aa7fa2f943973cc38 (commit) via 7e5d08319f534596652381f4e4881f4e1d83e727 (commit) via c70d841b83e6a8ebe7338dc0dfbb9a402cee2370 (commit) via 3490fed03c06dcac3a7600073a62f28352b08c30 (commit) via 511435c73e9a9164085117b77e9fbb3049da31ac (commit) via d782fde5e5a8d522b2b0b96a213f2da512eab76b (commit) via b5f7c5884b5475cd34cda6709180a161c99c0cc0 (commit) via c3c1aa9998b85cb0179ccab72c110f061dd6f707 (commit) via c16be1c2642bd8b4fc949a8a3decf47f9ea539c2 (commit) via d1f857c131be34cb6934724cb5c769b8602b0a8f (commit) via a114c61a04f5652f6ed7f6eb8bf084b1639fdb62 (commit) via 4c87229e65892e908dc82afbd3ca32277689e148 (commit) via d8be93350fa94dbf4b76c96a6971a8574e7b0f46 (commit) via 0413a6b71fdb3ac6fb766bb3e246190d76e2d71b (commit) via 8827f081ddfd2fbc0d6fa5bf75bf5f2cf9d9760e (commit) via a475ebf0174fe93b73f20ae50b6b88df05a5faa2 (commit) via fbc44864b3a65e188b0ed00ad1141936ca0b077e (commit) via 477bc5b4621bbc053b9f51a76dbd07a31502d804 (commit) via 0ae511c958b5b2e51d5474a3c34cfb95d351cff4 (commit) via bba86fb6a15534080b5e3bc490adb1291d2125f8 (commit) via bfdce275ee51b0bba600bbf94bf292c7bc52389c (commit) via 8ecf7b15ba0c4b5b486f85fec5c53b49588a95d9 (commit) via 8fd78de372b42cbae0531140e4b5f121e040d0e8 (commit) via 0c2599c0c1bb4a62b035c9d12a6f9deda86ec7a5 (commit) via 905cf4ea48eec3e6ac7e82ed2947b39855bfaa4a (commit) from ac2892913cdfe706ee4d6496d639bae8467a202f (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 eb8082b1f882706f589b2d5ff605d9d130e597e4 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Dec 2 07:10:12 2020 -0600 Fix rig_get_channel API change in dumpmem.c https://github.com/Hamlib/Hamlib/issues/430 diff --git a/tests/dumpmem.c b/tests/dumpmem.c index 9f965b53..c7f15165 100644 --- a/tests/dumpmem.c +++ b/tests/dumpmem.c @@ -165,7 +165,7 @@ int dump_chan(RIG *rig, int chan_num) chan.vfo = RIG_VFO_MEM; chan.channel_num = chan_num; - status = rig_get_channel(rig, &chan, 1); + status = rig_get_channel(rig, RIG_VFO_NONE, &chan, 1); if (status != RIG_OK) { commit 1beecdd68573ce73eb4981067b22fd03434eacbb Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Dec 1 16:57:10 2020 -0600 Add 25ms post_write_delay for gs232a/b and a retry when \r\n is received https://github.com/Hamlib/Hamlib/issues/371 diff --git a/rotators/gs232a/gs232a.c b/rotators/gs232a/gs232a.c index 5f206729..a2ccd3f6 100644 --- a/rotators/gs232a/gs232a.c +++ b/rotators/gs232a/gs232a.c @@ -103,6 +103,8 @@ transaction_write: retval = read_string(&rs->rotport, data, data_len, REPLY_EOM, strlen(REPLY_EOM)); + if (strncmp(data,"\r\n",2)==0) retval = -1; + if (retval < 0) { if (retry_read++ < rot->state.rotport.retry) @@ -304,7 +306,7 @@ const struct rot_caps gs23_rot_caps = .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = 0, - .post_write_delay = 0, + .post_write_delay = 25, .timeout = 400, .retry = 3, @@ -340,7 +342,7 @@ const struct rot_caps gs232_rot_caps = .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = 0, - .post_write_delay = 0, + .post_write_delay = 25, .timeout = 400, .retry = 3, @@ -376,7 +378,7 @@ const struct rot_caps gs232a_rot_caps = .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = 0, - .post_write_delay = 0, + .post_write_delay = 25, .timeout = 400, .retry = 3, diff --git a/rotators/gs232a/gs232b.c b/rotators/gs232a/gs232b.c index 9c032004..143f3f02 100644 --- a/rotators/gs232a/gs232b.c +++ b/rotators/gs232a/gs232b.c @@ -110,6 +110,8 @@ transaction_write: retval = read_string(&rs->rotport, data, data_len, REPLY_EOM, strlen(REPLY_EOM)); + if (strncmp(data,"\r\n",2)==0) retval = -1; + if (retval < 0) { if (retry_read++ < rot->state.rotport.retry) @@ -341,7 +343,7 @@ const struct rot_caps gs232b_rot_caps = .serial_parity = RIG_PARITY_NONE, .serial_handshake = RIG_HANDSHAKE_NONE, .write_delay = 0, - .post_write_delay = 0, + .post_write_delay = 25, .timeout = 400, .retry = 3, commit f8790337d37256e1d8a3c228382f9dd7cc9cf0ce Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Dec 1 15:18:08 2020 -0600 Hopefully this works for all gs232a/gs232b rotors and emulators We only look now for 0x0a on commands that expect a return If there is a rig/emulator that does not give 0x0a on expected returns then we will have a problem. gs232a/gs232b doc says 0x0a is expected on cmds that return info and 0x0d on command with no return. https://github.com/Hamlib/Hamlib/issues/371 diff --git a/rotators/gs232a/gs232a.c b/rotators/gs232a/gs232a.c index d9429919..5f206729 100644 --- a/rotators/gs232a/gs232a.c +++ b/rotators/gs232a/gs232a.c @@ -42,7 +42,7 @@ #include "gs232a.h" #define EOM "\r" -#define REPLY_EOM "\r\n" +#define REPLY_EOM "\n" #define BUFSZ 64 @@ -292,7 +292,7 @@ const struct rot_caps gs23_rot_caps = ROT_MODEL(ROT_MODEL_GS23), .model_name = "GS-23", .mfg_name = "Yaesu/Kenpro", - .version = "20200617.0", + .version = "20201201.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZEL, @@ -328,7 +328,7 @@ const struct rot_caps gs232_rot_caps = ROT_MODEL(ROT_MODEL_GS232), .model_name = "GS-232", .mfg_name = "Yaesu/Kenpro", - .version = "20200605.0", + .version = "20201201.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_AZEL, @@ -364,7 +364,7 @@ const struct rot_caps gs232a_rot_caps = ROT_MODEL(ROT_MODEL_GS232A), .model_name = "GS-232A", .mfg_name = "Yaesu", - .version = "20200505.0", + .version = "20201205.0", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rot_type = ROT_TYPE_OTHER, diff --git a/rotators/gs232a/gs232b.c b/rotators/gs232a/gs232b.c index 39946797..9c032004 100644 --- a/rotators/gs232a/gs232b.c +++ b/rotators/gs232a/gs232b.c @@ -43,7 +43,7 @@ #include "gs232a.h" #define EOM "\r" -#define REPLY_EOM "\r\n" +#define REPLY_EOM "\n" #define BUFSZ 64 @@ -329,7 +329,7 @@ const struct rot_caps gs232b_rot_caps = ROT_MODEL(ROT_MODEL_GS232B), .model_name = "GS-232B", .mfg_name = "Yaesu", - .version = "20200617.0", + .version = "20201201.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_OTHER, commit 5fc36df24987133730f0458982846c4c30d26ed3 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Nov 30 14:53:55 2020 -0600 astyle files diff --git a/rigs/aor/ar3030.c b/rigs/aor/ar3030.c index 5e40e49e..8dbc47cd 100644 --- a/rigs/aor/ar3030.c +++ b/rigs/aor/ar3030.c @@ -45,7 +45,8 @@ static int ar3030_set_mem(RIG *rig, vfo_t vfo, int ch); static int ar3030_get_mem(RIG *rig, vfo_t vfo, int *ch); static int ar3030_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); static int ar3030_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); -static int ar3030_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only); +static int ar3030_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only); static int ar3030_init(RIG *rig); static int ar3030_cleanup(RIG *rig); static int ar3030_close(RIG *rig); diff --git a/rigs/aor/ar7030p.c b/rigs/aor/ar7030p.c index d614c106..8ae78cf9 100644 --- a/rigs/aor/ar7030p.c +++ b/rigs/aor/ar7030p.c @@ -1638,7 +1638,8 @@ static int ar7030p_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan) return (-RIG_ENIMPL); } -static int ar7030p_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) +static int ar7030p_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only) { int rc = RIG_OK; unsigned char v; diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index f3c26ceb..a274fcdc 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -1888,7 +1888,8 @@ static int dummy_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan) } -static int dummy_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) +static int dummy_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only) { struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv; @@ -2078,7 +2079,7 @@ struct rig_caps dummy_caps = .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, - .targetable_vfo = RIG_TARGETABLE_PTT|RIG_TARGETABLE_RITXIT, + .targetable_vfo = RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, .port_type = RIG_PORT_NONE, @@ -2243,7 +2244,7 @@ struct rig_caps dummy_no_vfo_caps = .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, - .targetable_vfo = RIG_TARGETABLE_PTT|RIG_TARGETABLE_RITXIT, + .targetable_vfo = RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, .port_type = RIG_PORT_NONE, diff --git a/rigs/dummy/netrigctl.c b/rigs/dummy/netrigctl.c index 8d0743aa..98199165 100644 --- a/rigs/dummy/netrigctl.c +++ b/rigs/dummy/netrigctl.c @@ -2106,7 +2106,8 @@ static int netrigctl_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan) } -static int netrigctl_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) +static int netrigctl_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only) { return -RIG_ENIMPL; } diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 6ca3664f..ca718a8d 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -395,9 +395,12 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, { rmode_t tmode; int ret = rig_get_mode(rig, vfo, &tmode, &width); + if (ret != RIG_OK) { - rig_debug(RIG_DEBUG_WARN, "%s: Failed to get width for passband nochange err=%s\n", __func__, rigerror(ret)); + rig_debug(RIG_DEBUG_WARN, + "%s: Failed to get width for passband nochange err=%s\n", __func__, + rigerror(ret)); } } diff --git a/rigs/icom/ic746.c b/rigs/icom/ic746.c index 6fcada2f..7a0f87ff 100644 --- a/rigs/icom/ic746.c +++ b/rigs/icom/ic746.c @@ -153,7 +153,8 @@ typedef channel_str_t band_stack_reg_t; static int ic746_set_parm(RIG *rig, setting_t parm, value_t val); static int ic746_get_parm(RIG *rig, setting_t parm, value_t *val); -static int ic746pro_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only); +static int ic746pro_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only); static int ic746pro_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan); static int ic746pro_set_ext_parm(RIG *rig, token_t token, value_t val); static int ic746pro_get_ext_parm(RIG *rig, token_t token, value_t *val); diff --git a/rigs/icom/icr75.c b/rigs/icom/icr75.c index 18291cd8..4bc8c3a6 100644 --- a/rigs/icom/icr75.c +++ b/rigs/icom/icr75.c @@ -92,7 +92,8 @@ } static int icr75_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan); -static int icr75_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only); +static int icr75_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only); static int icr75_set_parm(RIG *rig, setting_t parm, value_t val); static int icr75_get_parm(RIG *rig, setting_t parm, value_t *val); diff --git a/rigs/kenwood/pihpsdr.c b/rigs/kenwood/pihpsdr.c index 4e5f9ab9..1c00de3d 100644 --- a/rigs/kenwood/pihpsdr.c +++ b/rigs/kenwood/pihpsdr.c @@ -64,7 +64,8 @@ static int pihpsdr_open(RIG *rig); static int pihpsdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); static int pihpsdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); -static int pihspdr_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only); +static int pihspdr_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only); static int pihspdr_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan); diff --git a/rigs/kenwood/thd72.c b/rigs/kenwood/thd72.c index 0ad208a7..39f8b065 100644 --- a/rigs/kenwood/thd72.c +++ b/rigs/kenwood/thd72.c @@ -1358,7 +1358,8 @@ static int thd72_parse_channel(int kind, const char *buf, channel_t *chan) return RIG_OK; } -static int thd72_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) +static int thd72_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only) { int retval; char buf[72]; diff --git a/rigs/kenwood/thd74.c b/rigs/kenwood/thd74.c index b19d8bd6..e35c1e7a 100644 --- a/rigs/kenwood/thd74.c +++ b/rigs/kenwood/thd74.c @@ -1275,7 +1275,8 @@ static int thd74_parse_channel(int kind, const char *buf, channel_t *chan) return RIG_OK; } -static int thd74_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only) +static int thd74_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only) { int retval; char buf[72]; diff --git a/rigs/kenwood/tmd710.c b/rigs/kenwood/tmd710.c index 70106d7b..22318454 100644 --- a/rigs/kenwood/tmd710.c +++ b/rigs/kenwood/tmd710.c @@ -71,7 +71,8 @@ static int tmd710_set_mem(RIG *rig, vfo_t vfo, int ch); static int tmd710_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code); static int tmd710_get_dcs_sql(RIG *rig, vfo_t vfo, tone_t *code); static int tmd710_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan); -static int tmd710_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only); +static int tmd710_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only); static int tmd710_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt); static int tmd710_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd); static int tmd710_vfo_op(RIG *rig, vfo_t vfo, vfo_op_t op); diff --git a/rigs/kenwood/tmv7.c b/rigs/kenwood/tmv7.c index 0aebff5e..373d6ad5 100644 --- a/rigs/kenwood/tmv7.c +++ b/rigs/kenwood/tmv7.c @@ -87,7 +87,8 @@ static int tmv7_decode_event(RIG *rig); static int tmv7_set_vfo(RIG *rig, vfo_t vfo); static int tmv7_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); static int tmv7_get_powerstat(RIG *rig, powerstat_t *status); -static int tmv7_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only); +static int tmv7_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only); static int tmv7_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan); /* diff --git a/rigs/kenwood/ts2000.c b/rigs/kenwood/ts2000.c index 2b17788f..60615366 100644 --- a/rigs/kenwood/ts2000.c +++ b/rigs/kenwood/ts2000.c @@ -58,7 +58,8 @@ /* prototypes */ static int ts2000_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); -static int ts2000_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, int read_only); +static int ts2000_get_channel(RIG *rig, vfo_t vfo, channel_t *chan, + int read_only); static int ts2000_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan); /* diff --git a/rigs/yaesu/ft1200.c b/rigs/yaesu/ft1200.c index f6af9d52..9aa8928a 100644 --- a/rigs/yaesu/ft1200.c +++ b/rigs/yaesu/ft1200.c @@ -42,16 +42,16 @@ const struct newcat_priv_caps ftdx1200_priv_caps = { .roofing_filter_count = 7, .roofing_filters = - { - // The index must match ext level combo index - { .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 }, - { .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 }, - { .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 }, - { .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 }, - { .index = 4, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 }, - { .index = 5, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 }, - { .index = 6, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 }, - } + { + // The index must match ext level combo index + { .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 }, + { .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 }, + { .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 }, + { .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 }, + { .index = 4, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 }, + { .index = 5, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 }, + { .index = 6, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 }, + } }; const struct confparams ftdx1200_ext_levels[] = @@ -63,11 +63,15 @@ const struct confparams ftdx1200_ext_levels[] = "Roofing filter", NULL, RIG_CONF_COMBO, - { .c = { .combostr = { - "AUTO", "15 kHz", "6 kHz", "3 kHz", - "AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", - NULL } - } } + { + .c = { + .combostr = { + "AUTO", "15 kHz", "6 kHz", "3 kHz", + "AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", + NULL + } + } + } }, { RIG_CONF_END, NULL, } }; diff --git a/rigs/yaesu/ft2000.c b/rigs/yaesu/ft2000.c index c33bcdfd..d486ab02 100644 --- a/rigs/yaesu/ft2000.c +++ b/rigs/yaesu/ft2000.c @@ -44,16 +44,16 @@ const struct newcat_priv_caps ft2000_priv_caps = { .roofing_filter_count = 7, .roofing_filters = - { - // The index must match ext level combo index - { .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 }, - { .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 }, - { .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 }, - { .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 }, - { .index = 4, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 }, - { .index = 5, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 }, - { .index = 6, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 }, - } + { + // The index must match ext level combo index + { .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 }, + { .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 }, + { .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 }, + { .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 }, + { .index = 4, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 }, + { .index = 5, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 }, + { .index = 6, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 }, + } }; const struct confparams ft2000_ext_levels[] = @@ -65,11 +65,15 @@ const struct confparams ft2000_ext_levels[] = "Roofing filter", NULL, RIG_CONF_COMBO, - { .c = { .combostr = { - "AUTO", "15 kHz", "6 kHz", "3 kHz", - "AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", - NULL } - } } + { + .c = { + .combostr = { + "AUTO", "15 kHz", "6 kHz", "3 kHz", + "AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", + NULL + } + } + } }, { RIG_CONF_END, NULL, } }; diff --git a/rigs/yaesu/ft3000.c b/rigs/yaesu/ft3000.c index dc416780..6a7e20a3 100644 --- a/rigs/yaesu/ft3000.c +++ b/rigs/yaesu/ft3000.c @@ -40,20 +40,20 @@ const struct newcat_priv_caps ftdx3000_priv_caps = { .roofing_filter_count = 11, .roofing_filters = - { - // The index must match ext level combo index - { .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 }, - { .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 }, - { .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 }, - { .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 }, - { .index = 4, .set_value = '4', .get_value = '7', .width = 600, .optional = 0 }, - { .index = 5, .set_value = '5', .get_value = '8', .width = 300, .optional = 0 }, - { .index = 6, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 }, - { .index = 7, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 }, - { .index = 8, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 }, - { .index = 9, .set_value = 0, .get_value = '9', .width = 600, .optional = 0 }, - { .index = 10, .set_value = 0, .get_value = 'A', .width = 300, .optional = 0 }, - } + { + // The index must match ext level combo index + { .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 }, + { .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 }, + { .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 }, + { .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 }, + { .index = 4, .set_value = '4', .get_value = '7', .width = 600, .optional = 0 }, + { .index = 5, .set_value = '5', .get_value = '8', .width = 300, .optional = 0 }, + { .index = 6, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 }, + { .index = 7, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 }, + { .index = 8, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 }, + { .index = 9, .set_value = 0, .get_value = '9', .width = 600, .optional = 0 }, + { .index = 10, .set_value = 0, .get_value = 'A', .width = 300, .optional = 0 }, + } }; const struct confparams ftdx3000_ext_levels[] = @@ -65,11 +65,15 @@ const struct confparams ftdx3000_ext_levels[] = "Roofing filter", NULL, RIG_CONF_COMBO, - { .c = { .combostr = { - "AUTO", "15 kHz", "6 kHz", "3 kHz", "600 Hz", "300 Hz", - "AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", "AUTO - 600 Hz", "AUTO - 300 Hz", - NULL } - } } + { + .c = { + .combostr = { + "AUTO", "15 kHz", "6 kHz", "3 kHz", "600 Hz", "300 Hz", + "AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", "AUTO - 600 Hz", "AUTO - 300 Hz", + NULL + } + } + } }, { RIG_CONF_END, NULL, } }; diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c index 7928da03..df68029d 100644 --- a/rigs/yaesu/ft5000.c +++ b/rigs/yaesu/ft5000.c @@ -40,20 +40,20 @@ const struct newcat_priv_caps ftdx5000_priv_caps = { .roofing_filter_count = 11, .roofing_filters = - { - // The index must match ext level combo index - { .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 }, - { .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 }, - { .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 }, - { .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 }, - { .index = 4, .set_value = '4', .get_value = '7', .width = 600, .optional = 0 }, - { .index = 5, .set_value = '5', .get_value = '8', .width = 300, .optional = 0 }, - { .index = 6, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 }, - { .index = 7, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 }, - { .index = 8, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 }, - { .index = 9, .set_value = 0, .get_value = '9', .width = 600, .optional = 0 }, - { .index = 10, .set_value = 0, .get_value = 'A', .width = 300, .optional = 0 }, - } + { + // The index must match ext level combo index + { .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 }, + { .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 }, + { .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 }, + { .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 }, + { .index = 4, .set_value = '4', .get_value = '7', .width = 600, .optional = 0 }, + { .index = 5, .set_value = '5', .get_value = '8', .width = 300, .optional = 0 }, + { .index = 6, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 }, + { .index = 7, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 }, + { .index = 8, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 }, + { .index = 9, .set_value = 0, .get_value = '9', .width = 600, .optional = 0 }, + { .index = 10, .set_value = 0, .get_value = 'A', .width = 300, .optional = 0 }, + } }; const struct confparams ftdx5000_ext_levels[] = @@ -65,11 +65,15 @@ const struct confparams ftdx5000_ext_levels[] = "Roofing filter", NULL, RIG_CONF_COMBO, - { .c = { .combostr = { - "AUTO", "15 kHz", "6 kHz", "3 kHz", "600 Hz (Main)", "300 Hz (Main)", - "AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", "AUTO - 600 Hz (Main)", "AUTO - 300 Hz (Main)", - NULL } - } } + { + .c = { + .combostr = { + "AUTO", "15 kHz", "6 kHz", "3 kHz", "600 Hz (Main)", "300 Hz (Main)", + "AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", "AUTO - 600 Hz (Main)", "AUTO - 300 Hz (Main)", + NULL + } + } + } }, { RIG_CONF_END, NULL, } }; diff --git a/rigs/yaesu/ft950.c b/rigs/yaesu/ft950.c index bf30d435..1141eba2 100644 --- a/rigs/yaesu/ft950.c +++ b/rigs/yaesu/ft950.c @@ -42,16 +42,16 @@ const struct newcat_priv_caps ft950_priv_caps = { .roofing_filter_count = 7, .roofing_filters = - { - // The index must match ext level combo index - { .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 }, - { .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 }, - { .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 }, - { .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 }, - { .index = 4, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 }, - { .index = 5, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 }, - { .index = 6, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 }, - } + { + // The index must match ext level combo index + { .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 }, + { .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 }, + { .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 }, + { .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 }, + { .index = 4, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 }, + { .index = 5, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 }, + { .index = 6, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 }, + } }; const struct confparams ft950_ext_levels[] = @@ -63,11 +63,15 @@ const struct confparams ft950_ext_levels[] = "Roofing filter", NULL, RIG_CONF_COMBO, - { .c = { .combostr = { - "AUTO", "15 kHz", "6 kHz", "3 kHz", - "AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", - NULL } - } } + { + .c = { + .combostr = { + "AUTO", "15 kHz", "6 kHz", "3 kHz", + "AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", + NULL + } + } + } }, { RIG_CONF_END, NULL, } }; diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 3df1a439..27ac0fea 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1498,6 +1498,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); err = newcat_get_freq(rig, vfo, &freq); // Need to get freq to determine band + if (err < 0) { return err; @@ -1510,7 +1511,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) // Step size is 100 kHz offs /= 100000; - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%03li%c", command, offs, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%03li%c", command, offs, + cat_term); } else if (is_ft2000) { @@ -1531,7 +1533,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) // Step size is 1 kHz offs /= 1000; - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, + cat_term); } else if (is_ft950) { @@ -1552,7 +1555,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) // Step size is 1 kHz offs /= 1000; - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, + cat_term); } else if (is_ft891) { @@ -1573,7 +1577,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) // Step size is 1 kHz offs /= 1000; - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, + cat_term); } else if (is_ft991) { @@ -1602,7 +1607,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) // Step size is 1 kHz offs /= 1000; - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, + cat_term); } else if (is_ftdx1200) { @@ -1623,7 +1629,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) // Step size is 1 kHz offs /= 1000; - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, + cat_term); } else if (is_ftdx3000) { @@ -1644,7 +1651,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) // Step size is 1 kHz offs /= 1000; - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, + cat_term); } else if (is_ftdx5000) { @@ -1665,7 +1673,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) // Step size is 1 kHz offs /= 1000; - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, + cat_term); } else if (is_ftdx101) { @@ -1686,7 +1695,8 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) // Step size is 1 kHz offs /= 1000; - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, + cat_term); } else { @@ -1709,6 +1719,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); err = newcat_get_freq(rig, vfo, &freq); // Need to get freq to determine band + if (err < 0) { return err; @@ -1895,6 +1906,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) } err = newcat_get_cmd(rig); + if (err != RIG_OK) { return err; @@ -3188,6 +3200,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { priv->cmd_str[2] = main_sub_vfo; } + break; case RIG_LEVEL_IF: @@ -3217,7 +3230,8 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } else if (is_ft891) { - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "IS0%d%+.4d%c", val.i == 0 ? 0 : 1, + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "IS0%d%+.4d%c", + val.i == 0 ? 0 : 1, val.i, cat_term); } else @@ -3235,8 +3249,10 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) priv->question_mark_response_means_rejected = 1; break; - case RIG_LEVEL_CWPITCH: { + case RIG_LEVEL_CWPITCH: + { int kp; + if (!newcat_valid_command(rig, "KP")) { return -RIG_ENAVAIL; @@ -3526,7 +3542,8 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PL%03d%c", fpf, cat_term); break; - case RIG_LEVEL_BKINDL: { + case RIG_LEVEL_BKINDL: + { int millis; value_t keyspd; @@ -3537,6 +3554,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) // Convert 10/ths of dots to milliseconds using the current key speed err = newcat_get_level(rig, vfo, RIG_LEVEL_KEYSPD, &keyspd); + if (err != RIG_OK) { return err; @@ -3556,7 +3574,8 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) else { // This covers 300-2900 06-32 - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%02d;", 6 + ((millis - 300) / 100)); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%02d;", + 6 + ((millis - 300) / 100)); } } else if (is_ftdx5000) @@ -3565,6 +3584,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { millis = 20; } + if (millis > 5000) { millis = 5000; @@ -3572,12 +3592,14 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%04d%c", millis, cat_term); } - else if (is_ft950 || is_ft450 || is_ft891 || is_ft991 || is_ftdx1200 || is_ftdx3000) + else if (is_ft950 || is_ft450 || is_ft891 || is_ft991 || is_ftdx1200 + || is_ftdx3000) { if (millis < 30) { millis = 30; } + if (millis > 3000) { millis = 3000; @@ -3591,6 +3613,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { millis = 0; } + if (millis > 5000) { millis = 5000; @@ -3604,6 +3627,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { millis = 1; } + if (millis > 5000) { millis = 5000; @@ -3787,6 +3811,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) val.i = 320; } } + if (is_ft950 || is_ftdx9000) { if (val.i > 300) @@ -3838,6 +3863,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "ML1%03d%c", fpf, cat_term); } + break; default: @@ -3939,6 +3965,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { priv->cmd_str[2] = main_sub_vfo; } + break; case RIG_LEVEL_CWPITCH: @@ -4206,6 +4233,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "ML1%c", cat_term); } + break; default: @@ -4416,7 +4444,8 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->f = (float)atoi(retlvl) / scale; break; - case RIG_LEVEL_BKINDL: { + case RIG_LEVEL_BKINDL: + { int raw_value = atoi(retlvl); int millis; value_t keyspd; @@ -4426,12 +4455,19 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) switch (raw_value) { case 0: millis = 30; break; + case 1: millis = 50; break; + case 2: millis = 100; break; + case 3: millis = 150; break; + case 4: millis = 200; break; + case 5: millis = 250; break; + case 6: millis = 300; break; + default: millis = (raw_value - 6) * 100 + 300; } @@ -4444,6 +4480,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) // Convert milliseconds to 10/ths of dots using the current key speed err = newcat_get_level(rig, vfo, RIG_LEVEL_KEYSPD, &keyspd); + if (err != RIG_OK) { return err; @@ -4452,6 +4489,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->i = millis_to_dot10ths(millis, keyspd.i); break; } + case RIG_LEVEL_STRENGTH: if (rig->caps->str_cal.size > 0) { @@ -4551,7 +4589,8 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; - case RIG_LEVEL_PREAMP: { + case RIG_LEVEL_PREAMP: + { int preamp; if (retlvl[0] < '0' || retlvl[0] > '9') @@ -4574,10 +4613,12 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } } } + break; } - case RIG_LEVEL_ATT: { + case RIG_LEVEL_ATT: + { int att; if (retlvl[0] < '0' || retlvl[0] > '9') @@ -4600,6 +4641,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } } } + break; } @@ -4609,15 +4651,19 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case '0': val->i = RIG_AGC_OFF; break; + case '1': val->i = RIG_AGC_FAST; break; + case '2': val->i = RIG_AGC_MEDIUM; break; + case '3': val->i = RIG_AGC_SLOW; break; + case '4': case '5': case '6': @@ -4639,6 +4685,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) // Most Yaesu rigs seem to use range of 0-75 to represent pitch of 300..1050 Hz in 10 Hz steps val->i = (atoi(retlvl) * 10) + 300; } + break; case RIG_LEVEL_METER: @@ -4777,7 +4824,8 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) return -RIG_ENAVAIL; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%d%c", status ? 1 : 0 , cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%d%c", status ? 1 : 0, + cat_term); if (rig->caps->targetable_vfo & RIG_TARGETABLE_TONE) { @@ -4859,11 +4907,13 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) if (is_ft891 || is_ft991 || is_ftdx1200 || is_ftdx3000 || is_ftdx101) { // There seems to be an error in the manuals for some of these rigs stating that values should be 1 = OFF and 2 = ON, but they are 0 = OFF and 1 = ON instead - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PR0%d%c", status ? 1 : 0, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PR0%d%c", status ? 1 : 0, + cat_term); } else { - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PR%d%c", status ? 1 : 0, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PR%d%c", status ? 1 : 0, + cat_term); } break; @@ -6013,7 +6063,7 @@ ncboolean newcat_valid_command(RIG *rig, char const *const command) is_ftdx101 = newcat_is_rig(rig, RIG_MODEL_FTDX101D); if (!is_ft450 && !is_ft950 && !is_ft891 && !is_ft991 && !is_ft2000 - && !is_ftdx5000 && !is_ftdx9000 && !is_ftdx1200 && !is_ftdx3000 && !is_ftdx101) + && !is_ftdx5000 && !is_ftdx9000 && !is_ftdx1200 && !is_ftdx3000 && !is_ftdx101) { rig_debug(RIG_DEBUG_ERR, "%s: '%s' is unknown\n", __func__, caps->model_name); return FALSE; @@ -6513,6 +6563,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_CWR: // Narrow mode must be chosen correctly before filter width err = newcat_set_narrow(rig, vfo, width <= 500 ? TRUE : FALSE); + if (err != RIG_OK) { return err; @@ -6530,12 +6581,14 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 1700) { w = 11; } else if (width <= 2000) { w = 12; } else { w = 13; } // 2400 Hz + break; case RIG_MODE_LSB: case RIG_MODE_USB: // Narrow mode must be chosen correctly before filter width err = newcat_set_narrow(rig, vfo, width <= 1800 ? TRUE : FALSE); + if (err != RIG_OK) { return err; @@ -6562,6 +6615,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 2800) { w = 18; } else if (width <= 2900) { w = 19; } else { w = 20; } // 3000 Hz + break; case RIG_MODE_AM: @@ -6593,6 +6647,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = newcat_set_narrow(rig, vfo, FALSE); } + return err; case RIG_MODE_FMN: @@ -6611,6 +6666,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_CWR: // Narrow mode must be chosen correctly before filter width err = newcat_set_narrow(rig, vfo, width <= 500 ? TRUE : FALSE); + if (err != RIG_OK) { return err; @@ -6634,12 +6690,14 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 2000) { w = 15; } else if (width <= 2400) { w = 16; } else { w = 17; } // 3000 Hz + break; case RIG_MODE_LSB: case RIG_MODE_USB: // Narrow mode must be chosen correctly before filter width err = newcat_set_narrow(rig, vfo, width <= 1800 ? TRUE : FALSE); + if (err != RIG_OK) { return err; @@ -6667,6 +6725,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 2900) { w = 19; } else if (width <= 3000) { w = 20; } else { w = 21; } // 3000 Hz + break; case RIG_MODE_AM: @@ -6680,6 +6739,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = newcat_set_narrow(rig, vfo, FALSE); } + return err; case RIG_MODE_FMN: @@ -6701,6 +6761,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_CWR: // Narrow mode must be chosen correctly before filter width err = newcat_set_narrow(rig, vfo, width <= 500 ? TRUE : FALSE); + if (err != RIG_OK) { return err; @@ -6724,12 +6785,14 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 2000) { w = 15; } else if (width <= 2400) { w = 16; } else { w = 17; } // 3000 Hz + break; case RIG_MODE_LSB: case RIG_MODE_USB: // Narrow mode must be chosen correctly before filter width err = newcat_set_narrow(rig, vfo, width <= 1800 ? TRUE : FALSE); + if (err != RIG_OK) { return err; @@ -6757,6 +6820,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 2900) { w = 19; } else if (width <= 3000) { w = 20; } else { w = 21; } // 3200 Hz + break; case RIG_MODE_AM: // Only 1 passband each for AM or AMN @@ -6764,6 +6828,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = newcat_set_narrow(rig, vfo, FALSE); } + return err; case RIG_MODE_AMN: @@ -6771,6 +6836,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = newcat_set_narrow(rig, vfo, TRUE); } + return err; case RIG_MODE_FM: // Only 1 passband each for FM or FMN @@ -6778,6 +6844,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = newcat_set_narrow(rig, vfo, FALSE); } + return err; case RIG_MODE_FMN: @@ -6785,6 +6852,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = newcat_set_narrow(rig, vfo, TRUE); } + return err; case RIG_MODE_C4FM: @@ -6800,6 +6868,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { return -RIG_EINVAL; } + return err; case RIG_MODE_PKTFM: @@ -6811,6 +6880,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = newcat_set_narrow(rig, vfo, FALSE); } + return err; default: @@ -6830,6 +6900,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_CWR: // Narrow mode must be chosen correctly before filter width err = newcat_set_narrow(rig, vfo, width <= 500 ? TRUE : FALSE); + if (err != RIG_OK) { return err; @@ -6852,12 +6923,14 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 1700) { w = 14; } else if (width <= 2000) { w = 15; } else { w = 16; } // 2400 Hz + break; case RIG_MODE_LSB: case RIG_MODE_USB: // Narrow mode must be chosen correctly before filter width err = newcat_set_narrow(rig, vfo, width <= 1800 ? TRUE : FALSE); + if (err != RIG_OK) { return err; @@ -6889,6 +6962,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 3600) { w = 23; } else if (width <= 3800) { w = 24; } else { w = 25; } // 4000 Hz + break; case RIG_MODE_AM: @@ -6923,6 +6997,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = newcat_set_narrow(rig, vfo, FALSE); } + return err; } } // end is_ftdx1200 and is_ftdx3000 @@ -6938,6 +7013,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_CWR: // Narrow mode must be chosen correctly before filter width err = newcat_set_narrow(rig, vfo, width <= 500 ? TRUE : FALSE); + if (err != RIG_OK) { return err; @@ -6960,12 +7036,14 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 1700) { w = 14; } else if (width <= 2000) { w = 15; } else { w = 16; } // 2400 Hz + break; case RIG_MODE_LSB: case RIG_MODE_USB: // Narrow mode must be chosen correctly before filter width err = newcat_set_narrow(rig, vfo, width <= 1800 ? TRUE : FALSE); + if (err != RIG_OK) { return err; @@ -6996,6 +7074,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 3600) { w = 23; } else if (width <= 3800) { w = 24; } else { w = 25; } // 4000 Hz + break; case RIG_MODE_AM: @@ -7030,6 +7109,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = newcat_set_narrow(rig, vfo, FALSE); } + return err; } } // end is_ftdx5000 @@ -7062,6 +7142,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 2000) { w = 16; } else if (width <= 2400) { w = 17; } else { w = 18; } + break; case RIG_MODE_LSB: @@ -7090,6 +7171,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 3200) { w = 21; } else if (width <= 3500) { w = 22; } else { w = 23; } // 4000Hz + break; case RIG_MODE_AM: @@ -7122,6 +7204,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = newcat_set_narrow(rig, vfo, FALSE); } + return err; case RIG_MODE_AMN: @@ -7144,6 +7227,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (width <= 500) { w = 6; } else if (width <= 1800) { w = 16; } else { w = 24; } + break; case RIG_MODE_LSB: @@ -7151,6 +7235,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (width <= 1800) { w = 8; } else if (width <= 2400) { w = 16; } else { w = 25; } // 3000 + break; case RIG_MODE_AM: @@ -7164,6 +7249,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = newcat_set_narrow(rig, vfo, FALSE); } + return err; case RIG_MODE_FMN: @@ -7407,6 +7493,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) cat_term); err = newcat_get_cmd(rig); + if (err != RIG_OK) { return err; @@ -7547,6 +7634,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) default: return -RIG_EINVAL; } + break; case RIG_MODE_AM: @@ -7593,6 +7681,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { *width = narrow ? 300 : 500; } + break; case 1: *width = 50; break; @@ -7732,6 +7821,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { *width = narrow ? 300 : 500; } + break; case 1: *width = 50; break; @@ -8308,6 +8398,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) { *width = rig_passband_normal(rig, mode); } + break; case RIG_MODE_AM: @@ -8823,6 +8914,7 @@ int newcat_set_cmd(RIG *rig) break; /* retry */ case '?': + /* The ? response is ambiguous and undocumented by Yaesu. For set commands it seems to indicate: * 1) either that the rig is busy and the command needs to be retried * 2) or that the rig rejected the command because the state of the rig is not valid for the command diff --git a/rotators/m2/rc2800.c b/rotators/m2/rc2800.c index 80b40512..a839c8df 100644 --- a/rotators/m2/rc2800.c +++ b/rotators/m2/rc2800.c @@ -53,7 +53,7 @@ /* - c2800_parse + rc2800_parse Parse output from the rotator controller @@ -249,17 +249,18 @@ rc2800_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) if (rot->caps->rot_model == ROT_MODEL_RC2800_EARLY_AZ) { - // we only do azimuth and this is the old protocol - // we have to switch modes and then send azimuth - // an extra CR gives us a response to expect - num_sprintf(cmdstr, "A\r%.0f\r\r", az); + // we only do azimuth and this is the old protocol + // we have to switch modes and then send azimuth + // an extra CR gives us a response to expect + num_sprintf(cmdstr, "A\r%.0f\r\r", az); } - else + else { // does the new protocol use decimal points? - // we'll assume no for now - num_sprintf(cmdstr, "A%0f"CR, az); + // we'll assume no for now + num_sprintf(cmdstr, "A%0f"CR, az); } + retval1 = rc2800_transaction(rot, cmdstr, NULL, 0); if (rot->caps->rot_type == ROT_TYPE_AZIMUTH) @@ -272,15 +273,16 @@ rc2800_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) if (rot->caps->rot_model == ROT_MODEL_RC2800_EARLY_AZEL) { - // this is the old protocol - // we have to switch modes and then send azimuth - // an extra CR gives us a response to expect - num_sprintf(cmdstr, "E\r%.0f\r\r", el); + // this is the old protocol + // we have to switch modes and then send azimuth + // an extra CR gives us a response to expect + num_sprintf(cmdstr, "E\r%.0f\r\r", el); } - else + else { num_sprintf(cmdstr, "E%.0f"CR, el); } + retval2 = rc2800_transaction(rot, cmdstr, NULL, 0); if (retval1 == retval2) diff --git a/src/mem.c b/src/mem.c index 769dda6f..128d677f 100644 --- a/src/mem.c +++ b/src/mem.c @@ -829,12 +829,13 @@ int HAMLIB_API rig_set_channel(RIG *rig, vfo_t vfo, const channel_t *chan) * * \sa rig_set_channel() */ -int HAMLIB_API rig_get_channel(RIG *rig, vfo_t vfox, channel_t *chan, int read_only) +int HAMLIB_API rig_get_channel(RIG *rig, vfo_t vfox, channel_t *chan, + int read_only) { struct rig_caps *rc; int curr_chan_num, get_mem_status = RIG_OK; vfo_t curr_vfo; - vfo_t vfotmp=RIG_VFO_NONE; /* requested vfo */ + vfo_t vfotmp = RIG_VFO_NONE; /* requested vfo */ int retcode = RIG_OK; int can_emulate_by_vfo_mem, can_emulate_by_vfo_op; @@ -939,7 +940,8 @@ int HAMLIB_API rig_get_channel(RIG *rig, vfo_t vfox, channel_t *chan, int read_o #ifndef DOC_HIDDEN -int get_chan_all_cb_generic(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t arg) +int get_chan_all_cb_generic(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, + rig_ptr_t arg) { int i, j; chan_t *chan_list = rig->state.chan_list; @@ -1004,7 +1006,8 @@ int get_chan_all_cb_generic(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t ar } -int set_chan_all_cb_generic(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t arg) +int set_chan_all_cb_generic(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, + rig_ptr_t arg) { int i, j, retval; chan_t *chan_list = rig->state.chan_list; @@ -1076,7 +1079,8 @@ static int map_chan(RIG *rig, * * \sa rig_set_chan_all(), rig_get_chan_all_cb() */ -int HAMLIB_API rig_set_chan_all_cb(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t arg) +int HAMLIB_API rig_set_chan_all_cb(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, + rig_ptr_t arg) { struct rig_caps *rc; int retval; @@ -1122,7 +1126,8 @@ int HAMLIB_API rig_set_chan_all_cb(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_p * * \sa rig_get_chan_all(), rig_set_chan_all_cb() */ -int HAMLIB_API rig_get_chan_all_cb(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, rig_ptr_t arg) +int HAMLIB_API rig_get_chan_all_cb(RIG *rig, vfo_t vfo, chan_cb_t chan_cb, + rig_ptr_t arg) { struct rig_caps *rc; int retval; @@ -1283,14 +1288,16 @@ static int map_parm(RIG *rig, const struct confparams *cfgps, value_t *value, } -int get_parm_all_cb_generic(RIG *rig, vfo_t vfo, confval_cb_t parm_cb, rig_ptr_t cfgps, +int get_parm_all_cb_generic(RIG *rig, vfo_t vfo, confval_cb_t parm_cb, + rig_ptr_t cfgps, rig_ptr_t vals) { return -RIG_ENIMPL; } -int set_parm_all_cb_generic(RIG *rig, vfo_t vfo, confval_cb_t parm_cb, rig_ptr_t cfgps, +int set_parm_all_cb_generic(RIG *rig, vfo_t vfo, confval_cb_t parm_cb, + rig_ptr_t cfgps, rig_ptr_t vals) { return -RIG_ENIMPL; @@ -1557,7 +1564,7 @@ int HAMLIB_API rig_get_mem_all(RIG *rig, return retval; } - retval = get_parm_all_cb_generic(rig, vfo, map_parm, + retval = get_parm_all_cb_generic(rig, vfo, map_parm, (rig_ptr_t)cfgps, (rig_ptr_t)vals); diff --git a/src/serial.c b/src/serial.c index e... [truncated message content] |
From: Michael B. <mdb...@us...> - 2020-11-15 13:43: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 ac2892913cdfe706ee4d6496d639bae8467a202f (commit) via 8ba011eaf7dbcd9ae9b7f36d4d36cbd3b9b94627 (commit) via 801e16ac97bb1a8596953897f52953f2cadeac6e (commit) via 2deeca86dc95c02f8cb92cbc5a447a4525535215 (commit) via cf3b528ea7f9c4274524f7793b9d9bc0df7d1234 (commit) via 6ecaed955f268fca4c3c59653cd18153dc0789a7 (commit) via 1d07b1d6b6fda08f5b94ec9480c86a038272a44f (commit) via 056e0b2359ec67a373b649d50027b703483bfb8a (commit) via cabe9ea35466e72e99ec46d7dac2a4b578590e8f (commit) via 81d02e22f160e81032e7e5c2dfac5161cbe517f5 (commit) via ff012234435559fc5ecaf5b00c01e55547c95d4d (commit) via 4102e8c1e5157e71a1ac908ffcd4c24e6589f5bf (commit) via e122955213fc9f1e277add81bf07c71ef9c2d48d (commit) from f3cb1a09aead849dcfc25ad53c0f94e1cf5267cd (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 ac2892913cdfe706ee4d6496d639bae8467a202f Merge: 801e16ac 8ba011ea Author: Michael Black <mdb...@ya...> Date: Sun Nov 15 07:40:23 2020 -0600 Merge pull request #442 from nonoo/master Add INDI rotator backend commit 8ba011eaf7dbcd9ae9b7f36d4d36cbd3b9b94627 Author: Nonoo <no...@no...> Date: Sun Nov 15 12:46:35 2020 +0100 Add INDI rotator backend This backend lets Hamlib control an astronomical (telescope) rotator through an INDI (https://indilib.org/) server. diff --git a/AUTHORS b/AUTHORS index 7f48f478..36aa525a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -265,6 +265,10 @@ C: Chris Bryant, G3WIE M: Øystein Hårberg, LA7LKA +[indi] +M: Norbert Varga, HA2NON + + [Frontend] M: Stephane Fillod, F8CFE @@ -362,3 +366,4 @@ Alexander Sack <pisymbol (at) gmail.com> Nirgal Vourgère <contact_hamlib (at) nirgal.com> Andrew Errington <a.errington (at) lancaster.ac.uk> Kārlis Millers YL3ALK <yl3alk (at) lrg.lv> +Norbert Varga HA2NON <nonoo (at) nonoo.hu> diff --git a/INSTALL b/INSTALL index 81b451bf..23034b25 100644 --- a/INSTALL +++ b/INSTALL @@ -287,6 +287,7 @@ are: --with-tcl-binding build Tcl binding and demo [default=no] --with-tcl=PATH directory containing tcl configuration (tclConfig.sh) --with-lua-binding build lua binding and demo [default=no] + --without-indi disable INDI rotator support [default=no] Optional features that may require specialized hardware are: diff --git a/configure.ac b/configure.ac index 5ac3056c..ab2e38af 100644 --- a/configure.ac +++ b/configure.ac @@ -363,6 +363,46 @@ AS_IF([test x"$ax_cv_lib_readline" = "xno"], [ cf_with_readline_support=no ]) +dnl Check if INDI support in rigctl/rotctl is wanted +AC_MSG_CHECKING([whether to use INDI in rigctl/rotctl]) +AC_ARG_WITH([indi], + [AS_HELP_STRING([--without-indi], + [disable INDI in rigctl/rotctl @<:@default=yes@:>@])], + [cf_with_indi_support=no], + [cf_with_indi_support=yes] + ) + +AS_IF([test x"$cf_with_indi_support" != "xno"], [ + # INDI support needs a C++ compiler, tested for presence above. + AS_IF([test x"${cf_with_cxx}" != "xyes"], [ + AC_MSG_WARN([INDI support needs a C++ compiler.]) + cf_with_indi_support=no + ]) +]) + +AS_IF([test x"$cf_with_indi_support" != "xno"], [ + # macros/ax_lib_nova.m4 + AX_LIB_NOVA + + AS_IF([test x"$ax_cv_lib_nova" = "xno"], [ + AC_MSG_WARN([libnova support not found, required by INDI.]) + cf_with_indi_support=no + ]) + + AS_IF([test x"$ax_cv_lib_nova" != "xno"], [ + # macros/ax_lib_indi.m4 + AX_LIB_INDI + + AS_IF([test x"$ax_cv_lib_indi" = "xno"], [ + AC_MSG_WARN([INDI support not found.]) + cf_with_indi_support=no + ]) + + AS_IF([test x"$cf_with_indi_support" != "xno"], [ + ROT_BACKEND_LIST="$ROT_BACKEND_LIST rotators/indi" + ]) + ]) +]) dnl Check if libgd-dev is installed, so we can enable rigmatrix AC_MSG_CHECKING([whether to build HTML rig feature matrix]) @@ -801,6 +841,7 @@ rotators/rotorez/Makefile rotators/sartek/Makefile rotators/spid/Makefile rotators/ts7400/Makefile +rotators/indi/Makefile rigs/adat/Makefile rigs/alinco/Makefile rigs/aor/Makefile @@ -857,6 +898,7 @@ echo \ With Lua binding ${cf_with_lua_binding} With rigmem XML support ${cf_with_xml_support} With Readline support ${cf_with_readline_support} + With INDI support ${cf_with_indi_support} Enable HTML rig feature matrix ${cf_enable_html_matrix} Enable WinRadio ${cf_with_winradio} diff --git a/include/hamlib/rotlist.h b/include/hamlib/rotlist.h index 4481c22f..53706e2a 100644 --- a/include/hamlib/rotlist.h +++ b/include/hamlib/rotlist.h @@ -455,6 +455,20 @@ #define ROT_MODEL_IOPTRON ROT_MAKE_MODEL(ROT_IOPTRON, 1) +/** ++ * \def ROT_MODEL_INDI ++ * \brief A macro that returns the model number of the INDI backend. ++ * ++ * The INDI backend can be used with rotators that support, among other, the ++ * INDI interface. ++ */ +//! @cond Doxygen_Suppress +#define ROT_INDI 20 +#define ROT_BACKEND_INDI "indi" +//! @endcond +#define ROT_MODEL_INDI ROT_MAKE_MODEL(ROT_INDI, 1) + + /** diff --git a/macros/Makefile.am b/macros/Makefile.am index c058a606..3507bbcf 100644 --- a/macros/Makefile.am +++ b/macros/Makefile.am @@ -6,6 +6,8 @@ MACROS = \ ax_pkg_swig.m4 \ ax_pthread.m4 \ ax_python_devel.m4 \ + ax_lib_indi.m4 \ + ax_lib_nova.m4 \ gr_doxygen.m4 \ gr_pwin32.m4 \ hl_getaddrinfo.m4 \ diff --git a/macros/ax_lib_indi.m4 b/macros/ax_lib_indi.m4 new file mode 100644 index 00000000..d74538e5 --- /dev/null +++ b/macros/ax_lib_indi.m4 @@ -0,0 +1,23 @@ +AU_ALIAS([VL_LIB_INDI], [AX_LIB_INDI]) +AC_DEFUN([AX_LIB_INDI], [ + AC_CACHE_CHECK([for INDI library], + ax_cv_lib_indi, [ + AC_LANG_PUSH(C++) + AC_CHECK_HEADER(libindi/baseclient.h, ax_cv_lib_indi="-lindiclient -lstdc++ -lz") + AC_LANG_POP() + + if test -z "$ax_cv_lib_indi"; then + ax_cv_lib_indi="no" + fi + ]) + + if test "$ax_cv_lib_indi" != "no"; then + ORIG_LIBS="$LIBS" + LIBS="$LIBS $ax_cv_lib_indi" + AC_DEFINE(HAVE_LIBINDI, 1, + [Define if you have an INDI compatible library]) + LIBS="$ORIG_LIBS" + INDI_LIBS="$ax_cv_lib_indi" + AC_SUBST([INDI_LIBS]) + fi +]) diff --git a/macros/ax_lib_nova.m4 b/macros/ax_lib_nova.m4 new file mode 100644 index 00000000..6eb0f0eb --- /dev/null +++ b/macros/ax_lib_nova.m4 @@ -0,0 +1,23 @@ +AU_ALIAS([VL_LIB_NOVA], [AX_LIB_NOVA]) +AC_DEFUN([AX_LIB_NOVA], [ + AC_CACHE_CHECK([for nova library], + ax_cv_lib_nova, [ + AC_LANG_PUSH(C++) + AC_CHECK_HEADER(libnova/libnova.h, ax_cv_lib_nova="-lnova -lstdc++ -lz") + AC_LANG_POP() + + if test -z "$ax_cv_lib_nova"; then + ax_cv_lib_nova="no" + fi + ]) + + if test "$ax_cv_lib_nova" != "no"; then + ORIG_LIBS="$LIBS" + LIBS="$LIBS $ax_cv_lib_nova" + AC_DEFINE(HAVE_LIBNOVA, 1, + [Define if you have a nova compatible library]) + LIBS="$ORIG_LIBS" + NOVA_LIBS="$ax_cv_lib_nova" + AC_SUBST([NOVA_LIBS]) + fi +]) diff --git a/rotators/indi/Android.mk b/rotators/indi/Android.mk new file mode 100644 index 00000000..4152c67a --- /dev/null +++ b/rotators/indi/Android.mk @@ -0,0 +1,12 @@ +LOCAL_PATH:= $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := indi.c indi_wrapper.cpp +LOCAL_MODULE := indi + +LOCAL_CFLAGS := -DHAVE_CONFIG_H +LOCAL_C_INCLUDES := android include src +LOCAL_LDLIBS := -lhamlib -Lobj/local/armeabi + +include $(BUILD_STATIC_LIBRARY) diff --git a/rotators/indi/Makefile.am b/rotators/indi/Makefile.am new file mode 100644 index 00000000..20b7bcd0 --- /dev/null +++ b/rotators/indi/Makefile.am @@ -0,0 +1,6 @@ + +noinst_LTLIBRARIES = libhamlib-indi.la +libhamlib_indi_la_SOURCES = indi.c indi_wrapper.cpp indi_wrapper.hpp indi_wrapper.h +libhamlib_indi_la_LDFLAGS = $(INDI_LIBS) + +EXTRA_DIST = Android.mk diff --git a/rotators/indi/README.indi.md b/rotators/indi/README.indi.md new file mode 100644 index 00000000..1fbb2712 --- /dev/null +++ b/rotators/indi/README.indi.md @@ -0,0 +1,8 @@ +INDI rotator backend +==================== + +This backend lets Hamlib control an astronomical (telescope) rotator through an +[INDI](https://indilib.org/) server. + +The easiest way to set up an INDI server is to use [EKOS](https://www.indilib.org/about/ekos.html), +which is available in [KStars](https://edu.kde.org/kstars/). diff --git a/rotators/indi/indi.c b/rotators/indi/indi.c new file mode 100644 index 00000000..07996fbb --- /dev/null +++ b/rotators/indi/indi.c @@ -0,0 +1,70 @@ +/* + * Hamlib Rotator backend - INDI integration + * Copyright (c) 2020 by Norbert Varga HA2NON <no...@no...> + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "indi_wrapper.h" + +#include <hamlib/rotator.h> +#include <register.h> + +const struct rot_caps indi_rot_caps = +{ + ROT_MODEL(ROT_MODEL_INDI), + .model_name = "INDI", + .mfg_name = "INDI", + .version = "0.1", + .copyright = "LGPL", + .status = RIG_STATUS_ALPHA, + .rot_type = ROT_TYPE_OTHER, + .port_type = RIG_PORT_NONE, + .write_delay = 0, + .post_write_delay = 0, + .timeout = 200, + .retry = 3, + + .min_az = 0, + .max_az = 360, + .min_el = -90, + .max_el = 90, + + .set_position = indi_wrapper_set_position, + .get_position = indi_wrapper_get_position, + .stop = indi_wrapper_stop, + .park = indi_wrapper_park, + .move = indi_wrapper_move, + .get_info = indi_wrapper_get_info, + .rot_open = indi_wrapper_open, + .rot_close = indi_wrapper_close, +}; + +/* ************************************************************************* */ + +DECLARE_INITROT_BACKEND(indi) +{ + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + rot_register(&indi_rot_caps); + + return RIG_OK; +} diff --git a/rotators/indi/indi_wrapper.cpp b/rotators/indi/indi_wrapper.cpp new file mode 100644 index 00000000..df616999 --- /dev/null +++ b/rotators/indi/indi_wrapper.cpp @@ -0,0 +1,621 @@ +/* + * Hamlib Rotator backend - INDI integration + * Copyright (c) 2020 by Norbert Varga HA2NON <no...@no...> + * + * + * 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 "indi_wrapper.hpp" + +#include <math.h> +#include <limits.h> + +#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) + +static std::unique_ptr<RotINDIClient> indi_wrapper_client(new RotINDIClient()); + +int RotINDIClient::setSpeed(int speedPercent) +{ + if (!mTelescope || !mTelescope->isConnected()) + { + rig_debug(RIG_DEBUG_ERR, "indi: telescope not connected\n"); + return -RIG_EIO; + } + + ISwitchVectorProperty *switchVector = + mTelescope->getSwitch("TELESCOPE_SLEW_RATE"); + + if (!switchVector) + { + rig_debug(RIG_DEBUG_ERR, + "indi: unable to find telescope or TELESCOPE_SLEW_RATE switch\n"); + return -RIG_EPROTO; + } + + if (speedPercent < 0) + { + speedPercent = 0; + } + + if (speedPercent > 100) + { + speedPercent = 100; + } + + int speed = DIV_ROUND_UP(speedPercent, 10); + + for (int i = 1; i <= 10; i++) + { + char switchName[4]; + snprintf(switchName, sizeof(switchName), "%ux", i); + + ISwitch *slewrate = IUFindSwitch(switchVector, switchName); + + if (slewrate) + { + if (speed == i) + { + rig_debug(RIG_DEBUG_VERBOSE, "indi: setting speed %s\n", switchName); + slewrate->s = ISS_ON; + } + else + { + slewrate->s = ISS_OFF; + } + } + else + { + rig_debug(RIG_DEBUG_ERR, "indi: unable to find switch member %s\n", switchName); + return -RIG_EPROTO; + } + } + + sendNewSwitch(switchVector); + + return RIG_OK; +} + +int RotINDIClient::move(int direction, int speedPercent) +{ + if (!mTelescope || !mTelescope->isConnected()) + { + rig_debug(RIG_DEBUG_ERR, "indi: telescope not connected\n"); + return -RIG_EIO; + } + + int err = setSpeed(speedPercent); + + if (err != RIG_OK) + { + return err; + } + + ISwitchVectorProperty *switchVector = + mTelescope->getSwitch("TELESCOPE_MOTION_NS"); + + if (!switchVector) + { + rig_debug(RIG_DEBUG_ERR, + "indi: unable to find telescope or TELESCOPE_MOTION_NS switch\n"); + return -RIG_EPROTO; + } + + ISwitch *motion_north = IUFindSwitch(switchVector, "MOTION_NORTH"); + + if (!motion_north) + { + rig_debug(RIG_DEBUG_ERR, "indi: unable to find switch member MOTION_NORTH\n"); + return -RIG_EPROTO; + } + + if (direction & ROT_MOVE_UP) + { + rig_debug(RIG_DEBUG_VERBOSE, "indi: moving up\n"); + motion_north->s = ISS_ON; + } + else + { + motion_north->s = ISS_OFF; + } + + ISwitch *motion_south = IUFindSwitch(switchVector, "MOTION_SOUTH"); + + if (!motion_south) + { + rig_debug(RIG_DEBUG_ERR, "indi: unable to find switch member MOTION_SOUTH\n"); + return -RIG_EPROTO; + } + + if (direction & ROT_MOVE_DOWN) + { + rig_debug(RIG_DEBUG_VERBOSE, "indi: moving down\n"); + motion_south->s = ISS_ON; + } + else + { + motion_south->s = ISS_OFF; + } + + sendNewSwitch(switchVector); + + switchVector = mTelescope->getSwitch("TELESCOPE_MOTION_WE"); + + if (!switchVector) + { + rig_debug(RIG_DEBUG_ERR, + "indi: unable to find telescope or TELESCOPE_MOTION_WE switch\n"); + return -RIG_EPROTO; + } + + ISwitch *motion_west = IUFindSwitch(switchVector, "MOTION_WEST"); + + if (!motion_west) + { + rig_debug(RIG_DEBUG_ERR, "indi: unable to find switch member MOTION_WEST\n"); + return -RIG_EPROTO; + } + + if (direction & ROT_MOVE_LEFT) + { + rig_debug(RIG_DEBUG_VERBOSE, "indi: moving left\n"); + motion_west->s = ISS_ON; + } + else + { + motion_west->s = ISS_OFF; + } + + ISwitch *motion_east = IUFindSwitch(switchVector, "MOTION_EAST"); + + if (!motion_east) + { + rig_debug(RIG_DEBUG_ERR, "indi: unable to find switch member MOTION_RIGHT\n"); + return -RIG_EPROTO; + } + + if (direction & ROT_MOVE_RIGHT) + { + rig_debug(RIG_DEBUG_VERBOSE, "indi: moving right\n"); + motion_east->s = ISS_ON; + } + else + { + motion_east->s = ISS_OFF; + } + + sendNewSwitch(switchVector); + + return RIG_OK; +} + +int RotINDIClient::stop() +{ + if (!mTelescope || !mTelescope->isConnected()) + { + rig_debug(RIG_DEBUG_ERR, "indi: telescope not connected\n"); + return -RIG_EIO; + } + + ISwitchVectorProperty *switchVector = + mTelescope->getSwitch("TELESCOPE_ABORT_MOTION"); + + if (!switchVector) + { + rig_debug(RIG_DEBUG_ERR, + "indi: unable to find telescope or TELESCOPE_ABORT_MOTION switch\n"); + return -RIG_EPROTO; + } + + ISwitch *sw = IUFindSwitch(switchVector, "ABORT"); + + if (!sw) + { + rig_debug(RIG_DEBUG_ERR, "indi: unable to find switch member ABORT_MOTION\n"); + return -RIG_EPROTO; + } + + sw->s = ISS_ON; + sendNewSwitch(switchVector); + + return RIG_OK; +} + +int RotINDIClient::park() +{ + if (!mTelescope) + { + return -RIG_EIO; + } + + if (!mTelescope->isConnected()) + { + rig_debug(RIG_DEBUG_ERR, "indi: telescope not connected\n"); + return -RIG_EIO; + } + + ISwitchVectorProperty *switchVector = mTelescope->getSwitch("TELESCOPE_PARK"); + + if (!switchVector) + { + rig_debug(RIG_DEBUG_ERR, + "indi: unable to find telescope or TELESCOPE_PARK switch\n"); + return -RIG_EPROTO; + } + + ISwitch *unpark = IUFindSwitch(switchVector, "UNPARK"); + + if (!unpark) + { + rig_debug(RIG_DEBUG_ERR, "indi: unable to find switch member UNPARK\n"); + return -RIG_EPROTO; + } + + unpark->s = ISS_OFF; + + ISwitch *park = IUFindSwitch(switchVector, "PARK"); + + if (!park) + { + rig_debug(RIG_DEBUG_ERR, "indi: unable to find switch member PARK\n"); + return -RIG_EPROTO; + } + + park->s = ISS_ON; + + sendNewSwitch(switchVector); + + return RIG_OK; +} + +int RotINDIClient::unPark() +{ + if (!mTelescope || !mTelescope->isConnected()) + { + rig_debug(RIG_DEBUG_ERR, "indi: telescope not connected\n"); + return -RIG_EIO; + } + + ISwitchVectorProperty *switchVector = mTelescope->getSwitch("TELESCOPE_PARK"); + + if (!switchVector) + { + rig_debug(RIG_DEBUG_ERR, + "indi: unable to find telescope or TELESCOPE_PARK switch\n"); + return -RIG_EPROTO; + } + + ISwitch *park = IUFindSwitch(switchVector, "PARK"); + + if (!park) + { + rig_debug(RIG_DEBUG_ERR, "indi: unable to find switch member PARK\n"); + return -RIG_EPROTO; + } + + park->s = ISS_OFF; + + ISwitch *unpark = IUFindSwitch(switchVector, "UNPARK"); + + if (!unpark) + { + rig_debug(RIG_DEBUG_ERR, "indi: unable to find switch member UNPARK\n"); + return -RIG_EPROTO; + } + + unpark->s = ISS_ON; + + sendNewSwitch(switchVector); + + return RIG_OK; +} + +void RotINDIClient::position(azimuth_t *az, elevation_t *el) +{ + *az = mAz; + *el = mEl; +} + +double RotINDIClient::getPositionDiffBetween(double deg1, double deg2) +{ + return fabs(deg1 - deg2); +} + +double RotINDIClient::getPositionDiffOutside(double deg1, double deg2, + double minDeg, double maxDeg) +{ + if (deg1 < deg2) + { + return getPositionDiffBetween(minDeg, deg1) + getPositionDiffBetween(deg2, + maxDeg); + } + + return getPositionDiffBetween(minDeg, deg2) + getPositionDiffBetween(deg1, + maxDeg); +} + +double RotINDIClient::getPositionDiff(double deg1, double deg2, double minDeg, + double maxDeg) +{ + double between = getPositionDiffBetween(deg1, deg2); + double outside = getPositionDiffOutside(deg1, deg2, minDeg, maxDeg); + + if (between < outside) + { + return between; + } + + return outside; +} + +int RotINDIClient::setPosition(azimuth_t az, elevation_t el) +{ + if (!mTelescope || !mTelescope->isConnected()) + { + rig_debug(RIG_DEBUG_ERR, "indi: telescope not connected\n"); + return -RIG_EIO; + } + + if (fabs(mDstAz - az) < 0.001 && fabs(mDstEl - el) < 0.001) + { + rig_debug(RIG_DEBUG_VERBOSE, + "indi: ignoring new position, already approaching\n"); + return RIG_OK; + } + + // Each coordinate set command stops and restarts the rotator, so we have to avoid unnecessary + // set calls by defining a range of distance from the new az/el coords which we ignore until + // we are closer to the new az/el coords than this value. + const int quickJumpRangeDegrees = 10; + + double currDstNewDstAzDiff = getPositionDiff(mDstAz, az, 0, 360); + double currDstNewDstElDiff = getPositionDiff(mDstEl, el, -90, 90); + double currDstNewDstDistance = sqrt(pow(currDstNewDstAzDiff, + 2) + pow(currDstNewDstElDiff, 2)); + double currPosNewDstAzDiff = getPositionDiff(mAz, az, 0, 360); + double currPosNewDstElDiff = getPositionDiff(mEl, el, -90, 90); + double currPosNewDstDistance = sqrt(pow(currPosNewDstAzDiff, + 2) + pow(currPosNewDstElDiff, 2)); + + if (currDstNewDstDistance < quickJumpRangeDegrees + && currPosNewDstDistance > quickJumpRangeDegrees) + { + rig_debug(RIG_DEBUG_VERBOSE, + "indi: ignoring new position, approaching quickly, newDst/currDst distance: %f newDst/currPos distance: %f\n", + currDstNewDstDistance, currPosNewDstDistance); + return RIG_OK; + } + + rig_debug(RIG_DEBUG_VERBOSE, "indi: setting position to az: %f el: %f\n", az, + el); + + mDstAz = az; + mDstEl = el; + + ISwitchVectorProperty *switchVector = mTelescope->getSwitch("ON_COORD_SET"); + + if (!switchVector) + { + rig_debug(RIG_DEBUG_ERR, + "indi: unable to find telescope or ON_COORD_SET switch\n"); + return -RIG_EPROTO; + } + + ISwitch *slew = IUFindSwitch(switchVector, "SLEW"); + + if (!slew) + { + rig_debug(RIG_DEBUG_ERR, "indi: unable to find switch member SLEW\n"); + return -RIG_EPROTO; + } + + slew->s = ISS_OFF; + + ISwitch *track = IUFindSwitch(switchVector, "TRACK"); + + if (!track) + { + rig_debug(RIG_DEBUG_ERR, "indi: unable to find switch member TRACK\n"); + return -RIG_EPROTO; + } + + track->s = ISS_ON; + + ISwitch *sync = IUFindSwitch(switchVector, "SYNC"); + + if (!sync) + { + rig_debug(RIG_DEBUG_ERR, "indi: unable to find switch member SYNC\n"); + return -RIG_EPROTO; + } + + sync->s = ISS_OFF; + + sendNewSwitch(switchVector); + + INumberVectorProperty *property = mTelescope->getNumber("HORIZONTAL_COORD"); + + if (!property) + { + rig_debug(RIG_DEBUG_ERR, + "indi: unable to find telescope or HORIZONTAL_COORD property\n"); + return -RIG_EPROTO; + } + + property->np[0].value = az; + property->np[1].value = el; + sendNewNumber(property); + + return RIG_OK; +} + +void RotINDIClient::removeDevice(INDI::BaseDevice *dp) {} +void RotINDIClient::newProperty(INDI::Property *property) +{ + std::string name(property->getName()); + + if (!mTelescope && name == "TELESCOPE_INFO") + { + mTelescope = property->getBaseDevice(); + rig_debug(RIG_DEBUG_VERBOSE, "indi: using device %s\n", + mTelescope->getDeviceName()); + watchDevice(mTelescope->getDeviceName()); + + if (!mTelescope->isConnected()) + { + connectDevice(mTelescope->getDeviceName()); + } + + mDstAz = INT_MAX; + mDstEl = INT_MAX; + } + + if (name == "HORIZONTAL_COORD") + { + mAz = property->getNumber()->np[0].value; + mEl = property->getNumber()->np[1].value; + } +} +void RotINDIClient::removeProperty(INDI::Property *property) {} +void RotINDIClient::newBLOB(IBLOB *bp) {} +void RotINDIClient::newSwitch(ISwitchVectorProperty *svp) {} +void RotINDIClient::newNumber(INumberVectorProperty *nvp) +{ + std::string name(nvp->name); + + if (name == "HORIZONTAL_COORD") + { + mAz = nvp->np[0].value; + mEl = nvp->np[1].value; + } +} +void RotINDIClient::newMessage(INDI::BaseDevice *dp, int messageID) {} +void RotINDIClient::newText(ITextVectorProperty *tvp) {} +void RotINDIClient::newLight(ILightVectorProperty *lvp) {} +void RotINDIClient::newDevice(INDI::BaseDevice *dp) {} + +void RotINDIClient::serverConnected() +{ + rig_debug(RIG_DEBUG_VERBOSE, "indi: server connected\n"); +} + +void RotINDIClient::serverDisconnected(int exit_code) +{ + rig_debug(RIG_DEBUG_VERBOSE, "indi: server disconnected\n"); +} + +const char *RotINDIClient::getInfo(void) +{ + static char info[128]; + + if (mTelescope && mTelescope->isConnected()) + { + snprintf(info, sizeof(info), "using INDI device %s", + mTelescope->getDeviceName()); + return info; + } + + return "no INDI device connected"; +} + +void RotINDIClient::close(void) +{ + if (mTelescope && mTelescope->isConnected()) + { + disconnectDevice(mTelescope->getDeviceName()); + } + + disconnectServer(); +} + +extern "C" int indi_wrapper_set_position(ROT *rot, azimuth_t az, + elevation_t el) +{ + int res; + + rig_debug(RIG_DEBUG_TRACE, "%s called: az=%f el=%f\n", __func__, az, el); + + res = indi_wrapper_client->unPark(); + + if (res != RIG_OK) + { + return res; + } + + return indi_wrapper_client->setPosition(az, el); +} + +extern "C" int indi_wrapper_get_position(ROT *rot, azimuth_t *az, + elevation_t *el) +{ + rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); + + indi_wrapper_client->position(az, el); + + return RIG_OK; +} + +extern "C" int indi_wrapper_stop(ROT *rot) +{ + rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); + + return indi_wrapper_client->stop(); +} + +extern "C" int indi_wrapper_park(ROT *rot) +{ + rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); + + return indi_wrapper_client->park(); +} + +extern "C" int indi_wrapper_move(ROT *rot, int direction, int speed) +{ + rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); + + return indi_wrapper_client->move(direction, speed); +} + +extern "C" const char *indi_wrapper_get_info(ROT *rot) +{ + rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); + + return indi_wrapper_client->getInfo(); +} + +extern "C" int indi_wrapper_open(ROT *rot) +{ + rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); + + indi_wrapper_client->setServer("localhost", 7624); + + if (!indi_wrapper_client->connectServer()) + { + rig_debug(RIG_DEBUG_ERR, "indi: server refused connection\n"); + return -RIG_EPROTO; + } + + return RIG_OK; +} + +extern "C" int indi_wrapper_close(ROT *rot) +{ + rig_debug(RIG_DEBUG_TRACE, "%s called\n", __func__); + + indi_wrapper_client->close(); + + return RIG_OK; +} diff --git a/rotators/indi/indi_wrapper.h b/rotators/indi/indi_wrapper.h new file mode 100644 index 00000000..cfd83682 --- /dev/null +++ b/rotators/indi/indi_wrapper.h @@ -0,0 +1,36 @@ +/* + * Hamlib Rotator backend - INDI integration + * Copyright (c) 2020 by Norbert Varga HA2NON <no...@no...> + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef _INDI_WRAPPER_H +#define _INDI_WRAPPER_H 1 + +#include <hamlib/rotator.h> + +int indi_wrapper_set_position(ROT *rot, azimuth_t az, elevation_t el); +int indi_wrapper_get_position(ROT *rot, azimuth_t *az, elevation_t *el); +int indi_wrapper_stop(ROT *rot); +int indi_wrapper_park(ROT *rot); +int indi_wrapper_move(ROT *rot, int direction, int speed); +const char *indi_wrapper_get_info(ROT *rot); +int indi_wrapper_open(ROT *rot); +int indi_wrapper_close(ROT *rot); + +#endif // _INDI_WRAPPER_H diff --git a/rotators/indi/indi_wrapper.hpp b/rotators/indi/indi_wrapper.hpp new file mode 100644 index 00000000..3f5efef0 --- /dev/null +++ b/rotators/indi/indi_wrapper.hpp @@ -0,0 +1,71 @@ +/* + * Hamlib Rotator backend - INDI integration + * Copyright (c) 2020 by Norbert Varga HA2NON <no...@no...> + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef _INDI_WRAPPER_HPP +#define _INDI_WRAPPER_HPP 1 + +#include <libindi/basedevice.h> +#include <libindi/baseclient.h> + +#include <hamlib/rotator.h> + +class RotINDIClient : public INDI::BaseClient +{ +public: + int setSpeed(int speedPercent); + int move(int direction, int speedPercent); + int stop(); + int park(); + int unPark(); + void position(azimuth_t *az, elevation_t *el); + int setPosition(azimuth_t az, elevation_t el); + const char *getInfo(); + void close(void); + +protected: + virtual void newDevice(INDI::BaseDevice *dp); + virtual void removeDevice(INDI::BaseDevice *dp); + virtual void newProperty(INDI::Property *property); + virtual void removeProperty(INDI::Property *property); + virtual void newBLOB(IBLOB *bp); + virtual void newSwitch(ISwitchVectorProperty *svp); + virtual void newNumber(INumberVectorProperty *nvp); + virtual void newMessage(INDI::BaseDevice *dp, int messageID); + virtual void newText(ITextVectorProperty *tvp); + virtual void newLight(ILightVectorProperty *lvp); + virtual void serverConnected(); + virtual void serverDisconnected(int exit_code); + +private: + double getPositionDiffBetween(double deg1, double deg2); + double getPositionDiffOutside(double deg1, double deg2, double minDeg, double maxDeg); + double getPositionDiff(double deg1, double deg2, double minDeg, double maxDeg); + + INDI::BaseDevice *mTelescope; + + azimuth_t mDstAz; + elevation_t mDstEl; + + azimuth_t mAz; + elevation_t mEl; +}; + +#endif // _INDI_WRAPPER_HPP diff --git a/src/Makefile.am b/src/Makefile.am index b53926a4..f3a9a22c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -12,7 +12,7 @@ libhamlib_la_SOURCES = $(RIGSRC) libhamlib_la_LDFLAGS = $(WINLDFLAGS) $(OSXLDFLAGS) -no-undefined -version-info $(ABI_VERSION):$(ABI_REVISION):$(ABI_AGE) libhamlib_la_LIBADD = $(top_builddir)/lib/libmisc.la \ - $(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS) $(NET_LIBS) $(MATH_LIBS) $(LIBUSB_LIBS) + $(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS) $(NET_LIBS) $(MATH_LIBS) $(LIBUSB_LIBS) $(INDI_LIBS) libhamlib_la_DEPENDENCIES = $(top_builddir)/lib/libmisc.la $(BACKENDEPS) $(RIG_BACKENDEPS) $(ROT_BACKENDEPS) $(AMP_BACKENDEPS) diff --git a/src/rot_reg.c b/src/rot_reg.c index ab77990a..3353e7bc 100644 --- a/src/rot_reg.c +++ b/src/rot_reg.c @@ -84,6 +84,9 @@ DEFINE_INITROT_BACKEND(cnctrk); DEFINE_INITROT_BACKEND(prosistel); DEFINE_INITROT_BACKEND(meade); DEFINE_INITROT_BACKEND(ioptron); +#if HAVE_LIBINDI +DEFINE_INITROT_BACKEND(indi); +#endif //! @endcond /** @@ -123,6 +126,9 @@ static struct { ROT_PROSISTEL, ROT_BACKEND_PROSISTEL, ROT_FUNCNAMA(prosistel) }, { ROT_MEADE, ROT_BACKEND_MEADE, ROT_FUNCNAMA(meade) }, { ROT_IOPTRON, ROT_BACKEND_IOPTRON, ROT_FUNCNAMA(ioptron) }, +#if HAVE_LIBINDI + { ROT_INDI, ROT_BACKEND_INDI, ROT_FUNCNAMA(indi) }, +#endif { 0, NULL }, /* end */ }; commit 801e16ac97bb1a8596953897f52953f2cadeac6e Merge: cf3b528e 2deeca86 Author: Michael Black <mdb...@ya...> Date: Sat Nov 14 08:45:08 2020 -0600 Merge pull request #441 from nonoo/master Fix decimal separators which sscanf can't handle commit 2deeca86dc95c02f8cb92cbc5a447a4525535215 Author: Nonoo <no...@no...> Date: Sat Nov 14 08:56:37 2020 +0100 Fix decimal separators which sscanf can't handle This is a workaround for some apps like Gpredict, which use comma as a decimal separator (depending on locale settings), but sscanf in Hamlib can only handle dots. diff --git a/tests/rotctl_parse.c b/tests/rotctl_parse.c index 95f5064a..63873ad1 100644 --- a/tests/rotctl_parse.c +++ b/tests/rotctl_parse.c @@ -1692,6 +1692,22 @@ declare_proto_rot(set_position) { azimuth_t az; elevation_t el; + char *comma_pos; + + /* Fixing args with an invalid decimal separator. */ + comma_pos = strchr(arg1, ','); + + if (comma_pos) + { + *comma_pos = '.'; + } + + comma_pos = strchr(arg2, ','); + + if (comma_pos) + { + *comma_pos = '.'; + } CHKSCN1ARG(sscanf(arg1, "%f", &az)); CHKSCN1ARG(sscanf(arg2, "%f", &el)); commit cf3b528ea7f9c4274524f7793b9d9bc0df7d1234 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Nov 11 16:40:06 2020 -0600 Change newcat.c RIG_FUNC_TUNER to send AC001 instead of AC002 to turn off TUNE G TUNE 1 is used to start tuning diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 2822278b..372dbc2e 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -4884,9 +4884,6 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) return -RIG_ENAVAIL; } - // some rigs use AC02 to actually start tuning - if (status == 1 && (is_ftdx101 || is_ftdx5000)) { status = 2; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "AC00%d%c", status == 0 ? 0 : status, cat_term); commit 6ecaed955f268fca4c3c59653cd18153dc0789a7 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Nov 11 08:21:38 2020 -0600 Add RIG_METER_TEMP for FTDX101D and other newcat.c rigs Update documentation on TONE and TSQL to make it clear diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 9d6aada6..ba916435 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -812,7 +812,8 @@ enum meter_level_e { RIG_METER_IC = (1 << 3), /*< IC */ RIG_METER_DB = (1 << 4), /*< DB */ RIG_METER_PO = (1 << 5), /*< Power Out */ - RIG_METER_VDD = (1 << 6) /*< Final Amp Voltage */ + RIG_METER_VDD = (1 << 6), /*< Final Amp Voltage */ + RIG_METER_TEMP = (1 << 7) /*< Final Amp Voltage */ }; @@ -1006,8 +1007,8 @@ typedef uint64_t setting_t; #define RIG_FUNC_NB CONSTANT_64BIT_FLAG (1) /*!< \c NB -- Noise Blanker */ #define RIG_FUNC_COMP CONSTANT_64BIT_FLAG (2) /*!< \c COMP -- Speech Compression */ #define RIG_FUNC_VOX CONSTANT_64BIT_FLAG (3) /*!< \c VOX -- Voice Operated Relay */ -#define RIG_FUNC_TONE CONSTANT_64BIT_FLAG (4) /*!< \c TONE -- CTCSS Tone */ -#define RIG_FUNC_TSQL CONSTANT_64BIT_FLAG (5) /*!< \c TSQL -- CTCSS Activate/De-activate and Encode-only value=2 if available */ +#define RIG_FUNC_TONE CONSTANT_64BIT_FLAG (4) /*!< \c TONE -- CTCSS Tone TX */ +#define RIG_FUNC_TSQL CONSTANT_64BIT_FLAG (5) /*!< \c TSQL -- CTCSS Activate/De-activate RX */ #define RIG_FUNC_SBKIN CONSTANT_64BIT_FLAG (6) /*!< \c SBKIN -- Semi Break-in (CW mode) */ #define RIG_FUNC_FBKIN CONSTANT_64BIT_FLAG (7) /*!< \c FBKIN -- Full Break-in (CW mode) */ #define RIG_FUNC_ANF CONSTANT_64BIT_FLAG (8) /*!< \c ANF -- Automatic Notch Filter (DSP) */ commit 1d07b1d6b6fda08f5b94ec9480c86a038272a44f Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Nov 11 07:26:51 2020 -0600 Undo last commit...FUNC_TONE and FUNC_TSQL handle this correctly diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index fb81777f..2822278b 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -4777,8 +4777,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) return -RIG_ENAVAIL; } - // FTDX101D has 3 states 0,1,2 - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%d%c", status , cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%d%c", status ? 1 : 0 , cat_term); if (rig->caps->targetable_vfo & RIG_TARGETABLE_TONE) { commit 056e0b2359ec67a373b649d50027b703483bfb8a Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Nov 11 07:06:51 2020 -0600 Chance TSQL in newcat.c to allow more than 2 states FTDX101D has state=2 for encode-only diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 040b953d..9d6aada6 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -1007,7 +1007,7 @@ typedef uint64_t setting_t; #define RIG_FUNC_COMP CONSTANT_64BIT_FLAG (2) /*!< \c COMP -- Speech Compression */ #define RIG_FUNC_VOX CONSTANT_64BIT_FLAG (3) /*!< \c VOX -- Voice Operated Relay */ #define RIG_FUNC_TONE CONSTANT_64BIT_FLAG (4) /*!< \c TONE -- CTCSS Tone */ -#define RIG_FUNC_TSQL CONSTANT_64BIT_FLAG (5) /*!< \c TSQL -- CTCSS Activate/De-activate */ +#define RIG_FUNC_TSQL CONSTANT_64BIT_FLAG (5) /*!< \c TSQL -- CTCSS Activate/De-activate and Encode-only value=2 if available */ #define RIG_FUNC_SBKIN CONSTANT_64BIT_FLAG (6) /*!< \c SBKIN -- Semi Break-in (CW mode) */ #define RIG_FUNC_FBKIN CONSTANT_64BIT_FLAG (7) /*!< \c FBKIN -- Full Break-in (CW mode) */ #define RIG_FUNC_ANF CONSTANT_64BIT_FLAG (8) /*!< \c ANF -- Automatic Notch Filter (DSP) */ diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 354e6e88..fb81777f 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -4777,8 +4777,8 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) return -RIG_ENAVAIL; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%d%c", status ? 1 : 0, - cat_term); + // FTDX101D has 3 states 0,1,2 + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%d%c", status , cat_term); if (rig->caps->targetable_vfo & RIG_TARGETABLE_TONE) { diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index a1e416f0..0ddbf4de 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201103" +#define NEWCAT_VER "20201111" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit cabe9ea35466e72e99ec46d7dac2a4b578590e8f Merge: ff012234 81d02e22 Author: Michael Black <mdb...@ya...> Date: Tue Nov 10 14:20:42 2020 -0600 Merge pull request #437 from mikaelnousiainen/yaesu-filter-fixes Remove RIG_PASSBAND_ROOF commit 81d02e22f160e81032e7e5c2dfac5161cbe517f5 Author: Mikael Nousiainen <mik...@ik...> Date: Tue Nov 10 22:17:15 2020 +0200 Remove RIG_PASSBAND_ROOF as it was not necessary to use it diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index f0dbd038..040b953d 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -495,16 +495,13 @@ typedef unsigned int vfo_t; * \brief Macro for bandpass to be set to normal * \def RIG_PASSBAND_NORMAL */ -#define RIG_PASSBAND_NORMAL s_Hz(0) // was 0 but collided with Yaesu SH00; capability +#define RIG_PASSBAND_NORMAL s_Hz(0) /** * \brief Macro for bandpass to be left alone */ #define RIG_PASSBAND_NOCHANGE s_Hz(-1) -/** - * \brief Macro for selecting roofing filter on set_mode/width -- FTDX101D - */ -#define RIG_PASSBAND_ROOF s_Hz(-3) + /** * * \sa rig_passband_normal(), rig_passband_narrow(), rig_passband_wide() diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index cabb74e9..354e6e88 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -6503,6 +6503,8 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) main_sub_vfo = (RIG_VFO_SUB == vfo) ? '1' : '0'; } + // NOTE: RIG_PASSBAND_NORMAL (0) should select the default filter width (SH00) + if (is_ft950) { switch (mode) @@ -7045,7 +7047,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_RTTYR: case RIG_MODE_CW: case RIG_MODE_CWR: - if (width == RIG_PASSBAND_ROOF) { w = 0; } + if (width == RIG_PASSBAND_NORMAL) { w = 0; } else if (width <= 50) { w = 1; } else if (width <= 100) { w = 2; } else if (width <= 150) { w = 3; } @@ -7068,7 +7070,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_LSB: case RIG_MODE_USB: - if (width == RIG_PASSBAND_ROOF) { w = 0; } + if (width == RIG_PASSBAND_NORMAL) { w = 0; } else if (width <= 300) { w = 1; } else if (width <= 400) { w = 2; } else if (width <= 600) { w = 3; } commit ff012234435559fc5ecaf5b00c01e55547c95d4d Merge: f3cb1a09 4102e8c1 Author: Michael Black <mdb...@ya...> Date: Tue Nov 10 07:34:00 2020 -0600 Merge pull request #436 from mikaelnousiainen/yaesu-repeater-offset Implement Yaesu newcat repeater offset commands commit 4102e8c1e5157e71a1ac908ffcd4c24e6589f5bf Author: Mikael Nousiainen <mik...@ik...> Date: Tue Nov 10 10:20:51 2020 +0200 Yaesu newcat repeater offset step size confirmed on an FTDX 5000 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 4d8069c9..cabb74e9 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1641,7 +1641,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) return -RIG_EINVAL; } - // TODO: Confirm: Step size is 1 kHz or 10 kHz -- CAT documentation is difficult to interpret + // Step size is 1 kHz offs /= 1000; snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); @@ -1662,7 +1662,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) return -RIG_EINVAL; } - // TODO: Confirm: Step size is 1 kHz or 10 kHz -- CAT documentation is difficult to interpret + // Step size is 1 kHz offs /= 1000; snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); @@ -1846,7 +1846,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) return RIG_OK; } - // TODO: Confirm: Step size is 1 kHz or 10 kHz -- CAT documentation is difficult to interpret + // Step size is 1 kHz step = 1000; } else if (is_ftdx5000) @@ -1866,7 +1866,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) return RIG_OK; } - // TODO: Confirm: Step size is 1 kHz or 10 kHz -- CAT documentation is difficult to interpret + // Step size is 1 kHz step = 1000; } else if (is_ftdx101) commit e122955213fc9f1e277add81bf07c71ef9c2d48d Author: Mikael Nousiainen <mik...@ik...> Date: Mon Nov 9 22:18:57 2020 +0200 Add repeater offset support for many Yaesu newcat rigs and fix FT-991 repeater offset step diff --git a/rigs/yaesu/ft1200.c b/rigs/yaesu/ft1200.c index 14dacd3f..f6af9d52 100644 --- a/rigs/yaesu/ft1200.c +++ b/rigs/yaesu/ft1200.c @@ -235,6 +235,8 @@ const struct rig_caps ftdx1200_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/ft2000.c b/rigs/yaesu/ft2000.c index af7a73d6..c33bcdfd 100644 --- a/rigs/yaesu/ft2000.c +++ b/rigs/yaesu/ft2000.c @@ -236,6 +236,8 @@ const struct rig_caps ft2000_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/ft3000.c b/rigs/yaesu/ft3000.c index 32f24550..dc416780 100644 --- a/rigs/yaesu/ft3000.c +++ b/rigs/yaesu/ft3000.c @@ -238,6 +238,8 @@ const struct rig_caps ftdx3000_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/ft450.c b/rigs/yaesu/ft450.c index 98857ed4..d0be5671 100644 --- a/rigs/yaesu/ft450.c +++ b/rigs/yaesu/ft450.c @@ -32,19 +32,13 @@ #include "hamlib/rig.h" #include "bandplan.h" -#include "serial.h" -#include "misc.h" -#include "yaesu.h" #include "newcat.h" #include "ft450.h" #include "idx_builtin.h" /* - * ft450 rigs capabilities. - * Also this struct is READONLY! - * + * FT-450 rig capabilities */ - const struct rig_caps ft450_caps = { RIG_MODEL(RIG_MODEL_FT450), @@ -192,6 +186,8 @@ const struct rig_caps ft450_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c index cfb13e23..7928da03 100644 --- a/rigs/yaesu/ft5000.c +++ b/rigs/yaesu/ft5000.c @@ -233,6 +233,8 @@ const struct rig_caps ftdx5000_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index 3a73d4fb..f33e2652 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -215,6 +215,8 @@ const struct rig_caps ft891_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/ft950.c b/rigs/yaesu/ft950.c index 27bba7c0..bf30d435 100644 --- a/rigs/yaesu/ft950.c +++ b/rigs/yaesu/ft950.c @@ -262,6 +262,8 @@ const struct rig_caps ft950_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/ft991.c b/rigs/yaesu/ft991.c index e643c025..60568197 100644 --- a/rigs/yaesu/ft991.c +++ b/rigs/yaesu/ft991.c @@ -207,8 +207,8 @@ const struct rig_caps ft991_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, - .set_rptr_offs = newcat_set_rptr_offs, /*ve9gj */ - .get_rptr_offs = newcat_get_rptr_offs, /*ve9gj */ + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = ft991_set_ctcss_tone, .get_ctcss_tone = ft991_get_ctcss_tone, .set_dcs_code = ft991_set_dcs_code, diff --git a/rigs/yaesu/ftdx101.c b/rigs/yaesu/ftdx101.c index 75b3668a..c7f517fb 100644 --- a/rigs/yaesu/ftdx101.c +++ b/rigs/yaesu/ftdx101.c @@ -229,6 +229,8 @@ const struct rig_caps ftdx101d_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 24e76019..4d8069c9 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1492,21 +1492,91 @@ 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; int err; - char command[16] ; - freq_t freq; + char command[32]; + freq_t freq = 0; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - if (newcat_is_rig(rig, RIG_MODEL_FT991)) + err = newcat_get_freq(rig, vfo, &freq); // Need to get freq to determine band + if (err < 0) + { + return err; + } + + if (is_ft450) { - freq = 0; - err = newcat_get_freq(rig, vfo, &freq); // Need to get freq to determine band + strcpy(command, "EX050"); + + // Step size is 100 kHz + offs /= 100000; - if (err < 0) + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%03li%c", command, offs, cat_term); + } + else if (is_ft2000) + { + if (freq >= 28000000 && freq <= 29700000) { - return err; + strcpy(command, "EX076"); + } + else if (freq >= 50000000 && freq <= 54000000) + { + strcpy(command, "EX077"); + } + else + { + // only valid on 10m and 6m bands + return -RIG_EINVAL; } + // Step size is 1 kHz + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + } + else if (is_ft950) + { + if (freq >= 28000000 && freq <= 29700000) + { + strcpy(command, "EX057"); + } + else if (freq >= 50000000 && freq <= 54000000) + { + strcpy(command, "EX058"); + } + else + { + // only valid on 10m and 6m bands + return -RIG_EINVAL; + } + + // Step size is 1 kHz + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + } + else if (is_ft891) + { + if (freq >= 28000000 && freq <= 29700000) + { + strcpy(command, "EX0904"); + } + else if (freq >= 50000000 && freq <= 54000000) + { + strcpy(command, "EX0905"); + } + else + { + // only valid on 10m and 6m bands + return -RIG_EINVAL; + } + + // Step size is 1 kHz + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + } + else if (is_ft991) + { if (freq >= 28000000 && freq <= 29700000) { strcpy(command, "EX080"); @@ -1526,15 +1596,104 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) else { // only valid on 10m to 70cm bands - return RIG_OK; + return -RIG_EINVAL; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, - cat_term); - return newcat_set_cmd(rig); + // Step size is 1 kHz + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); } + else if (is_ftdx1200) + { + if (freq >= 28000000 && freq <= 29700000) + { + strcpy(command, "EX087"); + } + else if (freq >= 50000000 && freq <= 54000000) + { + strcpy(command, "EX088"); + } + else + { + // only valid on 10m and 6m bands + return -RIG_EINVAL; + } - return -RIG_ENAVAIL; + // Step size is 1 kHz + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + } + else if (is_ftdx3000) + { + if (freq >= 28000000 && freq <= 29700000) + { + strcpy(command, "EX086"); + } + else if (freq >= 50000000 && freq <= 54000000) + { + strcpy(command, "EX087"); + } + else + { + // only valid on 10m and 6m bands + return -RIG_EINVAL; + } + + // TODO: Confirm: Step size is 1 kHz or 10 kHz -- CAT documentation is difficult to interpret + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + } + else if (is_ftdx5000) + { + if (freq >= 28000000 && freq <= 29700000) + { + strcpy(command, "EX081"); + } + else if (freq >= 50000000 && freq <= 54000000) + { + strcpy(command, "EX082"); + } + else + { + // only valid on 10m and 6m bands + return -RIG_EINVAL; + } + + // TODO: Confirm: Step size is 1 kHz or 10 kHz -- CAT documentation is difficult to interpret + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + } + else if (is_ftdx101) + { + if (freq >= 28000000 && freq <= 29700000) + { + strcpy(command, "EX010315"); + } + else if (freq >= 50000000 && freq <= 54000000) + { + strcpy(command, "EX010316"); + } + else + { + // only valid on 10m and 6m bands + return -RIG_EINVAL; + } + + // Step size is 1 kHz + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + } + else + { + return -RIG_ENAVAIL; + } + + return newcat_set_cmd(rig); } @@ -1544,20 +1703,86 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) int err; int ret_data_len; char *retoffs; - freq_t freq; + freq_t freq = 0; + int step; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - if (newcat_is_rig(rig, RIG_MODEL_FT991)) + err = newcat_get_freq(rig, vfo, &freq); // Need to get freq to determine band + if (err < 0) + { + return err; + } + + if (is_ft450) { - freq = 0; - err = newcat_get_freq(rig, vfo, &freq); // Need to get freq to determine band + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX050%c", cat_term); - if (err < 0) + // Step size is 100 kHz + step = 100000; + } + else if (is_ft2000) + { + if (freq >= 28000000 && freq <= 29700000) { - return err; + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX076%c", cat_term); + } + else if (freq >= 50000000 && freq <= 54000000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX077%c", cat_term); + } + else + { + // only valid on 10m and 6m bands + *offs = 0; + return RIG_OK; } + // Step size is 1 kHz + step = 1000; + } + else if (is_ft950) + { + if (freq >= 28000000 && freq <= 29700000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX057%c", cat_term); + } + else if (freq >= 50000000 && freq <= 54000000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX058%c", cat_term); + } + else + { + // only valid on 10m and 6m bands + *offs = 0; + return RIG_OK; + } + + // Step size is 1 kHz + step = 1000; + } + else if (is_ft891) + { + if (freq >= 28000000 && freq <= 29700000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX0904%c", cat_term); + } + else if (freq >= 50000000 && freq <= 54000000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX0905%c", cat_term); + } + else + { + // only valid on 10m and 6m bands + *offs = 0; + return RIG_OK; + } + + // Step size is 1 kHz + step = 1000; + } + else if (is_ft991) + { if (freq >= 28000000 && freq <= 29700000) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX080%c", cat_term); @@ -1576,28 +1801,114 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) } else { - *offs = 0; // only valid on 10m to 70cm bands + // only valid on 10m to 70cm bands + *offs = 0; return RIG_OK; } - if (RIG_OK != (err = newcat_get_cmd(rig))) + // Step size is 1 kHz + step = 1000; + } + else if (is_ftdx1200) + { + if (freq >= 28000000 && freq <= 29700000) { - return err; + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX087%c", cat_term); + } + else if (freq >= 50000000 && freq <= 54000000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX088%c", cat_term); + } + else + { + // only valid on 10m and 6m bands + *offs = 0; + return RIG_OK; + } + + // Step size is 1 kHz + step = 1000; + } + else if (is_ftdx3000) + { + if (freq >= 28000000 && freq <= 29700000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX086%c", cat_term); + } + else if (freq >= 50000000 && freq <= 54000000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX087%c", cat_term); + } + else + { + // only valid on 10m and 6m bands + *offs = 0; + return RIG_OK; + } + + // TODO: Confirm: Step size is 1 kHz or 10 kHz -- CAT documentation is difficult to interpret + step ... [truncated message content] |
From: Nate B. <n0...@us...> - 2020-11-14 13:58: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, Hamlib-4.0 has been updated via c76bf379e79df2f79880e3fefd8e7a05b251217f (commit) via 319d227b3cba8088ecf753000253674bd60418da (commit) via 8765f75b0207bb83e4c1620be21716bb4b19e16e (commit) via 96613e149dd9bf0175342d93b21eee6a3b9ed6fd (commit) via e014dbf71527b1219d07d3afc87e65e2ea57315c (commit) via 5f0bbad9c7f3703b897767ec79f6913f2d2eb7d6 (commit) via ff42aca3978f39017cc0e3244a7c3da63c3d639a (commit) via 051c6449e44079edcddcd8c7617d6f5a9181d755 (commit) via 9aabaa94e05568fa19d1b2f2fb8d7a4d0dd782de (commit) via 7ba0ddbdcc2ffc64ad7a2089ea1f4dd91306430a (commit) via 8fda0436a1a19863060bd1117bbffa61ed815443 (commit) via d9bd8dd38c2a5d2acc2e5969adaba0b80e5c6083 (commit) via 68151ba30b24e12b3a2c672daf364068ff9264f2 (commit) via f1361a8937038b9e8fb6cd079e3a1facf41073ea (commit) via 10d142883238ebb6a1b5d011d5f873ca5a44e9cc (commit) via d9c7a3cb1cd045d7bc6fb72952fc4fd2aff127cc (commit) via 21546623f343b46c9452207073c3dd34f9429cb6 (commit) via 3a32c66fcd8797fd1d4d08c0470f25fe92387600 (commit) via 048d8f28fcc8cb1f4240f1ece7eea9ff372e7a81 (commit) via 43fe9005a576e801dd1d267d636c9901c32a84ee (commit) via 6259de5cc76176ad52322983f3b97be9f3fb961d (commit) via 776877f4b3c254174895cc14e7de1337dbeca8b7 (commit) via 9b5b7db92b50f586ad8d29fa60ab4baf7568774a (commit) via c076cc97339b3223f394902643d1d215c1ac0e74 (commit) from c7de6e8b1979c7c36ed5fb56bba6ff6d49445a68 (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 c76bf379e79df2f79880e3fefd8e7a05b251217f Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Nov 11 16:40:06 2020 -0600 Change newcat.c RIG_FUNC_TUNER to send AC001 instead of AC002 to turn off TUNE G TUNE 1 is used to start tuning (cherry picked from commit cf3b528ea7f9c4274524f7793b9d9bc0df7d1234) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 2822278b..372dbc2e 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -4884,9 +4884,6 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) return -RIG_ENAVAIL; } - // some rigs use AC02 to actually start tuning - if (status == 1 && (is_ftdx101 || is_ftdx5000)) { status = 2; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "AC00%d%c", status == 0 ? 0 : status, cat_term); commit 319d227b3cba8088ecf753000253674bd60418da Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Nov 11 08:21:38 2020 -0600 Add RIG_METER_TEMP for FTDX101D and other newcat.c rigs Update documentation on TONE and TSQL to make it clear (cherry picked from commit 6ecaed955f268fca4c3c59653cd18153dc0789a7) diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 9d6aada6..ba916435 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -812,7 +812,8 @@ enum meter_level_e { RIG_METER_IC = (1 << 3), /*< IC */ RIG_METER_DB = (1 << 4), /*< DB */ RIG_METER_PO = (1 << 5), /*< Power Out */ - RIG_METER_VDD = (1 << 6) /*< Final Amp Voltage */ + RIG_METER_VDD = (1 << 6), /*< Final Amp Voltage */ + RIG_METER_TEMP = (1 << 7) /*< Final Amp Voltage */ }; @@ -1006,8 +1007,8 @@ typedef uint64_t setting_t; #define RIG_FUNC_NB CONSTANT_64BIT_FLAG (1) /*!< \c NB -- Noise Blanker */ #define RIG_FUNC_COMP CONSTANT_64BIT_FLAG (2) /*!< \c COMP -- Speech Compression */ #define RIG_FUNC_VOX CONSTANT_64BIT_FLAG (3) /*!< \c VOX -- Voice Operated Relay */ -#define RIG_FUNC_TONE CONSTANT_64BIT_FLAG (4) /*!< \c TONE -- CTCSS Tone */ -#define RIG_FUNC_TSQL CONSTANT_64BIT_FLAG (5) /*!< \c TSQL -- CTCSS Activate/De-activate and Encode-only value=2 if available */ +#define RIG_FUNC_TONE CONSTANT_64BIT_FLAG (4) /*!< \c TONE -- CTCSS Tone TX */ +#define RIG_FUNC_TSQL CONSTANT_64BIT_FLAG (5) /*!< \c TSQL -- CTCSS Activate/De-activate RX */ #define RIG_FUNC_SBKIN CONSTANT_64BIT_FLAG (6) /*!< \c SBKIN -- Semi Break-in (CW mode) */ #define RIG_FUNC_FBKIN CONSTANT_64BIT_FLAG (7) /*!< \c FBKIN -- Full Break-in (CW mode) */ #define RIG_FUNC_ANF CONSTANT_64BIT_FLAG (8) /*!< \c ANF -- Automatic Notch Filter (DSP) */ commit 8765f75b0207bb83e4c1620be21716bb4b19e16e Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Nov 11 07:26:51 2020 -0600 Undo last commit...FUNC_TONE and FUNC_TSQL handle this correctly (cherry picked from commit 1d07b1d6b6fda08f5b94ec9480c86a038272a44f) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index fb81777f..2822278b 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -4777,8 +4777,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) return -RIG_ENAVAIL; } - // FTDX101D has 3 states 0,1,2 - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%d%c", status , cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%d%c", status ? 1 : 0 , cat_term); if (rig->caps->targetable_vfo & RIG_TARGETABLE_TONE) { commit 96613e149dd9bf0175342d93b21eee6a3b9ed6fd Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Nov 11 07:06:51 2020 -0600 Chance TSQL in newcat.c to allow more than 2 states FTDX101D has state=2 for encode-only (cherry picked from commit 056e0b2359ec67a373b649d50027b703483bfb8a) diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 040b953d..9d6aada6 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -1007,7 +1007,7 @@ typedef uint64_t setting_t; #define RIG_FUNC_COMP CONSTANT_64BIT_FLAG (2) /*!< \c COMP -- Speech Compression */ #define RIG_FUNC_VOX CONSTANT_64BIT_FLAG (3) /*!< \c VOX -- Voice Operated Relay */ #define RIG_FUNC_TONE CONSTANT_64BIT_FLAG (4) /*!< \c TONE -- CTCSS Tone */ -#define RIG_FUNC_TSQL CONSTANT_64BIT_FLAG (5) /*!< \c TSQL -- CTCSS Activate/De-activate */ +#define RIG_FUNC_TSQL CONSTANT_64BIT_FLAG (5) /*!< \c TSQL -- CTCSS Activate/De-activate and Encode-only value=2 if available */ #define RIG_FUNC_SBKIN CONSTANT_64BIT_FLAG (6) /*!< \c SBKIN -- Semi Break-in (CW mode) */ #define RIG_FUNC_FBKIN CONSTANT_64BIT_FLAG (7) /*!< \c FBKIN -- Full Break-in (CW mode) */ #define RIG_FUNC_ANF CONSTANT_64BIT_FLAG (8) /*!< \c ANF -- Automatic Notch Filter (DSP) */ diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 354e6e88..fb81777f 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -4777,8 +4777,8 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) return -RIG_ENAVAIL; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%d%c", status ? 1 : 0, - cat_term); + // FTDX101D has 3 states 0,1,2 + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%d%c", status , cat_term); if (rig->caps->targetable_vfo & RIG_TARGETABLE_TONE) { diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index a1e416f0..0ddbf4de 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201103" +#define NEWCAT_VER "20201111" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit e014dbf71527b1219d07d3afc87e65e2ea57315c Author: Mikael Nousiainen <mik...@ik...> Date: Tue Nov 10 22:17:15 2020 +0200 Remove RIG_PASSBAND_ROOF as it was not necessary to use it (cherry picked from commit 81d02e22f160e81032e7e5c2dfac5161cbe517f5) diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index f0dbd038..040b953d 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -495,16 +495,13 @@ typedef unsigned int vfo_t; * \brief Macro for bandpass to be set to normal * \def RIG_PASSBAND_NORMAL */ -#define RIG_PASSBAND_NORMAL s_Hz(0) // was 0 but collided with Yaesu SH00; capability +#define RIG_PASSBAND_NORMAL s_Hz(0) /** * \brief Macro for bandpass to be left alone */ #define RIG_PASSBAND_NOCHANGE s_Hz(-1) -/** - * \brief Macro for selecting roofing filter on set_mode/width -- FTDX101D - */ -#define RIG_PASSBAND_ROOF s_Hz(-3) + /** * * \sa rig_passband_normal(), rig_passband_narrow(), rig_passband_wide() diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index cabb74e9..354e6e88 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -6503,6 +6503,8 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) main_sub_vfo = (RIG_VFO_SUB == vfo) ? '1' : '0'; } + // NOTE: RIG_PASSBAND_NORMAL (0) should select the default filter width (SH00) + if (is_ft950) { switch (mode) @@ -7045,7 +7047,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_RTTYR: case RIG_MODE_CW: case RIG_MODE_CWR: - if (width == RIG_PASSBAND_ROOF) { w = 0; } + if (width == RIG_PASSBAND_NORMAL) { w = 0; } else if (width <= 50) { w = 1; } else if (width <= 100) { w = 2; } else if (width <= 150) { w = 3; } @@ -7068,7 +7070,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_LSB: case RIG_MODE_USB: - if (width == RIG_PASSBAND_ROOF) { w = 0; } + if (width == RIG_PASSBAND_NORMAL) { w = 0; } else if (width <= 300) { w = 1; } else if (width <= 400) { w = 2; } else if (width <= 600) { w = 3; } commit 5f0bbad9c7f3703b897767ec79f6913f2d2eb7d6 Author: Mikael Nousiainen <mik...@ik...> Date: Tue Nov 10 10:20:51 2020 +0200 Yaesu newcat repeater offset step size confirmed on an FTDX 5000 (cherry picked from commit 4102e8c1e5157e71a1ac908ffcd4c24e6589f5bf) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 4d8069c9..cabb74e9 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1641,7 +1641,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) return -RIG_EINVAL; } - // TODO: Confirm: Step size is 1 kHz or 10 kHz -- CAT documentation is difficult to interpret + // Step size is 1 kHz offs /= 1000; snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); @@ -1662,7 +1662,7 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) return -RIG_EINVAL; } - // TODO: Confirm: Step size is 1 kHz or 10 kHz -- CAT documentation is difficult to interpret + // Step size is 1 kHz offs /= 1000; snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); @@ -1846,7 +1846,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) return RIG_OK; } - // TODO: Confirm: Step size is 1 kHz or 10 kHz -- CAT documentation is difficult to interpret + // Step size is 1 kHz step = 1000; } else if (is_ftdx5000) @@ -1866,7 +1866,7 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) return RIG_OK; } - // TODO: Confirm: Step size is 1 kHz or 10 kHz -- CAT documentation is difficult to interpret + // Step size is 1 kHz step = 1000; } else if (is_ftdx101) commit ff42aca3978f39017cc0e3244a7c3da63c3d639a Author: Mikael Nousiainen <mik...@ik...> Date: Mon Nov 9 22:18:57 2020 +0200 Add repeater offset support for many Yaesu newcat rigs and fix FT-991 repeater offset step (cherry picked from commit e122955213fc9f1e277add81bf07c71ef9c2d48d) diff --git a/rigs/yaesu/ft1200.c b/rigs/yaesu/ft1200.c index 14dacd3f..f6af9d52 100644 --- a/rigs/yaesu/ft1200.c +++ b/rigs/yaesu/ft1200.c @@ -235,6 +235,8 @@ const struct rig_caps ftdx1200_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/ft2000.c b/rigs/yaesu/ft2000.c index af7a73d6..c33bcdfd 100644 --- a/rigs/yaesu/ft2000.c +++ b/rigs/yaesu/ft2000.c @@ -236,6 +236,8 @@ const struct rig_caps ft2000_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/ft3000.c b/rigs/yaesu/ft3000.c index 32f24550..dc416780 100644 --- a/rigs/yaesu/ft3000.c +++ b/rigs/yaesu/ft3000.c @@ -238,6 +238,8 @@ const struct rig_caps ftdx3000_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/ft450.c b/rigs/yaesu/ft450.c index 98857ed4..d0be5671 100644 --- a/rigs/yaesu/ft450.c +++ b/rigs/yaesu/ft450.c @@ -32,19 +32,13 @@ #include "hamlib/rig.h" #include "bandplan.h" -#include "serial.h" -#include "misc.h" -#include "yaesu.h" #include "newcat.h" #include "ft450.h" #include "idx_builtin.h" /* - * ft450 rigs capabilities. - * Also this struct is READONLY! - * + * FT-450 rig capabilities */ - const struct rig_caps ft450_caps = { RIG_MODEL(RIG_MODEL_FT450), @@ -192,6 +186,8 @@ const struct rig_caps ft450_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c index cfb13e23..7928da03 100644 --- a/rigs/yaesu/ft5000.c +++ b/rigs/yaesu/ft5000.c @@ -233,6 +233,8 @@ const struct rig_caps ftdx5000_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index 3a73d4fb..f33e2652 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -215,6 +215,8 @@ const struct rig_caps ft891_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/ft950.c b/rigs/yaesu/ft950.c index 27bba7c0..bf30d435 100644 --- a/rigs/yaesu/ft950.c +++ b/rigs/yaesu/ft950.c @@ -262,6 +262,8 @@ const struct rig_caps ft950_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/ft991.c b/rigs/yaesu/ft991.c index e643c025..60568197 100644 --- a/rigs/yaesu/ft991.c +++ b/rigs/yaesu/ft991.c @@ -207,8 +207,8 @@ const struct rig_caps ft991_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, - .set_rptr_offs = newcat_set_rptr_offs, /*ve9gj */ - .get_rptr_offs = newcat_get_rptr_offs, /*ve9gj */ + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = ft991_set_ctcss_tone, .get_ctcss_tone = ft991_get_ctcss_tone, .set_dcs_code = ft991_set_dcs_code, diff --git a/rigs/yaesu/ftdx101.c b/rigs/yaesu/ftdx101.c index 75b3668a..c7f517fb 100644 --- a/rigs/yaesu/ftdx101.c +++ b/rigs/yaesu/ftdx101.c @@ -229,6 +229,8 @@ const struct rig_caps ftdx101d_caps = .mW2power = newcat_mW2power, .set_rptr_shift = newcat_set_rptr_shift, .get_rptr_shift = newcat_get_rptr_shift, + .set_rptr_offs = newcat_set_rptr_offs, + .get_rptr_offs = newcat_get_rptr_offs, .set_ctcss_tone = newcat_set_ctcss_tone, .get_ctcss_tone = newcat_get_ctcss_tone, .set_ctcss_sql = newcat_set_ctcss_sql, diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 24e76019..4d8069c9 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1492,21 +1492,91 @@ 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; int err; - char command[16] ; - freq_t freq; + char command[32]; + freq_t freq = 0; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - if (newcat_is_rig(rig, RIG_MODEL_FT991)) + err = newcat_get_freq(rig, vfo, &freq); // Need to get freq to determine band + if (err < 0) + { + return err; + } + + if (is_ft450) { - freq = 0; - err = newcat_get_freq(rig, vfo, &freq); // Need to get freq to determine band + strcpy(command, "EX050"); + + // Step size is 100 kHz + offs /= 100000; - if (err < 0) + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%03li%c", command, offs, cat_term); + } + else if (is_ft2000) + { + if (freq >= 28000000 && freq <= 29700000) { - return err; + strcpy(command, "EX076"); + } + else if (freq >= 50000000 && freq <= 54000000) + { + strcpy(command, "EX077"); + } + else + { + // only valid on 10m and 6m bands + return -RIG_EINVAL; } + // Step size is 1 kHz + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + } + else if (is_ft950) + { + if (freq >= 28000000 && freq <= 29700000) + { + strcpy(command, "EX057"); + } + else if (freq >= 50000000 && freq <= 54000000) + { + strcpy(command, "EX058"); + } + else + { + // only valid on 10m and 6m bands + return -RIG_EINVAL; + } + + // Step size is 1 kHz + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + } + else if (is_ft891) + { + if (freq >= 28000000 && freq <= 29700000) + { + strcpy(command, "EX0904"); + } + else if (freq >= 50000000 && freq <= 54000000) + { + strcpy(command, "EX0905"); + } + else + { + // only valid on 10m and 6m bands + return -RIG_EINVAL; + } + + // Step size is 1 kHz + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + } + else if (is_ft991) + { if (freq >= 28000000 && freq <= 29700000) { strcpy(command, "EX080"); @@ -1526,15 +1596,104 @@ int newcat_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t offs) else { // only valid on 10m to 70cm bands - return RIG_OK; + return -RIG_EINVAL; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, - cat_term); - return newcat_set_cmd(rig); + // Step size is 1 kHz + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); } + else if (is_ftdx1200) + { + if (freq >= 28000000 && freq <= 29700000) + { + strcpy(command, "EX087"); + } + else if (freq >= 50000000 && freq <= 54000000) + { + strcpy(command, "EX088"); + } + else + { + // only valid on 10m and 6m bands + return -RIG_EINVAL; + } - return -RIG_ENAVAIL; + // Step size is 1 kHz + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + } + else if (is_ftdx3000) + { + if (freq >= 28000000 && freq <= 29700000) + { + strcpy(command, "EX086"); + } + else if (freq >= 50000000 && freq <= 54000000) + { + strcpy(command, "EX087"); + } + else + { + // only valid on 10m and 6m bands + return -RIG_EINVAL; + } + + // TODO: Confirm: Step size is 1 kHz or 10 kHz -- CAT documentation is difficult to interpret + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + } + else if (is_ftdx5000) + { + if (freq >= 28000000 && freq <= 29700000) + { + strcpy(command, "EX081"); + } + else if (freq >= 50000000 && freq <= 54000000) + { + strcpy(command, "EX082"); + } + else + { + // only valid on 10m and 6m bands + return -RIG_EINVAL; + } + + // TODO: Confirm: Step size is 1 kHz or 10 kHz -- CAT documentation is difficult to interpret + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + } + else if (is_ftdx101) + { + if (freq >= 28000000 && freq <= 29700000) + { + strcpy(command, "EX010315"); + } + else if (freq >= 50000000 && freq <= 54000000) + { + strcpy(command, "EX010316"); + } + else + { + // only valid on 10m and 6m bands + return -RIG_EINVAL; + } + + // Step size is 1 kHz + offs /= 1000; + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%04li%c", command, offs, cat_term); + } + else + { + return -RIG_ENAVAIL; + } + + return newcat_set_cmd(rig); } @@ -1544,20 +1703,86 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) int err; int ret_data_len; char *retoffs; - freq_t freq; + freq_t freq = 0; + int step; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - if (newcat_is_rig(rig, RIG_MODEL_FT991)) + err = newcat_get_freq(rig, vfo, &freq); // Need to get freq to determine band + if (err < 0) + { + return err; + } + + if (is_ft450) { - freq = 0; - err = newcat_get_freq(rig, vfo, &freq); // Need to get freq to determine band + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX050%c", cat_term); - if (err < 0) + // Step size is 100 kHz + step = 100000; + } + else if (is_ft2000) + { + if (freq >= 28000000 && freq <= 29700000) { - return err; + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX076%c", cat_term); + } + else if (freq >= 50000000 && freq <= 54000000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX077%c", cat_term); + } + else + { + // only valid on 10m and 6m bands + *offs = 0; + return RIG_OK; } + // Step size is 1 kHz + step = 1000; + } + else if (is_ft950) + { + if (freq >= 28000000 && freq <= 29700000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX057%c", cat_term); + } + else if (freq >= 50000000 && freq <= 54000000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX058%c", cat_term); + } + else + { + // only valid on 10m and 6m bands + *offs = 0; + return RIG_OK; + } + + // Step size is 1 kHz + step = 1000; + } + else if (is_ft891) + { + if (freq >= 28000000 && freq <= 29700000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX0904%c", cat_term); + } + else if (freq >= 50000000 && freq <= 54000000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX0905%c", cat_term); + } + else + { + // only valid on 10m and 6m bands + *offs = 0; + return RIG_OK; + } + + // Step size is 1 kHz + step = 1000; + } + else if (is_ft991) + { if (freq >= 28000000 && freq <= 29700000) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX080%c", cat_term); @@ -1576,28 +1801,114 @@ int newcat_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *offs) } else { - *offs = 0; // only valid on 10m to 70cm bands + // only valid on 10m to 70cm bands + *offs = 0; return RIG_OK; } - if (RIG_OK != (err = newcat_get_cmd(rig))) + // Step size is 1 kHz + step = 1000; + } + else if (is_ftdx1200) + { + if (freq >= 28000000 && freq <= 29700000) { - return err; + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX087%c", cat_term); + } + else if (freq >= 50000000 && freq <= 54000000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX088%c", cat_term); + } + else + { + // only valid on 10m and 6m bands + *offs = 0; + return RIG_OK; + } + + // Step size is 1 kHz + step = 1000; + } + else if (is_ftdx3000) + { + if (freq >= 28000000 && freq <= 29700000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX086%c", cat_term); + } + else if (freq >= 50000000 && freq <= 54000000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX087%c", cat_term); + } + else + { + // only valid on 10m and 6m bands + *offs = 0; + return RIG_OK; + } + + // TODO: Confirm: Step size is 1 kHz or 10 kHz -- CAT documentation is difficult to interpret + step = 1000; + } + else if (is_ftdx5000) + { + if (freq >= 28000000 && freq <= 29700000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX081%c", cat_term); + } + else if (freq >= 50000000 && freq <= 54000000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX082%c", cat_term); + } + else + { + // only valid on 10m and 6m bands + *offs = 0; + return RIG_OK; } - ret_data_len = strlen(priv->ret_data); + // TODO: Confirm: Step size is 1 kHz or 10 kHz -- CAT documentation is difficult to interpret + step = 1000; + } + else if (is_ftdx101) + { + if (freq >= 28000000 && freq <= 29700000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX010315%c", cat_term); + } + else if (freq >= 50000000 && freq <= 54000000) + { + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "EX010316%c", cat_term); + } + else + { + // only valid on 10m and 6m bands + *offs = 0; + return RIG_OK; + } - /* skip command */ - retoffs = priv->ret_data + strlen(priv->cmd_str) - 1; - /* chop term */ - priv->ret_data[ret_data_len - 1] = '\0'; - *offs = atoi(retoffs); + // Step size is 1 kHz + step = 1000; } else { return -RIG_ENAVAIL; } + err = newcat_get_cmd(rig); + if (err != RIG_OK) + { + return err; + } + + ret_data_len = strlen(priv->ret_data); + + /* skip command */ + retoffs = priv->ret_data + strlen(priv->cmd_str) - 1; + /* chop term */ + priv->ret_data[ret_data_len - 1] = '\0'; + + *offs = atoi(retoffs) * step; + return RIG_OK; } commit 051c6449e44079edcddcd8c7617d6f5a9181d755 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Nov 9 23:06:44 2020 -0600 Add FUNC_TUNE to Flex/PowerSDR (cherry picked from commit f3cb1a09aead849dcfc25ad53c0f94e1cf5267cd) diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index 73267724..65411fbf 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -39,7 +39,7 @@ #define F6K_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_AM|RIG_MODE_FM|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB) -#define F6K_FUNC_ALL (RIG_FUNC_VOX) +#define F6K_FUNC_ALL (RIG_FUNC_VOX|RIG_FUNC_TUNER) #define F6K_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD) @@ -49,7 +49,7 @@ #define F6K_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3) /* PowerSDR differences */ -#define POWERSDR_FUNC_ALL (RIG_FUNC_VOX|RIG_FUNC_SQL|RIG_FUNC_NB|RIG_FUNC_ANF|RIG_FUNC_MUTE|RIG_FUNC_RIT|RIG_FUNC_XIT) +#define POWERSDR_FUNC_ALL (RIG_FUNC_VOX|RIG_FUNC_SQL|RIG_FUNC_NB|RIG_FUNC_ANF|RIG_FUNC_MUTE|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER) #define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_MICGAIN|RIG_LEVEL_VOXGAIN|RIG_LEVEL_SQL|RIG_LEVEL_AF|RIG_LEVEL_AGC|RIG_LEVEL_RF|RIG_LEVEL_IF) @@ -941,6 +941,10 @@ int powersdr_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) snprintf(cmd, sizeof(cmd) - 1, "ZZSO%01d", status); break; + case RIG_FUNC_TUNER: + snprintf(cmd, sizeof(cmd) - 1, "ZZTU%01d", status); + break; + default: return kenwood_set_func(rig, vfo, func, status); } @@ -1140,7 +1144,7 @@ const struct rig_caps powersdr_caps = RIG_MODEL(RIG_MODEL_POWERSDR), .model_name = "PowerSDR/Thetis", .mfg_name = "FlexRadio/ANAN", - .version = "20201016.0", + .version = "20201108.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 9aabaa94e05568fa19d1b2f2fb8d7a4d0dd782de Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Nov 7 06:45:47 2020 -0600 Fix max macro in kenwood.c -- wasn't being used anyways (cherry picked from commit 9a60e32defa48603d42f79ca7c835ac2ae3ed64e) diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 0565508d..473ff0b2 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -42,7 +42,7 @@ #include "ts990s.h" #ifndef max -#define max(a,b) (((a) (b)) ? (a) : (b)) +#define max(a,b) (((a) > (b)) ? (a) : (b)) #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif commit 7ba0ddbdcc2ffc64ad7a2089ea1f4dd91306430a Author: Mikael Nousiainen <mik...@ik...> Date: Sun Nov 8 13:03:48 2020 +0200 Improve handling of the ? response for Yaesu rigs (cherry picked from commit 7b8b96555aa934c586c7e93ff6a4b9d4e03085a9) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index e58f055a..24e76019 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2920,7 +2920,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) priv->cmd_str[2] = main_sub_vfo; } - // Some Yaesu rigs reject IF shift command in AM/FM modes + // Some Yaesu rigs reject this command in AM/FM modes priv->question_mark_response_means_rejected = 1; break; @@ -2983,6 +2983,9 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "MG%03d%c", fpf, cat_term); + + // Some Yaesu rigs reject this command in RTTY modes + priv->question_mark_response_means_rejected = 1; break; case RIG_LEVEL_METER: @@ -3189,6 +3192,8 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } } + // Some Yaesu rigs reject this command in AM/FM modes + priv->question_mark_response_means_rejected = 1; break; case RIG_LEVEL_COMP: @@ -3623,9 +3628,6 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { priv->cmd_str[2] = main_sub_vfo; } - - // Some Yaesu rigs reject IF shift command in AM/FM modes - priv->question_mark_response_means_rejected = 1; break; case RIG_LEVEL_CWPITCH: @@ -3901,9 +3903,6 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) err = newcat_get_cmd(rig); - // Clear flag after executing command - priv->question_mark_response_means_rejected = 0; - if (err != RIG_OK) { return err; @@ -4413,6 +4412,8 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) priv->cmd_str[2] = main_sub_vfo; } + // Some Yaesu rigs reject this command in AM/FM modes + priv->question_mark_response_means_rejected = 1; break; case RIG_FUNC_MN: @@ -4429,6 +4430,8 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) priv->cmd_str[2] = main_sub_vfo; } + // Some Yaesu rigs reject this command in AM/FM modes + priv->question_mark_response_means_rejected = 1; break; case RIG_FUNC_FBKIN: @@ -4533,6 +4536,8 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) priv->cmd_str[2] = main_sub_vfo; } + // Some Yaesu rigs reject this command in AM/FM modes + priv->question_mark_response_means_rejected = 1; break; case RIG_FUNC_COMP: @@ -4601,7 +4606,12 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) return -RIG_EINVAL; } - return newcat_set_cmd(rig); + err = newcat_set_cmd(rig); + + // Clear flag after executing command + priv->question_mark_response_means_rejected = 0; + + return err; } @@ -8363,18 +8373,25 @@ int newcat_get_cmd(RIG *rig) break; /* retry */ case '?': - if (priv->question_mark_response_means_rejected) - { - /* Some commands, like MR and MC return "?;" when choosing a channel that doesn't exist */ - rig_debug(RIG_DEBUG_ERR, "%s: Command rejected: '%s'\n", __func__, - priv->cmd_str); - return -RIG_ERJCTED; - } - - /* Rig busy wait please */ - rig_debug(RIG_DEBUG_ERR, "%s: Rig busy\n", __func__); - rc = -RIG_BUSBUSY; - break; /* retry read only */ + /* The ? response is ambiguous and undocumented by Yaesu, but for get commands it seems to + * indicate that the rig rejected the command because the state of the rig is not valid for the command + * or that the command parameter is invalid. Retrying the command does not fix the issue, + * as the error is caused by the an invalid combination of rig state. + * + * For example, the following cases have been observed: + * - MR and MC commands are rejected when referring to an _empty_ memory channel even + * if the channel number is in a valid range + * - BC (ANF) and RL (NR) commands fail in AM/FM modes, because they are + * supported only in SSB/CW/RTTY modes + * - MG (MICGAIN) command fails in RTTY mode, as it's a digital mode + * + * There are many more cases like these and they vary by rig model. + * + * So far, "rig busy" type situations with the ? response have not been observed for get commands. + */ + rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig: '%s'\n", __func__, + priv->cmd_str); + return -RIG_ERJCTED; } continue; @@ -8494,10 +8511,25 @@ int newcat_set_cmd(RIG *rig) break; /* retry */ case '?': + /* The ? response is ambiguous and undocumented by Yaesu. For set commands it seems to indicate: + * 1) either that the rig is busy and the command needs to be retried + * 2) or that the rig rejected the command because the state of the rig is not valid for the command + * or that the command parameter is invalid. Retrying the command does not fix the issue + * in this case, as the error is caused by the an invalid combination of rig state. + * The latter case is consistent with behaviour of get commands. + * + * For example, the following cases have been observed: + * - MR and MC commands are rejected when referring to an _empty_ memory channel even + * if the channel number is in a valid range + * - BC (ANF) and RL (NR) commands fail in AM/FM modes, because they are + * supported only in SSB/CW/RTTY modes + * - MG (MICGAIN) command fails in RTTY mode, as it's a digital mode + * + * There are many more cases like these and they vary by rig model. + */ if (priv->question_mark_response_means_rejected) { - /* Some commands, like MR and MC return "?;" when choosing a channel that doesn't exist */ - rig_debug(RIG_DEBUG_ERR, "%s: Command rejected: '%s'\n", __func__, + rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig: '%s'\n", __func__, priv->cmd_str); return -RIG_ERJCTED; } commit 8fda0436a1a19863060bd1117bbffa61ed815443 Author: Mikael Nousiainen <mik...@ik...> Date: Sun Nov 8 00:15:48 2020 +0200 Allow AMN mode on FTDX 5000 and FTDX 3000 -- the rig seems to return it regardless of documentation (cherry picked from commit 8f3d5b5a850488b8aeed8deac9fe3dcc955bd022) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index c630173f..e58f055a 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -6573,6 +6573,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) break; case RIG_MODE_AM: + case RIG_MODE_AMN: case RIG_MODE_FM: case RIG_MODE_PKTFM: case RIG_MODE_FMN: @@ -6591,8 +6592,10 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) switch (mode) { case RIG_MODE_AM: + case RIG_MODE_AMN: case RIG_MODE_FM: case RIG_MODE_PKTFM: + case RIG_MODE_FMN: if (width < rig_passband_normal(rig, mode)) { err = newcat_set_narrow(rig, vfo, TRUE); @@ -6602,9 +6605,6 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) err = newcat_set_narrow(rig, vfo, FALSE); } return err; - - case RIG_MODE_FMN: - return RIG_OK; } } // end is_ftdx1200 and is_ftdx3000 else if (is_ftdx5000) @@ -6680,6 +6680,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) break; case RIG_MODE_AM: + case RIG_MODE_AMN: case RIG_MODE_FM: case RIG_MODE_PKTFM: case RIG_MODE_FMN: @@ -6698,8 +6699,10 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) switch (mode) { case RIG_MODE_AM: + case RIG_MODE_AMN: case RIG_MODE_FM: case RIG_MODE_PKTFM: + case RIG_MODE_FMN: if (width < rig_passband_normal(rig, mode)) { err = newcat_set_narrow(rig, vfo, TRUE); @@ -6709,9 +6712,6 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) err = newcat_set_narrow(rig, vfo, FALSE); } return err; - - case RIG_MODE_FMN: - return RIG_OK; } } // end is_ftdx5000 else if (is_ftdx101) @@ -7661,6 +7661,10 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) *width = 9000; break; + case RIG_MODE_AMN: + *width = 6000; + break; + default: return -RIG_EINVAL; } /* end switch(mode) */ @@ -7801,6 +7805,10 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) *width = 9000; break; + case RIG_MODE_AMN: + *width = 6000; + break; + default: return -RIG_EINVAL; } /* end switch(mode) */ commit d9bd8dd38c2a5d2acc2e5969adaba0b80e5c6083 Author: Mikael Nousiainen <mik...@ik...> Date: Sun Nov 8 00:09:41 2020 +0200 Combine filters on AM/AMN and FM/FMN modes as the narrow setting changes the mode too (cherry picked from commit c10606ed4f79322fb1253ff2d6685ec96269864d) diff --git a/rigs/yaesu/ft3000.c b/rigs/yaesu/ft3000.c index 6172bd2b..32f24550 100644 --- a/rigs/yaesu/ft3000.c +++ b/rigs/yaesu/ft3000.c @@ -185,14 +185,13 @@ const struct rig_caps ftdx3000_caps = {FTDX5000_CW_RTTY_PKT_RX_MODES, Hz(1800)}, /* Normal CW, RTTY, PKT/USER */ {FTDX5000_CW_RTTY_PKT_RX_MODES, Hz(500)}, /* Narrow CW, RTTY, PKT/USER */ {FTDX5000_CW_RTTY_PKT_RX_MODES, Hz(2400)}, /* Wide CW, RTTY, PKT/USER */ - {RIG_MODE_SSB, Hz(2400)}, /* Normal SSB */ - {RIG_MODE_SSB, Hz(1800)}, /* Narrow SSB */ - {RIG_MODE_SSB, Hz(4000)}, /* Wide SSB */ - {RIG_MODE_AM, Hz(9000)}, /* Normal AM */ - {RIG_MODE_AM, Hz(6000)}, /* Narrow AM */ - {FTDX5000_FM_WIDE_RX_MODES, Hz(16000)}, /* Normal FM */ - {FTDX5000_FM_WIDE_RX_MODES, Hz(9000)}, /* Narrow FM */ - {RIG_MODE_FMN, Hz(9000)}, /* Narrow FM */ + {RIG_MODE_SSB, Hz(2400)}, /* Normal SSB */ + {RIG_MODE_SSB, Hz(1800)}, /* Narrow SSB */ + {RIG_MODE_SSB, Hz(4000)}, /* Wide SSB */ + {FTDX5000_AM_RX_MODES, Hz(9000)}, /* Normal AM */ + {FTDX5000_AM_RX_MODES, Hz(6000)}, /* Narrow AM */ + {FTDX5000_FM_RX_MODES, Hz(16000)}, /* Normal FM */ + {FTDX5000_FM_RX_MODES, Hz(9000)}, /* Narrow FM */ {FTDX5000_CW_RTTY_PKT_RX_MODES | RIG_MODE_SSB, RIG_FLT_ANY}, RIG_FLT_END, diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c index ca94e384..cfb13e23 100644 --- a/rigs/yaesu/ft5000.c +++ b/rigs/yaesu/ft5000.c @@ -183,11 +183,10 @@ const struct rig_caps ftdx5000_caps = {RIG_MODE_SSB, Hz(2400)}, /* Normal SSB */ {RIG_MODE_SSB, Hz(1800)}, /* Narrow SSB */ {RIG_MODE_SSB, Hz(4000)}, /* Wide SSB */ - {RIG_MODE_AM, Hz(9000)}, /* Normal AM */ - {RIG_MODE_AM, Hz(6000)}, /* Narrow AM */ - {FTDX5000_FM_WIDE_RX_MODES, Hz(16000)}, /* Normal FM */ - {FTDX5000_FM_WIDE_RX_MODES, Hz(9000)}, /* Narrow FM */ - {RIG_MODE_FMN, Hz(9000)}, /* Narrow FM */ + {FTDX5000_AM_RX_MODES, Hz(9000)}, /* Normal AM */ + {FTDX5000_AM_RX_MODES, Hz(6000)}, /* Narrow AM */ + {FTDX5000_FM_RX_MODES, Hz(16000)}, /* Normal FM */ + {FTDX5000_FM_RX_MODES, Hz(9000)}, /* Narrow FM */ {FTDX5000_CW_RTTY_PKT_RX_MODES | RIG_MODE_SSB, RIG_FLT_ANY}, RIG_FLT_END, diff --git a/rigs/yaesu/ft5000.h b/rigs/yaesu/ft5000.h index 5dc021b1..7b045376 100644 --- a/rigs/yaesu/ft5000.h +++ b/rigs/yaesu/ft5000.h @@ -32,15 +32,14 @@ /* Receiver caps */ -#define FTDX5000_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|\ +#define FTDX5000_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_AMN|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|\ RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|\ RIG_MODE_FM|RIG_MODE_FMN) #define FTDX5000_SSB_CW_RX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|\ RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB) -#define FTDX5000_AM_RX_MODES (RIG_MODE_AM) -#define FTDX5000_FM_WIDE_RX_MODES (RIG_MODE_FM|RIG_MODE_PKTFM) -#define FTDX5000_FM_RX_MODES (FTDX5000_FM_WIDE_RX_MODES|RIG_MODE_FMN) +#define FTDX5000_AM_RX_MODES (RIG_MODE_AM|RIG_MODE_AMN) +#define FTDX5000_FM_RX_MODES (RIG_MODE_FM|RIG_MODE_PKTFM|RIG_MODE_FMN) #define FTDX5000_CW_RTTY_PKT_RX_MODES (RIG_MODE_RTTY|RIG_MODE_RTTYR|\ RIG_MODE_PKTUSB|RIG_MODE_PKTLSB|RIG_MODE_CW|RIG_MODE_CWR) @@ -48,7 +47,7 @@ #define FTDX5000_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY| \ RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_FM|RIG_MODE_PKTFM|RIG_MODE_FMN) /* 100 W class */ -#define FTDX5000_AM_TX_MODES (RIG_MODE_AM) /* set 25W max */ +#define FTDX5000_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_AMN) /* set 25W max */ /* TBC */ #define FTDX5000_LEVELS (RIG_LEVEL_ATT|RIG_LEVEL_PREAMP|\ commit 68151ba30b24e12b3a2c672daf364068ff9264f2 Author: Mikael Nousiainen <mik...@ik...> Date: Sat Nov 7 23:46:09 2020 +0200 Fix roofing filter selection bug. Get mode for RX bandwidth from function argument. (cherry picked from commit fdbc66b434a38a542cf8220c43dd1b3d1dddb846) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 4e0c2eb5..c630173f 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -6941,7 +6941,7 @@ static int set_roofing_filter(RIG *rig, vfo_t vfo, int index) static int set_roofing_filter_for_width(RIG *rig, vfo_t vfo, int width) { struct newcat_priv_caps *priv_caps = (struct newcat_priv_caps *)rig->caps->priv; - int index = -1; + int index = 0; int i; rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__); @@ -6971,11 +6971,6 @@ static int set_roofing_filter_for_width(RIG *rig, vfo_t vfo, int width) index = current_filter->index; } - if (index < 0) - { - return -RIG_EINVAL; - } - return set_roofing_filter(rig, vfo, index); } @@ -7069,7 +7064,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) if (is_ft950 || is_ftdx5000) { // Some Yaesu rigs cannot query SH in modes such as AM/FM - switch (rig->state.current_mode) + switch (mode) { case RIG_MODE_FM: case RIG_MODE_FMN: commit f1361a8937038b9e8fb6cd079e3a1facf41073ea Author: Mikael Nousiainen <mik...@ik...> Date: Sat Nov 7 23:30:34 2020 +0200 Do not query filter width using SH command with FTDX 5000 in AM/FM modes (cherry picked from commit d114a5e2d669dd8a6f4c2aebc961b585c45a5a3a) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 7755bcf5..4e0c2eb5 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -7047,6 +7047,7 @@ 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; int err; int w; + int sh_command_valid = 1; char narrow = '!'; char cmd[] = "SH"; char main_sub_vfo = '0'; @@ -7065,19 +7066,20 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) return err; } - if (is_ft950) + if (is_ft950 || is_ftdx5000) { - // can't query SH in some modes + // Some Yaesu rigs cannot query SH in modes such as AM/FM switch (rig->state.current_mode) { - case RIG_MODE_FM: *width = 16000; break; - - case RIG_MODE_AM: *width = 9000; break; - - case RIG_MODE_AMN: *width = 6000; break; + case RIG_MODE_FM: + case RIG_MODE_FMN: + case RIG_MODE_PKTFM: + case RIG_MODE_AM: + case RIG_MODE_AMN: + case RIG_MODE_PKTAM: + sh_command_valid = 0; + break; } - - return RIG_OK; } if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) @@ -7085,45 +7087,53 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0'; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c%c", cmd, main_sub_vfo, - cat_term); - - /* Get RX BANDWIDTH */ - if (RIG_OK != (err = newcat_get_cmd(rig))) + if (sh_command_valid) { - return err; - } + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c%c", cmd, main_sub_vfo, + cat_term); - if (strlen(priv->ret_data) == 7) - { - if (sscanf(priv->ret_data, "SH%*1d0%3d", &w) != 1) + err = newcat_get_cmd(rig); + if (err != RIG_OK) { - err = -RIG_EPROTO; + return err; } - } - else if (strlen(priv->ret_data) == 6) - { - if (sscanf(priv->ret_data, "SH%*1d%3d", &w) != 1) + + if (strlen(priv->ret_data) == 7) + { + if (sscanf(priv->ret_data, "SH%*1d0%3d", &w) != 1) + { + err = -RIG_EPROTO; + } + } + else if (strlen(priv->ret_data) == 6) { - err = -RIG_EPROTO; + if (sscanf(priv->ret_data, "SH%*1d%3d", &w) != 1) + { + err = -RIG_EPROTO; + } } + else + { + rig_debug(RIG_DEBUG_ERR, "%s: unknown SH response='%s'\n", __func__, + priv->ret_data); + return -RIG_EPROTO; + } + + if (err != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: unable to parse width from '%s'\n", __func__, + priv->ret_data); + return -RIG_EPROTO; + } + + rig_debug(RIG_DEBUG_TRACE, "%s: w=%d\n", __func__, w); } else { - rig_debug(RIG_DEBUG_ERR, "%s: unknown SH response='%s'\n", __func__, - priv->ret_data); - return -RIG_EPROTO; - } - - if (err != RIG_OK) - { - rig_debug(RIG_DEBUG_ERR, "%s: unable to parse width from '%s'\n", __func__, - priv->ret_data); - return -RIG_EPROTO; + // Some Yaesu rigs cannot query filter width using SH command in modes such as AM/FM + w = 0; } - rig_debug(RIG_DEBUG_TRACE, "%s: w=%d\n", __func__, w); - if (is_ft950) { if ((narrow = get_narrow(rig, RIG_VFO_MAIN)) < 0) commit 10d142883238ebb6a1b5d011d5f873ca5a44e9cc Author: Mikael Nousiainen <mik...@ik...> Date: Sat Nov 7 22:58:09 2020 +0200 Add RIG_FLT_ANY for FT-991 and FT-891 (cherry picked from commit b9815a41656d95649cda4d7df773f8a2d9983692) diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index 5c5eaaaa..3a73d4fb 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -172,6 +172,7 @@ const struct rig_caps ft891_caps = {RIG_MODE_SSB, Hz(600)}, /* SSB */ {RIG_MODE_SSB, Hz(400)}, /* SSB */ {RIG_MODE_SSB, Hz(200)}, /* SSB */ + {FT891_CW_RTTY_PKT_RX_MODES | RIG_MODE_SSB, RIG_FLT_ANY }, {RIG_MODE_AM, Hz(9000)}, /* Normal AM */ {RIG_MODE_AM, Hz(6000)}, /* Narrow AM */ {FT891_FM_RX_MODES, Hz(16000)}, /* Normal FM */ diff --git a/rigs/yaesu/ft991.c b/rigs/yaesu/ft991.c index 7f2a1858..e643c025 100644 --- a/rigs/yaesu/ft991.c +++ b/rigs/yaesu/ft991.c @@ -163,6 +163,7 @@ const struct rig_caps ft991_caps = {RIG_MODE_SSB, Hz(600)}, /* SSB */ {RIG_MODE_SSB, Hz(400)}, /* SSB */ {RIG_MODE_SSB, Hz(200)}, /* SSB */ + {FT991_CW_RTTY_PKT_RX_MODES | RIG_MODE_SSB, RIG_FLT_ANY }, {RIG_MODE_AM, Hz(9000)}, /* Normal AM */ {RIG_MODE_AMN, Hz(6000)}, /* Narrow AM */ {FT991_FM_WIDE_RX_MODES, Hz(16000)}, /* Normal FM */ commit d9c7a3cb1cd045d7bc6fb72952fc4fd2aff127cc Author: Mikael Nousiainen <mik...@ik...> Date: Sat Nov 7 19:47:08 2020 +0200 Handle Yaesu rigs rejecting IF shift command without retries (cherry picked from commit 88cec8450cff870e981f53f632f3acf6839f2f1a) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 2bfc827c..7755bcf5 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2920,6 +2920,8 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) priv->cmd_str[2] = main_sub_vfo; } + // Some Yaesu rigs reject IF shift command in AM/FM modes + priv->question_mark_response_means_rejected = 1; break; case RIG_LEVEL_CWPITCH: { @@ -3526,7 +3528,12 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) return -RIG_EINVAL; } - return newcat_set_cmd(rig); + err = newcat_set_cmd(rig); + + // Clear flag after executing command + priv->question_mark_response_means_rejected = 0; + + return err; } @@ -3616,6 +3623,9 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { priv->cmd_str[2] = main_sub_vfo; } + + // Some Yaesu rigs reject IF shift command in AM/FM modes + priv->question_mark_response_means_rejected = 1; break; case RIG_LEVEL_CWPITCH: @@ -3889,7 +3899,12 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return -RIG_EINVAL; } - if (RIG_OK != (err = newcat_get_cmd(rig))) + err = newcat_get_cmd(rig); + + // Clear flag after executing command + priv->question_mark_response_means_rejected = 0; + + if (err != RIG_OK) { return err; } commit 21546623f343b46c9452207073c3dd34f9429cb6 Author: Mikael Nousiainen <mik...@ik...> Date: Sat Nov 7 15:03:54 2020 +0200 Add routines to convert between morse code dot duration and milliseconds. Implement Yaesu break-in delay level correctly using these conversion routines. (cherry picked from commit 7cbe39d5ab130eb38542332515a4573677e5ed10) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 1e1ee9b9..2bfc827c 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -3208,96 +3208,94 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PL%03d%c", fpf, cat_term); break; - case RIG_LEVEL_BKINDL: + case RIG_LEVEL_BKINDL: { + int millis; + value_t keyspd; - /* Standard: word "PARIS" == 50 Unit Intervals, UIs */ - /* 1 dot == 2 UIs */ - /* tenth_dots-per-second -to- milliseconds */ if (!newcat_valid_command(rig, "SD")) { return -RIG_ENAVAIL; } - // we don't get full resolution as long as val->i is in integer tenths - // consider changing this to float or to milliseconds - val.i *= 100; // tenths to ms conversion - - if (is_ftdx101) + // Convert 10/ths of dots to milliseconds using the current key speed + err = newcat_get_level(rig, vfo, RIG_LEVEL_KEYSPD, &keyspd); + if (err != RIG_OK) { - if (val.i <= 30) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD00;"); } - - else if (val.i <= 50) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD01;"); } - - else if (val.i <= 100) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD02;"); } - - else if (val.i <= 150) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD03;"); } - - else if (val.i <= 200) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD04;"); } + return err; + } - else if (val.i <= 250) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD05;"); } + millis = dot10ths_to_millis(val.i, keyspd.i); - else if (val.i > 2900) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD33;"); } - // this covers 300-2900 06-32 - else { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%02d;", 6 + ((val.i - 300) / 100)); } + if (is_ftdx101) + { + if (millis <= 30) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD00;"); } + else if (millis <= 50) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD01;"); } + else if (millis <= 100) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD02;"); } + else if (millis <= 150) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD03;"); } + else if (millis <= 200) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD04;"); } + else if (millis <= 250) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD05;"); } + else if (millis > 2900) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD33;"); } + else + { + // This covers 300-2900 06-32 + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%02d;", 6 + ((millis - 300) / 100)); + } } else if (is_ftdx5000) { - if (val.i < 20) + if (millis < 20) { - val.i = 20; + millis = 20; } - - if (val.i > 5000) + if (millis > 5000) { - val.i = 5000; + millis = 5000; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%04d%c", val.i, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%04d%c", millis, cat_term); } else if (is_ft950 || is_ft450 || is_ft891 || is_ft991 || is_ftdx1200 || is_ftdx3000) { - if (val.i < 30) + if (millis < 30) { - val.i = 30; + millis = 30; } - - if (val.i > 3000) + if (millis > 3000) { - val.i = 3000; + millis = 3000; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%04d%c", val.... [truncated message content] |
From: Michael B. <mdb...@us...> - 2020-11-10 05:07:05
|
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 f3cb1a09aead849dcfc25ad53c0f94e1cf5267cd (commit) via 78b469d193e194798b8ba8699b905e4810849b81 (commit) via 0f171f6aa6143659fc8eb129d932c2a6ba4624e2 (commit) via 7b8b96555aa934c586c7e93ff6a4b9d4e03085a9 (commit) via 8f3d5b5a850488b8aeed8deac9fe3dcc955bd022 (commit) via c10606ed4f79322fb1253ff2d6685ec96269864d (commit) via fdbc66b434a38a542cf8220c43dd1b3d1dddb846 (commit) via d114a5e2d669dd8a6f4c2aebc961b585c45a5a3a (commit) via b9815a41656d95649cda4d7df773f8a2d9983692 (commit) via 88cec8450cff870e981f53f632f3acf6839f2f1a (commit) via 7cbe39d5ab130eb38542332515a4573677e5ed10 (commit) via 9a60e32defa48603d42f79ca7c835ac2ae3ed64e (commit) via df5fb8d6c8501917f8cfe742c825a28f13e7cf44 (commit) via 9033fc2e783ba0b1257528ed58037778a48710f0 (commit) via 526fb218522500e2764622302fef4d77c76ab03a (commit) via 0f194c37294954ccc3283e057d018d0e12ce5123 (commit) via 0ad76ba38ae6b89934cf5f3388b2e8c26fc2bdbd (commit) via 5ba6059d2f56c030b5aef74eff96823bc0880860 (commit) from ba5ab4ba70806537f36b6eed2efd6693132b1d50 (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 f3cb1a09aead849dcfc25ad53c0f94e1cf5267cd Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Nov 9 23:06:44 2020 -0600 Add FUNC_TUNE to Flex/PowerSDR diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index 73267724..65411fbf 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -39,7 +39,7 @@ #define F6K_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_AM|RIG_MODE_FM|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB) -#define F6K_FUNC_ALL (RIG_FUNC_VOX) +#define F6K_FUNC_ALL (RIG_FUNC_VOX|RIG_FUNC_TUNER) #define F6K_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD) @@ -49,7 +49,7 @@ #define F6K_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3) /* PowerSDR differences */ -#define POWERSDR_FUNC_ALL (RIG_FUNC_VOX|RIG_FUNC_SQL|RIG_FUNC_NB|RIG_FUNC_ANF|RIG_FUNC_MUTE|RIG_FUNC_RIT|RIG_FUNC_XIT) +#define POWERSDR_FUNC_ALL (RIG_FUNC_VOX|RIG_FUNC_SQL|RIG_FUNC_NB|RIG_FUNC_ANF|RIG_FUNC_MUTE|RIG_FUNC_RIT|RIG_FUNC_XIT|RIG_FUNC_TUNER) #define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_MICGAIN|RIG_LEVEL_VOXGAIN|RIG_LEVEL_SQL|RIG_LEVEL_AF|RIG_LEVEL_AGC|RIG_LEVEL_RF|RIG_LEVEL_IF) @@ -941,6 +941,10 @@ int powersdr_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) snprintf(cmd, sizeof(cmd) - 1, "ZZSO%01d", status); break; + case RIG_FUNC_TUNER: + snprintf(cmd, sizeof(cmd) - 1, "ZZTU%01d", status); + break; + default: return kenwood_set_func(rig, vfo, func, status); } @@ -1140,7 +1144,7 @@ const struct rig_caps powersdr_caps = RIG_MODEL(RIG_MODEL_POWERSDR), .model_name = "PowerSDR/Thetis", .mfg_name = "FlexRadio/ANAN", - .version = "20201016.0", + .version = "20201108.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 78b469d193e194798b8ba8699b905e4810849b81 Merge: 9a60e32d 0f171f6a Author: Michael Black <mdb...@ya...> Date: Sun Nov 8 07:31:38 2020 -0600 Merge pull request #435 from mikaelnousiainen/yaesu-ft991-and-ftdx5000-fixes Yaesu newcat backend fixes for multiple rigs commit 0f171f6aa6143659fc8eb129d932c2a6ba4624e2 Merge: 7b8b9655 9a60e32d Author: Mikael Nousiainen <mik...@ik...> Date: Sun Nov 8 15:00:32 2020 +0200 Merge branch 'master' into yaesu-ft991-and-ftdx5000-fixes commit 7b8b96555aa934c586c7e93ff6a4b9d4e03085a9 Author: Mikael Nousiainen <mik...@ik...> Date: Sun Nov 8 13:03:48 2020 +0200 Improve handling of the ? response for Yaesu rigs diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index e58f055a..24e76019 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2920,7 +2920,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) priv->cmd_str[2] = main_sub_vfo; } - // Some Yaesu rigs reject IF shift command in AM/FM modes + // Some Yaesu rigs reject this command in AM/FM modes priv->question_mark_response_means_rejected = 1; break; @@ -2983,6 +2983,9 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "MG%03d%c", fpf, cat_term); + + // Some Yaesu rigs reject this command in RTTY modes + priv->question_mark_response_means_rejected = 1; break; case RIG_LEVEL_METER: @@ -3189,6 +3192,8 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } } + // Some Yaesu rigs reject this command in AM/FM modes + priv->question_mark_response_means_rejected = 1; break; case RIG_LEVEL_COMP: @@ -3623,9 +3628,6 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { priv->cmd_str[2] = main_sub_vfo; } - - // Some Yaesu rigs reject IF shift command in AM/FM modes - priv->question_mark_response_means_rejected = 1; break; case RIG_LEVEL_CWPITCH: @@ -3901,9 +3903,6 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) err = newcat_get_cmd(rig); - // Clear flag after executing command - priv->question_mark_response_means_rejected = 0; - if (err != RIG_OK) { return err; @@ -4413,6 +4412,8 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) priv->cmd_str[2] = main_sub_vfo; } + // Some Yaesu rigs reject this command in AM/FM modes + priv->question_mark_response_means_rejected = 1; break; case RIG_FUNC_MN: @@ -4429,6 +4430,8 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) priv->cmd_str[2] = main_sub_vfo; } + // Some Yaesu rigs reject this command in AM/FM modes + priv->question_mark_response_means_rejected = 1; break; case RIG_FUNC_FBKIN: @@ -4533,6 +4536,8 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) priv->cmd_str[2] = main_sub_vfo; } + // Some Yaesu rigs reject this command in AM/FM modes + priv->question_mark_response_means_rejected = 1; break; case RIG_FUNC_COMP: @@ -4601,7 +4606,12 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) return -RIG_EINVAL; } - return newcat_set_cmd(rig); + err = newcat_set_cmd(rig); + + // Clear flag after executing command + priv->question_mark_response_means_rejected = 0; + + return err; } @@ -8363,18 +8373,25 @@ int newcat_get_cmd(RIG *rig) break; /* retry */ case '?': - if (priv->question_mark_response_means_rejected) - { - /* Some commands, like MR and MC return "?;" when choosing a channel that doesn't exist */ - rig_debug(RIG_DEBUG_ERR, "%s: Command rejected: '%s'\n", __func__, - priv->cmd_str); - return -RIG_ERJCTED; - } - - /* Rig busy wait please */ - rig_debug(RIG_DEBUG_ERR, "%s: Rig busy\n", __func__); - rc = -RIG_BUSBUSY; - break; /* retry read only */ + /* The ? response is ambiguous and undocumented by Yaesu, but for get commands it seems to + * indicate that the rig rejected the command because the state of the rig is not valid for the command + * or that the command parameter is invalid. Retrying the command does not fix the issue, + * as the error is caused by the an invalid combination of rig state. + * + * For example, the following cases have been observed: + * - MR and MC commands are rejected when referring to an _empty_ memory channel even + * if the channel number is in a valid range + * - BC (ANF) and RL (NR) commands fail in AM/FM modes, because they are + * supported only in SSB/CW/RTTY modes + * - MG (MICGAIN) command fails in RTTY mode, as it's a digital mode + * + * There are many more cases like these and they vary by rig model. + * + * So far, "rig busy" type situations with the ? response have not been observed for get commands. + */ + rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig: '%s'\n", __func__, + priv->cmd_str); + return -RIG_ERJCTED; } continue; @@ -8494,10 +8511,25 @@ int newcat_set_cmd(RIG *rig) break; /* retry */ case '?': + /* The ? response is ambiguous and undocumented by Yaesu. For set commands it seems to indicate: + * 1) either that the rig is busy and the command needs to be retried + * 2) or that the rig rejected the command because the state of the rig is not valid for the command + * or that the command parameter is invalid. Retrying the command does not fix the issue + * in this case, as the error is caused by the an invalid combination of rig state. + * The latter case is consistent with behaviour of get commands. + * + * For example, the following cases have been observed: + * - MR and MC commands are rejected when referring to an _empty_ memory channel even + * if the channel number is in a valid range + * - BC (ANF) and RL (NR) commands fail in AM/FM modes, because they are + * supported only in SSB/CW/RTTY modes + * - MG (MICGAIN) command fails in RTTY mode, as it's a digital mode + * + * There are many more cases like these and they vary by rig model. + */ if (priv->question_mark_response_means_rejected) { - /* Some commands, like MR and MC return "?;" when choosing a channel that doesn't exist */ - rig_debug(RIG_DEBUG_ERR, "%s: Command rejected: '%s'\n", __func__, + rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig: '%s'\n", __func__, priv->cmd_str); return -RIG_ERJCTED; } commit 8f3d5b5a850488b8aeed8deac9fe3dcc955bd022 Author: Mikael Nousiainen <mik...@ik...> Date: Sun Nov 8 00:15:48 2020 +0200 Allow AMN mode on FTDX 5000 and FTDX 3000 -- the rig seems to return it regardless of documentation diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index c630173f..e58f055a 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -6573,6 +6573,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) break; case RIG_MODE_AM: + case RIG_MODE_AMN: case RIG_MODE_FM: case RIG_MODE_PKTFM: case RIG_MODE_FMN: @@ -6591,8 +6592,10 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) switch (mode) { case RIG_MODE_AM: + case RIG_MODE_AMN: case RIG_MODE_FM: case RIG_MODE_PKTFM: + case RIG_MODE_FMN: if (width < rig_passband_normal(rig, mode)) { err = newcat_set_narrow(rig, vfo, TRUE); @@ -6602,9 +6605,6 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) err = newcat_set_narrow(rig, vfo, FALSE); } return err; - - case RIG_MODE_FMN: - return RIG_OK; } } // end is_ftdx1200 and is_ftdx3000 else if (is_ftdx5000) @@ -6680,6 +6680,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) break; case RIG_MODE_AM: + case RIG_MODE_AMN: case RIG_MODE_FM: case RIG_MODE_PKTFM: case RIG_MODE_FMN: @@ -6698,8 +6699,10 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) switch (mode) { case RIG_MODE_AM: + case RIG_MODE_AMN: case RIG_MODE_FM: case RIG_MODE_PKTFM: + case RIG_MODE_FMN: if (width < rig_passband_normal(rig, mode)) { err = newcat_set_narrow(rig, vfo, TRUE); @@ -6709,9 +6712,6 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) err = newcat_set_narrow(rig, vfo, FALSE); } return err; - - case RIG_MODE_FMN: - return RIG_OK; } } // end is_ftdx5000 else if (is_ftdx101) @@ -7661,6 +7661,10 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) *width = 9000; break; + case RIG_MODE_AMN: + *width = 6000; + break; + default: return -RIG_EINVAL; } /* end switch(mode) */ @@ -7801,6 +7805,10 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) *width = 9000; break; + case RIG_MODE_AMN: + *width = 6000; + break; + default: return -RIG_EINVAL; } /* end switch(mode) */ commit c10606ed4f79322fb1253ff2d6685ec96269864d Author: Mikael Nousiainen <mik...@ik...> Date: Sun Nov 8 00:09:41 2020 +0200 Combine filters on AM/AMN and FM/FMN modes as the narrow setting changes the mode too diff --git a/rigs/yaesu/ft3000.c b/rigs/yaesu/ft3000.c index 6172bd2b..32f24550 100644 --- a/rigs/yaesu/ft3000.c +++ b/rigs/yaesu/ft3000.c @@ -185,14 +185,13 @@ const struct rig_caps ftdx3000_caps = {FTDX5000_CW_RTTY_PKT_RX_MODES, Hz(1800)}, /* Normal CW, RTTY, PKT/USER */ {FTDX5000_CW_RTTY_PKT_RX_MODES, Hz(500)}, /* Narrow CW, RTTY, PKT/USER */ {FTDX5000_CW_RTTY_PKT_RX_MODES, Hz(2400)}, /* Wide CW, RTTY, PKT/USER */ - {RIG_MODE_SSB, Hz(2400)}, /* Normal SSB */ - {RIG_MODE_SSB, Hz(1800)}, /* Narrow SSB */ - {RIG_MODE_SSB, Hz(4000)}, /* Wide SSB */ - {RIG_MODE_AM, Hz(9000)}, /* Normal AM */ - {RIG_MODE_AM, Hz(6000)}, /* Narrow AM */ - {FTDX5000_FM_WIDE_RX_MODES, Hz(16000)}, /* Normal FM */ - {FTDX5000_FM_WIDE_RX_MODES, Hz(9000)}, /* Narrow FM */ - {RIG_MODE_FMN, Hz(9000)}, /* Narrow FM */ + {RIG_MODE_SSB, Hz(2400)}, /* Normal SSB */ + {RIG_MODE_SSB, Hz(1800)}, /* Narrow SSB */ + {RIG_MODE_SSB, Hz(4000)}, /* Wide SSB */ + {FTDX5000_AM_RX_MODES, Hz(9000)}, /* Normal AM */ + {FTDX5000_AM_RX_MODES, Hz(6000)}, /* Narrow AM */ + {FTDX5000_FM_RX_MODES, Hz(16000)}, /* Normal FM */ + {FTDX5000_FM_RX_MODES, Hz(9000)}, /* Narrow FM */ {FTDX5000_CW_RTTY_PKT_RX_MODES | RIG_MODE_SSB, RIG_FLT_ANY}, RIG_FLT_END, diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c index ca94e384..cfb13e23 100644 --- a/rigs/yaesu/ft5000.c +++ b/rigs/yaesu/ft5000.c @@ -183,11 +183,10 @@ const struct rig_caps ftdx5000_caps = {RIG_MODE_SSB, Hz(2400)}, /* Normal SSB */ {RIG_MODE_SSB, Hz(1800)}, /* Narrow SSB */ {RIG_MODE_SSB, Hz(4000)}, /* Wide SSB */ - {RIG_MODE_AM, Hz(9000)}, /* Normal AM */ - {RIG_MODE_AM, Hz(6000)}, /* Narrow AM */ - {FTDX5000_FM_WIDE_RX_MODES, Hz(16000)}, /* Normal FM */ - {FTDX5000_FM_WIDE_RX_MODES, Hz(9000)}, /* Narrow FM */ - {RIG_MODE_FMN, Hz(9000)}, /* Narrow FM */ + {FTDX5000_AM_RX_MODES, Hz(9000)}, /* Normal AM */ + {FTDX5000_AM_RX_MODES, Hz(6000)}, /* Narrow AM */ + {FTDX5000_FM_RX_MODES, Hz(16000)}, /* Normal FM */ + {FTDX5000_FM_RX_MODES, Hz(9000)}, /* Narrow FM */ {FTDX5000_CW_RTTY_PKT_RX_MODES | RIG_MODE_SSB, RIG_FLT_ANY}, RIG_FLT_END, diff --git a/rigs/yaesu/ft5000.h b/rigs/yaesu/ft5000.h index 5dc021b1..7b045376 100644 --- a/rigs/yaesu/ft5000.h +++ b/rigs/yaesu/ft5000.h @@ -32,15 +32,14 @@ /* Receiver caps */ -#define FTDX5000_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|\ +#define FTDX5000_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_AMN|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|\ RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|\ RIG_MODE_FM|RIG_MODE_FMN) #define FTDX5000_SSB_CW_RX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|\ RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB) -#define FTDX5000_AM_RX_MODES (RIG_MODE_AM) -#define FTDX5000_FM_WIDE_RX_MODES (RIG_MODE_FM|RIG_MODE_PKTFM) -#define FTDX5000_FM_RX_MODES (FTDX5000_FM_WIDE_RX_MODES|RIG_MODE_FMN) +#define FTDX5000_AM_RX_MODES (RIG_MODE_AM|RIG_MODE_AMN) +#define FTDX5000_FM_RX_MODES (RIG_MODE_FM|RIG_MODE_PKTFM|RIG_MODE_FMN) #define FTDX5000_CW_RTTY_PKT_RX_MODES (RIG_MODE_RTTY|RIG_MODE_RTTYR|\ RIG_MODE_PKTUSB|RIG_MODE_PKTLSB|RIG_MODE_CW|RIG_MODE_CWR) @@ -48,7 +47,7 @@ #define FTDX5000_OTHER_TX_MODES (RIG_MODE_CW|RIG_MODE_SSB|RIG_MODE_RTTY| \ RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_FM|RIG_MODE_PKTFM|RIG_MODE_FMN) /* 100 W class */ -#define FTDX5000_AM_TX_MODES (RIG_MODE_AM) /* set 25W max */ +#define FTDX5000_AM_TX_MODES (RIG_MODE_AM|RIG_MODE_AMN) /* set 25W max */ /* TBC */ #define FTDX5000_LEVELS (RIG_LEVEL_ATT|RIG_LEVEL_PREAMP|\ commit fdbc66b434a38a542cf8220c43dd1b3d1dddb846 Author: Mikael Nousiainen <mik...@ik...> Date: Sat Nov 7 23:46:09 2020 +0200 Fix roofing filter selection bug. Get mode for RX bandwidth from function argument. diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 4e0c2eb5..c630173f 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -6941,7 +6941,7 @@ static int set_roofing_filter(RIG *rig, vfo_t vfo, int index) static int set_roofing_filter_for_width(RIG *rig, vfo_t vfo, int width) { struct newcat_priv_caps *priv_caps = (struct newcat_priv_caps *)rig->caps->priv; - int index = -1; + int index = 0; int i; rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__); @@ -6971,11 +6971,6 @@ static int set_roofing_filter_for_width(RIG *rig, vfo_t vfo, int width) index = current_filter->index; } - if (index < 0) - { - return -RIG_EINVAL; - } - return set_roofing_filter(rig, vfo, index); } @@ -7069,7 +7064,7 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) if (is_ft950 || is_ftdx5000) { // Some Yaesu rigs cannot query SH in modes such as AM/FM - switch (rig->state.current_mode) + switch (mode) { case RIG_MODE_FM: case RIG_MODE_FMN: commit d114a5e2d669dd8a6f4c2aebc961b585c45a5a3a Author: Mikael Nousiainen <mik...@ik...> Date: Sat Nov 7 23:30:34 2020 +0200 Do not query filter width using SH command with FTDX 5000 in AM/FM modes diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 7755bcf5..4e0c2eb5 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -7047,6 +7047,7 @@ 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; int err; int w; + int sh_command_valid = 1; char narrow = '!'; char cmd[] = "SH"; char main_sub_vfo = '0'; @@ -7065,19 +7066,20 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) return err; } - if (is_ft950) + if (is_ft950 || is_ftdx5000) { - // can't query SH in some modes + // Some Yaesu rigs cannot query SH in modes such as AM/FM switch (rig->state.current_mode) { - case RIG_MODE_FM: *width = 16000; break; - - case RIG_MODE_AM: *width = 9000; break; - - case RIG_MODE_AMN: *width = 6000; break; + case RIG_MODE_FM: + case RIG_MODE_FMN: + case RIG_MODE_PKTFM: + case RIG_MODE_AM: + case RIG_MODE_AMN: + case RIG_MODE_PKTAM: + sh_command_valid = 0; + break; } - - return RIG_OK; } if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) @@ -7085,45 +7087,53 @@ int newcat_get_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t *width) main_sub_vfo = (RIG_VFO_B == vfo || RIG_VFO_SUB == vfo) ? '1' : '0'; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c%c", cmd, main_sub_vfo, - cat_term); - - /* Get RX BANDWIDTH */ - if (RIG_OK != (err = newcat_get_cmd(rig))) + if (sh_command_valid) { - return err; - } + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c%c", cmd, main_sub_vfo, + cat_term); - if (strlen(priv->ret_data) == 7) - { - if (sscanf(priv->ret_data, "SH%*1d0%3d", &w) != 1) + err = newcat_get_cmd(rig); + if (err != RIG_OK) { - err = -RIG_EPROTO; + return err; } - } - else if (strlen(priv->ret_data) == 6) - { - if (sscanf(priv->ret_data, "SH%*1d%3d", &w) != 1) + + if (strlen(priv->ret_data) == 7) + { + if (sscanf(priv->ret_data, "SH%*1d0%3d", &w) != 1) + { + err = -RIG_EPROTO; + } + } + else if (strlen(priv->ret_data) == 6) { - err = -RIG_EPROTO; + if (sscanf(priv->ret_data, "SH%*1d%3d", &w) != 1) + { + err = -RIG_EPROTO; + } } + else + { + rig_debug(RIG_DEBUG_ERR, "%s: unknown SH response='%s'\n", __func__, + priv->ret_data); + return -RIG_EPROTO; + } + + if (err != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: unable to parse width from '%s'\n", __func__, + priv->ret_data); + return -RIG_EPROTO; + } + + rig_debug(RIG_DEBUG_TRACE, "%s: w=%d\n", __func__, w); } else { - rig_debug(RIG_DEBUG_ERR, "%s: unknown SH response='%s'\n", __func__, - priv->ret_data); - return -RIG_EPROTO; - } - - if (err != RIG_OK) - { - rig_debug(RIG_DEBUG_ERR, "%s: unable to parse width from '%s'\n", __func__, - priv->ret_data); - return -RIG_EPROTO; + // Some Yaesu rigs cannot query filter width using SH command in modes such as AM/FM + w = 0; } - rig_debug(RIG_DEBUG_TRACE, "%s: w=%d\n", __func__, w); - if (is_ft950) { if ((narrow = get_narrow(rig, RIG_VFO_MAIN)) < 0) commit b9815a41656d95649cda4d7df773f8a2d9983692 Author: Mikael Nousiainen <mik...@ik...> Date: Sat Nov 7 22:58:09 2020 +0200 Add RIG_FLT_ANY for FT-991 and FT-891 diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index 5c5eaaaa..3a73d4fb 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -172,6 +172,7 @@ const struct rig_caps ft891_caps = {RIG_MODE_SSB, Hz(600)}, /* SSB */ {RIG_MODE_SSB, Hz(400)}, /* SSB */ {RIG_MODE_SSB, Hz(200)}, /* SSB */ + {FT891_CW_RTTY_PKT_RX_MODES | RIG_MODE_SSB, RIG_FLT_ANY }, {RIG_MODE_AM, Hz(9000)}, /* Normal AM */ {RIG_MODE_AM, Hz(6000)}, /* Narrow AM */ {FT891_FM_RX_MODES, Hz(16000)}, /* Normal FM */ diff --git a/rigs/yaesu/ft991.c b/rigs/yaesu/ft991.c index 7f2a1858..e643c025 100644 --- a/rigs/yaesu/ft991.c +++ b/rigs/yaesu/ft991.c @@ -163,6 +163,7 @@ const struct rig_caps ft991_caps = {RIG_MODE_SSB, Hz(600)}, /* SSB */ {RIG_MODE_SSB, Hz(400)}, /* SSB */ {RIG_MODE_SSB, Hz(200)}, /* SSB */ + {FT991_CW_RTTY_PKT_RX_MODES | RIG_MODE_SSB, RIG_FLT_ANY }, {RIG_MODE_AM, Hz(9000)}, /* Normal AM */ {RIG_MODE_AMN, Hz(6000)}, /* Narrow AM */ {FT991_FM_WIDE_RX_MODES, Hz(16000)}, /* Normal FM */ commit 88cec8450cff870e981f53f632f3acf6839f2f1a Author: Mikael Nousiainen <mik...@ik...> Date: Sat Nov 7 19:47:08 2020 +0200 Handle Yaesu rigs rejecting IF shift command without retries diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 2bfc827c..7755bcf5 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2920,6 +2920,8 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) priv->cmd_str[2] = main_sub_vfo; } + // Some Yaesu rigs reject IF shift command in AM/FM modes + priv->question_mark_response_means_rejected = 1; break; case RIG_LEVEL_CWPITCH: { @@ -3526,7 +3528,12 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) return -RIG_EINVAL; } - return newcat_set_cmd(rig); + err = newcat_set_cmd(rig); + + // Clear flag after executing command + priv->question_mark_response_means_rejected = 0; + + return err; } @@ -3616,6 +3623,9 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { priv->cmd_str[2] = main_sub_vfo; } + + // Some Yaesu rigs reject IF shift command in AM/FM modes + priv->question_mark_response_means_rejected = 1; break; case RIG_LEVEL_CWPITCH: @@ -3889,7 +3899,12 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return -RIG_EINVAL; } - if (RIG_OK != (err = newcat_get_cmd(rig))) + err = newcat_get_cmd(rig); + + // Clear flag after executing command + priv->question_mark_response_means_rejected = 0; + + if (err != RIG_OK) { return err; } commit 7cbe39d5ab130eb38542332515a4573677e5ed10 Author: Mikael Nousiainen <mik...@ik...> Date: Sat Nov 7 15:03:54 2020 +0200 Add routines to convert between morse code dot duration and milliseconds. Implement Yaesu break-in delay level correctly using these conversion routines. diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 1e1ee9b9..2bfc827c 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -3208,96 +3208,94 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "PL%03d%c", fpf, cat_term); break; - case RIG_LEVEL_BKINDL: + case RIG_LEVEL_BKINDL: { + int millis; + value_t keyspd; - /* Standard: word "PARIS" == 50 Unit Intervals, UIs */ - /* 1 dot == 2 UIs */ - /* tenth_dots-per-second -to- milliseconds */ if (!newcat_valid_command(rig, "SD")) { return -RIG_ENAVAIL; } - // we don't get full resolution as long as val->i is in integer tenths - // consider changing this to float or to milliseconds - val.i *= 100; // tenths to ms conversion - - if (is_ftdx101) + // Convert 10/ths of dots to milliseconds using the current key speed + err = newcat_get_level(rig, vfo, RIG_LEVEL_KEYSPD, &keyspd); + if (err != RIG_OK) { - if (val.i <= 30) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD00;"); } - - else if (val.i <= 50) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD01;"); } - - else if (val.i <= 100) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD02;"); } - - else if (val.i <= 150) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD03;"); } - - else if (val.i <= 200) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD04;"); } + return err; + } - else if (val.i <= 250) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD05;"); } + millis = dot10ths_to_millis(val.i, keyspd.i); - else if (val.i > 2900) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD33;"); } - // this covers 300-2900 06-32 - else { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%02d;", 6 + ((val.i - 300) / 100)); } + if (is_ftdx101) + { + if (millis <= 30) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD00;"); } + else if (millis <= 50) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD01;"); } + else if (millis <= 100) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD02;"); } + else if (millis <= 150) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD03;"); } + else if (millis <= 200) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD04;"); } + else if (millis <= 250) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD05;"); } + else if (millis > 2900) { snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD33;"); } + else + { + // This covers 300-2900 06-32 + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%02d;", 6 + ((millis - 300) / 100)); + } } else if (is_ftdx5000) { - if (val.i < 20) + if (millis < 20) { - val.i = 20; + millis = 20; } - - if (val.i > 5000) + if (millis > 5000) { - val.i = 5000; + millis = 5000; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%04d%c", val.i, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%04d%c", millis, cat_term); } else if (is_ft950 || is_ft450 || is_ft891 || is_ft991 || is_ftdx1200 || is_ftdx3000) { - if (val.i < 30) + if (millis < 30) { - val.i = 30; + millis = 30; } - - if (val.i > 3000) + if (millis > 3000) { - val.i = 3000; + millis = 3000; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%04d%c", val.i, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%04d%c", millis, cat_term); } else if (is_ft2000 || is_ftdx9000) { - if (val.i < 0) + if (millis < 0) { - val.i = 0; + millis = 0; } - - if (val.i > 5000) + if (millis > 5000) { - val.i = 5000; + millis = 5000; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%04d%c", val.i, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%04d%c", millis, cat_term); } else // default { - if (val.i < 1) + if (millis < 1) { - val.i = 1; + millis = 1; } - - if (val.i > 5000) + if (millis > 5000) { - val.i = 5000; + millis = 5000; } - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%04d%c", val.i, cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%04d%c", millis, cat_term); } break; + } case RIG_LEVEL_SQL: if (!newcat_valid_command(rig, "SQ")) @@ -3711,7 +3709,6 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return -RIG_ENAVAIL; } - /* should be tenth of dots */ snprintf(priv->cmd_str, sizeof(priv->cmd_str), "SD%c", cat_term); break; @@ -4094,49 +4091,42 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->f = (float)atoi(retlvl) / scale; break; - case RIG_LEVEL_BKINDL: - val->i = atoi(retlvl); /* milliseconds */ + case RIG_LEVEL_BKINDL: { + int raw_value = atoi(retlvl); + int millis; + value_t keyspd; if (is_ftdx101) { - switch (val->i) + switch (raw_value) { - case 0: val->i = 1; break; - - case 1: val->i = 1; break; - - case 2: val->i = 1; break; - - case 3: val->i = 2; break; - - case 4: val->i = 2; break; - - case 5: val->i = 3; break; - - case 6: val->i = 3; break; - - default: val->i = (val->i - 6) + 3; + case 0: millis = 30; break; + case 1: millis = 50; break; + case 2: millis = 100; break; + case 3: millis = 150; break; + case 4: millis = 200; break; + case 5: millis = 250; break; + case 6: millis = 300; break; + default: + millis = (raw_value - 6) * 100 + 300; } - - return RIG_OK; } - - if (val->i < 1) + else { - val->i = 1; + // The rest of Yaesu rigs indicate break-in delay directly as milliseconds + millis = raw_value; } - // The rest of Yaesu rigs indicate break-in delay directly as milliseconds - // TODO: Fix BKINDL conversion from milliseconds ??? - val->i = 5000 / val->i; /* ms -to- tenth_dots-per-second */ - - if (val->i < 1) + // Convert milliseconds to 10/ths of dots using the current key speed + err = newcat_get_level(rig, vfo, RIG_LEVEL_KEYSPD, &keyspd); + if (err != RIG_OK) { - val->i = 1; + return err; } + val->i = millis_to_dot10ths(millis, keyspd.i); break; - + } case RIG_LEVEL_STRENGTH: if (rig->caps->str_cal.size > 0) { @@ -4149,17 +4139,27 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { val->i = round(rig_raw2val(atoi(retlvl), &yaesu_default_str_cal)); } - else // some Yaesu rigs return straight s-meter answers + else { + // Some Yaesu rigs return straight S-meter answers // Return dbS9 -- does >S9 mean 10dB increments? If not, add to rig driver - if (val->i > 0) { val->i = (atoi(retlvl) - 9) * 10; } - else { val->i = (atoi(retlvl) - 9) * 6; } // Return dbS9 does >S9 mean 10dB increments? + if (val->i > 0) + { + val->i = (atoi(retlvl) - 9) * 10; + } + else + { + val->i = (atoi(retlvl) - 9) * 6; + } } break; case RIG_LEVEL_RAWSTR: case RIG_LEVEL_KEYSPD: + val->i = atoi(retlvl); + break; + case RIG_LEVEL_IF: // IS00+0400 rig_debug(RIG_DEBUG_TRACE, "%s: ret_data=%s(%d), retlvl=%s\n", __func__, @@ -4183,9 +4183,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_NR: - - /* ratio 0 - 1.0 */ - if (newcat_is_rig(rig, RIG_MODEL_FT450)) + if (is_ft450) { val->f = (float)(atoi(retlvl) / 11.); } diff --git a/src/misc.c b/src/misc.c index b867c9f3..d4f5e681 100644 --- a/src/misc.c +++ b/src/misc.c @@ -49,6 +49,7 @@ #endif #include <unistd.h> +#include <math.h> #include <hamlib/rig.h> #include <hamlib/amplifier.h> @@ -230,6 +231,48 @@ unsigned long long HAMLIB_API from_bcd_be(const unsigned char bcd_data[], return f; } +/** + * \brief Convert duration of one morse code dot (element) to milliseconds at the given speed. + * \param wpm morse code speed in words per minute + * \return double duration in milliseconds + * + * The morse code speed is calculated using the standard based on word PARIS. + * + * "If you send PARIS 5 times in a minute (5WPM) you have sent 250 elements (using correct spacing). + * 250 elements into 60 seconds per minute = 240 milliseconds per element." + * + * Source: http://kent-engineers.com/codespeed.htm + */ +double morse_code_dot_to_millis(int wpm) +{ + return 240.0 * (5.0 / (double) wpm); +} + +/** + * \brief Convert duration of tenths of morse code dots to milliseconds at the given speed. + * \param tenths_of_dots number of 1/10ths of dots + * \param wpm morse code speed in words per minute + * \return int duration in milliseconds + * + * The morse code speed is calculated using the standard based on word PARIS. + */ +int dot10ths_to_millis(int dot10ths, int wpm) +{ + return ceil(morse_code_dot_to_millis(wpm) * (double) dot10ths / 10.0); +} + +/** + * \brief Convert duration in milliseconds to tenths of morse code dots at the given speed. + * \param millis duration in milliseconds + * \param wpm morse code speed in words per minute + * \return int number of 1/10ths of dots + * + * The morse code speed is calculated using the standard based on word PARIS. + */ +int millis_to_dot10ths(int millis, int wpm) +{ + return ceil(millis / morse_code_dot_to_millis(wpm) * 10.0); +} //! @cond Doxygen_Suppress #ifndef llabs diff --git a/src/misc.h b/src/misc.h index 5378f1da..de88ec68 100644 --- a/src/misc.h +++ b/src/misc.h @@ -72,6 +72,10 @@ extern HAMLIB_EXPORT(unsigned long long) from_bcd_be(const unsigned char bcd_data[], unsigned bcd_len); +extern HAMLIB_EXPORT(double) morse_code_dot_to_millis(int wpm); +extern HAMLIB_EXPORT(int) dot10ths_to_millis(int dot10ths, int wpm); +extern HAMLIB_EXPORT(int) millis_to_dot10ths(int millis, int wpm); + extern HAMLIB_EXPORT(int) sprintf_freq(char *str, freq_t); /* flag that determines if AI mode should be restored on exit on commit 9a60e32defa48603d42f79ca7c835ac2ae3ed64e Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Nov 7 06:45:47 2020 -0600 Fix max macro in kenwood.c -- wasn't being used anyways diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 0565508d..473ff0b2 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -42,7 +42,7 @@ #include "ts990s.h" #ifndef max -#define max(a,b) (((a) (b)) ? (a) : (b)) +#define max(a,b) (((a) > (b)) ? (a) : (b)) #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif commit df5fb8d6c8501917f8cfe742c825a28f13e7cf44 Author: Mikael Nousiainen <mik...@ik...> Date: Fri Nov 6 23:48:49 2020 +0200 Set narrow filter mode correctly for Yaesu rigs that support it to allow setting DSP filter width correctly. Handle setting of roofing filter and narrow mode for AM/FM modes. diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index a5e1d658..1e1ee9b9 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -6179,6 +6179,13 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_RTTYR: case RIG_MODE_CW: case RIG_MODE_CWR: + // Narrow mode must be chosen correctly before filter width + err = newcat_set_narrow(rig, vfo, width <= 500 ? TRUE : FALSE); + if (err != RIG_OK) + { + return err; + } + if (width == RIG_PASSBAND_NORMAL) { w = 0; } else if (width <= 100) { w = 3; } else if (width <= 200) { w = 4; } @@ -6195,6 +6202,13 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_LSB: case RIG_MODE_USB: + // Narrow mode must be chosen correctly before filter width + err = newcat_set_narrow(rig, vfo, width <= 1800 ? TRUE : FALSE); + if (err != RIG_OK) + { + return err; + } + if (width == RIG_PASSBAND_NORMAL) { w = 0; } else if (width <= 200) { w = 1; } else if (width <= 400) { w = 2; } @@ -6218,6 +6232,24 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else { w = 20; } // 3000 Hz break; + case RIG_MODE_AM: + case RIG_MODE_FM: + case RIG_MODE_PKTFM: + case RIG_MODE_FMN: + // Set roofing filter and narrow mode + break; + + default: + return -RIG_EINVAL; + } // end switch(mode) + + if ((err = set_roofing_filter_for_width(rig, vfo, width)) != RIG_OK) + { + return err; + } + + switch (mode) + { case RIG_MODE_AM: case RIG_MODE_FM: case RIG_MODE_PKTFM: @@ -6232,15 +6264,7 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) return err; case RIG_MODE_FMN: - break; - - default: - return -RIG_EINVAL; - } // end switch(mode) - - if ((err = set_roofing_filter_for_width(rig, vfo, width)) != RIG_OK) - { - return err; + return RIG_OK; } } // end is_ft950 */ else if (is_ft891) @@ -6253,6 +6277,13 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_RTTYR: case RIG_MODE_CW: case RIG_MODE_CWR: + // Narrow mode must be chosen correctly before filter width + err = newcat_set_narrow(rig, vfo, width <= 500 ? TRUE : FALSE); + if (err != RIG_OK) + { + return err; + } + if (width == RIG_PASSBAND_NORMAL) { w = 0; } else if (width <= 50) { w = 1; } else if (width <= 100) { w = 2; } @@ -6275,6 +6306,13 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_LSB: case RIG_MODE_USB: + // Narrow mode must be chosen correctly before filter width + err = newcat_set_narrow(rig, vfo, width <= 1800 ? TRUE : FALSE); + if (err != RIG_OK) + { + return err; + } + if (width == RIG_PASSBAND_NORMAL) { w = 0; } else if (width <= 200) { w = 1; } else if (width <= 400) { w = 2; } @@ -6329,6 +6367,13 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_RTTYR: case RIG_MODE_CW: case RIG_MODE_CWR: + // Narrow mode must be chosen correctly before filter width + err = newcat_set_narrow(rig, vfo, width <= 500 ? TRUE : FALSE); + if (err != RIG_OK) + { + return err; + } + if (width == RIG_PASSBAND_NORMAL) { w = 0; } else if (width <= 50) { w = 1; } else if (width <= 100) { w = 2; } @@ -6351,6 +6396,13 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_LSB: case RIG_MODE_USB: + // Narrow mode must be chosen correctly before filter width + err = newcat_set_narrow(rig, vfo, width <= 1800 ? TRUE : FALSE); + if (err != RIG_OK) + { + return err; + } + if (width == RIG_PASSBAND_NORMAL) { w = 0; } else if (width <= 200) { w = 1; } else if (width <= 400) { w = 2; } @@ -6444,6 +6496,13 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_RTTYR: case RIG_MODE_CW: case RIG_MODE_CWR: + // Narrow mode must be chosen correctly before filter width + err = newcat_set_narrow(rig, vfo, width <= 500 ? TRUE : FALSE); + if (err != RIG_OK) + { + return err; + } + if (width == RIG_PASSBAND_NORMAL) { w = 0; } else if (width <= 50) { w = 1; } else if (width <= 100) { w = 2; } @@ -6465,6 +6524,13 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_LSB: case RIG_MODE_USB: + // Narrow mode must be chosen correctly before filter width + err = newcat_set_narrow(rig, vfo, width <= 1800 ? TRUE : FALSE); + if (err != RIG_OK) + { + return err; + } + if (width == RIG_PASSBAND_NORMAL) { w = 0; } else if (width <= 200) { w = 1; } else if (width <= 400) { w = 2; } @@ -6493,6 +6559,24 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else { w = 25; } // 4000 Hz break; + case RIG_MODE_AM: + case RIG_MODE_FM: + case RIG_MODE_PKTFM: + case RIG_MODE_FMN: + // Set roofing filter and narrow mode + break; + + default: + return -RIG_EINVAL; + } // end switch(mode) + + if ((err = set_roofing_filter_for_width(rig, vfo, width)) != RIG_OK) + { + return err; + } + + switch (mode) + { case RIG_MODE_AM: case RIG_MODE_FM: case RIG_MODE_PKTFM: @@ -6506,13 +6590,8 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) } return err; - default: - return -RIG_EINVAL; - } // end switch(mode) - - if ((err = set_roofing_filter_for_width(rig, vfo, width)) != RIG_OK) - { - return err; + case RIG_MODE_FMN: + return RIG_OK; } } // end is_ftdx1200 and is_ftdx3000 else if (is_ftdx5000) @@ -6525,6 +6604,13 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_RTTYR: case RIG_MODE_CW: case RIG_MODE_CWR: + // Narrow mode must be chosen correctly before filter width + err = newcat_set_narrow(rig, vfo, width <= 500 ? TRUE : FALSE); + if (err != RIG_OK) + { + return err; + } + if (width == RIG_PASSBAND_NORMAL) { w = 0; } else if (width <= 50) { w = 1; } else if (width <= 100) { w = 2; } @@ -6546,6 +6632,13 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) case RIG_MODE_LSB: case RIG_MODE_USB: + // Narrow mode must be chosen correctly before filter width + err = newcat_set_narrow(rig, vfo, width <= 1800 ? TRUE : FALSE); + if (err != RIG_OK) + { + return err; + } + if (width == RIG_PASSBAND_NORMAL) { w = 0; } else if (width <= 200) { w = 1; } else if (width <= 400) { w = 2; } @@ -6573,6 +6666,24 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else { w = 25; } // 4000 Hz break; + case RIG_MODE_AM: + case RIG_MODE_FM: + case RIG_MODE_PKTFM: + case RIG_MODE_FMN: + // Set roofing filter and narrow mode + break; + + default: + return -RIG_EINVAL; + } // end switch(mode) + + if ((err = set_roofing_filter_for_width(rig, vfo, width)) != RIG_OK) + { + return err; + } + + switch (mode) + { case RIG_MODE_AM: case RIG_MODE_FM: case RIG_MODE_PKTFM: @@ -6585,11 +6696,9 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) err = newcat_set_narrow(rig, vfo, FALSE); } return err; - } // end switch(mode) - if ((err = set_roofing_filter_for_width(rig, vfo, width)) != RIG_OK) - { - return err; + case RIG_MODE_FMN: + return RIG_OK; } } // end is_ftdx5000 else if (is_ftdx101) @@ -6650,12 +6759,43 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) else if (width <= 3500) { w = 22; } else { w = 23; } // 4000Hz break; + + case RIG_MODE_AM: + case RIG_MODE_AMN: + case RIG_MODE_FM: + case RIG_MODE_PKTFM: + case RIG_MODE_FMN: + // Set roofing filter and narrow mode + break; + + default: + return -RIG_EINVAL; } // end switch(mode) if ((err = set_roofing_filter_for_width(rig, vfo, width)) != RIG_OK) { return err; } + + switch (mode) + { + case RIG_MODE_AM: + case RIG_MODE_FM: + case RIG_MODE_PKTFM: + if (width < rig_passband_normal(rig, mode)) + { + err = newcat_set_narrow(rig, vfo, TRUE); + } + else + { + err = newcat_set_narrow(rig, vfo, FALSE); + } + return err; + + case RIG_MODE_AMN: + case RIG_MODE_FMN: + return RIG_OK; + } } // end is_ftdx101 else { @@ -6694,9 +6834,12 @@ int newcat_set_rx_bandwidth(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) } return err; + case RIG_MODE_FMN: + return RIG_OK; + default: return -RIG_EINVAL; - } /* end switch(mode) */ + } /* end switch(mode) */ } /* end else */ commit 9033fc2e783ba0b1257528ed58037778a48710f0 Author: Mikael Nousiainen <mik...@ik...> Date: Fri Nov 6 11:02:36 2020 +0200 Fix default filter width diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c index 885bc151..ca94e384 100644 --- a/rigs/yaesu/ft5000.c +++ b/rigs/yaesu/ft5000.c @@ -177,7 +177,7 @@ const struct rig_caps ftdx5000_caps = /* mode/filter list, .remember = order matters! */ .filters = { - {FTDX5000_CW_RTTY_PKT_RX_MODES, Hz(1800)}, /* Normal CW, RTTY, PKT/USER */ + {FTDX5000_CW_RTTY_PKT_RX_MODES, Hz(1700)}, /* Normal CW, RTTY, PKT/USER */ {FTDX5000_CW_RTTY_PKT_RX_MODES, Hz(500)}, /* Narrow CW, RTTY, PKT/USER */ {FTDX5000_CW_RTTY_PKT_RX_MODES, Hz(2400)}, /* Wide CW, RTTY, PKT/USER */ {RIG_MODE_SSB, Hz(2400)}, /* Normal SSB */ commit 526fb218522500e2764622302fef4d77c76ab03a Author: Mikael Nousiainen <mik...@ik...> Date: Fri Nov 6 10:35:21 2020 +0200 Add RX filter choices for FTDX 5000 and FTDX 3000. Go through the rest of the filter definitions and try to unify and fix any bugs. Add roofing filter support for FT-950 and FT-2000. diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 8a27d782..f0dbd038 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -495,7 +495,7 @@ typedef unsigned int vfo_t; * \brief Macro for bandpass to be set to normal * \def RIG_PASSBAND_NORMAL */ -#define RIG_PASSBAND_NORMAL s_Hz(0) // was 0 but collided with Yasue SH00; capability +#define RIG_PASSBAND_NORMAL s_Hz(0) // was 0 but collided with Yaesu SH00; capability /** * \brief Macro for bandpass to be left alone diff --git a/rigs/yaesu/ft1200.c b/rigs/yaesu/ft1200.c index dcaa1061..14dacd3f 100644 --- a/rigs/yaesu/ft1200.c +++ b/rigs/yaesu/ft1200.c @@ -174,12 +174,11 @@ const struct rig_caps ftdx1200_caps = {FTDX1200_FM_RX_MODES, kHz(1)}, /* Fast */ RIG_TS_END, - }, /* mode/filter list, .remember = order matters! */ .filters = { - {FTDX1200_CW_RTTY_PKT_RX_MODES, Hz(2400)}, /* Normal CW, RTTY, PKT/USER */ + {FTDX1200_CW_RTTY_PKT_RX_MODES, Hz(1800)}, /* Normal CW, RTTY, PKT/USER */ {FTDX1200_CW_RTTY_PKT_RX_MODES, Hz(500)}, /* Narrow CW, RTTY, PKT/USER */ {FTDX1200_CW_RTTY_PKT_RX_MODES, Hz(2400)}, /* Wide CW, RTTY, PKT/USER */ {RIG_MODE_SSB, Hz(2400)}, /* Normal SSB */ @@ -187,8 +186,10 @@ const struct rig_caps ftdx1200_caps = {RIG_MODE_SSB, Hz(4000)}, /* Wide SSB */ {RIG_MODE_AM, Hz(9000)}, /* Normal AM */ {RIG_MODE_AM, Hz(6000)}, /* Narrow AM */ - {FTDX1200_FM_RX_MODES, Hz(12000)}, /* Normal FM */ - {FTDX1200_FM_RX_MODES, Hz(8000)}, /* Narrow FM */ + {FTDX1200_FM_WIDE_RX_MODES, Hz(16000)}, /* Normal FM */ + {FTDX1200_FM_WIDE_RX_MODES, Hz(9000)}, /* Narrow FM */ + {RIG_MODE_FMN, Hz(9000)}, /* Narrow FM */ + {FTDX1200_CW_RTTY_PKT_RX_MODES | RIG_MODE_SSB, RIG_FLT_ANY}, RIG_FLT_END, }, diff --git a/rigs/yaesu/ft1200.h b/rigs/yaesu/ft1200.h index 7910be05..88afd85d 100644 --- a/rigs/yaesu/ft1200.h +++ b/rigs/yaesu/ft1200.h @@ -34,12 +34,13 @@ /* Receiver caps */ #define FTDX1200_ALL_RX_MODES (RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|\ - RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|RIG_MODE_FM) + RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB|RIG_MODE_PKTFM|RIG_MODE_FM|RIG_MODE_FMN) #define FTDX1200_SSB_CW_RX_MODES (RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|\ RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_PKTLSB|RIG_MODE_PKTUSB) #define FTDX1200_AM_RX_MODES (RIG_MODE_AM) -#define FTDX1200_FM_RX_MODES (RIG_MODE_FM|RIG_MODE_PKTFM) +#define FTDX1200_FM_WIDE_RX_MODES (RIG_MODE_FM|RIG_MODE_PKTFM) +#define FTDX1200_FM_RX_MODES (FTDX1200_FM_WIDE_RX_MODES|RIG_MODE_FMN) #define FTDX1200_CW_RTTY_PKT_RX_MODES (RIG_MODE_RTTY|RIG_MODE_RTTYR|\ RIG_MODE_PKTUSB|RIG_MODE_PKTLSB|RIG_MODE_CW|RIG_MODE_CWR) diff --git a/rigs/yaesu/ft2000.c b/rigs/yaesu/ft2000.c index 32521f45..af7a73d6 100644 --- a/rigs/yaesu/ft2000.c +++ b/rigs/yaesu/ft2000.c @@ -40,12 +40,49 @@ #include "idx_builtin.h" #include "tones.h" +const struct newcat_priv_caps ft2000_priv_caps = +{ + .roofing_filter_count = 7, + .roofing_filters = + { + // The index must match ext level combo index + { .index = 0, .set_value = '0', .get_value = 0, .width = 15000, .optional = 0 }, + { .index = 1, .set_value = '1', .get_value = '1', .width = 15000, .optional = 0 }, + { .index = 2, .set_value = '2', .get_value = '2', .width = 6000, .optional = 0 }, + { .index = 3, .set_value = '3', .get_value = '3', .width = 3000, .optional = 0 }, + { .index = 4, .set_value = 0, .get_value = '4', .width = 15000, .optional = 0 }, + { .index = 5, .set_value = 0, .get_value = '5', .width = 6000, .optional = 0 }, + { .index = 6, .set_value = 0, .get_value = '6', .width = 3000, .optional = 0 }, + } +}; + +const struct confparams ft2000_ext_levels[] = +{ + { + TOK_ROOFING_FILTER, + "ROOFINGFILTER", + "Roofing filter", + "Roofing filter", + NULL, + RIG_CONF_COMBO, + { .c = { .combostr = { + "AUTO", "15 kHz", "6 kHz", "3 kHz", + "AUTO - 15 kHz", "AUTO - 6 kHz", "AUTO - 3 kHz", + NULL } + } } + }, + { RIG_CONF_END, NULL, } +}; + +int ft2000_ext_tokens[] = +{ + TOK_ROOFING_FILTER, TOK_BACKEND_NONE +}; + + /* - * ft2000 rigs capabilities. - * Also this struct is READONLY! - * + * FT-2000 rig capabilities */ - const struct rig_caps ft2000_caps = { RIG_MODEL(RIG_MODEL_FT2000), @@ -140,7 +177,6 @@ const struct rig_caps ft2000_caps = {FT2000_FM_RX_MODES, kHz(1)}, /* Fast */ RIG_TS_END, - }, /* mode/filter list, .remember = order matters! */ @@ -159,7 +195,10 @@ const struct rig_caps ft2000_caps = RIG_FLT_END, }, - .priv = NULL, + .ext_tokens = ft2000_ext_tokens, + .extlevels = ft2000_ext_levels, + + .priv = &ft2000_priv_caps, .rig_init = newcat_init, .rig_cleanup = newcat_cleanup, @@ -209,5 +248,7 @@ const struct rig_caps ft2000_caps = .get_trn = newcat_get_trn, .set_channel = newcat_set_channel, .get_channel = newcat_get_channel, + .set_ext_level = newcat_set_ext_level, + .get_ext_level = newcat_get_ext_level, }; diff --git a/rigs/yaesu/ft3000.c b/rigs/yaesu/ft3000.c index fcfa6789..6172bd2b 100644 --- a/rigs/yaesu/ft3000.c +++ b/rigs/yaesu/ft3000.c @@ -178,7 +178,6 @@ const struct rig_caps ftdx3000_caps = {FTDX5000_FM_RX_MODES, kHz(1)}, /* Fast */ RIG_TS_END, - }, /* mode/filter list, .remember = order matters! */ @@ -188,11 +187,13 @@ const struct rig_caps ftdx3000_caps = {FTDX5000_CW_RTTY_PKT_RX_MODES, Hz(2400)}, /* Wide CW, RTTY, PKT/USER */ {RIG_MODE_SSB, Hz(2400)}, /* Normal SSB */ {RIG_MODE_SSB, Hz(1800)}, /* Narrow SSB */ - {RIG_MODE_SSB, Hz(3000)}, /* Wide SSB */ + {RIG_MODE_SSB, Hz(4000)}, /* Wide SSB */ {RIG_MODE_AM, Hz(9000)}, /* Normal AM */ {RIG_MODE_AM, Hz(6000)}, /* Narrow AM */ - {FTDX5000_FM_RX_MODES, Hz(15000)}, /* Normal FM */ - {FTDX5000_FM_RX_MODES, Hz(8000)}, /* Narrow FM */ + {FTDX5000_FM_WIDE_RX_MODES, Hz(16000)}, /* Normal FM */ + {FTDX5000_FM_WIDE_RX_MODES, Hz(9000)}, /* Narrow FM */ + {RIG_MODE_FMN, Hz(9000)}, /* Narrow FM */ + {FTDX5000_CW_RTTY_PKT_RX_MODES | RIG_MODE_SSB, RIG_FLT_ANY}, RIG_FLT_END, }, diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c index d8d53cf1..885bc151 100644 --- a/rigs/yaesu/ft5000.c +++ b/rigs/yaesu/ft5000.c @@ -173,7 +173,6 @@ const struct rig_caps ftdx5000_caps = {FTDX5000_FM_RX_MODES, kHz(1)}, /* Fast */ RIG_TS_END, - }, /* mode/filter list, .remember = order matters! */ @@ -183,11 +182,13 @@ const struct rig_caps ftdx5000_caps = {FTDX5000_CW_RTTY_PKT_RX_MODES, Hz(2400)}, /* Wide CW, RTTY, PKT/USER */ {RIG_MODE_SSB, Hz(2400)}, /* Normal SSB */ {RIG_MODE_SSB, Hz(1800)}, /* Narrow SSB */ - {RIG_MODE_SSB, Hz(3000)}, /* Wide SSB */ + {RIG_MODE_SSB, Hz(4000)}, /* Wide SSB */ {RIG_MODE_AM, Hz(9000)}, /* Normal AM */ {RIG_MODE_AM, Hz(6000)}, /* Narrow AM */ - {FTDX5000_FM_RX_MODES, Hz(15000)}, /* Normal FM */ - {FTDX5000_FM_RX_MODES, Hz(8000)}, /* Narrow FM */ + {FTDX5000_FM_WIDE_RX_MODES, Hz(16000)}, /* Normal FM */ + {FTDX5000_FM_WIDE_RX_MODES, Hz(9000)}, /* Narrow FM */ + {RIG_MODE_FMN, Hz(9000)}, /* Narrow FM */ + {FTDX5000_CW_RTTY_PKT_RX_MODES | RIG_MODE_SSB, RIG_FLT_ANY}, RIG_FLT_END, }, diff --git a/rigs/yaesu/ft5000.h b/rigs/yaesu/ft5000.h index 59f6c892..5dc021b1 100644 --- a/rigs/yaesu/ft5000.h +++ b/rigs/yaesu/ft5000.h @@ -39,7 +39,8 @@ #define FTDX5000_SSB_CW_RX_MODES (RI... [truncated message content] |
From: Michael B. <mdb...@us...> - 2020-11-03 18:35: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 ba5ab4ba70806537f36b6eed2efd6693132b1d50 (commit) via 11058e63ff99ac345342b64e743e73ac746bb0fa (commit) via 20fc303686ee4fdb94d20d746936fd1249d091ec (commit) via 072cd6107f55a45acfd32abd2999c0698fda357f (commit) via 51b4e0966c56b4b8b1cfcef897b30e7a9bbc9752 (commit) via 335a75518c2690f8adcd52e00bdd14112ebc0ec8 (commit) via ccdeffbcd82b4ca7ac96e1c6436cf04d36f3320b (commit) via fd9e5d841b63675df33350fbec5f885c8e90fb95 (commit) via 5721db70be80957797162271c84629280bc06edf (commit) via 74356b3a99c836bbcb3f784ce2f39284a02cfb0b (commit) via fe672e8115de4bd557498e26bfb199e196548e20 (commit) via 06cc95de56dcb3fcb58f79e88c75387437416773 (commit) via f55d50c7bcfc5a32e6a9fa7c6c0ab21e2a2791a8 (commit) via c8eaafb499948cb28ea41205dbd4b81ae0d76a90 (commit) via 07447c881d8efd68205f06a183fab08cb09372ce (commit) via 73d05831f3e896c5b336f1588bcb643c2a4f821a (commit) via 378cbfb0082cfd02fcfff740f56afdedf21dd225 (commit) via 0fef98fc43c37c9da7ccea2cd29123aa30ae29b9 (commit) via ce7a30f038417be93507b44f5aa1ff723aa5ac80 (commit) via 9f65348f496cdb4325a5ff916e0d8a30637a7aba (commit) via 31b20c003cc1b4025fff51a85d76468dbfd22031 (commit) via bd47d262b8e415e04a569126a31406641b9d8ea3 (commit) via cc529aab0cd57347a562d1cc3ca040400ed5afbf (commit) via aeabe40acde2fb7a86e204bcde7d707bc41e8f8a (commit) via 06f99b9a630adbd5ce87def21dae3175143e166f (commit) via b1c5a2b9ccb7034d819881de05d29a80b2d1fdc6 (commit) via 0e1fd6e6f9a331ecc515f4b3d153fcd85ac4d293 (commit) via 3af4de57816431d3f0ca45d09a92e34dbd86b2d4 (commit) via b460c24d5a93160b5898fa1fff67f75b7ce92da0 (commit) via e67c053091354be405b85cfd0c16143430806454 (commit) via ca00333c0f657073f3be74d25f24809a23294b5c (commit) via 6e74284e55ffd914bdaa6a86fac1bb7a851c2bd5 (commit) via ac72d7bf0aa30c57a425dd1a63285dafc448efd0 (commit) via ad77e23fe54f105e25bfa5ffc36f156e364ea63f (commit) via 2eb22413154fa38b414a18314ca61caf05421d7e (commit) via 3ffbeae881255945d0ba1e8b0e662963813de149 (commit) via 03d318bfbcb89560f07dee1bad045622c641ed8e (commit) via 07dc84f6e75d27ce782f096ec06d634a4a14901f (commit) via 25adec088a00933cabb8f1f5256dc0b70d6a109a (commit) via d4e434fa2057fa966c913775de4f1fff4591bcc4 (commit) via bb71728ebe76426177b471adf63531d5a1211b2d (commit) via 24775b40fe0341dbb595a39f670a393e1006aa5f (commit) via d306b34e2fb0240261870e9a079110e17619d396 (commit) via c4a007cb5fae6d71a8ec5bab86e8e3b52caa125c (commit) via bebc2d9f17515514d5abc96dea3d2f79726f9120 (commit) via 20d00263bcd5e3a80bad11d060d00fe2cc56ad07 (commit) via 61074cd238a573abc7bf600735d1e69927c1cf49 (commit) via cc465e7d54e19686e0af7cbdddfb098584c4bc12 (commit) via a70e45413a793afbdc2ec196c24208037f3fa6f1 (commit) via ec60ffface1c85b8ea7c885c36d06b05a92c1780 (commit) via 956be046e748066577a34508cbfe68718954edcf (commit) via 3a49428f58efdb0fb353cf2817735f74d4f9e71f (commit) via 3116fc77f069d17d4149b21c91aec365e0b5f8d0 (commit) via 0cb37ec8ea1f0e8d9ac6cf8235677e4565408014 (commit) via 93e7663ac2a39a7b3de5983636590e5034be53c2 (commit) via 131d45551caa7bb1aff1edade65b4b4ae3fa1d67 (commit) via 948e9d5f9944ff37ca1a7db4ea98f187b6f50183 (commit) via 4e748df12b699724861ee1d949ddfceb783a55dc (commit) via 53c09369eaaa78cb9f199cc5ea718870f52763f0 (commit) via b67d39611f03819adcf67581b68cf54c284ff4be (commit) via 1c34b044ddeaece44e7b138e120efdb80b95d954 (commit) via b09eadad562d89816d078b9363ef44e5de9188ff (commit) via f7d1b74ff69196ab53cd2819261ee342df68ac8f (commit) via be2524b4c91feef2ecf3e6891d3b5e452aed3ec7 (commit) via ce19b843baf8d60d8961788f1d1414a0189bdb59 (commit) via 211de272dfcc46d985ebf8bdaccb00e985e1e929 (commit) via d8e63850ad68a8546a6c503ae11cc5f2360a7beb (commit) via db2017c0eac6bbeb963e33a87d6b773fa60133a9 (commit) via df61e2ec7189990bc91d04f92fe1d43d8be3a6fd (commit) via f2d89ab7cebd4b4aa9acdb75a600d46c255fac33 (commit) via 3770c441bf80d8d91c1c6106588069e513422c1c (commit) via c152fcb279372073920b9dc35885aafe7db85579 (commit) via ed5815f1b4d18458d7105fa59cfdb3d9b9d2b4d1 (commit) via 68aaa426bb6e7af5f48bfdb92db1552b29f3dbdc (commit) via d4e1e9127260d0268ce9df5faa8a20d049cedbd0 (commit) via fea5ed875d8c201f83f4a35a4d6b55062f0c2ccd (commit) via 1c379029b34e0e4562c3d72a4461d125174e1211 (commit) via 88bda82a7d85c4709076acaf4386fc3183bb4992 (commit) via 042b55a5f55f9bb26ae7765e6554d2eea5ed3679 (commit) via b8a29430ad176c615d458b6ca9d8373a4d53b276 (commit) via f52007d02dbb58b7f0c41e25f9c83003b8c32c71 (commit) via 8a769c701101ea68d83f80709fd680242200feca (commit) via bafd6e97f4588c240bc3e388baaf637359081b10 (commit) via a8961426b03633a150737364e254c191f438ef14 (commit) via 0a2263a2f1a9853c7a9548855c67d45611ab08aa (commit) via 7e8bfc8b49477b638b2605751ff4eea4905c4b6c (commit) via b406c82c2de4c4570e5088db8609d068bff3182d (commit) via 1a823ae44a6957aeba95f5badb7c4dfc8ee12db3 (commit) via 4c43689d6cf9cea4a2f1216bab09b1b39934bc85 (commit) via ffeb3b44cf39f9467c5ae356ad31cb2082fa148d (commit) via 0443afc794b59120214ddf49f4c21b2c73aef2db (commit) via f5e22acbaf256b2b3d133c74858a5b1e34f5a264 (commit) via f5e4f8e3a87acb78214aa12bfa2cd8d0b2dda77c (commit) via a815179c684af5c9c9708cc051d6ddc613904eab (commit) via e1b3bcff9e6a46a5e87cdf6b44d551c540bdb1ed (commit) via cd220db7c7642f029e67e6b6732f3bbd525948c5 (commit) via 73a37749ac6fe4d8815839c21feb1b62709ae5cf (commit) via 7a45f018ec83c1db780c9f69f8fedb5f903f9906 (commit) via 8127391623ea4cc19a1e40be7ce93a978d04cb86 (commit) via d066243a00b5546e0c6510e4d5b0f8b310a72dc0 (commit) via 25851f74e13cc21056847b69576450a80812430d (commit) via 856df487d177d765525f3e86b16c2badd79ba77b (commit) via 2c5aaff0c44b072ebc2bc704d5b6ddd94bc39165 (commit) via e149c9980f5d08b3d56fed2937c8a1191d75df4b (commit) via d81a027063a33444ffcf7207ca085151f2471346 (commit) via d866d4dc3307be14cb5bf20b08c899aef06d399a (commit) via c8a30f2ef3e1081cc589ae3b1302320c1674195d (commit) via 93560bf6824bd05585df0b94976e138f327f3ca7 (commit) via aab02e5a27249b1a35f9a4ccce66219b77785396 (commit) via de20ee6533990c28c0718c3d3db980aac07dd11b (commit) via 146bdf7d41380551a52d0fa38b0fe284557693fe (commit) via 8fbe6a7678a6555bf3d33f8126644ddda48e1305 (commit) via f38ee5c6f1805f74ea430c182c6f7259134ae1eb (commit) via 8872ee50ad218526072d00ffabdf79674e40438a (commit) via 2544a0535761ae2eb9c9e1b9142067a537cb9bb6 (commit) via 05d57f586792bbde3f9866fb14ab1592114b40a2 (commit) via 1e41f3201710ed8ba380a79884b7bfd44c1f8a6c (commit) via 28b7543de660c432b22d0035b250d32fb91797e4 (commit) via 892c2bd6349673a263231bc64b3b984f1fa79655 (commit) via c5ac5b2334d701c9b09785096547967e84711c61 (commit) via 1c7e5b2e48050d8adbd0e92e9de269669989c48a (commit) via cf32ace4be9d9802bd664e27b85ab2f26150d49b (commit) via 5add4b343d14c900f46ad770d580781c5195327d (commit) via 90cf25b6feac3e8e3fc64eadaa82f342f0239db1 (commit) via 341828a319fe3d33bc7482fd0ce6e13f4e0c891a (commit) via d15c4da09121822e8e9a78e360abcded3656c6ed (commit) via 2ed842b0982699c10257d93085b76f181820308c (commit) via 8462796b000a3fb67e5561b77ae6a946413f1a36 (commit) via 7c78530da279077cb1c1c047d3f445027b098613 (commit) via 6a65b41698528b94c6cbe27990a21450207c0cfd (commit) via 6807fa739a0391dca34cd7e9fd3616164c2fa21e (commit) via 733bd9d2806af2ace06bb6118f8f734f0320934a (commit) via ab51d7ec66ae2ab2b01017f2248dee3298444aa5 (commit) via 18e43245bc9fe5ccfeb251e2065e5fecf2699823 (commit) via 8b541f3e0bddf64d5baf16396ee8b88c7183b9c7 (commit) via fe1d705e33bbde3702b4e26dcdcdd5a0310a1968 (commit) via a77e82be4e885d33235d902f194913f772c8a0b7 (commit) via 7d7622faced7ce6cd1fafd42166689795a5de64c (commit) via 1351eb6bd79096ecbf3d9ddd833bc5094dad898d (commit) via ef34c699c016602367ae428854bd598fbcdda9a4 (commit) via 4faad82da727e908cfc79d856f391d9feed46e7e (commit) via 70a448fe8533ba38fadd30e0d9694cc73d115173 (commit) via 980ef1d88fdd81f3121bbf391971914ccf6bf7b5 (commit) via 8c8eeaf795e4cca87f225ffef434db8edb5453e8 (commit) via 1115314782cf05d8a41ea67461d3550bbfdddf07 (commit) via 2df1e2e199500e300754b6c69394b78be2cfb958 (commit) via 1f0c2a2e4f008a8561f9ff7dc04c033200c97ce5 (commit) via ad5b87c9ae7ffb36dfff0b030cec31976dc35dca (commit) via 45edda6a1633a9ca5f3b31ba9c8131a5d4c9a77d (commit) via 4690e26aa43172affd5e352870dd141f1d9fd1c1 (commit) via 34e9327446161f23e4b5240e667f459371594cfd (commit) via 5453a9c0360f7672b82d944d25d032cfa1167b65 (commit) via b8da9b6bba8f38c8ed9752addf7e97ca03b7a320 (commit) via 1e00e4e8db42e40268420005164d5b332279c7f7 (commit) via 41be8d65e4bdd4a9fb73d0e899d50fcb9b02b749 (commit) via e0594e89766f07e5e7e1c800dec9633674dac432 (commit) via 6981f6e9c087c418cac69b8c8be1f017bf887bfb (commit) via 0f23261792c034df2b2cddf2a8be666132a2e743 (commit) via 13174121c283c8ec5fc67b5d4eb60ef04fc03052 (commit) via 985a7b3ded9b10cf65057f4c29e98667bbc8a5e2 (commit) via 32b7063801afce26b01aa5f5717864ae6392d0a7 (commit) via 9a2625ebef891209ae71d8a40be8b5662851cae4 (commit) via c31fb3dcc477c86551618b84b235fb3e8a9eb475 (commit) via bd559f14d83b375b7b89465ab569c553b5019f7c (commit) via 28da03c7fafc4ea4eeab0c5ce3b4c99d4a6f40a8 (commit) via 8c5190959540faad301764e49aabb932839dc48d (commit) via 33fc32e18b58b468c1a3adce0b0549c9c5f2d170 (commit) via d6cad85cf256ffef9fd8e76c74187a8dd18a9def (commit) via c479244fc1258f2a38f60cefd448abf6e669b278 (commit) via 8760d2576bee3ee726db5dc02d64be4c9b23f7b5 (commit) via 253ee97a90fc8f1b757b3e9ff6ddd8dc2b06fced (commit) via 4bad0ff4bb5feca0bbe1cff08523ef262756dce3 (commit) via fc41ca9ca6296191f52dc9a55d2ab22ba7684de4 (commit) via 50b394098e347fa0a4d821674159d507725a456d (commit) via 6d51f655282c65a34fc1b96197b78190d6f11feb (commit) via 86417420b4d7eeb68c296c1714031ed89a670d9e (commit) via 82dd82a6584941bee3932e62f01859c8ac639e42 (commit) via 4c47bb168780e758690e69351a3cd9fd068b4e33 (commit) via e84c26ff15a00b9a1dbb7c38895822ff764782d4 (commit) via e4981ff2fb10ac9362d26c63c57ff0848e27ae67 (commit) via c6cc3ba37c0157218150403a390e5c5e32db06a5 (commit) via 81c2385d43d71d50edb1769d4038c8fae4389948 (commit) via 7351315d078de6e1dee9d8572e0a55c98e5a6745 (commit) via 7f293e23dfe3b92ef583f265c61c7bdf8eaa6eb8 (commit) via 0afe35ecc6105c1a20b732ee3238e993b1b4ee60 (commit) via fca4cc790344bbe3bc004b1d13abd74db098ad50 (commit) via 2e1a4e5d5cd1fb3fc68abfaf22688530ac0e37db (commit) via 1435b155d9b5bc2f82036d7dce215a7dddc40d4d (commit) via fd8c05b01d30ac3589fea701a48314edbf76c3f5 (commit) via f2f5c9a1afe730ada719a25c0941c75748c33b3d (commit) via e8eb75196c1988c58b8672948a598bebdbf106bb (commit) via e463fcc12c65d800ec72fdf3797a76a71bfdc932 (commit) via b7f73a3b4661f7e25c4df7f8f31c23278885b122 (commit) via 9b26a4e957c29e797633e67ea30f09e2c654d1a6 (commit) via 5f30da0eda9c8fa29e9b92919bbcde0cd5f2fbfb (commit) via 657c745ca1d6b665b9661fc1bc7725a8e1dd9e0c (commit) via 8492bbccd1d68df87544fe84d37530a74a9ef462 (commit) via 0e44e2f317d6110d7264dcbf1a1a30c64793a50e (commit) via 6216570cf0b5825f8a59f3ace98b9347e9ab7912 (commit) via 48f700ba8b53237342e48f2a59f976b2cfe7ee6b (commit) via fa7ea205c2ba3190cc17796e6c8aa9f7173ebf65 (commit) via 2f2574d1e68bc8d342686214717f017fe235398f (commit) via d40f0f76f891b29a71c3955bb76e4e9edc926234 (commit) via 14627552ccd2615426c537b933fedf63b73d042c (commit) via 0777b62108bd1496254ed1d3dd5c208f1593fe45 (commit) via a9202fbf78f6f5abb44fc0961b4e9677e8cc649b (commit) via 7785df17697576ea9bdc9a161efd9547de04d79b (commit) via 93946b2d165fb082d65ea7c9dd1ea2dbb059d34c (commit) via 5ee2cbb2615cdecf75da9412d9f103a1dd335ac3 (commit) via cd8f5d9d856c81e1f597d5348920e40bb279b3a9 (commit) via af883bd58f76bd674b7d4641723f9266de9c20d4 (commit) via 0c23c3954f8726603481cecef641d53032cf138b (commit) via fcd55cdf8aa7975b4c64c3dc84ade99de998e445 (commit) from 5ae848c48f1810fa81deb8365cb89e552740c8b7 (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 ba5ab4ba70806537f36b6eed2efd6693132b1d50 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Nov 3 11:10:40 2020 -0600 Restrict newcat.c bands to ITU regions and use GEN as default otherwise https://github.com/Hamlib/Hamlib/issues/424 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index b43b143b..3a410cbb 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -391,27 +391,30 @@ static ncboolean newcat_valid_command(RIG *rig, char const *const command); */ static int newcat_band_index(freq_t freq) { - // FTDX101D has band=12=MW Medium Wave int band = 11; // general - // what about 13? + // restrict band memory recall to ITU 1,2,3 band ranges + // using < instead of <= for the moment + // does anybody work LSB or RTTYR at the upper band edge? + // what about band 13 -- what is it? if (freq >= MHz(420) && freq < MHz(470)) { band = 16; } - else if (freq >= MHz(144) && freq < MHz(148)) { band = 15; } + // band 14 is RX only else if (freq >= MHz(118) && freq < MHz(164)) { band = 14; } - else if (freq >= MHz(70) && freq < MHz(75)) { band = 17; } - else if (freq >= MHz(50) && freq < MHz(54)) { band = 10; } - // do we need to restrict ranges below here? - else if (freq >= MHz(28)) { band = 9; } - else if (freq >= MHz(24.5)) { band = 8; } - else if (freq >= MHz(21)) { band = 7; } - else if (freq >= MHz(18)) { band = 6; } - else if (freq >= MHz(14)) { band = 5; } - else if (freq >= MHz(10)) { band = 4; } - else if (freq >= MHz(7)) { band = 3; } - else if (freq >= MHz(5)) { band = 2; } - else if (freq >= MHz(3.5)) { band = 1; } - else if (freq >= MHz(1.8)) { band = 0; } - else if (freq >= MHz(0.5)) { band = 12; } // MW Medium Wave + // override band 14 with 15 if needed + else if (freq >= MHz(144) && freq < MHz(148)) { band = 15; } + else if (freq >= MHz(70) && freq < MHz(70.5)) { band = 17; } + else if (freq >= MHz(50) && freq < MHz(55)) { band = 10; } + else if (freq >= MHz(28) && freq < MHz(29.7)) { band = 9; } + else if (freq >= MHz(24.890) && freq < MHz(24.990)) { band = 8; } + else if (freq >= MHz(21) && freq < MHz(21.45)) { band = 7; } + else if (freq >= MHz(18) && freq < MHz(18.168)) { band = 6; } + else if (freq >= MHz(14) && freq < MHz(14.35)) { band = 5; } + else if (freq >= MHz(10) && freq < MHz(10.15)) { band = 4; } + else if (freq >= MHz(7) && freq < MHz(7.3)) { band = 3; } + else if (freq >= MHz(5.3515) && freq < MHz(5.3665)) { band = 2; } + else if (freq >= MHz(3.5) && freq < MHz(4)) { band = 1; } + else if (freq >= MHz(1.8) && freq < MHz(2)) { band = 0; } + else if (freq >= MHz(0.5) && freq < MHz(1.705)) { band = 12; } // MW Medium Wave rig_debug(RIG_DEBUG_TRACE, "%s: freq=%g, band=%d\n", __func__, freq, band); return band; commit 11058e63ff99ac345342b64e743e73ac746bb0fa Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Nov 3 09:28:00 2020 -0600 Fix get/set_xit for Yaesu rigs to avoid vfo swapping Fix get_xit to return VFOA/B appropriately THe IF/OI commands apparently always return VFOA/B respectively so vfo swapping is not needed to read info https://github.com/Hamlib/Hamlib/issues/430 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index ca3fa675..b43b143b 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1170,6 +1170,29 @@ int newcat_set_vfo(RIG *rig, vfo_t vfo) return RIG_OK; } +// 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; + + rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s, oldvfo=%s\n", __func__, rig_strvfo(vfo), + rig_strvfo(oldvfo)); + + if (oldvfo != vfo) + { + int ret; + ret = newcat_set_vfo(rig, vfo); + + if (ret != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: error setting vfo=%s\n", __func__, + rig_strvfo(vfo)); + return ret; + } + } + + return oldvfo; +} /* * rig_get_vfo @@ -1731,11 +1754,9 @@ int newcat_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) return RIG_OK; } - int newcat_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) { struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; - int vfo_swap = 0; vfo_t oldvfo; int ret; @@ -1744,19 +1765,9 @@ int newcat_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) return -RIG_ENAVAIL; } - if (rig->state.current_vfo != vfo) - { - oldvfo = rig->state.current_vfo; - ret = newcat_set_vfo(rig, vfo); - - if (ret != RIG_OK) - { - rig_debug(RIG_DEBUG_ERR, "%s: error setting vfo=%s\n", __func__, - rig_strvfo(vfo)); - } + oldvfo = newcat_set_vfo_if_needed(rig, vfo); - vfo_swap = 1; - } + if (oldvfo < 0) { return oldvfo; } if (rit > rig->caps->max_rit) { @@ -1785,16 +1796,9 @@ int newcat_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) ret = newcat_set_cmd(rig); - if (vfo_swap) - { - newcat_set_vfo(rig, oldvfo); + oldvfo = newcat_set_vfo_if_needed(rig, oldvfo); - if (ret != RIG_OK) - { - rig_debug(RIG_DEBUG_ERR, "%s: error setting vfo=%s\n", __func__, - rig_strvfo(vfo)); - } - } + if (oldvfo < 0) { return oldvfo; } return ret; } @@ -1865,12 +1869,18 @@ 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; + vfo_t oldvfo; + int ret; if (!newcat_valid_command(rig, "XT")) { return -RIG_ENAVAIL; } + oldvfo = newcat_set_vfo_if_needed(rig, vfo); + + if (oldvfo < 0) { return oldvfo; } + if (xit > rig->caps->max_xit) { xit = rig->caps->max_xit; /* + */ @@ -1897,7 +1907,13 @@ int newcat_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit) labs(xit), cat_term); } - return newcat_set_cmd(rig); + ret = newcat_set_cmd(rig); + + oldvfo = newcat_set_vfo_if_needed(rig, vfo); + + if (oldvfo < 0) { return oldvfo; } + + return ret; } @@ -1907,8 +1923,14 @@ int newcat_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) char *retval; int err; int offset = 0; + char *cmd = "IF"; + + if (vfo == RIG_VFO_B || vfo == RIG_VFO_SUB) + { + cmd = "OI"; + } - if (!newcat_valid_command(rig, "IF")) + if (!newcat_valid_command(rig, cmd)) { return -RIG_ENAVAIL; } @@ -1917,7 +1939,7 @@ int newcat_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", "IF", cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", cmd, cat_term); rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index bae618a3..a1e416f0 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201102" +#define NEWCAT_VER "20201103" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 20fc303686ee4fdb94d20d746936fd1249d091ec Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Nov 3 15:24:06 2020 +0000 Fix set_mode for IC-7000 https://github.com/Hamlib/Hamlib/issues/428 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index fadfd433..7b12a79d 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1700,12 +1700,13 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) return err; } - /* IC-731 and IC-735 don't support passband data */ + /* IC-731, IC-735, IC-7000 don't support passband data */ /* IC-726 & IC-475A/E also limited support - only on CW */ /* TODO: G4WJS CW wide/narrow are possible with above two radios */ if (priv->civ_731_mode || rig->caps->rig_model == RIG_MODEL_OS456 || rig->caps->rig_model == RIG_MODEL_IC726 - || rig->caps->rig_model == RIG_MODEL_IC475) + || rig->caps->rig_model == RIG_MODEL_IC475 + || rig->caps->rig_model == RIG_MODEL_IC7000) { icmode_ext = -1; } diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index a52b9069..b264776a 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -30,7 +30,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20201018" +#define BACKEND_VER "20201103" /* * defines used by comp_cal_str in rig.c commit 072cd6107f55a45acfd32abd2999c0698fda357f Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Nov 2 17:21:20 2020 -0600 Change yaesu newcat_get_rit to use "OI" instead of vfo swapping Change yaesu newcat_set_rit to do vfo swap if needed https://github.com/Hamlib/Hamlib/issues/430 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 285bdef0..ca3fa675 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1735,12 +1735,29 @@ 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; + int vfo_swap = 0; + vfo_t oldvfo; + int ret; if (!newcat_valid_command(rig, "RT")) { return -RIG_ENAVAIL; } + if (rig->state.current_vfo != vfo) + { + oldvfo = rig->state.current_vfo; + ret = newcat_set_vfo(rig, vfo); + + if (ret != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: error setting vfo=%s\n", __func__, + rig_strvfo(vfo)); + } + + vfo_swap = 1; + } + if (rit > rig->caps->max_rit) { rit = rig->caps->max_rit; /* + */ @@ -1766,7 +1783,20 @@ int newcat_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) labs(rit), cat_term); } - return newcat_set_cmd(rig); + ret = newcat_set_cmd(rig); + + if (vfo_swap) + { + newcat_set_vfo(rig, oldvfo); + + if (ret != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: error setting vfo=%s\n", __func__, + rig_strvfo(vfo)); + } + } + + return ret; } @@ -1776,8 +1806,14 @@ int newcat_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) char *retval; int err; int offset = 0; + char *cmd = "IF"; - if (!newcat_valid_command(rig, "IF")) + if (vfo == RIG_VFO_B || vfo == RIG_VFO_SUB) + { + cmd = "OI"; + } + + if (!newcat_valid_command(rig, cmd)) { return -RIG_ENAVAIL; } @@ -1786,7 +1822,7 @@ int newcat_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", "IF", cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", cmd, cat_term); rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 85ff10a2..bae618a3 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201029" +#define NEWCAT_VER "20201102" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 51b4e0966c56b4b8b1cfcef897b30e7a9bbc9752 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Nov 1 17:05:29 2020 -0600 Remove bad targetable code from rigs https://github.com/Hamlib/Hamlib/issues/430 https://github.com/Hamlib/Hamlib/issues/414 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 6cbe4c89..fadfd433 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -814,11 +814,6 @@ icom_rig_open(RIG *rig) #if 0 // do not do this here -- needs to be done when ranges are requested instead as this is very slow icom_get_freq_range(rig); // try get to get rig range capability dyamically #endif - // All Icom rigs as of 20201031 do not need VFO switch for PTT and RITXIT - // They are non-VFO specific commands - // If they ever become VFO specific implement in the backend - //rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | - // RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; return RIG_OK; } diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 3ea19292..0565508d 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -938,12 +938,6 @@ int kenwood_open(RIG *rig) // mismatched IDs can still be tested rig->state.rigport.retry = retry_save; - // All Kenwood rigs as of 20201031 do not need VFO switch for PTT and RITXIT - // They are non-VFO specific commands - // If they ever become VFO specific implement in the backend - // newcat.c version is getting segfault here -- read only? - //rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | - // RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; return RIG_OK; } diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index bec7b8a5..285bdef0 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -529,14 +529,6 @@ int newcat_open(RIG *rig) /* Initialize rig_id in case any subsequent commands need it */ (void)newcat_get_rigid(rig); - // All Yaeus rigs as of 20201031 do not need VFO switch for PTT and RITXIT - // They are non-VFO specific commands - // A couple of rigs do have vfo-specific in the backends - // If they ever become VFO specific implement in the backend - // this is getting a segfault on Linux -- read only?? - //rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | - // RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; - return RIG_OK; } commit 335a75518c2690f8adcd52e00bdd14112ebc0ec8 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Nov 1 17:00:44 2020 -0600 Add TARGETABLE_COMMON to rig.h diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 2550ab1c..8a27d782 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -473,6 +473,7 @@ typedef unsigned int vfo_t; #define RIG_TARGETABLE_PTT (1<<7) #define RIG_TARGETABLE_MEM (1<<8) #define RIG_TARGETABLE_BANK (1<<9) +#define RIG_TARGETABLE_COMMON (RIG_TARGETABLE_RITXIT | RIG_TARGETABLE_PTT | RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK) #define RIG_TARGETABLE_ALL 0x7fffffff //! @endcond // commit ccdeffbcd82b4ca7ac96e1c6436cf04d36f3320b Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Nov 1 16:59:05 2020 -0600 Add TARGETABLE_COMMON to ftdx101.c diff --git a/rigs/yaesu/ftdx101.c b/rigs/yaesu/ftdx101.c index 5b6358f9..a330c1e1 100644 --- a/rigs/yaesu/ftdx101.c +++ b/rigs/yaesu/ftdx101.c @@ -78,7 +78,7 @@ const struct rig_caps ftdx101d_caps = RIG_MODEL(RIG_MODEL_FTDX101D), .model_name = "FTDX101D", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".5", + .version = NEWCAT_VER ".6", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -113,7 +113,7 @@ const struct rig_caps ftdx101d_caps = .max_xit = Hz(9999), .max_ifshift = Hz(1200), .vfo_ops = FTDX101_VFO_OPS, - .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_FUNC | RIG_TARGETABLE_LEVEL, + .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_FUNC | RIG_TARGETABLE_LEVEL | RIG_TARGETABLE_COMMON, .transceive = RIG_TRN_OFF, /* May enable later as the FTDX101 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, commit fd9e5d841b63675df33350fbec5f885c8e90fb95 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Nov 1 15:35:17 2020 -0600 Backing out targetable flags due to segfault on Linux https://github.com/Hamlib/Hamlib/issues/431 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index c8b70ebd..6cbe4c89 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -817,8 +817,8 @@ icom_rig_open(RIG *rig) // All Icom rigs as of 20201031 do not need VFO switch for PTT and RITXIT // They are non-VFO specific commands // If they ever become VFO specific implement in the backend - rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | - RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; + //rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | + // RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; return RIG_OK; } diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index e6eef492..3ea19292 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -941,9 +941,9 @@ int kenwood_open(RIG *rig) // All Kenwood rigs as of 20201031 do not need VFO switch for PTT and RITXIT // They are non-VFO specific commands // If they ever become VFO specific implement in the backend - - rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | - RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; + // newcat.c version is getting segfault here -- read only? + //rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | + // RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; return RIG_OK; } diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 0aedb5e9..bec7b8a5 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -533,8 +533,9 @@ int newcat_open(RIG *rig) // They are non-VFO specific commands // A couple of rigs do have vfo-specific in the backends // If they ever become VFO specific implement in the backend - rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | - RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; + // this is getting a segfault on Linux -- read only?? + //rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | + // RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; return RIG_OK; } commit 5721db70be80957797162271c84629280bc06edf Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Nov 1 07:48:52 2020 -0600 Added two more targetable flags for MEM and BANK to avoid VFO swapping https://github.com/Hamlib/Hamlib/issues/430 https://github.com/Hamlib/Hamlib/issues/414 diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 013ad650..2550ab1c 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -459,7 +459,7 @@ typedef unsigned int vfo_t; * RIG_TARGETABLE_PURE means a pure targetable radio on every command * In rig.c lack of a flag will case a VFO change if needed * So setting this flag will mean the backend handles any VFO needs - * For many rigs RITXIT and PTT are non-VFO commands so need these flags + * For many rigs RITXIT, PTT, MEM, and BANK are non-VFO commands so need these flags to avoid unnecessary VFO swapping */ //! @cond Doxygen_Suppress #define RIG_TARGETABLE_NONE 0 @@ -471,6 +471,8 @@ typedef unsigned int vfo_t; #define RIG_TARGETABLE_LEVEL (1<<5) #define RIG_TARGETABLE_RITXIT (1<<6) #define RIG_TARGETABLE_PTT (1<<7) +#define RIG_TARGETABLE_MEM (1<<8) +#define RIG_TARGETABLE_BANK (1<<9) #define RIG_TARGETABLE_ALL 0x7fffffff //! @endcond // diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index d7bc08d8..c8b70ebd 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -817,7 +817,8 @@ icom_rig_open(RIG *rig) // All Icom rigs as of 20201031 do not need VFO switch for PTT and RITXIT // They are non-VFO specific commands // If they ever become VFO specific implement in the backend - rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT; + rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | + RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; return RIG_OK; } diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 6dea3477..e6eef492 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -942,7 +942,8 @@ int kenwood_open(RIG *rig) // They are non-VFO specific commands // If they ever become VFO specific implement in the backend - rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT; + rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | + RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; return RIG_OK; } diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index ad8bac00..0aedb5e9 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -533,7 +533,8 @@ int newcat_open(RIG *rig) // They are non-VFO specific commands // A couple of rigs do have vfo-specific in the backends // If they ever become VFO specific implement in the backend - rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT; + rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | + RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; return RIG_OK; } diff --git a/src/mem.c b/src/mem.c index 837ec149..9d347cf9 100644 --- a/src/mem.c +++ b/src/mem.c @@ -89,7 +89,7 @@ int HAMLIB_API rig_set_mem(RIG *rig, vfo_t vfo, int ch) return -RIG_ENAVAIL; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_MEM) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { @@ -152,7 +152,7 @@ int HAMLIB_API rig_get_mem(RIG *rig, vfo_t vfo, int *ch) return -RIG_ENAVAIL; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_MEM) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { @@ -215,7 +215,7 @@ int HAMLIB_API rig_set_bank(RIG *rig, vfo_t vfo, int bank) return -RIG_ENAVAIL; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_BANK) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { commit 74356b3a99c836bbcb3f784ce2f39284a02cfb0b Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Oct 31 17:19:08 2020 -0500 Add RIG_TARGETABLE_PTT and RIG_TARGETABLE_RITXIT For most rigs these are non-vfo specific commands so we can avoid doing VFO switching Add flags to all Yaesu, Icom, and Kenwood in rig_open Some rigs do have VFO specific but it's already in the backend More rigs can use these flags..TBD... https://github.com/Hamlib/Hamlib/issues/430 diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 03474a84..013ad650 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -457,6 +457,9 @@ typedef unsigned int vfo_t; /* * targetable bitfields, for internal use. * RIG_TARGETABLE_PURE means a pure targetable radio on every command + * In rig.c lack of a flag will case a VFO change if needed + * So setting this flag will mean the backend handles any VFO needs + * For many rigs RITXIT and PTT are non-VFO commands so need these flags */ //! @cond Doxygen_Suppress #define RIG_TARGETABLE_NONE 0 @@ -466,6 +469,8 @@ typedef unsigned int vfo_t; #define RIG_TARGETABLE_TONE (1<<3) #define RIG_TARGETABLE_FUNC (1<<4) #define RIG_TARGETABLE_LEVEL (1<<5) +#define RIG_TARGETABLE_RITXIT (1<<6) +#define RIG_TARGETABLE_PTT (1<<7) #define RIG_TARGETABLE_ALL 0x7fffffff //! @endcond // diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index 1eb02497..c214ce3c 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -2078,7 +2078,7 @@ struct rig_caps dummy_caps = .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, - .targetable_vfo = 0, + .targetable_vfo = RIG_TARGETABLE_PTT|RIG_TARGETABLE_RITXIT, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, .port_type = RIG_PORT_NONE, @@ -2243,7 +2243,7 @@ struct rig_caps dummy_no_vfo_caps = .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, - .targetable_vfo = 0, + .targetable_vfo = RIG_TARGETABLE_PTT|RIG_TARGETABLE_RITXIT, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, .port_type = RIG_PORT_NONE, diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index fadfd433..d7bc08d8 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -814,6 +814,10 @@ icom_rig_open(RIG *rig) #if 0 // do not do this here -- needs to be done when ranges are requested instead as this is very slow icom_get_freq_range(rig); // try get to get rig range capability dyamically #endif + // All Icom rigs as of 20201031 do not need VFO switch for PTT and RITXIT + // They are non-VFO specific commands + // If they ever become VFO specific implement in the backend + rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT; return RIG_OK; } diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index a8e7d79b..6dea3477 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -937,6 +937,12 @@ int kenwood_open(RIG *rig) // we're making this non fatal // mismatched IDs can still be tested rig->state.rigport.retry = retry_save; + + // All Kenwood rigs as of 20201031 do not need VFO switch for PTT and RITXIT + // They are non-VFO specific commands + // If they ever become VFO specific implement in the backend + + rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT; return RIG_OK; } diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 285bdef0..ad8bac00 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -529,6 +529,12 @@ int newcat_open(RIG *rig) /* Initialize rig_id in case any subsequent commands need it */ (void)newcat_get_rigid(rig); + // All Yaeus rigs as of 20201031 do not need VFO switch for PTT and RITXIT + // They are non-VFO specific commands + // A couple of rigs do have vfo-specific in the backends + // If they ever become VFO specific implement in the backend + rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT; + return RIG_OK; } diff --git a/src/rig.c b/src/rig.c index ffeb0b4b..69a990dd 100644 --- a/src/rig.c +++ b/src/rig.c @@ -2271,7 +2271,7 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) return -RIG_ENIMPL; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_PTT) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { @@ -2486,7 +2486,7 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) return RIG_OK; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_PTT) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { @@ -3860,7 +3860,7 @@ int HAMLIB_API rig_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) return -RIG_ENAVAIL; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_RITXIT) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { @@ -3928,7 +3928,7 @@ int HAMLIB_API rig_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) return -RIG_ENAVAIL; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_RITXIT) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { @@ -3996,7 +3996,7 @@ int HAMLIB_API rig_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit) return -RIG_ENAVAIL; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_RITXIT) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { @@ -4064,7 +4064,7 @@ int HAMLIB_API rig_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) return -RIG_ENAVAIL; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_RITXIT) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { commit fe672e8115de4bd557498e26bfb199e196548e20 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Oct 31 17:18:08 2020 -0500 Fix cppcheck for memcsv.c diff --git a/tests/memcsv.c b/tests/memcsv.c index b5ed3b0c..0bbade49 100644 --- a/tests/memcsv.c +++ b/tests/memcsv.c @@ -304,7 +304,7 @@ static char *mystrtok(char *s, char delim) } } - // cppcheck-suppress nullPointerArithmeticRedundantCheck + // cppcheck-suppress * return str + ent_pos; } commit 06cc95de56dcb3fcb58f79e88c75387437416773 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 29 23:47:43 2020 -0500 WSJT-X is working with the IC-729 so promotint to stable https://github.com/Hamlib/Hamlib/issues/429 diff --git a/rigs/icom/ic728.c b/rigs/icom/ic728.c index d799f753..2b2617b2 100644 --- a/rigs/icom/ic728.c +++ b/rigs/icom/ic728.c @@ -183,7 +183,7 @@ const struct rig_caps ic729_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, commit f55d50c7bcfc5a32e6a9fa7c6c0ab21e2a2791a8 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 29 22:45:57 2020 -0500 Finish IC-729 addition https://github.com/Hamlib/Hamlib/issues/429 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index eab78ea7..fadfd433 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -7570,6 +7570,7 @@ DECLARE_INITRIG_BACKEND(icom) rig_register(&ic781_caps); rig_register(&ic707_caps); rig_register(&ic728_caps); + rig_register(&ic729_caps); rig_register(&ic820h_caps); rig_register(&ic821h_caps); diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 808b7521..a52b9069 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -347,6 +347,7 @@ extern const struct rig_caps ic718_caps; extern const struct rig_caps ic725_caps; extern const struct rig_caps ic726_caps; extern const struct rig_caps ic728_caps; +extern const struct rig_caps ic729_caps; extern const struct rig_caps ic735_caps; extern const struct rig_caps ic736_caps; extern const struct rig_caps ic737_caps; commit c8eaafb499948cb28ea41205dbd4b81ae0d76a90 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 29 22:30:34 2020 -0500 Add IC-729 https://github.com/Hamlib/Hamlib/issues/429 diff --git a/rigs/icom/ic728.c b/rigs/icom/ic728.c index 5d75075b..d799f753 100644 --- a/rigs/icom/ic728.c +++ b/rigs/icom/ic728.c @@ -168,3 +168,121 @@ const struct rig_caps ic728_caps = }; +static const struct icom_priv_caps ic729_priv_caps = +{ + 0x3a, /* default address */ + 0, /* 731 mode */ + 0, /* no XCHG */ + ic737_ts_sc_list +}; + +const struct rig_caps ic729_caps = +{ + RIG_MODEL(RIG_MODEL_IC729), + .model_name = "IC-729", + .mfg_name = "Icom", + .version = BACKEND_VER ".0", + .copyright = "LGPL", + .status = RIG_STATUS_ALPHA, + .rig_type = RIG_TYPE_TRANSCEIVER, + .ptt_type = RIG_PTT_NONE, + .dcd_type = RIG_DCD_NONE, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 1200, + .serial_rate_max = 9600, + .serial_data_bits = 8, + .serial_stop_bits = 2, + .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 = IC728_VFO_OPS, + .scan_ops = IC728_SCAN_OPS, + .transceive = RIG_TRN_RIG, + .bank_qty = 0, + .chan_desc_sz = 0, + + .chan_list = { + { 1, 26, RIG_MTYPE_MEM, IC_MIN_MEM_CAP }, + RIG_CHAN_END, + }, + + .rx_range_list1 = { + {kHz(500), MHz(30), IC728_ALL_RX_MODES, -1, -1, IC728_VFO_ALL}, + RIG_FRNG_END, + }, + .tx_range_list1 = { + FRQ_RNG_HF(1, IC728_OTHER_TX_MODES, W(10), W(100), IC728_VFO_ALL, IC728_ANTS), + FRQ_RNG_HF(1, IC728_AM_TX_MODES, W(10), W(40), IC728_VFO_ALL, IC728_ANTS), /* AM class */ + RIG_FRNG_END, + }, + + .rx_range_list2 = { + {kHz(500), MHz(30), IC728_ALL_RX_MODES, -1, -1, IC728_VFO_ALL}, + RIG_FRNG_END, + }, + .tx_range_list2 = { + FRQ_RNG_HF(2, IC728_OTHER_TX_MODES, W(10), W(100), IC728_VFO_ALL, IC728_ANTS), + FRQ_RNG_HF(2, IC728_AM_TX_MODES, W(10), W(40), IC728_VFO_ALL, IC728_ANTS), /* AM class */ + RIG_FRNG_END, + }, + + .tuning_steps = { + {IC728_ALL_RX_MODES, 10}, /* basic resolution, there's no set_ts */ + RIG_TS_END, + }, + /* mode/filter list, remember: order matters! */ + .filters = { + {RIG_MODE_SSB | RIG_MODE_CW, kHz(2.1)}, + {RIG_MODE_AM, kHz(6)}, + {RIG_MODE_FM, kHz(12)}, + RIG_FLT_END, + }, + + .cfgparams = icom_cfg_params, + .set_conf = icom_set_conf, + .get_conf = icom_get_conf, + + .priv = (void *)& ic729_priv_caps, + .rig_init = icom_init, + .rig_cleanup = icom_cleanup, + .rig_open = icom_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, + .set_split_vfo = icom_set_split_vfo, + .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, + + .scan = icom_scan, + + .decode_event = icom_decode_event, + .set_mem = icom_set_mem, + .vfo_op = icom_vfo_op, + +}; + commit 07447c881d8efd68205f06a183fab08cb09372ce Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 29 12:54:35 2020 -0500 remove some cppcheck statements not needed anymore diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index b81db412..03474a84 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -24,13 +24,9 @@ #ifndef _RIG_H #define _RIG_H 1 -// cppcheck-suppress * #include <stdio.h> -// cppcheck-suppress * #include <stdarg.h> -// cppcheck-suppress * #include <inttypes.h> -// cppcheck-suppress * #include <time.h> /* Rig list is in a separate file so as not to mess up w/ this one */ @@ -2787,7 +2783,6 @@ extern HAMLIB_EXPORT(int) rig_set_cache_timeout_ms(RIG *rig, hamlib_cache_t sele extern HAMLIB_EXPORT(int) rig_set_vfo_opt(RIG *rig, int status); -// cppcheck-suppress * typedef unsigned long rig_useconds_t; extern HAMLIB_EXPORT(int) hl_usleep(rig_useconds_t msec); commit 73d05831f3e896c5b336f1588bcb643c2a4f821a Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 29 12:54:13 2020 -0500 update newcat.h version diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index ff2bb045..85ff10a2 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201028" +#define NEWCAT_VER "20201029" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 378cbfb0082cfd02fcfff740f56afdedf21dd225 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 29 12:53:39 2020 -0500 remove some cppcheck statements not needed anymore diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 4e0bcd06..808b7521 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -27,7 +27,6 @@ #include "tones.h" #ifdef HAVE_SYS_TIME_H -// cppcheck-suppress * #include <sys/time.h> #endif commit 0fef98fc43c37c9da7ccea2cd29123aa30ae29b9 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 29 12:52:54 2020 -0500 remove some cppcheck statements not needed anymore diff --git a/src/iofunc.h b/src/iofunc.h index a1edbdff..efe8b668 100644 --- a/src/iofunc.h +++ b/src/iofunc.h @@ -22,7 +22,6 @@ #ifndef _IOFUNC_H #define _IOFUNC_H 1 -// cppcheck-suppress * #include <sys/types.h> #include <hamlib/rig.h> diff --git a/src/misc.h b/src/misc.h index 24aa869f..5378f1da 100644 --- a/src/misc.h +++ b/src/misc.h @@ -84,12 +84,10 @@ extern int no_restore_ai; /* needs config.h included beforehand in .c file */ #ifdef HAVE_INTTYPES_H -// cppcheck-suppress * # include <inttypes.h> #endif #ifdef HAVE_SYS_TIME_H -// cppcheck-suppress * # include <sys/time.h> #endif diff --git a/src/parallel.h b/src/parallel.h index 56afaca2..c676ee43 100644 --- a/src/parallel.h +++ b/src/parallel.h @@ -27,7 +27,6 @@ #include "iofunc.h" #ifdef HAVE_LINUX_PARPORT_H -// cppcheck-suppress * # include <linux/parport.h> #endif commit ce7a30f038417be93507b44f5aa1ff723aa5ac80 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 29 12:52:09 2020 -0500 remove some cppcheck statements not needed anymore diff --git a/tests/memcsv.c b/tests/memcsv.c index 8e27088f..b5ed3b0c 100644 --- a/tests/memcsv.c +++ b/tests/memcsv.c @@ -25,20 +25,13 @@ # include "config.h" #endif -// cppcheck-suppress * #include <stdio.h> -// cppcheck-suppress * #include <stdlib.h> -// cppcheck-suppress * #include <string.h> -// cppcheck-suppress * #include <unistd.h> -// cppcheck-suppress * #include <ctype.h> -// cppcheck-suppress * #include <errno.h> -// cppcheck-suppress * #include <getopt.h> #include <hamlib/rig.h> @@ -311,7 +304,7 @@ static char *mystrtok(char *s, char delim) } } - // cppcheck-suppress * + // cppcheck-suppress nullPointerArithmeticRedundantCheck return str + ent_pos; } commit 9f65348f496cdb4325a5ff916e0d8a30637a7aba Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 29 10:24:25 2020 -0500 Fix newcat_band_index frequencies https://github.com/Hamlib/Hamlib/issues/424 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index ed52d54b..285bdef0 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -391,28 +391,29 @@ static ncboolean newcat_valid_command(RIG *rig, char const *const command); */ static int newcat_band_index(freq_t freq) { - // FTDX101D has band=12=MW...what is that? + // FTDX101D has band=12=MW Medium Wave int band = 11; // general // what about 13? - if (freq >= 420 && freq < 470) { band = 16; } - else if (freq >= 144 && freq < 148) { band = 15; } - else if (freq >= 118 && freq < 164) { band = 14; } - else if (freq >= 70 && freq < 75) { band = 17; } - else if (freq >= 50 && freq < 54) { band = 10; } + if (freq >= MHz(420) && freq < MHz(470)) { band = 16; } + else if (freq >= MHz(144) && freq < MHz(148)) { band = 15; } + else if (freq >= MHz(118) && freq < MHz(164)) { band = 14; } + else if (freq >= MHz(70) && freq < MHz(75)) { band = 17; } + else if (freq >= MHz(50) && freq < MHz(54)) { band = 10; } // do we need to restrict ranges below here? - else if (freq >= 28) { band = 9; } - else if (freq >= 24.5) { band = 8; } - else if (freq >= 21) { band = 7; } - else if (freq >= 18) { band = 6; } - else if (freq >= 14) { band = 5; } - else if (freq >= 10) { band = 4; } - else if (freq >= 7) { band = 3; } - else if (freq >= 5) { band = 2; } - else if (freq >= 3.5) { band = 1; } - else if (freq >= 1.8) { band = 0; } - - rig_debug(RIG_DEBUG_TRACE, "%s: band=%d\n", __func__, band); + else if (freq >= MHz(28)) { band = 9; } + else if (freq >= MHz(24.5)) { band = 8; } + else if (freq >= MHz(21)) { band = 7; } + else if (freq >= MHz(18)) { band = 6; } + else if (freq >= MHz(14)) { band = 5; } + else if (freq >= MHz(10)) { band = 4; } + else if (freq >= MHz(7)) { band = 3; } + else if (freq >= MHz(5)) { band = 2; } + else if (freq >= MHz(3.5)) { band = 1; } + else if (freq >= MHz(1.8)) { band = 0; } + else if (freq >= MHz(0.5)) { band = 12; } // MW Medium Wave + + rig_debug(RIG_DEBUG_TRACE, "%s: freq=%g, band=%d\n", __func__, freq, band); return band; } commit 31b20c003cc1b4025fff51a85d76468dbfd22031 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 29 08:17:40 2020 -0500 Enhance ic7000 set bandwidth and prompt ic7000 to stable https://github.com/Hamlib/Hamlib/issues/428 diff --git a/rigs/icom/ic7000.c b/rigs/icom/ic7000.c index b2169943..b722be8d 100644 --- a/rigs/icom/ic7000.c +++ b/rigs/icom/ic7000.c @@ -135,6 +135,35 @@ struct cmdparams ic7000_extcmds[] = { {.s = RIG_PARM_NONE} } }; +/* + * This function does the special bandwidth coding for IC-7000 + */ +static int ic7000_r2i_mode(RIG *rig, rmode_t mode, pbwidth_t width, + unsigned char *md, signed char *pd) +{ + int err; + + err = rig2icom_mode(rig, mode, width, md, pd); + + if (err != RIG_OK) + { + return err; + } + + // CAT section of manual says: nn = 0 -40 > bw = 50Hz > 3600Hz + // Tested by Ian G3VPX 20201029 + // 0 - 9 > bw 50Hz to 500Hz in 50Hz steps + // 10 - 40 > bw 600Hz to 3600Hz in 100Hz steps + if (width != RIG_PASSBAND_NOCHANGE) + { + if (width <= 500) { *pd = width / 50 - 1; } + else if (width <= 3600) { *pd = width / 100 + 4; } + else { *pd = 40; } + } + + return RIG_OK; +} + /* * IC-7000 rig capabilities. */ @@ -152,6 +181,7 @@ static const struct icom_priv_caps IC7000_priv_caps = { .level = -1, .icom_level = 0 }, }, .extcmds = ic7000_extcmds, + .r2i_mode = ic7000_r2i_mode }; const struct rig_caps ic7000_caps = @@ -159,9 +189,9 @@ const struct rig_caps ic7000_caps = RIG_MODEL(RIG_MODEL_IC7000), .model_name = "IC-7000", .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_RIG, .dcd_type = RIG_DCD_RIG, commit bd47d262b8e415e04a569126a31406641b9d8ea3 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Oct 28 09:43:26 2020 -0500 Fix newcat_band_index May need some more restrictions if people are using odd frequencies https://github.com/Hamlib/Hamlib/issues/424 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 6120a8cb..ed52d54b 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -394,9 +394,13 @@ static int newcat_band_index(freq_t freq) // FTDX101D has band=12=MW...what is that? int band = 11; // general - if (freq >= 70) { band = 17; } - // what about 11-16? - else if (freq >= 50) { band = 10; } + // what about 13? + if (freq >= 420 && freq < 470) { band = 16; } + else if (freq >= 144 && freq < 148) { band = 15; } + else if (freq >= 118 && freq < 164) { band = 14; } + else if (freq >= 70 && freq < 75) { band = 17; } + else if (freq >= 50 && freq < 54) { band = 10; } + // do we need to restrict ranges below here? else if (freq >= 28) { band = 9; } else if (freq >= 24.5) { band = 8; } else if (freq >= 21) { band = 7; } commit cc529aab0cd57347a562d1cc3ca040400ed5afbf Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Oct 28 09:26:06 2020 -0500 Fix newcat_band_index https://github.com/Hamlib/Hamlib/issues/424 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 192ab2fe..6120a8cb 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -394,19 +394,19 @@ static int newcat_band_index(freq_t freq) // FTDX101D has band=12=MW...what is that? int band = 11; // general - if (freq >= 1.8) { band = 0; } - else if (freq >= 3.5) { band = 1; } - else if (freq >= 5) { band = 2; } - else if (freq >= 7) { band = 3; } - else if (freq >= 10) { band = 4; } - else if (freq >= 14) { band = 5; } - else if (freq >= 18) { band = 6; } - else if (freq >= 21) { band = 7; } - else if (freq >= 24.5) { band = 8; } - else if (freq >= 28) { band = 9; } - else if (freq >= 50) { band = 10; } + if (freq >= 70) { band = 17; } // what about 11-16? - else if (freq >= 70) { band = 17; } + else if (freq >= 50) { band = 10; } + else if (freq >= 28) { band = 9; } + else if (freq >= 24.5) { band = 8; } + else if (freq >= 21) { band = 7; } + else if (freq >= 18) { band = 6; } + else if (freq >= 14) { band = 5; } + else if (freq >= 10) { band = 4; } + else if (freq >= 7) { band = 3; } + else if (freq >= 5) { band = 2; } + else if (freq >= 3.5) { band = 1; } + else if (freq >= 1.8) { band = 0; } rig_debug(RIG_DEBUG_TRACE, "%s: band=%d\n", __func__, band); return band; commit aeabe40acde2fb7a86e204bcde7d707bc41e8f8a Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Oct 28 08:53:55 2020 -0500 Make the BS cmd write the band instead of read it in newcat.c https://github.com/Hamlib/Hamlib/issues/424 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 3452e92a..192ab2fe 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -765,7 +765,8 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (newcat_valid_command(rig, "BS") && newcat_band_index(freq) != newcat_band_index(rig->state.current_freq)) { - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BS%c", cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BS%02d%c", + newcat_band_index(freq), cat_term); if (RIG_OK != (e... [truncated message content] |
From: Nate B. <n0...@us...> - 2020-11-03 18:11: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, Hamlib-4.0 has been updated via c7de6e8b1979c7c36ed5fb56bba6ff6d49445a68 (commit) via 060a9a3001efc361c6541ad20d2af8f8798bd70c (commit) via 6760e9abe1552985555e31da55d3c90bc024606a (commit) via aab674c6b0d678514d9d6e98d68a7af41b2d25bb (commit) via 1db05ed27c18e1da59fc18d3bae88a055f2f5152 (commit) via c5dd5728aa44a4590a8595de4a236306a8f6211e (commit) via 4e055a81a3f5218201a60aba7792c3750effdda8 (commit) via a34fdf5267011d3853c5702f8ea91ce9a4b4cd23 (commit) via 1aa5f5be8b593eb6b08424f33732f4247414e452 (commit) via b5c97fca61279cbf1c3ed3df3a6cd608bca094c0 (commit) via 08680a5f281d070f02db9c8f742bb61318a196a9 (commit) via 459a0303c31bba55a7a20603dda9fa4e4295b29d (commit) via acfb0d4c9ec218e426af622f570f355b87fbff05 (commit) via f4848a8e0f8b74368b2c15ff495967ba1718c315 (commit) via 8e44485802b32fa9dbbea1186f802b521994665c (commit) via 6eca8e7fb836f14bd0896692e11e76a1c27c564e (commit) via 3096b403888b4d255c29896ea4a822e21cb2fd78 (commit) via d19eb9ff3c4d4411336273a8fb42d98ede418fd0 (commit) via 88a0ef4609bed069de117932812758813d8a6444 (commit) via 3da2b6e16d662333da57889db36012599bc0eeff (commit) via 8b9e45216ea92b8ad2b818cd7769836ca92a20a6 (commit) via 1133b783e430352267e2e12413add23983acb403 (commit) via 0b2d68d1f233681cacebfb148b3813b915cbfdc9 (commit) via 98e87d91d5390d3e58cec68c1c03e30aad698a24 (commit) via 31e99eae1ab44160696086df2410cb72eff7d47b (commit) via 71000b3ddce80aee28b781656ff61fc4fe02500d (commit) via d86f5497665dbaafb5f74fb0dd673426fe2fb8ea (commit) via d393a0628226a36f577ab563b125b6afcb6ce645 (commit) via d372c900fa1fb988d671ef40204d977ca3c69c30 (commit) via d4ed8960b7be485dee2c067252d039f71c853ddc (commit) via 811dff427c3b303394a43f8d101d59fe1a910913 (commit) via 93ba14a43a171d215938c3faa61739921541397f (commit) via 7993f573b7f835b0dc8006f717b78b6fc685d2f8 (commit) via 22e76e652f2cef202a8193bfddb3a27e100fd238 (commit) via 2ac168720b2ebf9c4f297ee5116b84e6a9922745 (commit) via 0b39620b545722f31158f043c7cb7d867e587222 (commit) via bd0bb6a4271ca2af4e95f13d037a6994b8c74dfc (commit) via 4e355eb7601e860051fe42ae7c850a5e79cf3101 (commit) via 9ffc407980174d3f1487d1c76495000c9f0e52d6 (commit) via bf553fd918e324a2f8c5d10c1c8df1833a7614de (commit) via 1a786f80546b595f8a1266f242e6d5eb0912ca09 (commit) via 1366190ab615e6973fdccb5d4aa1c85b85fe4fab (commit) via c46d6cd7286feba256ae5013141cf5892ff17a24 (commit) via 1b001dfdebd4764179771fe3afaa2904b982817e (commit) via 671afffc428ae706da8732dc9fffd73888ec998d (commit) via cd137d7a8c720b24251967d998e6666a229129a2 (commit) via 1d89d74f7b4d7c294c54ca78e210657bc77fd708 (commit) via afed664b2c340327bc8912c39375c57d496ea5aa (commit) via d819e59a80e7e569c59bc74309b1fa1dd6561da9 (commit) via 502ff7b16183a0f30669e676e8d244bc4611b5d0 (commit) via 09ddeeace89290328908b739a95f0e978f79bdca (commit) via 5898c1dc1d0e863ee1ba91af1cb594933b12c59d (commit) via 3b992dde73fda2a0074a322617e76c256ee51a43 (commit) via 1449c2662dd87a46ae4fd5105141825b5bf02add (commit) via 8ca3dd8d28b3b0e3d4fc884ff844b0c2ae4f92ca (commit) via e2a537880bc5907090c107cc2ec215f132e011d2 (commit) via 1c19332593e56509c570aa1333d0e3ec9cf48f49 (commit) via 1d369ae3d7a2c0ad20c5880af6824278bc37527b (commit) via 1c1194e3da5bafd4b48cb28c733c4c74c17d3e9d (commit) via d3b5dbae94dde590156104e1f72c57fafaa278ac (commit) via e1d1850e2f5b663bb9ef67b8842acd54dff48bd1 (commit) via edf6ac5c9998bf9fa736981e60daaa87989f42a8 (commit) via 8acdf59680c5145a300d3a7fa00101e2f1635109 (commit) via ab724e8cfb1771e3a458295d68ca6deab9215256 (commit) via b52b0ca8cb9e1300d00c9c0f31b585ff0f7bc9ea (commit) via b72f759956ab0ebc16247e65f8118926f1ce64e9 (commit) via 5010932c6f354c56cdd488ebaa082f1764c85ae4 (commit) via 9f4be67d4b3e35dd435a445e11b38a5ba11b7e3e (commit) via 992fedd4d260e5be51f3920c3c4347a0d8cded98 (commit) via f0807e49027384bc0a8f39ee4c3b65490b2c733f (commit) via afca207f1e856fcea0cd3ca54dbc20be611c1c3f (commit) via 454c3a69ac6b5fc026d67b9a54b8094b11554151 (commit) via d340f747c1a2d0283d9512b775931b8d2a56367d (commit) via efebaa7d2d949ca5f1523987e9e1b2aa1d0fc9b3 (commit) via 7a4403d5ee8ac0c1dada07b151706342fe1afa98 (commit) via 0808e93ce580fde1e9b914b7fac65fe36809a43d (commit) via 5f8ac53163402ce7389a2e9022bb59aaf1688326 (commit) via 49f1396c31da2c53731bf02709c0059cec3eaee1 (commit) via 7de961ceedd6c7b81014f759ab46ecf7e1541d44 (commit) via 552516a27a03832cb8dae363a743a4c865c04771 (commit) via a7c91ef16acb935cb8db28608a795a87e29f58b2 (commit) via c2f37f7caee55344a4307d8d7fccdb8835bb6597 (commit) via 7c3c9ab1bc940d4a1d72751fa09edb000a8b2822 (commit) via 2a2d56e95744bf26e233c35c0804a0543a894d98 (commit) via 686be18bedb3efc0f8d8943ec7232c23a7623eb7 (commit) via 9eecff3cb9460da0d05c71e8ce7e57f5793fd682 (commit) via 4818743b6a0ce76391ece55b7f4d6a2d9ed1a673 (commit) via 000cf575ebcdf1497ac6ae21bf305219f1ac7d4c (commit) via b12758e92ef3240120946a0712b01381cc7b5c78 (commit) via 67c0217827c040e35271bfcb8326e535788a297a (commit) via 40f48ea32c014baed27c955e03ebb7c8b7dc276b (commit) via 86ce977b12d36e4dbb3976acd80a182b77053470 (commit) via 06ce8bb3520291cad8197eda98ea2a3bb5702efc (commit) via 2ba07c15efc039b981277df770f5784a1c54ded2 (commit) via 72eec4e01cd249f47c220d63ee1ad3afb5bc05b6 (commit) via 75a1356dd856ab3cf25fee7b0c786af61433d6aa (commit) via 549701b0bbc74153ba7be3e6087db80db3d3dd41 (commit) via f813ad37625e84d28bd45ea0bae3241f9bfbce2a (commit) via d5978eefa8808cbe9a92e8c5e7fb6005408373d2 (commit) via 70a2ca58dd247cf89b6615e4315a5548ed902d50 (commit) via dfa88dc89cbd99bff9625a4a03011313bb594975 (commit) via 8e813bc21983f262e9f6f830aca1b2dd0c0f5025 (commit) via a01f9cd1a76d698f56c486da26560b4133925b3d (commit) via 24b1b6d7b995e2a67440762eb5e7c8324a432dd5 (commit) via befb922093999f711388d383e0ea2eb4828a6669 (commit) via b93461a93a4632652d03f03e61d89066f5b56ca9 (commit) via 498c2fb3685669f41528fe700f06684f18c5ebe9 (commit) via ce05352f4241b9a63c344a8d8d339daea1e3f597 (commit) via e2941a60da26adb71bb5cce7d70fc8edb1a8010c (commit) via 3f55b1cf67e3a6b147456256414a5b2fb731a321 (commit) via b595a405e9b3962ae4fdb3bc697faeec3e0fffe2 (commit) via 836d82f7b3956f8a22b061825f7faedc739a4b70 (commit) via a2527b40a00c5aa2d7b9e0ab347ac4d872ac8035 (commit) via 90e69e22b53725a49ac32dda5706690efe79a520 (commit) via d4863a25cf8dde34ccf9d56933fef28a3e2821b1 (commit) via f4387d260ea6f14567c90fb63064eaae8e4f5f78 (commit) via eb022a1c3c3bb69e86252274aa8c96d24cab6e5d (commit) via 3046a9b4a1a33aa22f9f09a2afa04369bcd2b4cf (commit) via 28308c13805bb56e4ae263945b9f2153c547799e (commit) via 151ca9573386f7733a435bd9df779bd63fb61ada (commit) via 33e67bcd49723883da29b32db37bbc9c1fbd83e4 (commit) via 2c25ee32ab1363a6a4de35ddf9389eec0644adde (commit) via 9682af9fe879beb471ab52f81bbdccb155ffc603 (commit) via 57dbecdc4ea266d52541eacd6116e4233e81e64a (commit) via 497c76b59d52ba7e4b867d25a39097d27db5252f (commit) via 1c4bc78b5dcf634c6f9110bb85b8340e371f030a (commit) via 2474eca66128e5e25018d6c51e42b72a408178c3 (commit) via f87015da96726aaddfa5b8de2a4fd84e7f8e7673 (commit) via f44b4c507eb14554d3ad86487443b5c57ac127f8 (commit) via dee3c9989f7106e0b096fb543f1e99913a7da64a (commit) via dfe4dbcf838e4155f74fa8ea438a871068a5f133 (commit) via 3fadcb16c746c4294e3cb006b7500c971c9500d7 (commit) via 73a975c125e55914d03d3cfb576584825975c962 (commit) via 0ea6ac10130c6d45825d46adbf3f4823cf6b4b9c (commit) via 491a7207a111c368467e39039495fd605c65d879 (commit) via c717c9e38c064e47614621aa2ef90d7dde63e70b (commit) via a152cbb9868f9b82a9687fcc12aa8988a9584892 (commit) via 0c4e6749af536eb051c464657dd1e287f8eb4ba2 (commit) via 3b772d34684cbd89f640eca07720dea6af20a121 (commit) via f9302ab96f46a382fdcb35cb05fe5a100bca6551 (commit) via efe98fac5fb19da41cd33ee2add550e31c5dc0c7 (commit) via 770a3ae4f05fa135f8c4d52e1d43649c196371a6 (commit) via c881225ca9598c751e0914399116a8b474434c3e (commit) via 008b24a3448e56fb860b76211147e9b6dd3a286b (commit) via 579338ad64c9f3583e29ddc3f2fea07f1e2884c2 (commit) via 7705ef01a7fa9bbdceed45427d8d40e819ab4c61 (commit) via 945f9aeb8e78b4f46176c8d0c8c9501c75390c79 (commit) via a612dbda169d16b97c3303a7ca80168a90d7ac6c (commit) via f37426adc588bc06c6d85c59fc20f2721f8ffbe1 (commit) via d8edf32c8a6f6a2f8695dbc1a963aa641ec30e1a (commit) via 5f72ad1b2955ff2e0e62290a35ac015dcb9bc309 (commit) via 189cb7f350b70233d55426c9946f7e900b54e502 (commit) via 691e3748712a4327e895d6f2b24580b111f22e69 (commit) via 2bc973a87d00a0072a8b2d2e7b176949bdb3d96d (commit) via 937b32a14d12bdc1ac5dfd15c3f838b1a4c24d42 (commit) via 7fedd4c864405a10a9b8e18cc47ced9c2eac419a (commit) via 69ba91cd3cef96e85455123a0616067af0fe3483 (commit) via 4a3769380b660d9981ac632724463cf31da729ee (commit) via 445481579e73b95ff21e5ac8cb2049b2b1121639 (commit) via 2b168e46133c5e3e4877c9a7a89d33e0cc16cf81 (commit) via ba80f66af956237a426f24f3aa752b9d87560301 (commit) via a6304a397c0b01218daca138ac14dec42bdbcc2e (commit) via 1245b24efc2888658a13e7896adc60ccae93ee81 (commit) via 7501bcb923a084d15f7095ca2d4a53af1e6beaee (commit) via bcad10f929bb445f891f5fdfff3d3241a268fe64 (commit) via 2b3a463646e4b02c481734ab3351f45ff9ed93ce (commit) via 496e43623f5eabddb5106efa0f38902dadc37068 (commit) via 9a494f859b176eab04e77f0284cab0de976aba74 (commit) via 025d88330ec62547a9ceef2f03e737690883c846 (commit) via a5be1c11768017ca7f62fb1f70c02f3b6d8bf4c5 (commit) via 8755d281ccbd128a061534b3c873260054f12e72 (commit) via 60d99bd53dec79fa0a98b5e8f70527d70697a304 (commit) via bf7cd03190ef97e97a4249097fe15db1c78827e4 (commit) via 28a07754d81edfdb4648e2073313fa8874fce24b (commit) via 6b7af78fadfc7a94cb937ad8ec8a6e4683e5cdbe (commit) via b7f4e2783ee776a8ec9049da06c75167638e41a7 (commit) via 12c3cb85d05f2c5ecea577ce30e7a74a058f8175 (commit) via eab1aed335dd73df4c81485f082c44e05c6962fa (commit) via f052c3878514e93f3eaca647026a781b6b1338e9 (commit) via b23c2f0c43582876174fd982b256b9cb7684b41f (commit) via 6910a61fd326cbbf986de431f25f8e98d654f80a (commit) via ef3ab588a025c8f5687b49902744306ce95d3a56 (commit) via 2ae05ebba65b8a7b61775361e3d8dc72eb12f6ff (commit) via 44f8a974454d6329210fda702cb7e26cb97df735 (commit) via 78e227cca02094c90a0b6a81d50c02353abc71cb (commit) via 10e5c7872533bbe4b4efce565ad0052dcd432ca7 (commit) via 875ef7fcf213a3d0cadbc9b6ab8a586641b2534b (commit) via 97cecb3137fad566bb7192cef6906450067918ca (commit) via d08223357917f0589580bf98b707272a3114728e (commit) via d02055238a54cd8dd17adb38892a682d9367003d (commit) via f5df7d154a170876f1598052cc35d435f88aab76 (commit) via 66c31c42e26044ba84832e9d605631a05e65fae9 (commit) via d7265846c56ff3e77e0158af82b01db6d298c918 (commit) via 65e3bbb3c1c09ecb7559e630454a48936ddf1ce8 (commit) via ff1be43c09cd1d6e410039dfd6e9fac8d759f1c8 (commit) via a02bddea5c833b6135bc023e00a5d27f3c2ae743 (commit) via f77be9bcdbfd355047e5453f02031dcbcf62a48e (commit) via c0c970ca6b7745bf08e94ad9f0b22a90a744257c (commit) via 5b518ad9e9baefba80d0a94b33fb5242f84a8537 (commit) via b64b7fd14d064507b8774d0092a14778d9a22467 (commit) from 506cd8118442173ee275c60651bf80c09974a76e (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 c7de6e8b1979c7c36ed5fb56bba6ff6d49445a68 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Nov 3 09:28:00 2020 -0600 Fix get/set_xit for Yaesu rigs to avoid vfo swapping Fix get_xit to return VFOA/B appropriately THe IF/OI commands apparently always return VFOA/B respectively so vfo swapping is not needed to read info https://github.com/Hamlib/Hamlib/issues/430 (cherry picked from commit 11058e63ff99ac345342b64e743e73ac746bb0fa) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index ca3fa675..b43b143b 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1170,6 +1170,29 @@ int newcat_set_vfo(RIG *rig, vfo_t vfo) return RIG_OK; } +// 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; + + rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s, oldvfo=%s\n", __func__, rig_strvfo(vfo), + rig_strvfo(oldvfo)); + + if (oldvfo != vfo) + { + int ret; + ret = newcat_set_vfo(rig, vfo); + + if (ret != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: error setting vfo=%s\n", __func__, + rig_strvfo(vfo)); + return ret; + } + } + + return oldvfo; +} /* * rig_get_vfo @@ -1731,11 +1754,9 @@ int newcat_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *tx_vfo) return RIG_OK; } - int newcat_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) { struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; - int vfo_swap = 0; vfo_t oldvfo; int ret; @@ -1744,19 +1765,9 @@ int newcat_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) return -RIG_ENAVAIL; } - if (rig->state.current_vfo != vfo) - { - oldvfo = rig->state.current_vfo; - ret = newcat_set_vfo(rig, vfo); - - if (ret != RIG_OK) - { - rig_debug(RIG_DEBUG_ERR, "%s: error setting vfo=%s\n", __func__, - rig_strvfo(vfo)); - } + oldvfo = newcat_set_vfo_if_needed(rig, vfo); - vfo_swap = 1; - } + if (oldvfo < 0) { return oldvfo; } if (rit > rig->caps->max_rit) { @@ -1785,16 +1796,9 @@ int newcat_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) ret = newcat_set_cmd(rig); - if (vfo_swap) - { - newcat_set_vfo(rig, oldvfo); + oldvfo = newcat_set_vfo_if_needed(rig, oldvfo); - if (ret != RIG_OK) - { - rig_debug(RIG_DEBUG_ERR, "%s: error setting vfo=%s\n", __func__, - rig_strvfo(vfo)); - } - } + if (oldvfo < 0) { return oldvfo; } return ret; } @@ -1865,12 +1869,18 @@ 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; + vfo_t oldvfo; + int ret; if (!newcat_valid_command(rig, "XT")) { return -RIG_ENAVAIL; } + oldvfo = newcat_set_vfo_if_needed(rig, vfo); + + if (oldvfo < 0) { return oldvfo; } + if (xit > rig->caps->max_xit) { xit = rig->caps->max_xit; /* + */ @@ -1897,7 +1907,13 @@ int newcat_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit) labs(xit), cat_term); } - return newcat_set_cmd(rig); + ret = newcat_set_cmd(rig); + + oldvfo = newcat_set_vfo_if_needed(rig, vfo); + + if (oldvfo < 0) { return oldvfo; } + + return ret; } @@ -1907,8 +1923,14 @@ int newcat_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) char *retval; int err; int offset = 0; + char *cmd = "IF"; + + if (vfo == RIG_VFO_B || vfo == RIG_VFO_SUB) + { + cmd = "OI"; + } - if (!newcat_valid_command(rig, "IF")) + if (!newcat_valid_command(rig, cmd)) { return -RIG_ENAVAIL; } @@ -1917,7 +1939,7 @@ int newcat_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", "IF", cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", cmd, cat_term); rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index bae618a3..a1e416f0 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201102" +#define NEWCAT_VER "20201103" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 060a9a3001efc361c6541ad20d2af8f8798bd70c Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Nov 3 15:24:06 2020 +0000 Fix set_mode for IC-7000 https://github.com/Hamlib/Hamlib/issues/428 (cherry picked from commit 20fc303686ee4fdb94d20d746936fd1249d091ec) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index fadfd433..7b12a79d 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1700,12 +1700,13 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) return err; } - /* IC-731 and IC-735 don't support passband data */ + /* IC-731, IC-735, IC-7000 don't support passband data */ /* IC-726 & IC-475A/E also limited support - only on CW */ /* TODO: G4WJS CW wide/narrow are possible with above two radios */ if (priv->civ_731_mode || rig->caps->rig_model == RIG_MODEL_OS456 || rig->caps->rig_model == RIG_MODEL_IC726 - || rig->caps->rig_model == RIG_MODEL_IC475) + || rig->caps->rig_model == RIG_MODEL_IC475 + || rig->caps->rig_model == RIG_MODEL_IC7000) { icmode_ext = -1; } diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index a52b9069..b264776a 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -30,7 +30,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20201018" +#define BACKEND_VER "20201103" /* * defines used by comp_cal_str in rig.c commit 6760e9abe1552985555e31da55d3c90bc024606a Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Nov 2 17:21:20 2020 -0600 Change yaesu newcat_get_rit to use "OI" instead of vfo swapping Change yaesu newcat_set_rit to do vfo swap if needed https://github.com/Hamlib/Hamlib/issues/430 (cherry picked from commit 072cd6107f55a45acfd32abd2999c0698fda357f) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 285bdef0..ca3fa675 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1735,12 +1735,29 @@ 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; + int vfo_swap = 0; + vfo_t oldvfo; + int ret; if (!newcat_valid_command(rig, "RT")) { return -RIG_ENAVAIL; } + if (rig->state.current_vfo != vfo) + { + oldvfo = rig->state.current_vfo; + ret = newcat_set_vfo(rig, vfo); + + if (ret != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: error setting vfo=%s\n", __func__, + rig_strvfo(vfo)); + } + + vfo_swap = 1; + } + if (rit > rig->caps->max_rit) { rit = rig->caps->max_rit; /* + */ @@ -1766,7 +1783,20 @@ int newcat_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) labs(rit), cat_term); } - return newcat_set_cmd(rig); + ret = newcat_set_cmd(rig); + + if (vfo_swap) + { + newcat_set_vfo(rig, oldvfo); + + if (ret != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: error setting vfo=%s\n", __func__, + rig_strvfo(vfo)); + } + } + + return ret; } @@ -1776,8 +1806,14 @@ int newcat_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) char *retval; int err; int offset = 0; + char *cmd = "IF"; - if (!newcat_valid_command(rig, "IF")) + if (vfo == RIG_VFO_B || vfo == RIG_VFO_SUB) + { + cmd = "OI"; + } + + if (!newcat_valid_command(rig, cmd)) { return -RIG_ENAVAIL; } @@ -1786,7 +1822,7 @@ int newcat_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", "IF", cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "%s%c", cmd, cat_term); rig_debug(RIG_DEBUG_TRACE, "%s: cmd_str = %s\n", __func__, priv->cmd_str); diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 85ff10a2..bae618a3 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201029" +#define NEWCAT_VER "20201102" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit aab674c6b0d678514d9d6e98d68a7af41b2d25bb Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Nov 1 17:05:29 2020 -0600 Remove bad targetable code from rigs https://github.com/Hamlib/Hamlib/issues/430 https://github.com/Hamlib/Hamlib/issues/414 (cherry picked from commit 51b4e0966c56b4b8b1cfcef897b30e7a9bbc9752) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 6cbe4c89..fadfd433 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -814,11 +814,6 @@ icom_rig_open(RIG *rig) #if 0 // do not do this here -- needs to be done when ranges are requested instead as this is very slow icom_get_freq_range(rig); // try get to get rig range capability dyamically #endif - // All Icom rigs as of 20201031 do not need VFO switch for PTT and RITXIT - // They are non-VFO specific commands - // If they ever become VFO specific implement in the backend - //rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | - // RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; return RIG_OK; } diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 3ea19292..0565508d 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -938,12 +938,6 @@ int kenwood_open(RIG *rig) // mismatched IDs can still be tested rig->state.rigport.retry = retry_save; - // All Kenwood rigs as of 20201031 do not need VFO switch for PTT and RITXIT - // They are non-VFO specific commands - // If they ever become VFO specific implement in the backend - // newcat.c version is getting segfault here -- read only? - //rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | - // RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; return RIG_OK; } diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index bec7b8a5..285bdef0 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -529,14 +529,6 @@ int newcat_open(RIG *rig) /* Initialize rig_id in case any subsequent commands need it */ (void)newcat_get_rigid(rig); - // All Yaeus rigs as of 20201031 do not need VFO switch for PTT and RITXIT - // They are non-VFO specific commands - // A couple of rigs do have vfo-specific in the backends - // If they ever become VFO specific implement in the backend - // this is getting a segfault on Linux -- read only?? - //rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | - // RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; - return RIG_OK; } commit 1db05ed27c18e1da59fc18d3bae88a055f2f5152 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Nov 1 17:00:44 2020 -0600 Add TARGETABLE_COMMON to rig.h (cherry picked from commit 335a75518c2690f8adcd52e00bdd14112ebc0ec8) diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 2550ab1c..8a27d782 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -473,6 +473,7 @@ typedef unsigned int vfo_t; #define RIG_TARGETABLE_PTT (1<<7) #define RIG_TARGETABLE_MEM (1<<8) #define RIG_TARGETABLE_BANK (1<<9) +#define RIG_TARGETABLE_COMMON (RIG_TARGETABLE_RITXIT | RIG_TARGETABLE_PTT | RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK) #define RIG_TARGETABLE_ALL 0x7fffffff //! @endcond // commit c5dd5728aa44a4590a8595de4a236306a8f6211e Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Nov 1 16:59:05 2020 -0600 Add TARGETABLE_COMMON to ftdx101.c (cherry picked from commit ccdeffbcd82b4ca7ac96e1c6436cf04d36f3320b) diff --git a/rigs/yaesu/ftdx101.c b/rigs/yaesu/ftdx101.c index 5b6358f9..a330c1e1 100644 --- a/rigs/yaesu/ftdx101.c +++ b/rigs/yaesu/ftdx101.c @@ -78,7 +78,7 @@ const struct rig_caps ftdx101d_caps = RIG_MODEL(RIG_MODEL_FTDX101D), .model_name = "FTDX101D", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".5", + .version = NEWCAT_VER ".6", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -113,7 +113,7 @@ const struct rig_caps ftdx101d_caps = .max_xit = Hz(9999), .max_ifshift = Hz(1200), .vfo_ops = FTDX101_VFO_OPS, - .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_FUNC | RIG_TARGETABLE_LEVEL, + .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_FUNC | RIG_TARGETABLE_LEVEL | RIG_TARGETABLE_COMMON, .transceive = RIG_TRN_OFF, /* May enable later as the FTDX101 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, commit 4e055a81a3f5218201a60aba7792c3750effdda8 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Nov 1 15:35:17 2020 -0600 Backing out targetable flags due to segfault on Linux https://github.com/Hamlib/Hamlib/issues/431 (cherry picked from commit fd9e5d841b63675df33350fbec5f885c8e90fb95) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index c8b70ebd..6cbe4c89 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -817,8 +817,8 @@ icom_rig_open(RIG *rig) // All Icom rigs as of 20201031 do not need VFO switch for PTT and RITXIT // They are non-VFO specific commands // If they ever become VFO specific implement in the backend - rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | - RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; + //rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | + // RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; return RIG_OK; } diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index e6eef492..3ea19292 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -941,9 +941,9 @@ int kenwood_open(RIG *rig) // All Kenwood rigs as of 20201031 do not need VFO switch for PTT and RITXIT // They are non-VFO specific commands // If they ever become VFO specific implement in the backend - - rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | - RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; + // newcat.c version is getting segfault here -- read only? + //rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | + // RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; return RIG_OK; } diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 0aedb5e9..bec7b8a5 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -533,8 +533,9 @@ int newcat_open(RIG *rig) // They are non-VFO specific commands // A couple of rigs do have vfo-specific in the backends // If they ever become VFO specific implement in the backend - rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | - RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; + // this is getting a segfault on Linux -- read only?? + //rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | + // RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; return RIG_OK; } commit a34fdf5267011d3853c5702f8ea91ce9a4b4cd23 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Nov 1 07:48:52 2020 -0600 Added two more targetable flags for MEM and BANK to avoid VFO swapping https://github.com/Hamlib/Hamlib/issues/430 https://github.com/Hamlib/Hamlib/issues/414 (cherry picked from commit 5721db70be80957797162271c84629280bc06edf) diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 013ad650..2550ab1c 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -459,7 +459,7 @@ typedef unsigned int vfo_t; * RIG_TARGETABLE_PURE means a pure targetable radio on every command * In rig.c lack of a flag will case a VFO change if needed * So setting this flag will mean the backend handles any VFO needs - * For many rigs RITXIT and PTT are non-VFO commands so need these flags + * For many rigs RITXIT, PTT, MEM, and BANK are non-VFO commands so need these flags to avoid unnecessary VFO swapping */ //! @cond Doxygen_Suppress #define RIG_TARGETABLE_NONE 0 @@ -471,6 +471,8 @@ typedef unsigned int vfo_t; #define RIG_TARGETABLE_LEVEL (1<<5) #define RIG_TARGETABLE_RITXIT (1<<6) #define RIG_TARGETABLE_PTT (1<<7) +#define RIG_TARGETABLE_MEM (1<<8) +#define RIG_TARGETABLE_BANK (1<<9) #define RIG_TARGETABLE_ALL 0x7fffffff //! @endcond // diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index d7bc08d8..c8b70ebd 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -817,7 +817,8 @@ icom_rig_open(RIG *rig) // All Icom rigs as of 20201031 do not need VFO switch for PTT and RITXIT // They are non-VFO specific commands // If they ever become VFO specific implement in the backend - rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT; + rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | + RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; return RIG_OK; } diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 6dea3477..e6eef492 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -942,7 +942,8 @@ int kenwood_open(RIG *rig) // They are non-VFO specific commands // If they ever become VFO specific implement in the backend - rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT; + rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | + RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; return RIG_OK; } diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index ad8bac00..0aedb5e9 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -533,7 +533,8 @@ int newcat_open(RIG *rig) // They are non-VFO specific commands // A couple of rigs do have vfo-specific in the backends // If they ever become VFO specific implement in the backend - rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT; + rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT | + RIG_TARGETABLE_MEM | RIG_TARGETABLE_BANK; return RIG_OK; } diff --git a/src/mem.c b/src/mem.c index 837ec149..9d347cf9 100644 --- a/src/mem.c +++ b/src/mem.c @@ -89,7 +89,7 @@ int HAMLIB_API rig_set_mem(RIG *rig, vfo_t vfo, int ch) return -RIG_ENAVAIL; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_MEM) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { @@ -152,7 +152,7 @@ int HAMLIB_API rig_get_mem(RIG *rig, vfo_t vfo, int *ch) return -RIG_ENAVAIL; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_MEM) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { @@ -215,7 +215,7 @@ int HAMLIB_API rig_set_bank(RIG *rig, vfo_t vfo, int bank) return -RIG_ENAVAIL; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_BANK) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { commit 1aa5f5be8b593eb6b08424f33732f4247414e452 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Oct 31 17:19:08 2020 -0500 Add RIG_TARGETABLE_PTT and RIG_TARGETABLE_RITXIT For most rigs these are non-vfo specific commands so we can avoid doing VFO switching Add flags to all Yaesu, Icom, and Kenwood in rig_open Some rigs do have VFO specific but it's already in the backend More rigs can use these flags..TBD... https://github.com/Hamlib/Hamlib/issues/430 (cherry picked from commit 74356b3a99c836bbcb3f784ce2f39284a02cfb0b) diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 03474a84..013ad650 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -457,6 +457,9 @@ typedef unsigned int vfo_t; /* * targetable bitfields, for internal use. * RIG_TARGETABLE_PURE means a pure targetable radio on every command + * In rig.c lack of a flag will case a VFO change if needed + * So setting this flag will mean the backend handles any VFO needs + * For many rigs RITXIT and PTT are non-VFO commands so need these flags */ //! @cond Doxygen_Suppress #define RIG_TARGETABLE_NONE 0 @@ -466,6 +469,8 @@ typedef unsigned int vfo_t; #define RIG_TARGETABLE_TONE (1<<3) #define RIG_TARGETABLE_FUNC (1<<4) #define RIG_TARGETABLE_LEVEL (1<<5) +#define RIG_TARGETABLE_RITXIT (1<<6) +#define RIG_TARGETABLE_PTT (1<<7) #define RIG_TARGETABLE_ALL 0x7fffffff //! @endcond // diff --git a/rigs/dummy/dummy.c b/rigs/dummy/dummy.c index 1eb02497..c214ce3c 100644 --- a/rigs/dummy/dummy.c +++ b/rigs/dummy/dummy.c @@ -2078,7 +2078,7 @@ struct rig_caps dummy_caps = .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, - .targetable_vfo = 0, + .targetable_vfo = RIG_TARGETABLE_PTT|RIG_TARGETABLE_RITXIT, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, .port_type = RIG_PORT_NONE, @@ -2243,7 +2243,7 @@ struct rig_caps dummy_no_vfo_caps = .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_OTHER, - .targetable_vfo = 0, + .targetable_vfo = RIG_TARGETABLE_PTT|RIG_TARGETABLE_RITXIT, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, .port_type = RIG_PORT_NONE, diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index fadfd433..d7bc08d8 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -814,6 +814,10 @@ icom_rig_open(RIG *rig) #if 0 // do not do this here -- needs to be done when ranges are requested instead as this is very slow icom_get_freq_range(rig); // try get to get rig range capability dyamically #endif + // All Icom rigs as of 20201031 do not need VFO switch for PTT and RITXIT + // They are non-VFO specific commands + // If they ever become VFO specific implement in the backend + rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT; return RIG_OK; } diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index a8e7d79b..6dea3477 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -937,6 +937,12 @@ int kenwood_open(RIG *rig) // we're making this non fatal // mismatched IDs can still be tested rig->state.rigport.retry = retry_save; + + // All Kenwood rigs as of 20201031 do not need VFO switch for PTT and RITXIT + // They are non-VFO specific commands + // If they ever become VFO specific implement in the backend + + rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT; return RIG_OK; } diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 285bdef0..ad8bac00 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -529,6 +529,12 @@ int newcat_open(RIG *rig) /* Initialize rig_id in case any subsequent commands need it */ (void)newcat_get_rigid(rig); + // All Yaeus rigs as of 20201031 do not need VFO switch for PTT and RITXIT + // They are non-VFO specific commands + // A couple of rigs do have vfo-specific in the backends + // If they ever become VFO specific implement in the backend + rig->caps->targetable_vfo |= RIG_TARGETABLE_PTT | RIG_TARGETABLE_RITXIT; + return RIG_OK; } diff --git a/src/rig.c b/src/rig.c index ffeb0b4b..69a990dd 100644 --- a/src/rig.c +++ b/src/rig.c @@ -2271,7 +2271,7 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) return -RIG_ENIMPL; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_PTT) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { @@ -2486,7 +2486,7 @@ int HAMLIB_API rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) return RIG_OK; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_PTT) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { @@ -3860,7 +3860,7 @@ int HAMLIB_API rig_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) return -RIG_ENAVAIL; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_RITXIT) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { @@ -3928,7 +3928,7 @@ int HAMLIB_API rig_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) return -RIG_ENAVAIL; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_RITXIT) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { @@ -3996,7 +3996,7 @@ int HAMLIB_API rig_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit) return -RIG_ENAVAIL; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_RITXIT) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { @@ -4064,7 +4064,7 @@ int HAMLIB_API rig_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) return -RIG_ENAVAIL; } - if ((caps->targetable_vfo & RIG_TARGETABLE_PURE) + if ((caps->targetable_vfo & RIG_TARGETABLE_RITXIT) || vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo) { commit b5c97fca61279cbf1c3ed3df3a6cd608bca094c0 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Oct 31 17:18:08 2020 -0500 Fix cppcheck for memcsv.c (cherry picked from commit fe672e8115de4bd557498e26bfb199e196548e20) diff --git a/tests/memcsv.c b/tests/memcsv.c index b5ed3b0c..0bbade49 100644 --- a/tests/memcsv.c +++ b/tests/memcsv.c @@ -304,7 +304,7 @@ static char *mystrtok(char *s, char delim) } } - // cppcheck-suppress nullPointerArithmeticRedundantCheck + // cppcheck-suppress * return str + ent_pos; } commit 08680a5f281d070f02db9c8f742bb61318a196a9 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 29 23:47:43 2020 -0500 WSJT-X is working with the IC-729 so promotint to stable https://github.com/Hamlib/Hamlib/issues/429 (cherry picked from commit 06cc95de56dcb3fcb58f79e88c75387437416773) diff --git a/rigs/icom/ic728.c b/rigs/icom/ic728.c index d799f753..2b2617b2 100644 --- a/rigs/icom/ic728.c +++ b/rigs/icom/ic728.c @@ -183,7 +183,7 @@ const struct rig_caps ic729_caps = .mfg_name = "Icom", .version = BACKEND_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, .ptt_type = RIG_PTT_NONE, .dcd_type = RIG_DCD_NONE, commit 459a0303c31bba55a7a20603dda9fa4e4295b29d Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 29 22:45:57 2020 -0500 Finish IC-729 addition https://github.com/Hamlib/Hamlib/issues/429 (cherry picked from commit f55d50c7bcfc5a32e6a9fa7c6c0ab21e2a2791a8) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index eab78ea7..fadfd433 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -7570,6 +7570,7 @@ DECLARE_INITRIG_BACKEND(icom) rig_register(&ic781_caps); rig_register(&ic707_caps); rig_register(&ic728_caps); + rig_register(&ic729_caps); rig_register(&ic820h_caps); rig_register(&ic821h_caps); diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 808b7521..a52b9069 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -347,6 +347,7 @@ extern const struct rig_caps ic718_caps; extern const struct rig_caps ic725_caps; extern const struct rig_caps ic726_caps; extern const struct rig_caps ic728_caps; +extern const struct rig_caps ic729_caps; extern const struct rig_caps ic735_caps; extern const struct rig_caps ic736_caps; extern const struct rig_caps ic737_caps; commit acfb0d4c9ec218e426af622f570f355b87fbff05 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 29 22:30:34 2020 -0500 Add IC-729 https://github.com/Hamlib/Hamlib/issues/429 (cherry picked from commit c8eaafb499948cb28ea41205dbd4b81ae0d76a90) diff --git a/rigs/icom/ic728.c b/rigs/icom/ic728.c index 5d75075b..d799f753 100644 --- a/rigs/icom/ic728.c +++ b/rigs/icom/ic728.c @@ -168,3 +168,121 @@ const struct rig_caps ic728_caps = }; +static const struct icom_priv_caps ic729_priv_caps = +{ + 0x3a, /* default address */ + 0, /* 731 mode */ + 0, /* no XCHG */ + ic737_ts_sc_list +}; + +const struct rig_caps ic729_caps = +{ + RIG_MODEL(RIG_MODEL_IC729), + .model_name = "IC-729", + .mfg_name = "Icom", + .version = BACKEND_VER ".0", + .copyright = "LGPL", + .status = RIG_STATUS_ALPHA, + .rig_type = RIG_TYPE_TRANSCEIVER, + .ptt_type = RIG_PTT_NONE, + .dcd_type = RIG_DCD_NONE, + .port_type = RIG_PORT_SERIAL, + .serial_rate_min = 1200, + .serial_rate_max = 9600, + .serial_data_bits = 8, + .serial_stop_bits = 2, + .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 = IC728_VFO_OPS, + .scan_ops = IC728_SCAN_OPS, + .transceive = RIG_TRN_RIG, + .bank_qty = 0, + .chan_desc_sz = 0, + + .chan_list = { + { 1, 26, RIG_MTYPE_MEM, IC_MIN_MEM_CAP }, + RIG_CHAN_END, + }, + + .rx_range_list1 = { + {kHz(500), MHz(30), IC728_ALL_RX_MODES, -1, -1, IC728_VFO_ALL}, + RIG_FRNG_END, + }, + .tx_range_list1 = { + FRQ_RNG_HF(1, IC728_OTHER_TX_MODES, W(10), W(100), IC728_VFO_ALL, IC728_ANTS), + FRQ_RNG_HF(1, IC728_AM_TX_MODES, W(10), W(40), IC728_VFO_ALL, IC728_ANTS), /* AM class */ + RIG_FRNG_END, + }, + + .rx_range_list2 = { + {kHz(500), MHz(30), IC728_ALL_RX_MODES, -1, -1, IC728_VFO_ALL}, + RIG_FRNG_END, + }, + .tx_range_list2 = { + FRQ_RNG_HF(2, IC728_OTHER_TX_MODES, W(10), W(100), IC728_VFO_ALL, IC728_ANTS), + FRQ_RNG_HF(2, IC728_AM_TX_MODES, W(10), W(40), IC728_VFO_ALL, IC728_ANTS), /* AM class */ + RIG_FRNG_END, + }, + + .tuning_steps = { + {IC728_ALL_RX_MODES, 10}, /* basic resolution, there's no set_ts */ + RIG_TS_END, + }, + /* mode/filter list, remember: order matters! */ + .filters = { + {RIG_MODE_SSB | RIG_MODE_CW, kHz(2.1)}, + {RIG_MODE_AM, kHz(6)}, + {RIG_MODE_FM, kHz(12)}, + RIG_FLT_END, + }, + + .cfgparams = icom_cfg_params, + .set_conf = icom_set_conf, + .get_conf = icom_get_conf, + + .priv = (void *)& ic729_priv_caps, + .rig_init = icom_init, + .rig_cleanup = icom_cleanup, + .rig_open = icom_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, + .set_split_vfo = icom_set_split_vfo, + .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, + + .scan = icom_scan, + + .decode_event = icom_decode_event, + .set_mem = icom_set_mem, + .vfo_op = icom_vfo_op, + +}; + commit f4848a8e0f8b74368b2c15ff495967ba1718c315 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 29 12:54:35 2020 -0500 remove some cppcheck statements not needed anymore (cherry picked from commit 07447c881d8efd68205f06a183fab08cb09372ce) diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index b81db412..03474a84 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -24,13 +24,9 @@ #ifndef _RIG_H #define _RIG_H 1 -// cppcheck-suppress * #include <stdio.h> -// cppcheck-suppress * #include <stdarg.h> -// cppcheck-suppress * #include <inttypes.h> -// cppcheck-suppress * #include <time.h> /* Rig list is in a separate file so as not to mess up w/ this one */ @@ -2787,7 +2783,6 @@ extern HAMLIB_EXPORT(int) rig_set_cache_timeout_ms(RIG *rig, hamlib_cache_t sele extern HAMLIB_EXPORT(int) rig_set_vfo_opt(RIG *rig, int status); -// cppcheck-suppress * typedef unsigned long rig_useconds_t; extern HAMLIB_EXPORT(int) hl_usleep(rig_useconds_t msec); commit 8e44485802b32fa9dbbea1186f802b521994665c Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 29 12:54:13 2020 -0500 update newcat.h version (cherry picked from commit 73d05831f3e896c5b336f1588bcb643c2a4f821a) diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index ff2bb045..85ff10a2 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201028" +#define NEWCAT_VER "20201029" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit 6eca8e7fb836f14bd0896692e11e76a1c27c564e Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 29 12:53:39 2020 -0500 remove some cppcheck statements not needed anymore (cherry picked from commit 378cbfb0082cfd02fcfff740f56afdedf21dd225) diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 4e0bcd06..808b7521 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -27,7 +27,6 @@ #include "tones.h" #ifdef HAVE_SYS_TIME_H -// cppcheck-suppress * #include <sys/time.h> #endif commit 3096b403888b4d255c29896ea4a822e21cb2fd78 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 29 12:52:54 2020 -0500 remove some cppcheck statements not needed anymore (cherry picked from commit 0fef98fc43c37c9da7ccea2cd29123aa30ae29b9) diff --git a/src/iofunc.h b/src/iofunc.h index a1edbdff..efe8b668 100644 --- a/src/iofunc.h +++ b/src/iofunc.h @@ -22,7 +22,6 @@ #ifndef _IOFUNC_H #define _IOFUNC_H 1 -// cppcheck-suppress * #include <sys/types.h> #include <hamlib/rig.h> diff --git a/src/misc.h b/src/misc.h index 24aa869f..5378f1da 100644 --- a/src/misc.h +++ b/src/misc.h @@ -84,12 +84,10 @@ extern int no_restore_ai; /* needs config.h included beforehand in .c file */ #ifdef HAVE_INTTYPES_H -// cppcheck-suppress * # include <inttypes.h> #endif #ifdef HAVE_SYS_TIME_H -// cppcheck-suppress * # include <sys/time.h> #endif diff --git a/src/parallel.h b/src/parallel.h index 56afaca2..c676ee43 100644 --- a/src/parallel.h +++ b/src/parallel.h @@ -27,7 +27,6 @@ #include "iofunc.h" #ifdef HAVE_LINUX_PARPORT_H -// cppcheck-suppress * # include <linux/parport.h> #endif commit d19eb9ff3c4d4411336273a8fb42d98ede418fd0 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 29 12:52:09 2020 -0500 remove some cppcheck statements not needed anymore (cherry picked from commit ce7a30f038417be93507b44f5aa1ff723aa5ac80) diff --git a/tests/memcsv.c b/tests/memcsv.c index 8e27088f..b5ed3b0c 100644 --- a/tests/memcsv.c +++ b/tests/memcsv.c @@ -25,20 +25,13 @@ # include "config.h" #endif -// cppcheck-suppress * #include <stdio.h> -// cppcheck-suppress * #include <stdlib.h> -// cppcheck-suppress * #include <string.h> -// cppcheck-suppress * #include <unistd.h> -// cppcheck-suppress * #include <ctype.h> -// cppcheck-suppress * #include <errno.h> -// cppcheck-suppress * #include <getopt.h> #include <hamlib/rig.h> @@ -311,7 +304,7 @@ static char *mystrtok(char *s, char delim) } } - // cppcheck-suppress * + // cppcheck-suppress nullPointerArithmeticRedundantCheck return str + ent_pos; } commit 88a0ef4609bed069de117932812758813d8a6444 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 29 10:24:25 2020 -0500 Fix newcat_band_index frequencies https://github.com/Hamlib/Hamlib/issues/424 (cherry picked from commit 9f65348f496cdb4325a5ff916e0d8a30637a7aba) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index ed52d54b..285bdef0 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -391,28 +391,29 @@ static ncboolean newcat_valid_command(RIG *rig, char const *const command); */ static int newcat_band_index(freq_t freq) { - // FTDX101D has band=12=MW...what is that? + // FTDX101D has band=12=MW Medium Wave int band = 11; // general // what about 13? - if (freq >= 420 && freq < 470) { band = 16; } - else if (freq >= 144 && freq < 148) { band = 15; } - else if (freq >= 118 && freq < 164) { band = 14; } - else if (freq >= 70 && freq < 75) { band = 17; } - else if (freq >= 50 && freq < 54) { band = 10; } + if (freq >= MHz(420) && freq < MHz(470)) { band = 16; } + else if (freq >= MHz(144) && freq < MHz(148)) { band = 15; } + else if (freq >= MHz(118) && freq < MHz(164)) { band = 14; } + else if (freq >= MHz(70) && freq < MHz(75)) { band = 17; } + else if (freq >= MHz(50) && freq < MHz(54)) { band = 10; } // do we need to restrict ranges below here? - else if (freq >= 28) { band = 9; } - else if (freq >= 24.5) { band = 8; } - else if (freq >= 21) { band = 7; } - else if (freq >= 18) { band = 6; } - else if (freq >= 14) { band = 5; } - else if (freq >= 10) { band = 4; } - else if (freq >= 7) { band = 3; } - else if (freq >= 5) { band = 2; } - else if (freq >= 3.5) { band = 1; } - else if (freq >= 1.8) { band = 0; } - - rig_debug(RIG_DEBUG_TRACE, "%s: band=%d\n", __func__, band); + else if (freq >= MHz(28)) { band = 9; } + else if (freq >= MHz(24.5)) { band = 8; } + else if (freq >= MHz(21)) { band = 7; } + else if (freq >= MHz(18)) { band = 6; } + else if (freq >= MHz(14)) { band = 5; } + else if (freq >= MHz(10)) { band = 4; } + else if (freq >= MHz(7)) { band = 3; } + else if (freq >= MHz(5)) { band = 2; } + else if (freq >= MHz(3.5)) { band = 1; } + else if (freq >= MHz(1.8)) { band = 0; } + else if (freq >= MHz(0.5)) { band = 12; } // MW Medium Wave + + rig_debug(RIG_DEBUG_TRACE, "%s: freq=%g, band=%d\n", __func__, freq, band); return band; } commit 3da2b6e16d662333da57889db36012599bc0eeff Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 29 08:17:40 2020 -0500 Enhance ic7000 set bandwidth and prompt ic7000 to stable https://github.com/Hamlib/Hamlib/issues/428 (cherry picked from commit 31b20c003cc1b4025fff51a85d76468dbfd22031) diff --git a/rigs/icom/ic7000.c b/rigs/icom/ic7000.c index b2169943..b722be8d 100644 --- a/rigs/icom/ic7000.c +++ b/rigs/icom/ic7000.c @@ -135,6 +135,35 @@ struct cmdparams ic7000_extcmds[] = { {.s = RIG_PARM_NONE} } }; +/* + * This function does the special bandwidth coding for IC-7000 + */ +static int ic7000_r2i_mode(RIG *rig, rmode_t mode, pbwidth_t width, + unsigned char *md, signed char *pd) +{ + int err; + + err = rig2icom_mode(rig, mode, width, md, pd); + + if (err != RIG_OK) + { + return err; + } + + // CAT section of manual says: nn = 0 -40 > bw = 50Hz > 3600Hz + // Tested by Ian G3VPX 20201029 + // 0 - 9 > bw 50Hz to 500Hz in 50Hz steps + // 10 - 40 > bw 600Hz to 3600Hz in 100Hz steps + if (width != RIG_PASSBAND_NOCHANGE) + { + if (width <= 500) { *pd = width / 50 - 1; } + else if (width <= 3600) { *pd = width / 100 + 4; } + else { *pd = 40; } + } + + return RIG_OK; +} + /* * IC-7000 rig capabilities. */ @@ -152,6 +181,7 @@ static const struct icom_priv_caps IC7000_priv_caps = { .level = -1, .icom_level = 0 }, }, .extcmds = ic7000_extcmds, + .r2i_mode = ic7000_r2i_mode }; const struct rig_caps ic7000_caps = @@ -159,9 +189,9 @@ const struct rig_caps ic7000_caps = RIG_MODEL(RIG_MODEL_IC7000), .model_name = "IC-7000", .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_RIG, .dcd_type = RIG_DCD_RIG, commit 8b9e45216ea92b8ad2b818cd7769836ca92a20a6 Author: Nate Bargmann <n0...@n0...> Date: Thu Oct 29 07:43:56 2020 -0500 Match rigs/yaesu/newcat.c and ftdx1010.h to the version in the master branch This likely means that its behavior is entirely broken in this branch up to this commit due to trying to fix cherry-pick conflicts and choosing the wrong one... diff --git a/rigs/yaesu/ftdx101.h b/rigs/yaesu/ftdx101.h index b810fcb7..66be4a8a 100644 --- a/rigs/yaesu/ftdx101.h +++ b/rigs/yaesu/ftdx101.h @@ -71,6 +71,7 @@ RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\ RIG_OP_TO_VFO|RIG_OP_FROM_VFO|RIG_OP_TOGGLE) +// Based on testing with G3VPX Ian Sumner #define FTDX101D_SWR_CAL \ { \ 8, \ diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index d3a28274..ed52d54b 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -151,15 +151,49 @@ const cal_table_float_t yaesu_default_alc_cal = { 3, { - // Based on testing with G3VPX Ian Sumner - {0, 1.0f}, - {26, 1.2f}, - {52, 1.5f}, - {89, 2.0f}, - {126, 3.0f}, - {173, 4.0f}, - {236, 5.0f}, - {255, 25.0f}, + {0, 0.0f}, + {128, 1.0f}, + {255, 2.0f}, + } +}; + +// TODO: Provide sane defaults +const cal_table_float_t yaesu_default_comp_meter_cal = +{ + 2, + { + {0, 0.0f}, + {255, 1.0f}, + } +}; + +// TODO: Provide sane defaults +const cal_table_float_t yaesu_default_rfpower_meter_cal = +{ + 2, + { + {0, 0.0f}, + {255, 1.0f}, + } +}; + +// TODO: Provide sane defaults +const cal_table_float_t yaesu_default_vd_meter_cal = +{ + 2, + { + {0, 0.0f}, + {255, 1.0f}, + } +}; + +// TODO: Provide sane defaults +const cal_table_float_t yaesu_default_id_meter_cal = +{ + 2, + { + {0, 0.0f}, + {255, 1.0f}, } }; commit 1133b783e430352267e2e12413add23983acb403 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Oct 28 09:43:26 2020 -0500 Fix newcat_band_index May need some more restrictions if people are using odd frequencies https://github.com/Hamlib/Hamlib/issues/424 (cherry picked from commit bd47d262b8e415e04a569126a31406641b9d8ea3) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 2c372e62..d3a28274 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -360,9 +360,13 @@ static int newcat_band_index(freq_t freq) // FTDX101D has band=12=MW...what is that? int band = 11; // general - if (freq >= 70) { band = 17; } - // what about 11-16? - else if (freq >= 50) { band = 10; } + // what about 13? + if (freq >= 420 && freq < 470) { band = 16; } + else if (freq >= 144 && freq < 148) { band = 15; } + else if (freq >= 118 && freq < 164) { band = 14; } + else if (freq >= 70 && freq < 75) { band = 17; } + else if (freq >= 50 && freq < 54) { band = 10; } + // do we need to restrict ranges below here? else if (freq >= 28) { band = 9; } else if (freq >= 24.5) { band = 8; } else if (freq >= 21) { band = 7; } commit 0b2d68d1f233681cacebfb148b3813b915cbfdc9 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Oct 28 09:26:06 2020 -0500 Fix newcat_band_index https://github.com/Hamlib/Hamlib/issues/424 (cherry picked from commit cc529aab0cd57347a562d1cc3ca040400ed5afbf) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 2976f66e..2c372e62 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -360,19 +360,19 @@ static int newcat_band_index(freq_t freq) // FTDX101D has band=12=MW...what is that? int band = 11; // general - if (freq >= 1.8) { band = 0; } - else if (freq >= 3.5) { band = 1; } - else if (freq >= 5) { band = 2; } - else if (freq >= 7) { band = 3; } - else if (freq >= 10) { band = 4; } - else if (freq >= 14) { band = 5; } - else if (freq >= 18) { band = 6; } - else if (freq >= 21) { band = 7; } - else if (freq >= 24.5) { band = 8; } - else if (freq >= 28) { band = 9; } - else if (freq >= 50) { band = 10; } + if (freq >= 70) { band = 17; } // what about 11-16? - else if (freq >= 70) { band = 17; } + else if (freq >= 50) { band = 10; } + else if (freq >= 28) { band = 9; } + else if (freq >= 24.5) { band = 8; } + else if (freq >= 21) { band = 7; } + else if (freq >= 18) { band = 6; } + else if (freq >= 14) { band = 5; } + else if (freq >= 10) { band = 4; } + else if (freq >= 7) { band = 3; } + else if (freq >= 5) { band = 2; } + else if (freq >= 3.5) { band = 1; } + else if (freq >= 1.8) { band = 0; } rig_debug(RIG_DEBUG_TRACE, "%s: band=%d\n", __func__, band); return band; commit 98e87d91d5390d3e58cec68c1c03e30aad698a24 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Oct 28 08:53:55 2020 -0500 Make the BS cmd write the band instead of read it in newcat.c https://github.com/Hamlib/Hamlib/issues/424 (cherry picked from commit aeabe40acde2fb7a86e204bcde7d707bc41e8f8a) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index c30f16e0..2976f66e 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -731,7 +731,8 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) if (newcat_valid_command(rig, "BS") && newcat_band_index(freq) != newcat_band_index(rig->state.current_freq)) { - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BS%c", cat_term); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "BS%02d%c", + ... [truncated message content] |
From: Nate B. <n0...@us...> - 2020-10-03 16:30:40
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, Hamlib-4.0 has been updated via 506cd8118442173ee275c60651bf80c09974a76e (commit) via 98045329d4615ca910535585ac8d8b9e824029fd (commit) via 2b5cfb37c911de699820f8997d20b938801a5462 (commit) via e062000aa341b45c1104ad8bd3ea232b07071ccc (commit) via b2227c20005dd2615380479a336d1565c31ac178 (commit) via 755d719505971b12fbdce6ba6f821dc636dc3251 (commit) via e7b881712d0367439bcc630a6afec1286e1e83c2 (commit) via e63087ccd4d4f36955e377f78dedd0b669a209c2 (commit) via fd27a7a3af221e4d50771306a2c4fb6f0eed3321 (commit) via fe3d7a108f3fbff3008f74f1f15458bc2e8bd613 (commit) via dcf43f537ef096239448c3f5f8451c15a54e937f (commit) via f96440fb9200d6d070d9b306f77c2f0f5a56ace9 (commit) via 7c03ec7e236173c3a54255e270cd4ed9627bf7b7 (commit) via fdbdb9bbf7cd44791069909eb116bc97f27314c2 (commit) via 2454771cbb0efd2c4f76d9984ca7750cf4a45239 (commit) via 0d4e5aae6dff52b3059bad92c14e2920d09fdedb (commit) via 6b34508ffa1977b1f30da77c63c88caa5dd0f871 (commit) via 3a93eb0adc09945df9b71679020f4fa519302d8f (commit) via 29a09d0f46894cf9b85673c4bda6c396cf1d7512 (commit) via a963a9f486ec32f826b99834b72c00de630a3f0a (commit) via f17c578c0c423ba0772380250f472c1db7782f75 (commit) via dc494a9687f494be0839c05984226ea7ca4c5d16 (commit) via eb9b55cab0a13d6fdd3394b494687417726c4315 (commit) via dffdc904a06c1e813bd8a2a223d764048e988e1c (commit) via 2aaa5af80c6edfb79d9d23741b98f8855abba624 (commit) via af76fe554a2d68d4be21959057eb00288086a211 (commit) via 8965b62cd68a2513d583860952dd688394f3651a (commit) via 309e19b273f48473d43edb44fcf83db009183b4a (commit) via f43a266cdfdb9ca3bb7dbcedd24785da5a92832c (commit) via 7c008339e9c3a7c3c1dd2da53c128f56f1c6bc83 (commit) via e569113f448ab3a3a8c7e8afd0b77d06e1bb7129 (commit) via 65fcdb0f0836d18df9ea84d0c7769b3fea3910f7 (commit) from 89b290f946062e878b9f249f4205c73d7a6c6707 (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 506cd8118442173ee275c60651bf80c09974a76e Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Oct 3 00:16:02 2020 -0500 Implemented dynamic detection of RFPOWER levels for Kenwoods Need to remove RFPOWER customizations from other Kenwood backends now Need to do this same thing for MICGAIN https://github.com/Hamlib/Hamlib/issues/389 (cherry picked from commit 5ae848c48f1810fa81deb8365cb89e552740c8b7) diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 374b9cff..4dc3ca1c 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2179,6 +2179,63 @@ int kenwood_get_mode_if(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) return RIG_OK; } +/* kenwood_get_power_minmax + * Kenwood rigs have different power levels by mode and by rig + * This routine relies on the idea that setting the power + * to 0 and 255 will result in the minimum and maximum values being set + * If a rig doesn't behave this way then customize inside that rig's backend +*/ +static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min, + int *power_max, + int restore) +{ + int retval; + char levelbuf[19]; + // 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 + // otherwise we expect calling routine to be setting new power level + // we batch these commands together for speed + char *cmd = "PC;PC000;PC;PC255;PC;PC000;"; + int n; + struct rig_state *rs = &rig->state; + + rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__); + retval = write_block(&rs->rigport, cmd, strlen(cmd)); + + if (retval != RIG_OK) { return retval; } + + retval = read_string(&rs->rigport, levelbuf, sizeof(levelbuf), NULL, 0); + + rig_debug(RIG_DEBUG_TRACE, "%s: retval=%d\n", __func__, retval); + + if (retval != 18) + { + rig_debug(RIG_DEBUG_ERR, "%s: expected 19, got %d in '%s'\n", __func__, retval, + levelbuf); + return -RIG_EPROTO; + } + + n = sscanf(levelbuf, "PC%d;PC%d;PC%d", power_now, power_min, power_max); + + if (n != 3) + { + rig_debug(RIG_DEBUG_ERR, "%s: count not parse 3 values from '%s'\n", __func__, + levelbuf); + return -RIG_EPROTO; + } + + if (restore) + { + snprintf(levelbuf, sizeof(levelbuf), "PC%03d;", *power_now); + retval = kenwood_transaction(rig, levelbuf, NULL, 0); + return retval; + } + + rig_debug(RIG_DEBUG_TRACE, "%s: returning now=%d, min=%d, max=%d\n", __func__, + *power_now, *power_min, *power_max); + return RIG_OK; +} + int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { char levelbuf[16]; @@ -2198,12 +2255,16 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) switch (level) { + int power_now, power_min, power_max; + int retval; + 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, 0); - /* - * Best estimate: 1.0 corresponds to 100W - */ - kenwood_val = val.f * 100; + if (retval != RIG_OK) { return retval; } + + kenwood_val = val.f * (power_max - power_min) + power_min; snprintf(levelbuf, sizeof(levelbuf), "PC%03d", kenwood_val); break; @@ -2425,6 +2486,8 @@ 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) { @@ -2562,12 +2625,13 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_RFPOWER: - /* - * an answer "PC100" means 100 Watt - */ - ret = get_kenwood_level(rig, "PC", NULL, &val->i); - val->f = val->i / 100.0; - return ret; + // 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) { return retval; } + + val->f = (power_now - power_min) / (float)(power_max - power_min); + return RIG_OK; case RIG_LEVEL_AF: diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index ce8ec5b2..ecc284ff 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -27,7 +27,7 @@ #include <string.h> #include "token.h" -#define BACKEND_VER "20200930" +#define BACKEND_VER "20201002" #define EOM_KEN ';' #define EOM_TH '\r' diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index be13fc6d..0f6a97ac 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -111,9 +111,7 @@ kenwood_ts480_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) switch (level) { case RIG_LEVEL_RFPOWER: - kenwood_val = val.f * 100; /* level for TS480SAT is from 0.. 100W in SSB */ - sprintf(levelbuf, "PC%03d", kenwood_val); - break; + return kenwood_set_level(rig, vfo, level, val); case RIG_LEVEL_AF: return kenwood_set_level(rig, vfo, level, val); @@ -246,29 +244,6 @@ kenwood_ts480_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) switch (level) { - case RIG_LEVEL_RFPOWER: - retval = kenwood_transaction(rig, "PC", ackbuf, sizeof(ackbuf)); - - if (RIG_OK != retval) - { - return retval; - } - - ack_len = strlen(ackbuf); - - if (5 != ack_len) - { - return -RIG_EPROTO; - } - - if (1 != sscanf(&ackbuf[2], "%d", &levelint)) - { - return -RIG_EPROTO; - } - - val->f = (float) levelint / 100.; - return RIG_OK; - case RIG_LEVEL_AF: if (rig->caps->rig_model == RIG_MODEL_TS890S) { @@ -424,6 +399,9 @@ kenwood_ts480_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return RIG_OK; + case RIG_LEVEL_RFPOWER: + return kenwood_get_level(rig, vfo, level, val); + case RIG_LEVEL_MICGAIN: case RIG_LEVEL_PREAMP: case RIG_LEVEL_IF: commit 98045329d4615ca910535585ac8d8b9e824029fd Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Oct 2 23:00:53 2020 -0500 Remove debug (cherry picked from commit 86949c4ef711d5e4baa86241d7e7579bdffef1e3) diff --git a/src/iofunc.c b/src/iofunc.c index 6fc16ae1..c3677a7f 100644 --- a/src/iofunc.c +++ b/src/iofunc.c @@ -753,7 +753,6 @@ int HAMLIB_API read_string(hamlib_port_t *p, */ rd_count = port_read(p, &rxbuffer[total_count], 1); - rig_debug(RIG_DEBUG_TRACE, "%s: YYY rd_count=%d, total_count=%d\n", __func__, rd_count, total_count); /* if we get 0 bytes or an error something is wrong */ if (rd_count <= 0) { commit 2b5cfb37c911de699820f8997d20b938801a5462 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Oct 2 15:46:06 2020 -0700 Fix kenwood RFPOWER...more to come to make it know the max power possible https://github.com/Hamlib/Hamlib/issues/389 (cherry picked from commit ba943ae4b9209dfb7f4ed2cdb3efff679c71b900) diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 02dac60a..374b9cff 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2566,7 +2566,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) * an answer "PC100" means 100 Watt */ ret = get_kenwood_level(rig, "PC", NULL, &val->i); - val->f = val->f / 100.0; + val->f = val->i / 100.0; return ret; case RIG_LEVEL_AF: commit e062000aa341b45c1104ad8bd3ea232b07071ccc Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Oct 2 17:23:48 2020 -0500 Fix W command speed by using bytes requested correctly read_string now recognizes binary strings to read 5X more bytes Fixed Reply: prompt double output and space after : https://github.com/Hamlib/Hamlib/issues/387 (cherry picked from commit 293a844c41945db98dc6d8fa3036fec598de56a0) diff --git a/src/iofunc.c b/src/iofunc.c index d7380bce..6fc16ae1 100644 --- a/src/iofunc.c +++ b/src/iofunc.c @@ -753,6 +753,7 @@ int HAMLIB_API read_string(hamlib_port_t *p, */ rd_count = port_read(p, &rxbuffer[total_count], 1); + rig_debug(RIG_DEBUG_TRACE, "%s: YYY rd_count=%d, total_count=%d\n", __func__, rd_count, total_count); /* if we get 0 bytes or an error something is wrong */ if (rd_count <= 0) { @@ -765,6 +766,8 @@ int HAMLIB_API read_string(hamlib_port_t *p, return -RIG_EIO; } + // check to see if our string startis with \...if so we need more chars + if (total_count == 0 && rxbuffer[total_count] == '\\') rxmax = (rxmax-1)*5; ++total_count; if (stopset && memchr(stopset, rxbuffer[total_count - 1], stopset_len)) diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index ce37d0a5..3d1e8da3 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -989,11 +989,13 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc, { rig_debug(RIG_DEBUG_TRACE, "%s: debug7\n", __func__); +#if 0 // was printing Reply: twice if (prompt) { rig_debug(RIG_DEBUG_TRACE, "%s: debug8\n", __func__); fprintf_flush(fout, "%s: ", cmd_entry->arg2); } +#endif if (scanfc(fin, "%s", arg2) < 1) { @@ -4285,11 +4287,11 @@ declare_proto_rig(get_powerstat) return status; } -static int hasbinary(char *s) +static int hasbinary(char *s, int len) { int i; - for (i = 0; s[i] != 0; ++i) + for (i = 0; i < len; ++i) { if (!isascii(s[i])) { return 1; } } @@ -4309,7 +4311,7 @@ declare_proto_rig(send_cmd) struct rig_state *rs; int backend_num, cmd_len; #define BUFSZ 128 - char bufcmd[BUFSZ]; + char bufcmd[BUFSZ*5]; // allow for 5 chars for binary unsigned char buf[BUFSZ]; char eom_buf[4] = { 0xa, 0xd, 0, 0 }; int binary = 0; @@ -4414,7 +4416,7 @@ declare_proto_rig(send_cmd) rig_flush(&rs->rigport); rig_debug(RIG_DEBUG_TRACE, "%s: rigport=%d, bufcmd=%s, cmd_len=%d\n", __func__, - rs->rigport.fd, hasbinary(bufcmd) ? "BINARY" : bufcmd, cmd_len); + rs->rigport.fd, hasbinary(bufcmd, cmd_len) ? "BINARY" : bufcmd, cmd_len); retval = write_block(&rs->rigport, (char *)bufcmd, cmd_len); if (retval != RIG_OK) @@ -4426,7 +4428,7 @@ declare_proto_rig(send_cmd) { rig_debug(RIG_DEBUG_TRACE, "%s: debug Cmd\n", __func__); fwrite(cmd->arg2, 1, strlen(cmd->arg2), fout); /* i.e. "Frequency" */ - fwrite(":", 1, 1, fout); /* i.e. "Frequency" */ + fwrite(": ", 1, 2, fout); /* i.e. "Frequency" */ } do @@ -4436,9 +4438,6 @@ declare_proto_rig(send_cmd) if (rxbytes > 0) { ++rxbytes; // need length + 1 for end of string - - if (cmd->cmd == 'W') { rxbytes *= 5; } - eom_buf[0] = 0; } @@ -4463,10 +4462,10 @@ declare_proto_rig(send_cmd) buf[BUFSZ - 1] = '\0'; } - if (rig->caps->rig_model != RIG_MODEL_NETRIGCTL) + //if (rig->caps->rig_model != RIG_MODEL_NETRIGCTL) { // see if we have binary being returned - binary = hasbinary((char *)buf); + binary = hasbinary((char *)buf, retval); } if (binary) // convert our buf to a hex representation commit b2227c20005dd2615380479a336d1565c31ac178 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 1 22:51:31 2020 -0500 astyle files (cherry picked from commit 0576a01ec2b73cafec6f1ea5506d014fa82d75ff) diff --git a/dummy/dummy.c b/dummy/dummy.c index 5bfad894..f7382559 100644 --- a/dummy/dummy.c +++ b/dummy/dummy.c @@ -1273,21 +1273,23 @@ static int dummy_set_ext_func(RIG *rig, vfo_t vfo, token_t token, int status) switch (token) { - case TOK_EL_MAGICEXTFUNC: - break; + case TOK_EL_MAGICEXTFUNC: + break; - default: - return -RIG_EINVAL; + default: + return -RIG_EINVAL; } switch (cfp->type) { - case RIG_CONF_CHECKBUTTON: - break; - case RIG_CONF_BUTTON: - break; - default: - return -RIG_EINTERNAL; + case RIG_CONF_CHECKBUTTON: + break; + + case RIG_CONF_BUTTON: + break; + + default: + return -RIG_EINTERNAL; } elp = find_ext(priv->ext_funcs, token); @@ -1301,7 +1303,7 @@ static int dummy_set_ext_func(RIG *rig, vfo_t vfo, token_t token, int status) elp->val.i = status; rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s %d\n", __func__, - cfp->name, status); + cfp->name, status); return RIG_OK; } @@ -1322,10 +1324,11 @@ static int dummy_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status) switch (token) { - case TOK_EL_MAGICEXTFUNC: - break; - default: - return -RIG_EINVAL; + case TOK_EL_MAGICEXTFUNC: + break; + + default: + return -RIG_EINVAL; } elp = find_ext(priv->ext_funcs, token); @@ -1339,7 +1342,7 @@ static int dummy_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status) *status = elp->val.i; rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, - cfp->name); + cfp->name); return RIG_OK; } diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 4f059a0d..d57ba7d0 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -901,7 +901,7 @@ int ic7300_set_parm(RIG *rig, setting_t parm, value_t val) switch (parm) { - unsigned char prmbuf[MAXFRAMELEN]; + unsigned char prmbuf[MAXFRAMELEN]; case RIG_PARM_ANN: { diff --git a/rigs/icom/ic7600.c b/rigs/icom/ic7600.c index dec54753..9c2fc55e 100644 --- a/rigs/icom/ic7600.c +++ b/rigs/icom/ic7600.c @@ -129,7 +129,8 @@ struct cmdparams ic7600_extcmds[] = { { 0 } } }; -int ic7600_ext_tokens[] = { +int ic7600_ext_tokens[] = +{ TOK_DRIVE_GAIN, TOK_BACKEND_NONE }; diff --git a/rigs/icom/ic7610.c b/rigs/icom/ic7610.c index 66670451..a121bbd3 100644 --- a/rigs/icom/ic7610.c +++ b/rigs/icom/ic7610.c @@ -127,7 +127,8 @@ struct cmdparams ic7610_extcmds[] = { { 0 } } }; -int ic7610_ext_tokens[] = { +int ic7610_ext_tokens[] = +{ TOK_DRIVE_GAIN, TOK_DIGI_SEL_FUNC, TOK_DIGI_SEL_LEVEL, TOK_BACKEND_NONE }; diff --git a/rigs/icom/ic7700.c b/rigs/icom/ic7700.c index 03f4d5c6..03d2f7c8 100644 --- a/rigs/icom/ic7700.c +++ b/rigs/icom/ic7700.c @@ -111,7 +111,8 @@ struct cmdparams ic7700_extcmds[] = { { 0 } } }; -int ic7700_ext_tokens[] = { +int ic7700_ext_tokens[] = +{ TOK_DRIVE_GAIN, TOK_DIGI_SEL_FUNC, TOK_DIGI_SEL_LEVEL, TOK_BACKEND_NONE }; diff --git a/rigs/icom/ic7800.c b/rigs/icom/ic7800.c index e3ad8de4..ef9b83ef 100644 --- a/rigs/icom/ic7800.c +++ b/rigs/icom/ic7800.c @@ -114,7 +114,8 @@ struct cmdparams ic7800_extcmds[] = { { 0 } } }; -int ic7800_ext_tokens[] = { +int ic7800_ext_tokens[] = +{ TOK_DRIVE_GAIN, TOK_DIGI_SEL_FUNC, TOK_DIGI_SEL_LEVEL, TOK_BACKEND_NONE }; @@ -347,6 +348,7 @@ int ic7800_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } return icom_set_level(rig, vfo, level, val); + default: return icom_set_level(rig, vfo, level, val); } @@ -378,7 +380,9 @@ int ic7800_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { val->i = rig->state.attenuator[val->i - 1]; } + break; + default: return icom_get_level(rig, vfo, level, val); } diff --git a/rigs/icom/ic785x.c b/rigs/icom/ic785x.c index f100d238..6f7fb9a3 100644 --- a/rigs/icom/ic785x.c +++ b/rigs/icom/ic785x.c @@ -120,7 +120,8 @@ struct cmdparams ic785x_extcmds[] = }; -int ic785x_ext_tokens[] = { +int ic785x_ext_tokens[] = +{ TOK_DRIVE_GAIN, TOK_DIGI_SEL_FUNC, TOK_DIGI_SEL_LEVEL, TOK_BACKEND_NONE }; @@ -331,5 +332,5 @@ int ic785x_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) int ic785x_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { - return ic7800_get_level(rig, vfo, level, val); + return ic7800_get_level(rig, vfo, level, val); } diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index df5b4a59..63007070 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -3241,9 +3241,12 @@ int icom_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status) { value_t value; int result = icom_get_ext_cmd(rig, vfo, token, &value); - if (result == RIG_OK) { + + if (result == RIG_OK) + { *status = value.i; } + return result; } else { i++; } @@ -5411,6 +5414,7 @@ int icom_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); value_t value; + for (i = 0; extcmds && extcmds[i].id.s != 0; i++) { rig_debug(RIG_DEBUG_TRACE, "%s: i=%d\n", __func__, i); @@ -5418,9 +5422,12 @@ int icom_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) if (extcmds[i].cmdparamtype == CMD_PARAM_TYPE_FUNC && extcmds[i].id.s == func) { int result = icom_get_cmd(rig, vfo, (struct cmdparams *)&extcmds[i], &value); - if (result == RIG_OK) { + + if (result == RIG_OK) + { *status = value.i; } + return result; } } diff --git a/rigs/kenwood/elecraft.c b/rigs/kenwood/elecraft.c index 97bc1381..3fedc481 100644 --- a/rigs/kenwood/elecraft.c +++ b/rigs/kenwood/elecraft.c @@ -183,31 +183,44 @@ int elecraft_open(RIG *rig) case RIG_MODEL_K3S: case RIG_MODEL_KX2: case RIG_MODEL_KX3: - // we need to know what's hooked up for PC command max levels - err = kenwood_safe_transaction(rig, "OM", buf, KENWOOD_MAX_BUF_LEN, 15); - if (err != RIG_OK) { return err; } - rig_debug(RIG_DEBUG_TRACE, "%s: OM=%s\n", __func__, buf); - priv->has_kpa3 = 0; - if (strstr(buf,"P")) priv->has_kpa3 = 1; - if (buf[13] == '0') // then we have a KX3 or KX2 - { - char modelnum; - modelnum = buf[14]; - switch (modelnum) - { - case '1': model = "KX2";break; - case '2': model = "KX3";break; - default: - rig_debug(RIG_DEBUG_ERR, "%s: Unknown Elecraft modelnum=%c, expected 1 or 2\n", __func__, modelnum); - break; - } - if (strstr(buf,"P")) priv->has_kpa100 = 1; - } - else { - model = "K3"; - if (strstr(buf,"R")) model = "K3S"; - } - rig_debug(RIG_DEBUG_TRACE, "%s: model=%s, kpa3%d\n", __func__, model, priv->has_kpa3); + // we need to know what's hooked up for PC command max levels + err = kenwood_safe_transaction(rig, "OM", buf, KENWOOD_MAX_BUF_LEN, 15); + + if (err != RIG_OK) { return err; } + + rig_debug(RIG_DEBUG_TRACE, "%s: OM=%s\n", __func__, buf); + priv->has_kpa3 = 0; + + if (strstr(buf, "P")) { priv->has_kpa3 = 1; } + + if (buf[13] == '0') // then we have a KX3 or KX2 + { + char modelnum; + modelnum = buf[14]; + + switch (modelnum) + { + case '1': model = "KX2"; break; + + case '2': model = "KX3"; break; + + default: + rig_debug(RIG_DEBUG_ERR, "%s: Unknown Elecraft modelnum=%c, expected 1 or 2\n", + __func__, modelnum); + break; + } + + if (strstr(buf, "P")) { priv->has_kpa100 = 1; } + } + else + { + model = "K3"; + + if (strstr(buf, "R")) { model = "K3S"; } + } + + rig_debug(RIG_DEBUG_TRACE, "%s: model=%s, kpa3%d\n", __func__, model, + priv->has_kpa3); err = elecraft_get_extension_level(rig, "K2", &priv->k2_ext_lvl); diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index c33357cb..76016dc8 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -1581,44 +1581,54 @@ int k3_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, static int k3_get_maxpower(RIG *rig) { - int retval; - int maxpower = 12; // K3 default power level - char levelbuf[16]; - struct kenwood_priv_data *priv = rig->state.priv; - // default range is 0-12 if there is no KPA3 installed - if (priv->has_kpa3 || priv->has_kpa100) maxpower = 110; - if (RIG_IS_KX2 || RIG_IS_KX3) { - - int bandnum = -1; - retval = kenwood_safe_transaction(rig, "BN", levelbuf, KENWOOD_MAX_BUF_LEN, 4); - if (retval != RIG_OK) { return retval; } - sscanf(levelbuf,"BN%d", &bandnum); - switch(bandnum) - { - case 1: - case 2: - case 3: - case 4: - case 5: - maxpower = 15; - break; - case 0: // 160M - case 6: // 17M - case 7: // 15M - case 8: // 12M - case 9: // 10M - maxpower = 12; - break; - case 10: // 6M - maxpower = 10; - break; - default: // are transverters all limited to 3W?? - maxpower = 3; - break; - } - } - rig_debug(RIG_DEBUG_TRACE, "%s: maxpower=%d\n", __func__, maxpower); - return maxpower; + int retval; + int maxpower = 12; // K3 default power level + char levelbuf[16]; + struct kenwood_priv_data *priv = rig->state.priv; + + // default range is 0-12 if there is no KPA3 installed + if (priv->has_kpa3 || priv->has_kpa100) { maxpower = 110; } + + if (RIG_IS_KX2 || RIG_IS_KX3) + { + + int bandnum = -1; + retval = kenwood_safe_transaction(rig, "BN", levelbuf, KENWOOD_MAX_BUF_LEN, 4); + + if (retval != RIG_OK) { return retval; } + + sscanf(levelbuf, "BN%d", &bandnum); + + switch (bandnum) + { + case 1: + case 2: + case 3: + case 4: + case 5: + maxpower = 15; + break; + + case 0: // 160M + case 6: // 17M + case 7: // 15M + case 8: // 12M + case 9: // 10M + maxpower = 12; + break; + + case 10: // 6M + maxpower = 10; + break; + + default: // are transverters all limited to 3W?? + maxpower = 3; + break; + } + } + + rig_debug(RIG_DEBUG_TRACE, "%s: maxpower=%d\n", __func__, maxpower); + return maxpower; } int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) @@ -1724,8 +1734,9 @@ int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) break; case RIG_LEVEL_RFPOWER: - snprintf(levelbuf, sizeof(levelbuf), "PC%03d", (int)(val.f * k3_get_maxpower(rig))); - break; + snprintf(levelbuf, sizeof(levelbuf), "PC%03d", + (int)(val.f * k3_get_maxpower(rig))); + break; default: return kenwood_set_level(rig, vfo, level, val); @@ -1970,7 +1981,7 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) sscanf(levelbuf + 2, "%d", &lvl); val->f = (float) lvl / 250.0f; - break; + break; case RIG_LEVEL_AF: retval = kenwood_safe_transaction(rig, "AG", levelbuf, sizeof(levelbuf), 5); @@ -1998,6 +2009,7 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) sscanf(levelbuf + 2, "%d", &lvl); val->f = (float) lvl / 60.0f; break; + case RIG_LEVEL_RFPOWER: retval = kenwood_safe_transaction(rig, "PC", levelbuf, sizeof(levelbuf), 5); @@ -2008,7 +2020,7 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) sscanf(levelbuf + 2, "%d", &lvl); val->f = (float) lvl / k3_get_maxpower(rig); - break; + break; default: return kenwood_get_level(rig, vfo, level, val); @@ -2030,16 +2042,18 @@ int kx3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { case RIG_LEVEL_RF: ival = val.f * (250.0 - 190.0) + 190.0; - snprintf(cmdbuf,sizeof(cmdbuf)-1,"RG%03d", ival); - return kenwood_transaction(rig, cmdbuf, NULL, 0); + snprintf(cmdbuf, sizeof(cmdbuf) - 1, "RG%03d", ival); + return kenwood_transaction(rig, cmdbuf, NULL, 0); + case RIG_LEVEL_AF: - // manual says 0-255 as of Rev G5 but experiment says 0-60 + // manual says 0-255 as of Rev G5 but experiment says 0-60 snprintf(cmdbuf, sizeof(cmdbuf), "AG%03d", (int)(val.f * 60.0f)); - return kenwood_transaction(rig, cmdbuf, NULL, 0); + return kenwood_transaction(rig, cmdbuf, NULL, 0); + case RIG_LEVEL_MICGAIN: - // manual says 0-255 as of Rev G5 but experiment says 0-80 + // manual says 0-255 as of Rev G5 but experiment says 0-80 snprintf(cmdbuf, sizeof(cmdbuf), "MG%03d", (int)(val.f * 80.0f)); - return kenwood_transaction(rig, cmdbuf, NULL, 0); + return kenwood_transaction(rig, cmdbuf, NULL, 0); } return k3_set_level(rig, vfo, level, val); @@ -2055,20 +2069,26 @@ int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { case RIG_LEVEL_AF: retval = get_kenwood_level(rig, "AG", NULL, &val->i); + if (retval != RIG_OK) { return retval; } - // manual says 0-255 as of Rev G5 but experiment says 0-60 + + // manual says 0-255 as of Rev G5 but experiment says 0-60 val->f = val->i / 60.0; return retval; case RIG_LEVEL_RF: retval = get_kenwood_level(rig, "RG", NULL, &val->i); + if (retval != RIG_OK) { return retval; } - val->f = (val->i - 190.0) / (250.0-190.0); + + val->f = (val->i - 190.0) / (250.0 - 190.0); return retval; case RIG_LEVEL_MICGAIN: retval = get_kenwood_level(rig, "MG", NULL, &val->i); + if (retval != RIG_OK) { return retval; } + val->f = val->i / 80.0; return retval; diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 94e33e4f..02dac60a 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2203,7 +2203,7 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) /* * Best estimate: 1.0 corresponds to 100W */ - kenwood_val = val.f * 100; + kenwood_val = val.f * 100; snprintf(levelbuf, sizeof(levelbuf), "PC%03d", kenwood_val); break; @@ -2240,6 +2240,7 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_MICGAIN: if (val.f > 1.0 || val.f < 0) { return -RIG_EINVAL; } + kenwood_val = val.f * 100; snprintf(levelbuf, sizeof(levelbuf), "MG%03d", kenwood_val); break; @@ -2249,6 +2250,7 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) /* XXX check level range */ // KX2 and KX3 have range -190 to 250 if (val.f > 1.0 || val.f < 0) { return -RIG_EINVAL; } + kenwood_val = val.f * 255.0; snprintf(levelbuf, sizeof(levelbuf), "RG%03d", kenwood_val); break; @@ -2661,6 +2663,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) rig_debug(RIG_DEBUG_ERR, "%s: Error getting MICGAIN\n", __func__); return ret; } + val->f = val->i / 255.0; return RIG_OK; diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index bbdad637..b1f17832 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2685,9 +2685,12 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { return -RIG_ENAVAIL; } - if (newcat_is_rig(rig, RIG_MODEL_TS890S)) // new format for the command with VFO selection + + if (newcat_is_rig(rig, + RIG_MODEL_TS890S)) // new format for the command with VFO selection { format = "MS0%d;"; + if (vfo == RIG_VFO_SUB) { format = "MS1%d"; @@ -3672,9 +3675,12 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "NB0%d%c", status ? 1 : 0, cat_term); - if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE){ - priv->cmd_str[2] = main_sub_vfo; + + if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) + { + priv->cmd_str[2] = main_sub_vfo; } + break; case RIG_FUNC_NR: @@ -3685,9 +3691,12 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "NR0%d%c", status ? 1 : 0, cat_term); - if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE){ - priv->cmd_str[2] = main_sub_vfo; + + if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) + { + priv->cmd_str[2] = main_sub_vfo; } + break; case RIG_FUNC_COMP: diff --git a/src/ext.c b/src/ext.c index 3c7adaef..ddd42403 100644 --- a/src/ext.c +++ b/src/ext.c @@ -62,7 +62,8 @@ static int rig_has_ext_token(RIG *rig, token_t token) for (i = 0; ext_tokens[i] != TOK_BACKEND_NONE; i++) { - if (ext_tokens[i] == token) { + if (ext_tokens[i] == token) + { return 1; } } @@ -83,10 +84,10 @@ static int rig_has_ext_token(RIG *rig, token_t token) * rig_ext_func_foreach. */ int HAMLIB_API rig_ext_func_foreach(RIG *rig, - int (*cfunc)(RIG *, - const struct confparams *, - rig_ptr_t), - rig_ptr_t data) + int (*cfunc)(RIG *, + const struct confparams *, + rig_ptr_t), + rig_ptr_t data) { const struct confparams *cfp; @@ -99,7 +100,8 @@ int HAMLIB_API rig_ext_func_foreach(RIG *rig, for (cfp = rig->caps->extfuncs; cfp && cfp->name; cfp++) { - if (!rig_has_ext_token(rig, cfp->token)) { + if (!rig_has_ext_token(rig, cfp->token)) + { continue; } @@ -148,7 +150,8 @@ int HAMLIB_API rig_ext_level_foreach(RIG *rig, for (cfp = rig->caps->extlevels; cfp && cfp->name; cfp++) { - if (!rig_has_ext_token(rig, cfp->token)) { + if (!rig_has_ext_token(rig, cfp->token)) + { continue; } @@ -197,7 +200,8 @@ int HAMLIB_API rig_ext_parm_foreach(RIG *rig, for (cfp = rig->caps->extparms; cfp && cfp->name; cfp++) { - if (!rig_has_ext_token(rig, cfp->token)) { + if (!rig_has_ext_token(rig, cfp->token)) + { continue; } diff --git a/src/settings.c b/src/settings.c index 4a81426a..8cf24837 100644 --- a/src/settings.c +++ b/src/settings.c @@ -534,9 +534,11 @@ int HAMLIB_API rig_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) return caps->set_func(rig, vfo, func, status); } - else { + else + { int targetable = caps->targetable_vfo & RIG_TARGETABLE_FUNC; - rig_debug(RIG_DEBUG_TRACE, "%s: targetable=%d, vfo=%s, currvfo=%s\n", __func__, targetable, rig_strvfo(vfo), rig_strvfo(rig->state.current_vfo)); + rig_debug(RIG_DEBUG_TRACE, "%s: targetable=%d, vfo=%s, currvfo=%s\n", __func__, + targetable, rig_strvfo(vfo), rig_strvfo(rig->state.current_vfo)); } if (!caps->set_vfo) commit 755d719505971b12fbdce6ba6f821dc636dc3251 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 1 16:08:53 2020 -0700 Fix K3/K3S/KX2/KX3 RFPOWER set/get for band specific power levels (cherry picked from commit 3f94e66c9fe8ec3db7fe6494e58592334e913c27) diff --git a/rigs/kenwood/elecraft.c b/rigs/kenwood/elecraft.c index 52e4d249..97bc1381 100644 --- a/rigs/kenwood/elecraft.c +++ b/rigs/kenwood/elecraft.c @@ -94,8 +94,9 @@ int elecraft_get_firmware_revision_level(RIG *rig, const char *cmd, int elecraft_open(RIG *rig) { int err; - char id[KENWOOD_MAX_BUF_LEN]; + char buf[KENWOOD_MAX_BUF_LEN]; struct kenwood_priv_data *priv = rig->state.priv; + char *model = "Unknown"; rig_debug(RIG_DEBUG_VERBOSE, "%s called, rig version=%s\n", __func__, @@ -134,7 +135,7 @@ int elecraft_open(RIG *rig) return err; } - err = read_string(&rs->rigport, id, sizeof(id), ";", 1); + err = read_string(&rs->rigport, buf, sizeof(buf), ";", 1); if (err < 0) { @@ -142,7 +143,7 @@ int elecraft_open(RIG *rig) return err; } - rig_debug(RIG_DEBUG_VERBOSE, "%s: id=%s\n", __func__, id); + rig_debug(RIG_DEBUG_VERBOSE, "%s: id=%s\n", __func__, buf); #if 0 if (err != RIG_OK) @@ -155,7 +156,7 @@ int elecraft_open(RIG *rig) } else // Standard Kenwood { - err = verify_kenwood_id(rig, id); + err = verify_kenwood_id(rig, buf); if (err != RIG_OK) { @@ -182,6 +183,32 @@ int elecraft_open(RIG *rig) case RIG_MODEL_K3S: case RIG_MODEL_KX2: case RIG_MODEL_KX3: + // we need to know what's hooked up for PC command max levels + err = kenwood_safe_transaction(rig, "OM", buf, KENWOOD_MAX_BUF_LEN, 15); + if (err != RIG_OK) { return err; } + rig_debug(RIG_DEBUG_TRACE, "%s: OM=%s\n", __func__, buf); + priv->has_kpa3 = 0; + if (strstr(buf,"P")) priv->has_kpa3 = 1; + if (buf[13] == '0') // then we have a KX3 or KX2 + { + char modelnum; + modelnum = buf[14]; + switch (modelnum) + { + case '1': model = "KX2";break; + case '2': model = "KX3";break; + default: + rig_debug(RIG_DEBUG_ERR, "%s: Unknown Elecraft modelnum=%c, expected 1 or 2\n", __func__, modelnum); + break; + } + if (strstr(buf,"P")) priv->has_kpa100 = 1; + } + else { + model = "K3"; + if (strstr(buf,"R")) model = "K3S"; + } + rig_debug(RIG_DEBUG_TRACE, "%s: model=%s, kpa3%d\n", __func__, model, priv->has_kpa3); + err = elecraft_get_extension_level(rig, "K2", &priv->k2_ext_lvl); if (err != RIG_OK) diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index c1846d3e..c33357cb 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -1579,6 +1579,48 @@ int k3_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, return RIG_OK; } +static int k3_get_maxpower(RIG *rig) +{ + int retval; + int maxpower = 12; // K3 default power level + char levelbuf[16]; + struct kenwood_priv_data *priv = rig->state.priv; + // default range is 0-12 if there is no KPA3 installed + if (priv->has_kpa3 || priv->has_kpa100) maxpower = 110; + if (RIG_IS_KX2 || RIG_IS_KX3) { + + int bandnum = -1; + retval = kenwood_safe_transaction(rig, "BN", levelbuf, KENWOOD_MAX_BUF_LEN, 4); + if (retval != RIG_OK) { return retval; } + sscanf(levelbuf,"BN%d", &bandnum); + switch(bandnum) + { + case 1: + case 2: + case 3: + case 4: + case 5: + maxpower = 15; + break; + case 0: // 160M + case 6: // 17M + case 7: // 15M + case 8: // 12M + case 9: // 10M + maxpower = 12; + break; + case 10: // 6M + maxpower = 10; + break; + default: // are transverters all limited to 3W?? + maxpower = 3; + break; + } + } + rig_debug(RIG_DEBUG_TRACE, "%s: maxpower=%d\n", __func__, maxpower); + return maxpower; +} + int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { char levelbuf[16]; @@ -1682,9 +1724,8 @@ int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) break; case RIG_LEVEL_RFPOWER: - // range is 0-12 if there is no KPA3 installed - snprintf(levelbuf, sizeof(levelbuf), "PC%03d", (int)(val.f * 12.0f)); - break; + snprintf(levelbuf, sizeof(levelbuf), "PC%03d", (int)(val.f * k3_get_maxpower(rig))); + break; default: return kenwood_set_level(rig, vfo, level, val); @@ -1957,6 +1998,17 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) sscanf(levelbuf + 2, "%d", &lvl); val->f = (float) lvl / 60.0f; break; + case RIG_LEVEL_RFPOWER: + retval = kenwood_safe_transaction(rig, "PC", levelbuf, sizeof(levelbuf), 5); + + if (retval != RIG_OK) + { + return retval; + } + + sscanf(levelbuf + 2, "%d", &lvl); + val->f = (float) lvl / k3_get_maxpower(rig); + break; default: return kenwood_get_level(rig, vfo, level, val); diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 85ea6589..ce8ec5b2 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -117,18 +117,20 @@ struct kenwood_priv_data int k2_ext_lvl; /* Initial K2 extension level */ int k3_ext_lvl; /* Initial K3 extension level */ int k2_md_rtty; /* K2 RTTY mode available flag, 1 = RTTY, 0 = N/A */ - char *fw_rev; /* firmware revision level */ - int trn_state; /* AI state discovered at startup */ + int has_kpa3; /* Elecraft K3 has k3pa for PC command */ + int has_kpa100; /* Elecraft KX3/KX2 has kpa100 for PC command */ + char *fw_rev; /* firmware revision level */ + int trn_state; /* AI state discovered at startup */ unsigned fw_rev_uint; /* firmware revision as a number 1.07 -> 107 */ char verify_cmd[4]; /* command used to verify set commands */ int is_emulation; /* flag for TS-2000 emulations */ void *data; /* model specific data */ - rmode_t curr_mode; /* used for is_emulation to avoid get_mode on VFOB */ + rmode_t curr_mode; /* used for is_emulation to avoid get_mode on VFOB */ struct timespec cache_start; char last_if_response[KENWOOD_MAX_BUF_LEN]; - int poweron; /* to avoid powering on more than once */ - int has_rit2; /* rig has set 2 rit command */ - int ag_format; /* which AG command is being used...see LEVEL_AF in kenwood.c*/ + int poweron; /* to avoid powering on more than once */ + int has_rit2; /* rig has set 2 rit command */ + int ag_format; /* which AG command is being used...see LEVEL_AF in kenwood.c*/ }; commit e7b881712d0367439bcc630a6afec1286e1e83c2 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 1 09:46:01 2020 -0700 Change KX3 MICGAIN level to 0-80 (cherry picked from commit 614627d8ba5e4c37aed6964c6a2d4bddd2f121b3) diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index bff4f9a6..c1846d3e 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -1985,8 +1985,8 @@ int kx3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) snprintf(cmdbuf, sizeof(cmdbuf), "AG%03d", (int)(val.f * 60.0f)); return kenwood_transaction(rig, cmdbuf, NULL, 0); case RIG_LEVEL_MICGAIN: - // manual says 0-255 as of Rev G5 but experiment says 0-99 - snprintf(cmdbuf, sizeof(cmdbuf), "MG%03d", (int)(val.f * 99.0f)); + // manual says 0-255 as of Rev G5 but experiment says 0-80 + snprintf(cmdbuf, sizeof(cmdbuf), "MG%03d", (int)(val.f * 80.0f)); return kenwood_transaction(rig, cmdbuf, NULL, 0); } @@ -2017,7 +2017,7 @@ int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_MICGAIN: retval = get_kenwood_level(rig, "MG", NULL, &val->i); if (retval != RIG_OK) { return retval; } - val->f = val->i / 99.0; + val->f = val->i / 80.0; return retval; case RIG_LEVEL_RFPOWER_METER: commit e63087ccd4d4f36955e377f78dedd0b669a209c2 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Sep 30 21:35:06 2020 -0700 Remove unneeded k3 code from kenwood.c Implement RFPOWER for kx3 https://github.com/Hamlib/Hamlib/issues/388 (cherry picked from commit 5fdf98ec57982f6dc29e960dc4a6218d63e03a68) diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 28bc75e1..bff4f9a6 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -1681,6 +1681,11 @@ int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) snprintf(levelbuf, sizeof(levelbuf), "ML%03d", (int)(val.f * 60.0f)); break; + case RIG_LEVEL_RFPOWER: + // range is 0-12 if there is no KPA3 installed + snprintf(levelbuf, sizeof(levelbuf), "PC%03d", (int)(val.f * 12.0f)); + break; + default: return kenwood_set_level(rig, vfo, level, val); } diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index beca782a..94e33e4f 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2203,15 +2203,7 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) /* * Best estimate: 1.0 corresponds to 100W */ - if (RIG_IS_K3 || RIG_IS_KX3 || RIG_IS_KX2) - { - kenwood_val = val.f * 12; - } // range is 0-12 if there is no KPA3 installed - else - { - kenwood_val = val.f * 100; - } - + kenwood_val = val.f * 100; snprintf(levelbuf, sizeof(levelbuf), "PC%03d", kenwood_val); break; @@ -2247,14 +2239,8 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_MICGAIN: - /* XXX check level range */ - if (RIG_IS_KX2 || RIG_IS_KX3 || RIG_IS_K2 || RIG_IS_K3 || RIG_IS_K3S) { // range is 0-255 - kenwood_val = val.f * 100 * (60.0/255.0); - } - else { // range is 0-100 - kenwood_val = val.f * 100; - } - + if (val.f > 1.0 || val.f < 0) { return -RIG_EINVAL; } + kenwood_val = val.f * 100; snprintf(levelbuf, sizeof(levelbuf), "MG%03d", kenwood_val); break; @@ -2262,21 +2248,8 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) /* XXX check level range */ // KX2 and KX3 have range -190 to 250 - if (val.f > 1.0) { return -RIG_EINVAL; } - - if (RIG_IS_KX2 || RIG_IS_KX3) - { - kenwood_val = val.f * (250.0 - 190.0) + 190; - } - else if (RIG_IS_K3 || RIG_IS_K3S) - { - kenwood_val = val.f * (250.0 / 100.0); - } - else // other kenwood rigs - { - kenwood_val = val.f * 255.0; - } - + if (val.f > 1.0 || val.f < 0) { return -RIG_EINVAL; } + kenwood_val = val.f * 255.0; snprintf(levelbuf, sizeof(levelbuf), "RG%03d", kenwood_val); break; @@ -2587,23 +2560,11 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_RFPOWER: -#if 0 // TBD - if (RIG_IS_K3) { // see if KPA3 is enabled - ret = get_kenwood_level(rig, "MP055", NULL, &val->i); - if (val->i == - } -#endif /* * an answer "PC100" means 100 Watt */ ret = get_kenwood_level(rig, "PC", NULL, &val->i); - if (RIG_IS_K3 || RIG_IS_KX3 || RIG_IS_KX2) - { // range is 0-12 if there is no KPA3 installed - val->f = val->i / 12.0; - } - else { - val->f = val->f / 100.0; - } + val->f = val->f / 100.0; return ret; case RIG_LEVEL_AF: @@ -2700,12 +2661,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) rig_debug(RIG_DEBUG_ERR, "%s: Error getting MICGAIN\n", __func__); return ret; } - if (RIG_IS_KX2 || RIG_IS_KX3 || RIG_IS_K2 || RIG_IS_K3 || RIG_IS_K3S) { - val->f = val->i * (255.0/60.0); - } - else { - val->f = val->i / 255.0; - } + val->f = val->i / 255.0; return RIG_OK; case RIG_LEVEL_AGC: commit fd27a7a3af221e4d50771306a2c4fb6f0eed3321 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Sep 30 21:17:11 2020 -0700 Fix KX3 MICGAIN set/get https://github.com/Hamlib/Hamlib/issues/388 (cherry picked from commit 8020450559bfc4c713b11e3db78f95e76dd75788) diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 34ffe597..28bc75e1 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -1979,6 +1979,10 @@ int kx3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) // manual says 0-255 as of Rev G5 but experiment says 0-60 snprintf(cmdbuf, sizeof(cmdbuf), "AG%03d", (int)(val.f * 60.0f)); return kenwood_transaction(rig, cmdbuf, NULL, 0); + case RIG_LEVEL_MICGAIN: + // manual says 0-255 as of Rev G5 but experiment says 0-99 + snprintf(cmdbuf, sizeof(cmdbuf), "MG%03d", (int)(val.f * 99.0f)); + return kenwood_transaction(rig, cmdbuf, NULL, 0); } return k3_set_level(rig, vfo, level, val); @@ -2005,6 +2009,12 @@ int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->f = (val->i - 190.0) / (250.0-190.0); return retval; + case RIG_LEVEL_MICGAIN: + retval = get_kenwood_level(rig, "MG", NULL, &val->i); + if (retval != RIG_OK) { return retval; } + val->f = val->i / 99.0; + return retval; + case RIG_LEVEL_RFPOWER_METER: { int tx_status = 0; commit fe3d7a108f3fbff3008f74f1f15458bc2e8bd613 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Sep 30 20:49:37 2020 -0700 Fix KX3 LEVEL_AF https://github.com/Hamlib/Hamlib/issues/388 (cherry picked from commit bbde85064a4858265cf2de5c00a8b523f6e189d5) diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index c38a2bd7..34ffe597 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -1693,7 +1693,7 @@ int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) */ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { - char lvlbuf[50]; + char levelbuf[16]; int retval; int lvl; struct kenwood_priv_data *priv = rig->state.priv; @@ -1725,14 +1725,14 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { cal_table_t str_cal = K3_SM_CAL; - retval = kenwood_safe_transaction(rig, "SM", lvlbuf, sizeof(lvlbuf), 6); + retval = kenwood_safe_transaction(rig, "SM", levelbuf, sizeof(levelbuf), 6); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%d", &val->i); /* rawstr */ + sscanf(levelbuf + 2, "%d", &val->i); /* rawstr */ val->i = (int) rig_raw2val(val->i, &str_cal); } @@ -1740,14 +1740,14 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { cal_table_t str_cal = K3_SMH_CAL; - retval = kenwood_safe_transaction(rig, "SMH", lvlbuf, sizeof(lvlbuf), 6); + retval = kenwood_safe_transaction(rig, "SMH", levelbuf, sizeof(levelbuf), 6); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 3, "%d", &val->i); /* rawstr */ + sscanf(levelbuf + 3, "%d", &val->i); /* rawstr */ val->i = (int) rig_raw2val(val->i, &str_cal); } @@ -1809,14 +1809,14 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } case RIG_LEVEL_AGC: - retval = kenwood_safe_transaction(rig, "GT", lvlbuf, sizeof(lvlbuf), 5); + retval = kenwood_safe_transaction(rig, "GT", levelbuf, sizeof(levelbuf), 5); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%d", &lvl); + sscanf(levelbuf + 2, "%d", &lvl); if (lvl == 0) { @@ -1838,14 +1838,14 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_ATT: - retval = kenwood_safe_transaction(rig, "RA", lvlbuf, sizeof(lvlbuf), 4); + retval = kenwood_safe_transaction(rig, "RA", levelbuf, sizeof(levelbuf), 4); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%d", &lvl); + sscanf(levelbuf + 2, "%d", &lvl); if (lvl == 0) { @@ -1879,62 +1879,62 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_MICGAIN: - retval = kenwood_safe_transaction(rig, "MG", lvlbuf, sizeof(lvlbuf), 5); + retval = kenwood_safe_transaction(rig, "MG", levelbuf, sizeof(levelbuf), 5); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%d", &lvl); + sscanf(levelbuf + 2, "%d", &lvl); val->f = (float) lvl / 60.0f; break; case RIG_LEVEL_COMP: - retval = kenwood_safe_transaction(rig, "CP", lvlbuf, sizeof(lvlbuf), 5); + retval = kenwood_safe_transaction(rig, "CP", levelbuf, sizeof(levelbuf), 5); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%d", &lvl); + sscanf(levelbuf + 2, "%d", &lvl); val->f = (float) lvl / 40.0f; break; case RIG_LEVEL_SQL: - retval = kenwood_safe_transaction(rig, "SQ", lvlbuf, sizeof(lvlbuf), 5); + retval = kenwood_safe_transaction(rig, "SQ", levelbuf, sizeof(levelbuf), 5); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%d", &lvl); + sscanf(levelbuf + 2, "%d", &lvl); val->f = (float) lvl / 29.0f; break; case RIG_LEVEL_RF: - retval = kenwood_safe_transaction(rig, "RG", lvlbuf, sizeof(lvlbuf), 5); + retval = kenwood_safe_transaction(rig, "RG", levelbuf, sizeof(levelbuf), 5); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%d", &lvl); + sscanf(levelbuf + 2, "%d", &lvl); val->f = (float) lvl / 250.0f; break; case RIG_LEVEL_AF: - retval = kenwood_safe_transaction(rig, "AG", lvlbuf, sizeof(lvlbuf), 5); + retval = kenwood_safe_transaction(rig, "AG", levelbuf, sizeof(levelbuf), 5); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%d", &lvl); + sscanf(levelbuf + 2, "%d", &lvl); val->f = (float) lvl / 250.0f; break; @@ -1942,14 +1942,14 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return k3_get_nb_level(rig, &val->f, NULL); case RIG_LEVEL_MONITOR_GAIN: - retval = kenwood_safe_transaction(rig, "ML", lvlbuf, sizeof(lvlbuf), 5); + retval = kenwood_safe_transaction(rig, "ML", levelbuf, sizeof(levelbuf), 5); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%d", &lvl); + sscanf(levelbuf + 2, "%d", &lvl); val->f = (float) lvl / 60.0f; break; @@ -1975,7 +1975,12 @@ int kx3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) ival = val.f * (250.0 - 190.0) + 190.0; snprintf(cmdbuf,sizeof(cmdbuf)-1,"RG%03d", ival); return kenwood_transaction(rig, cmdbuf, NULL, 0); + case RIG_LEVEL_AF: + // manual says 0-255 as of Rev G5 but experiment says 0-60 + snprintf(cmdbuf, sizeof(cmdbuf), "AG%03d", (int)(val.f * 60.0f)); + return kenwood_transaction(rig, cmdbuf, NULL, 0); } + return k3_set_level(rig, vfo, level, val); } @@ -1987,13 +1992,19 @@ int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) switch (level) { + case RIG_LEVEL_AF: + retval = get_kenwood_level(rig, "AG", NULL, &val->i); + if (retval != RIG_OK) { return retval; } + // manual says 0-255 as of Rev G5 but experiment says 0-60 + val->f = val->i / 60.0; + return retval; + case RIG_LEVEL_RF: retval = get_kenwood_level(rig, "RG", NULL, &val->i); if (retval != RIG_OK) { return retval; } val->f = (val->i - 190.0) / (250.0-190.0); return retval; - case RIG_LEVEL_RFPOWER_METER: { int tx_status = 0; @@ -2021,14 +2032,11 @@ int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } val->f = pwr; - break; + return retval; } - - default: - return k3_get_level(rig, vfo, level, val); } - return RIG_OK; + return k3_get_level(rig, vfo, level, val); } @@ -2147,7 +2155,7 @@ int set_rit_xit(RIG *rig, shortfreq_t rit) int k3_set_nb_level(RIG *rig, float dsp_nb, float if_nb) { - char lvlbuf[16]; + char levelbuf[16]; int dsp_nb_raw = 0; int if_nb_raw = 0; @@ -2168,14 +2176,14 @@ int k3_set_nb_level(RIG *rig, float dsp_nb, float if_nb) int current_dsp_nb_raw; int current_if_nb_raw; - int retval = kenwood_safe_transaction(rig, "NL", lvlbuf, sizeof(lvlbuf), 6); + int retval = kenwood_safe_transaction(rig, "NL", levelbuf, sizeof(levelbuf), 6); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%02d%02d", ¤t_dsp_nb_raw, ¤t_if_nb_raw); + sscanf(levelbuf + 2, "%02d%02d", ¤t_dsp_nb_raw, ¤t_if_nb_raw); if (dsp_nb < 0) { @@ -2188,28 +2196,28 @@ int k3_set_nb_level(RIG *rig, float dsp_nb, float if_nb) } } - snprintf(lvlbuf, sizeof(lvlbuf), "NL%02d%02d", dsp_nb_raw, if_nb_raw); + snprintf(levelbuf, sizeof(levelbuf), "NL%02d%02d", dsp_nb_raw, if_nb_raw); - return kenwood_transaction(rig, lvlbuf, NULL, 0); + return kenwood_transaction(rig, levelbuf, NULL, 0); } int k3_get_nb_level(RIG *rig, float *dsp_nb, float *if_nb) { - char lvlbuf[16]; + char levelbuf[16]; int retval; int dsp_nb_raw; int if_nb_raw; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - retval = kenwood_safe_transaction(rig, "NL", lvlbuf, sizeof(lvlbuf), 6); + retval = kenwood_safe_transaction(rig, "NL", levelbuf, sizeof(levelbuf), 6); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%02d%02d", &dsp_nb_raw, &if_nb_raw); + sscanf(levelbuf + 2, "%02d%02d", &dsp_nb_raw, &if_nb_raw); if (dsp_nb != NULL) { @@ -2227,7 +2235,7 @@ 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) { - char lvlbuf[16]; + char levelbuf[16]; int retval; int tm_raw; int bg_raw; @@ -2243,14 +2251,14 @@ int k3_get_bar_graph_level(RIG *rig, float *smeter, float *pwr, float *alc, return retval; } - retval = kenwood_safe_transaction(rig, "BG", lvlbuf, sizeof(lvlbuf), 5); + retval = kenwood_safe_transaction(rig, "BG", levelbuf, sizeof(levelbuf), 5); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%02d%c", &bg_raw, &mode); + sscanf(levelbuf + 2, "%02d%c", &bg_raw, &mode); if (mode == 'R') { @@ -2324,20 +2332,20 @@ int k3_get_bar_graph_level(RIG *rig, float *smeter, float *pwr, float *alc, int kx3_get_bar_graph_level(RIG *rig, float *level) { - char lvlbuf[16]; + char levelbuf[16]; int retval; int bg_raw; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - retval = kenwood_safe_transaction(rig, "BG", lvlbuf, sizeof(lvlbuf), 4); + retval = kenwood_safe_transaction(rig, "BG", levelbuf, sizeof(levelbuf), 4); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%02d", &bg_raw); + sscanf(levelbuf + 2, "%02d", &bg_raw); if (bg_raw >= 0 && bg_raw <= 10) { commit dcf43f537ef096239448c3f5f8451c15a54e937f Author: root <root@rigpi4.local> Date: Wed Sep 30 16:07:10 2020 -0700 Fix K3X LEVEL_RF https://github.com/Hamlib/Hamlib/issues/388 (cherry picked from commit b6ed9b53e6d20a938e9ab830d1408b73207e3e58) diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 0b00a1fa..c38a2bd7 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -152,6 +152,7 @@ int k3_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, pbwidth_t *tx_width); int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); +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); @@ -758,7 +759,7 @@ const struct rig_caps kx3_caps = .get_func = k3_get_func, .set_ext_parm = kenwood_set_ext_parm, .get_ext_parm = kenwood_get_ext_parm, - .set_level = k3_set_level, + .set_level = kx3_set_level, .get_level = kx3_get_level, .set_ext_level = k3_set_ext_level, .get_ext_level = k3_get_ext_level, @@ -907,7 +908,7 @@ const struct rig_caps kx2_caps = .get_func = k3_get_func, .set_ext_parm = kenwood_set_ext_parm, .get_ext_parm = kenwood_get_ext_parm, - .set_level = k3_set_level, + .set_level = kx3_set_level, .get_level = kx3_get_level, .set_ext_level = k3_set_ext_level, .get_ext_level = k3_get_ext_level, @@ -1913,8 +1914,8 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->f = (float) lvl / 29.0f; break; - case RIG_... [truncated message content] |
From: Michael B. <mdb...@us...> - 2020-10-03 05:25: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 5ae848c48f1810fa81deb8365cb89e552740c8b7 (commit) via 86949c4ef711d5e4baa86241d7e7579bdffef1e3 (commit) via ba943ae4b9209dfb7f4ed2cdb3efff679c71b900 (commit) via 293a844c41945db98dc6d8fa3036fec598de56a0 (commit) from 0576a01ec2b73cafec6f1ea5506d014fa82d75ff (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 5ae848c48f1810fa81deb8365cb89e552740c8b7 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Oct 3 00:16:02 2020 -0500 Implemented dynamic detection of RFPOWER levels for Kenwoods Need to remove RFPOWER customizations from other Kenwood backends now Need to do this same thing for MICGAIN https://github.com/Hamlib/Hamlib/issues/389 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 374b9cff..4dc3ca1c 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2179,6 +2179,63 @@ int kenwood_get_mode_if(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) return RIG_OK; } +/* kenwood_get_power_minmax + * Kenwood rigs have different power levels by mode and by rig + * This routine relies on the idea that setting the power + * to 0 and 255 will result in the minimum and maximum values being set + * If a rig doesn't behave this way then customize inside that rig's backend +*/ +static int kenwood_get_power_minmax(RIG *rig, int *power_now, int *power_min, + int *power_max, + int restore) +{ + int retval; + char levelbuf[19]; + // 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 + // otherwise we expect calling routine to be setting new power level + // we batch these commands together for speed + char *cmd = "PC;PC000;PC;PC255;PC;PC000;"; + int n; + struct rig_state *rs = &rig->state; + + rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__); + retval = write_block(&rs->rigport, cmd, strlen(cmd)); + + if (retval != RIG_OK) { return retval; } + + retval = read_string(&rs->rigport, levelbuf, sizeof(levelbuf), NULL, 0); + + rig_debug(RIG_DEBUG_TRACE, "%s: retval=%d\n", __func__, retval); + + if (retval != 18) + { + rig_debug(RIG_DEBUG_ERR, "%s: expected 19, got %d in '%s'\n", __func__, retval, + levelbuf); + return -RIG_EPROTO; + } + + n = sscanf(levelbuf, "PC%d;PC%d;PC%d", power_now, power_min, power_max); + + if (n != 3) + { + rig_debug(RIG_DEBUG_ERR, "%s: count not parse 3 values from '%s'\n", __func__, + levelbuf); + return -RIG_EPROTO; + } + + if (restore) + { + snprintf(levelbuf, sizeof(levelbuf), "PC%03d;", *power_now); + retval = kenwood_transaction(rig, levelbuf, NULL, 0); + return retval; + } + + rig_debug(RIG_DEBUG_TRACE, "%s: returning now=%d, min=%d, max=%d\n", __func__, + *power_now, *power_min, *power_max); + return RIG_OK; +} + int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { char levelbuf[16]; @@ -2198,12 +2255,16 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) switch (level) { + int power_now, power_min, power_max; + int retval; + 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, 0); - /* - * Best estimate: 1.0 corresponds to 100W - */ - kenwood_val = val.f * 100; + if (retval != RIG_OK) { return retval; } + + kenwood_val = val.f * (power_max - power_min) + power_min; snprintf(levelbuf, sizeof(levelbuf), "PC%03d", kenwood_val); break; @@ -2425,6 +2486,8 @@ 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) { @@ -2562,12 +2625,13 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_RFPOWER: - /* - * an answer "PC100" means 100 Watt - */ - ret = get_kenwood_level(rig, "PC", NULL, &val->i); - val->f = val->i / 100.0; - return ret; + // 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) { return retval; } + + val->f = (power_now - power_min) / (float)(power_max - power_min); + return RIG_OK; case RIG_LEVEL_AF: diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index ce8ec5b2..ecc284ff 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -27,7 +27,7 @@ #include <string.h> #include "token.h" -#define BACKEND_VER "20200930" +#define BACKEND_VER "20201002" #define EOM_KEN ';' #define EOM_TH '\r' diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index be13fc6d..0f6a97ac 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -111,9 +111,7 @@ kenwood_ts480_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) switch (level) { case RIG_LEVEL_RFPOWER: - kenwood_val = val.f * 100; /* level for TS480SAT is from 0.. 100W in SSB */ - sprintf(levelbuf, "PC%03d", kenwood_val); - break; + return kenwood_set_level(rig, vfo, level, val); case RIG_LEVEL_AF: return kenwood_set_level(rig, vfo, level, val); @@ -246,29 +244,6 @@ kenwood_ts480_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) switch (level) { - case RIG_LEVEL_RFPOWER: - retval = kenwood_transaction(rig, "PC", ackbuf, sizeof(ackbuf)); - - if (RIG_OK != retval) - { - return retval; - } - - ack_len = strlen(ackbuf); - - if (5 != ack_len) - { - return -RIG_EPROTO; - } - - if (1 != sscanf(&ackbuf[2], "%d", &levelint)) - { - return -RIG_EPROTO; - } - - val->f = (float) levelint / 100.; - return RIG_OK; - case RIG_LEVEL_AF: if (rig->caps->rig_model == RIG_MODEL_TS890S) { @@ -424,6 +399,9 @@ kenwood_ts480_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return RIG_OK; + case RIG_LEVEL_RFPOWER: + return kenwood_get_level(rig, vfo, level, val); + case RIG_LEVEL_MICGAIN: case RIG_LEVEL_PREAMP: case RIG_LEVEL_IF: commit 86949c4ef711d5e4baa86241d7e7579bdffef1e3 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Oct 2 23:00:53 2020 -0500 Remove debug diff --git a/src/iofunc.c b/src/iofunc.c index 6fc16ae1..c3677a7f 100644 --- a/src/iofunc.c +++ b/src/iofunc.c @@ -753,7 +753,6 @@ int HAMLIB_API read_string(hamlib_port_t *p, */ rd_count = port_read(p, &rxbuffer[total_count], 1); - rig_debug(RIG_DEBUG_TRACE, "%s: YYY rd_count=%d, total_count=%d\n", __func__, rd_count, total_count); /* if we get 0 bytes or an error something is wrong */ if (rd_count <= 0) { commit ba943ae4b9209dfb7f4ed2cdb3efff679c71b900 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Oct 2 15:46:06 2020 -0700 Fix kenwood RFPOWER...more to come to make it know the max power possible https://github.com/Hamlib/Hamlib/issues/389 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 02dac60a..374b9cff 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2566,7 +2566,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) * an answer "PC100" means 100 Watt */ ret = get_kenwood_level(rig, "PC", NULL, &val->i); - val->f = val->f / 100.0; + val->f = val->i / 100.0; return ret; case RIG_LEVEL_AF: commit 293a844c41945db98dc6d8fa3036fec598de56a0 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Oct 2 17:23:48 2020 -0500 Fix W command speed by using bytes requested correctly read_string now recognizes binary strings to read 5X more bytes Fixed Reply: prompt double output and space after : https://github.com/Hamlib/Hamlib/issues/387 diff --git a/src/iofunc.c b/src/iofunc.c index d7380bce..6fc16ae1 100644 --- a/src/iofunc.c +++ b/src/iofunc.c @@ -753,6 +753,7 @@ int HAMLIB_API read_string(hamlib_port_t *p, */ rd_count = port_read(p, &rxbuffer[total_count], 1); + rig_debug(RIG_DEBUG_TRACE, "%s: YYY rd_count=%d, total_count=%d\n", __func__, rd_count, total_count); /* if we get 0 bytes or an error something is wrong */ if (rd_count <= 0) { @@ -765,6 +766,8 @@ int HAMLIB_API read_string(hamlib_port_t *p, return -RIG_EIO; } + // check to see if our string startis with \...if so we need more chars + if (total_count == 0 && rxbuffer[total_count] == '\\') rxmax = (rxmax-1)*5; ++total_count; if (stopset && memchr(stopset, rxbuffer[total_count - 1], stopset_len)) diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index ce37d0a5..3d1e8da3 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -989,11 +989,13 @@ int rigctl_parse(RIG *my_rig, FILE *fin, FILE *fout, char *argv[], int argc, { rig_debug(RIG_DEBUG_TRACE, "%s: debug7\n", __func__); +#if 0 // was printing Reply: twice if (prompt) { rig_debug(RIG_DEBUG_TRACE, "%s: debug8\n", __func__); fprintf_flush(fout, "%s: ", cmd_entry->arg2); } +#endif if (scanfc(fin, "%s", arg2) < 1) { @@ -4285,11 +4287,11 @@ declare_proto_rig(get_powerstat) return status; } -static int hasbinary(char *s) +static int hasbinary(char *s, int len) { int i; - for (i = 0; s[i] != 0; ++i) + for (i = 0; i < len; ++i) { if (!isascii(s[i])) { return 1; } } @@ -4309,7 +4311,7 @@ declare_proto_rig(send_cmd) struct rig_state *rs; int backend_num, cmd_len; #define BUFSZ 128 - char bufcmd[BUFSZ]; + char bufcmd[BUFSZ*5]; // allow for 5 chars for binary unsigned char buf[BUFSZ]; char eom_buf[4] = { 0xa, 0xd, 0, 0 }; int binary = 0; @@ -4414,7 +4416,7 @@ declare_proto_rig(send_cmd) rig_flush(&rs->rigport); rig_debug(RIG_DEBUG_TRACE, "%s: rigport=%d, bufcmd=%s, cmd_len=%d\n", __func__, - rs->rigport.fd, hasbinary(bufcmd) ? "BINARY" : bufcmd, cmd_len); + rs->rigport.fd, hasbinary(bufcmd, cmd_len) ? "BINARY" : bufcmd, cmd_len); retval = write_block(&rs->rigport, (char *)bufcmd, cmd_len); if (retval != RIG_OK) @@ -4426,7 +4428,7 @@ declare_proto_rig(send_cmd) { rig_debug(RIG_DEBUG_TRACE, "%s: debug Cmd\n", __func__); fwrite(cmd->arg2, 1, strlen(cmd->arg2), fout); /* i.e. "Frequency" */ - fwrite(":", 1, 1, fout); /* i.e. "Frequency" */ + fwrite(": ", 1, 2, fout); /* i.e. "Frequency" */ } do @@ -4436,9 +4438,6 @@ declare_proto_rig(send_cmd) if (rxbytes > 0) { ++rxbytes; // need length + 1 for end of string - - if (cmd->cmd == 'W') { rxbytes *= 5; } - eom_buf[0] = 0; } @@ -4463,10 +4462,10 @@ declare_proto_rig(send_cmd) buf[BUFSZ - 1] = '\0'; } - if (rig->caps->rig_model != RIG_MODEL_NETRIGCTL) + //if (rig->caps->rig_model != RIG_MODEL_NETRIGCTL) { // see if we have binary being returned - binary = hasbinary((char *)buf); + binary = hasbinary((char *)buf, retval); } if (binary) // convert our buf to a hex representation ----------------------------------------------------------------------- Summary of changes: rigs/kenwood/kenwood.c | 84 ++++++++++++++++++++++++++++++++++++++++++++------ rigs/kenwood/kenwood.h | 2 +- rigs/kenwood/ts480.c | 30 +++--------------- src/iofunc.c | 2 ++ tests/rigctl_parse.c | 19 ++++++------ 5 files changed, 90 insertions(+), 47 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-10-02 03:53:57
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via 0576a01ec2b73cafec6f1ea5506d014fa82d75ff (commit) via 3f94e66c9fe8ec3db7fe6494e58592334e913c27 (commit) via 614627d8ba5e4c37aed6964c6a2d4bddd2f121b3 (commit) via 5fdf98ec57982f6dc29e960dc4a6218d63e03a68 (commit) via 8020450559bfc4c713b11e3db78f95e76dd75788 (commit) via bbde85064a4858265cf2de5c00a8b523f6e189d5 (commit) via b6ed9b53e6d20a938e9ab830d1408b73207e3e58 (commit) via 0e50906ca1bb122fdddf1a03374e79ca8fbdd43f (commit) via 58c5f52de8db78c0fffab1cd375fe784f7df77cb (commit) via 92dcdcd952419dc27a68e413a785008bca4e8dca (commit) via 01364ba1baa2d97e7a4c0b79288720d7b4e3eb14 (commit) via b47028c59d49ac562a1371df0fe75a5c643384b3 (commit) via ca8e49eb2ba9e03300ab3d6601a955d59bf45123 (commit) via 28bf6ac2741cf9f57752f4e34056ba3af8fbb2e0 (commit) via 65bb646ef04c49585cec9ea33d44dcb68a16a379 (commit) via 3cbdd3c387c5bab1a7810b5b9748d2bfb8868cf3 (commit) via eb40d8811cad90bf2d08aec14b535c9ae0f6ea4c (commit) via 63d325eb915819f60f68746957750bd9865e37ba (commit) via 38daabee8e152fc569d3afef5e5fc9fd9f843e11 (commit) via 7455fa1b918527b1ae8395883cc57022adb784f0 (commit) via 49d24815b2040e31511eeec3b00b1382c5df45a3 (commit) via 73d947213f449bd0a2dc3a8a38c8c60e101e8ad7 (commit) via 3c6ae62e594873f286951e45a07518579513b1ac (commit) via cfff76dae653fdbc1161fb14a0fb1f8535ed48ba (commit) from c9cfd40e91a225184f8e9423cd93015c94a57385 (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 0576a01ec2b73cafec6f1ea5506d014fa82d75ff Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 1 22:51:31 2020 -0500 astyle files diff --git a/dummy/dummy.c b/dummy/dummy.c index 5bfad894..f7382559 100644 --- a/dummy/dummy.c +++ b/dummy/dummy.c @@ -1273,21 +1273,23 @@ static int dummy_set_ext_func(RIG *rig, vfo_t vfo, token_t token, int status) switch (token) { - case TOK_EL_MAGICEXTFUNC: - break; + case TOK_EL_MAGICEXTFUNC: + break; - default: - return -RIG_EINVAL; + default: + return -RIG_EINVAL; } switch (cfp->type) { - case RIG_CONF_CHECKBUTTON: - break; - case RIG_CONF_BUTTON: - break; - default: - return -RIG_EINTERNAL; + case RIG_CONF_CHECKBUTTON: + break; + + case RIG_CONF_BUTTON: + break; + + default: + return -RIG_EINTERNAL; } elp = find_ext(priv->ext_funcs, token); @@ -1301,7 +1303,7 @@ static int dummy_set_ext_func(RIG *rig, vfo_t vfo, token_t token, int status) elp->val.i = status; rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s %d\n", __func__, - cfp->name, status); + cfp->name, status); return RIG_OK; } @@ -1322,10 +1324,11 @@ static int dummy_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status) switch (token) { - case TOK_EL_MAGICEXTFUNC: - break; - default: - return -RIG_EINVAL; + case TOK_EL_MAGICEXTFUNC: + break; + + default: + return -RIG_EINVAL; } elp = find_ext(priv->ext_funcs, token); @@ -1339,7 +1342,7 @@ static int dummy_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status) *status = elp->val.i; rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, - cfp->name); + cfp->name); return RIG_OK; } diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 4f059a0d..d57ba7d0 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -901,7 +901,7 @@ int ic7300_set_parm(RIG *rig, setting_t parm, value_t val) switch (parm) { - unsigned char prmbuf[MAXFRAMELEN]; + unsigned char prmbuf[MAXFRAMELEN]; case RIG_PARM_ANN: { diff --git a/rigs/icom/ic7600.c b/rigs/icom/ic7600.c index dec54753..9c2fc55e 100644 --- a/rigs/icom/ic7600.c +++ b/rigs/icom/ic7600.c @@ -129,7 +129,8 @@ struct cmdparams ic7600_extcmds[] = { { 0 } } }; -int ic7600_ext_tokens[] = { +int ic7600_ext_tokens[] = +{ TOK_DRIVE_GAIN, TOK_BACKEND_NONE }; diff --git a/rigs/icom/ic7610.c b/rigs/icom/ic7610.c index 66670451..a121bbd3 100644 --- a/rigs/icom/ic7610.c +++ b/rigs/icom/ic7610.c @@ -127,7 +127,8 @@ struct cmdparams ic7610_extcmds[] = { { 0 } } }; -int ic7610_ext_tokens[] = { +int ic7610_ext_tokens[] = +{ TOK_DRIVE_GAIN, TOK_DIGI_SEL_FUNC, TOK_DIGI_SEL_LEVEL, TOK_BACKEND_NONE }; diff --git a/rigs/icom/ic7700.c b/rigs/icom/ic7700.c index 03f4d5c6..03d2f7c8 100644 --- a/rigs/icom/ic7700.c +++ b/rigs/icom/ic7700.c @@ -111,7 +111,8 @@ struct cmdparams ic7700_extcmds[] = { { 0 } } }; -int ic7700_ext_tokens[] = { +int ic7700_ext_tokens[] = +{ TOK_DRIVE_GAIN, TOK_DIGI_SEL_FUNC, TOK_DIGI_SEL_LEVEL, TOK_BACKEND_NONE }; diff --git a/rigs/icom/ic7800.c b/rigs/icom/ic7800.c index e3ad8de4..ef9b83ef 100644 --- a/rigs/icom/ic7800.c +++ b/rigs/icom/ic7800.c @@ -114,7 +114,8 @@ struct cmdparams ic7800_extcmds[] = { { 0 } } }; -int ic7800_ext_tokens[] = { +int ic7800_ext_tokens[] = +{ TOK_DRIVE_GAIN, TOK_DIGI_SEL_FUNC, TOK_DIGI_SEL_LEVEL, TOK_BACKEND_NONE }; @@ -347,6 +348,7 @@ int ic7800_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } return icom_set_level(rig, vfo, level, val); + default: return icom_set_level(rig, vfo, level, val); } @@ -378,7 +380,9 @@ int ic7800_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { val->i = rig->state.attenuator[val->i - 1]; } + break; + default: return icom_get_level(rig, vfo, level, val); } diff --git a/rigs/icom/ic785x.c b/rigs/icom/ic785x.c index f100d238..6f7fb9a3 100644 --- a/rigs/icom/ic785x.c +++ b/rigs/icom/ic785x.c @@ -120,7 +120,8 @@ struct cmdparams ic785x_extcmds[] = }; -int ic785x_ext_tokens[] = { +int ic785x_ext_tokens[] = +{ TOK_DRIVE_GAIN, TOK_DIGI_SEL_FUNC, TOK_DIGI_SEL_LEVEL, TOK_BACKEND_NONE }; @@ -331,5 +332,5 @@ int ic785x_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) int ic785x_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { - return ic7800_get_level(rig, vfo, level, val); + return ic7800_get_level(rig, vfo, level, val); } diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index df5b4a59..63007070 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -3241,9 +3241,12 @@ int icom_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status) { value_t value; int result = icom_get_ext_cmd(rig, vfo, token, &value); - if (result == RIG_OK) { + + if (result == RIG_OK) + { *status = value.i; } + return result; } else { i++; } @@ -5411,6 +5414,7 @@ int icom_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); value_t value; + for (i = 0; extcmds && extcmds[i].id.s != 0; i++) { rig_debug(RIG_DEBUG_TRACE, "%s: i=%d\n", __func__, i); @@ -5418,9 +5422,12 @@ int icom_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) if (extcmds[i].cmdparamtype == CMD_PARAM_TYPE_FUNC && extcmds[i].id.s == func) { int result = icom_get_cmd(rig, vfo, (struct cmdparams *)&extcmds[i], &value); - if (result == RIG_OK) { + + if (result == RIG_OK) + { *status = value.i; } + return result; } } diff --git a/rigs/kenwood/elecraft.c b/rigs/kenwood/elecraft.c index 97bc1381..3fedc481 100644 --- a/rigs/kenwood/elecraft.c +++ b/rigs/kenwood/elecraft.c @@ -183,31 +183,44 @@ int elecraft_open(RIG *rig) case RIG_MODEL_K3S: case RIG_MODEL_KX2: case RIG_MODEL_KX3: - // we need to know what's hooked up for PC command max levels - err = kenwood_safe_transaction(rig, "OM", buf, KENWOOD_MAX_BUF_LEN, 15); - if (err != RIG_OK) { return err; } - rig_debug(RIG_DEBUG_TRACE, "%s: OM=%s\n", __func__, buf); - priv->has_kpa3 = 0; - if (strstr(buf,"P")) priv->has_kpa3 = 1; - if (buf[13] == '0') // then we have a KX3 or KX2 - { - char modelnum; - modelnum = buf[14]; - switch (modelnum) - { - case '1': model = "KX2";break; - case '2': model = "KX3";break; - default: - rig_debug(RIG_DEBUG_ERR, "%s: Unknown Elecraft modelnum=%c, expected 1 or 2\n", __func__, modelnum); - break; - } - if (strstr(buf,"P")) priv->has_kpa100 = 1; - } - else { - model = "K3"; - if (strstr(buf,"R")) model = "K3S"; - } - rig_debug(RIG_DEBUG_TRACE, "%s: model=%s, kpa3%d\n", __func__, model, priv->has_kpa3); + // we need to know what's hooked up for PC command max levels + err = kenwood_safe_transaction(rig, "OM", buf, KENWOOD_MAX_BUF_LEN, 15); + + if (err != RIG_OK) { return err; } + + rig_debug(RIG_DEBUG_TRACE, "%s: OM=%s\n", __func__, buf); + priv->has_kpa3 = 0; + + if (strstr(buf, "P")) { priv->has_kpa3 = 1; } + + if (buf[13] == '0') // then we have a KX3 or KX2 + { + char modelnum; + modelnum = buf[14]; + + switch (modelnum) + { + case '1': model = "KX2"; break; + + case '2': model = "KX3"; break; + + default: + rig_debug(RIG_DEBUG_ERR, "%s: Unknown Elecraft modelnum=%c, expected 1 or 2\n", + __func__, modelnum); + break; + } + + if (strstr(buf, "P")) { priv->has_kpa100 = 1; } + } + else + { + model = "K3"; + + if (strstr(buf, "R")) { model = "K3S"; } + } + + rig_debug(RIG_DEBUG_TRACE, "%s: model=%s, kpa3%d\n", __func__, model, + priv->has_kpa3); err = elecraft_get_extension_level(rig, "K2", &priv->k2_ext_lvl); diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index c33357cb..76016dc8 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -1581,44 +1581,54 @@ int k3_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, static int k3_get_maxpower(RIG *rig) { - int retval; - int maxpower = 12; // K3 default power level - char levelbuf[16]; - struct kenwood_priv_data *priv = rig->state.priv; - // default range is 0-12 if there is no KPA3 installed - if (priv->has_kpa3 || priv->has_kpa100) maxpower = 110; - if (RIG_IS_KX2 || RIG_IS_KX3) { - - int bandnum = -1; - retval = kenwood_safe_transaction(rig, "BN", levelbuf, KENWOOD_MAX_BUF_LEN, 4); - if (retval != RIG_OK) { return retval; } - sscanf(levelbuf,"BN%d", &bandnum); - switch(bandnum) - { - case 1: - case 2: - case 3: - case 4: - case 5: - maxpower = 15; - break; - case 0: // 160M - case 6: // 17M - case 7: // 15M - case 8: // 12M - case 9: // 10M - maxpower = 12; - break; - case 10: // 6M - maxpower = 10; - break; - default: // are transverters all limited to 3W?? - maxpower = 3; - break; - } - } - rig_debug(RIG_DEBUG_TRACE, "%s: maxpower=%d\n", __func__, maxpower); - return maxpower; + int retval; + int maxpower = 12; // K3 default power level + char levelbuf[16]; + struct kenwood_priv_data *priv = rig->state.priv; + + // default range is 0-12 if there is no KPA3 installed + if (priv->has_kpa3 || priv->has_kpa100) { maxpower = 110; } + + if (RIG_IS_KX2 || RIG_IS_KX3) + { + + int bandnum = -1; + retval = kenwood_safe_transaction(rig, "BN", levelbuf, KENWOOD_MAX_BUF_LEN, 4); + + if (retval != RIG_OK) { return retval; } + + sscanf(levelbuf, "BN%d", &bandnum); + + switch (bandnum) + { + case 1: + case 2: + case 3: + case 4: + case 5: + maxpower = 15; + break; + + case 0: // 160M + case 6: // 17M + case 7: // 15M + case 8: // 12M + case 9: // 10M + maxpower = 12; + break; + + case 10: // 6M + maxpower = 10; + break; + + default: // are transverters all limited to 3W?? + maxpower = 3; + break; + } + } + + rig_debug(RIG_DEBUG_TRACE, "%s: maxpower=%d\n", __func__, maxpower); + return maxpower; } int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) @@ -1724,8 +1734,9 @@ int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) break; case RIG_LEVEL_RFPOWER: - snprintf(levelbuf, sizeof(levelbuf), "PC%03d", (int)(val.f * k3_get_maxpower(rig))); - break; + snprintf(levelbuf, sizeof(levelbuf), "PC%03d", + (int)(val.f * k3_get_maxpower(rig))); + break; default: return kenwood_set_level(rig, vfo, level, val); @@ -1970,7 +1981,7 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) sscanf(levelbuf + 2, "%d", &lvl); val->f = (float) lvl / 250.0f; - break; + break; case RIG_LEVEL_AF: retval = kenwood_safe_transaction(rig, "AG", levelbuf, sizeof(levelbuf), 5); @@ -1998,6 +2009,7 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) sscanf(levelbuf + 2, "%d", &lvl); val->f = (float) lvl / 60.0f; break; + case RIG_LEVEL_RFPOWER: retval = kenwood_safe_transaction(rig, "PC", levelbuf, sizeof(levelbuf), 5); @@ -2008,7 +2020,7 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) sscanf(levelbuf + 2, "%d", &lvl); val->f = (float) lvl / k3_get_maxpower(rig); - break; + break; default: return kenwood_get_level(rig, vfo, level, val); @@ -2030,16 +2042,18 @@ int kx3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { case RIG_LEVEL_RF: ival = val.f * (250.0 - 190.0) + 190.0; - snprintf(cmdbuf,sizeof(cmdbuf)-1,"RG%03d", ival); - return kenwood_transaction(rig, cmdbuf, NULL, 0); + snprintf(cmdbuf, sizeof(cmdbuf) - 1, "RG%03d", ival); + return kenwood_transaction(rig, cmdbuf, NULL, 0); + case RIG_LEVEL_AF: - // manual says 0-255 as of Rev G5 but experiment says 0-60 + // manual says 0-255 as of Rev G5 but experiment says 0-60 snprintf(cmdbuf, sizeof(cmdbuf), "AG%03d", (int)(val.f * 60.0f)); - return kenwood_transaction(rig, cmdbuf, NULL, 0); + return kenwood_transaction(rig, cmdbuf, NULL, 0); + case RIG_LEVEL_MICGAIN: - // manual says 0-255 as of Rev G5 but experiment says 0-80 + // manual says 0-255 as of Rev G5 but experiment says 0-80 snprintf(cmdbuf, sizeof(cmdbuf), "MG%03d", (int)(val.f * 80.0f)); - return kenwood_transaction(rig, cmdbuf, NULL, 0); + return kenwood_transaction(rig, cmdbuf, NULL, 0); } return k3_set_level(rig, vfo, level, val); @@ -2055,20 +2069,26 @@ int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { case RIG_LEVEL_AF: retval = get_kenwood_level(rig, "AG", NULL, &val->i); + if (retval != RIG_OK) { return retval; } - // manual says 0-255 as of Rev G5 but experiment says 0-60 + + // manual says 0-255 as of Rev G5 but experiment says 0-60 val->f = val->i / 60.0; return retval; case RIG_LEVEL_RF: retval = get_kenwood_level(rig, "RG", NULL, &val->i); + if (retval != RIG_OK) { return retval; } - val->f = (val->i - 190.0) / (250.0-190.0); + + val->f = (val->i - 190.0) / (250.0 - 190.0); return retval; case RIG_LEVEL_MICGAIN: retval = get_kenwood_level(rig, "MG", NULL, &val->i); + if (retval != RIG_OK) { return retval; } + val->f = val->i / 80.0; return retval; diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 94e33e4f..02dac60a 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2203,7 +2203,7 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) /* * Best estimate: 1.0 corresponds to 100W */ - kenwood_val = val.f * 100; + kenwood_val = val.f * 100; snprintf(levelbuf, sizeof(levelbuf), "PC%03d", kenwood_val); break; @@ -2240,6 +2240,7 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_MICGAIN: if (val.f > 1.0 || val.f < 0) { return -RIG_EINVAL; } + kenwood_val = val.f * 100; snprintf(levelbuf, sizeof(levelbuf), "MG%03d", kenwood_val); break; @@ -2249,6 +2250,7 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) /* XXX check level range */ // KX2 and KX3 have range -190 to 250 if (val.f > 1.0 || val.f < 0) { return -RIG_EINVAL; } + kenwood_val = val.f * 255.0; snprintf(levelbuf, sizeof(levelbuf), "RG%03d", kenwood_val); break; @@ -2661,6 +2663,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) rig_debug(RIG_DEBUG_ERR, "%s: Error getting MICGAIN\n", __func__); return ret; } + val->f = val->i / 255.0; return RIG_OK; diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index bbdad637..b1f17832 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2685,9 +2685,12 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { return -RIG_ENAVAIL; } - if (newcat_is_rig(rig, RIG_MODEL_TS890S)) // new format for the command with VFO selection + + if (newcat_is_rig(rig, + RIG_MODEL_TS890S)) // new format for the command with VFO selection { format = "MS0%d;"; + if (vfo == RIG_VFO_SUB) { format = "MS1%d"; @@ -3672,9 +3675,12 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "NB0%d%c", status ? 1 : 0, cat_term); - if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE){ - priv->cmd_str[2] = main_sub_vfo; + + if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) + { + priv->cmd_str[2] = main_sub_vfo; } + break; case RIG_FUNC_NR: @@ -3685,9 +3691,12 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "NR0%d%c", status ? 1 : 0, cat_term); - if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE){ - priv->cmd_str[2] = main_sub_vfo; + + if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) + { + priv->cmd_str[2] = main_sub_vfo; } + break; case RIG_FUNC_COMP: diff --git a/src/ext.c b/src/ext.c index 3c7adaef..ddd42403 100644 --- a/src/ext.c +++ b/src/ext.c @@ -62,7 +62,8 @@ static int rig_has_ext_token(RIG *rig, token_t token) for (i = 0; ext_tokens[i] != TOK_BACKEND_NONE; i++) { - if (ext_tokens[i] == token) { + if (ext_tokens[i] == token) + { return 1; } } @@ -83,10 +84,10 @@ static int rig_has_ext_token(RIG *rig, token_t token) * rig_ext_func_foreach. */ int HAMLIB_API rig_ext_func_foreach(RIG *rig, - int (*cfunc)(RIG *, - const struct confparams *, - rig_ptr_t), - rig_ptr_t data) + int (*cfunc)(RIG *, + const struct confparams *, + rig_ptr_t), + rig_ptr_t data) { const struct confparams *cfp; @@ -99,7 +100,8 @@ int HAMLIB_API rig_ext_func_foreach(RIG *rig, for (cfp = rig->caps->extfuncs; cfp && cfp->name; cfp++) { - if (!rig_has_ext_token(rig, cfp->token)) { + if (!rig_has_ext_token(rig, cfp->token)) + { continue; } @@ -148,7 +150,8 @@ int HAMLIB_API rig_ext_level_foreach(RIG *rig, for (cfp = rig->caps->extlevels; cfp && cfp->name; cfp++) { - if (!rig_has_ext_token(rig, cfp->token)) { + if (!rig_has_ext_token(rig, cfp->token)) + { continue; } @@ -197,7 +200,8 @@ int HAMLIB_API rig_ext_parm_foreach(RIG *rig, for (cfp = rig->caps->extparms; cfp && cfp->name; cfp++) { - if (!rig_has_ext_token(rig, cfp->token)) { + if (!rig_has_ext_token(rig, cfp->token)) + { continue; } diff --git a/src/settings.c b/src/settings.c index 4a81426a..8cf24837 100644 --- a/src/settings.c +++ b/src/settings.c @@ -534,9 +534,11 @@ int HAMLIB_API rig_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) return caps->set_func(rig, vfo, func, status); } - else { + else + { int targetable = caps->targetable_vfo & RIG_TARGETABLE_FUNC; - rig_debug(RIG_DEBUG_TRACE, "%s: targetable=%d, vfo=%s, currvfo=%s\n", __func__, targetable, rig_strvfo(vfo), rig_strvfo(rig->state.current_vfo)); + rig_debug(RIG_DEBUG_TRACE, "%s: targetable=%d, vfo=%s, currvfo=%s\n", __func__, + targetable, rig_strvfo(vfo), rig_strvfo(rig->state.current_vfo)); } if (!caps->set_vfo) commit 3f94e66c9fe8ec3db7fe6494e58592334e913c27 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 1 16:08:53 2020 -0700 Fix K3/K3S/KX2/KX3 RFPOWER set/get for band specific power levels diff --git a/rigs/kenwood/elecraft.c b/rigs/kenwood/elecraft.c index 52e4d249..97bc1381 100644 --- a/rigs/kenwood/elecraft.c +++ b/rigs/kenwood/elecraft.c @@ -94,8 +94,9 @@ int elecraft_get_firmware_revision_level(RIG *rig, const char *cmd, int elecraft_open(RIG *rig) { int err; - char id[KENWOOD_MAX_BUF_LEN]; + char buf[KENWOOD_MAX_BUF_LEN]; struct kenwood_priv_data *priv = rig->state.priv; + char *model = "Unknown"; rig_debug(RIG_DEBUG_VERBOSE, "%s called, rig version=%s\n", __func__, @@ -134,7 +135,7 @@ int elecraft_open(RIG *rig) return err; } - err = read_string(&rs->rigport, id, sizeof(id), ";", 1); + err = read_string(&rs->rigport, buf, sizeof(buf), ";", 1); if (err < 0) { @@ -142,7 +143,7 @@ int elecraft_open(RIG *rig) return err; } - rig_debug(RIG_DEBUG_VERBOSE, "%s: id=%s\n", __func__, id); + rig_debug(RIG_DEBUG_VERBOSE, "%s: id=%s\n", __func__, buf); #if 0 if (err != RIG_OK) @@ -155,7 +156,7 @@ int elecraft_open(RIG *rig) } else // Standard Kenwood { - err = verify_kenwood_id(rig, id); + err = verify_kenwood_id(rig, buf); if (err != RIG_OK) { @@ -182,6 +183,32 @@ int elecraft_open(RIG *rig) case RIG_MODEL_K3S: case RIG_MODEL_KX2: case RIG_MODEL_KX3: + // we need to know what's hooked up for PC command max levels + err = kenwood_safe_transaction(rig, "OM", buf, KENWOOD_MAX_BUF_LEN, 15); + if (err != RIG_OK) { return err; } + rig_debug(RIG_DEBUG_TRACE, "%s: OM=%s\n", __func__, buf); + priv->has_kpa3 = 0; + if (strstr(buf,"P")) priv->has_kpa3 = 1; + if (buf[13] == '0') // then we have a KX3 or KX2 + { + char modelnum; + modelnum = buf[14]; + switch (modelnum) + { + case '1': model = "KX2";break; + case '2': model = "KX3";break; + default: + rig_debug(RIG_DEBUG_ERR, "%s: Unknown Elecraft modelnum=%c, expected 1 or 2\n", __func__, modelnum); + break; + } + if (strstr(buf,"P")) priv->has_kpa100 = 1; + } + else { + model = "K3"; + if (strstr(buf,"R")) model = "K3S"; + } + rig_debug(RIG_DEBUG_TRACE, "%s: model=%s, kpa3%d\n", __func__, model, priv->has_kpa3); + err = elecraft_get_extension_level(rig, "K2", &priv->k2_ext_lvl); if (err != RIG_OK) diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index c1846d3e..c33357cb 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -1579,6 +1579,48 @@ int k3_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, return RIG_OK; } +static int k3_get_maxpower(RIG *rig) +{ + int retval; + int maxpower = 12; // K3 default power level + char levelbuf[16]; + struct kenwood_priv_data *priv = rig->state.priv; + // default range is 0-12 if there is no KPA3 installed + if (priv->has_kpa3 || priv->has_kpa100) maxpower = 110; + if (RIG_IS_KX2 || RIG_IS_KX3) { + + int bandnum = -1; + retval = kenwood_safe_transaction(rig, "BN", levelbuf, KENWOOD_MAX_BUF_LEN, 4); + if (retval != RIG_OK) { return retval; } + sscanf(levelbuf,"BN%d", &bandnum); + switch(bandnum) + { + case 1: + case 2: + case 3: + case 4: + case 5: + maxpower = 15; + break; + case 0: // 160M + case 6: // 17M + case 7: // 15M + case 8: // 12M + case 9: // 10M + maxpower = 12; + break; + case 10: // 6M + maxpower = 10; + break; + default: // are transverters all limited to 3W?? + maxpower = 3; + break; + } + } + rig_debug(RIG_DEBUG_TRACE, "%s: maxpower=%d\n", __func__, maxpower); + return maxpower; +} + int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { char levelbuf[16]; @@ -1682,9 +1724,8 @@ int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) break; case RIG_LEVEL_RFPOWER: - // range is 0-12 if there is no KPA3 installed - snprintf(levelbuf, sizeof(levelbuf), "PC%03d", (int)(val.f * 12.0f)); - break; + snprintf(levelbuf, sizeof(levelbuf), "PC%03d", (int)(val.f * k3_get_maxpower(rig))); + break; default: return kenwood_set_level(rig, vfo, level, val); @@ -1957,6 +1998,17 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) sscanf(levelbuf + 2, "%d", &lvl); val->f = (float) lvl / 60.0f; break; + case RIG_LEVEL_RFPOWER: + retval = kenwood_safe_transaction(rig, "PC", levelbuf, sizeof(levelbuf), 5); + + if (retval != RIG_OK) + { + return retval; + } + + sscanf(levelbuf + 2, "%d", &lvl); + val->f = (float) lvl / k3_get_maxpower(rig); + break; default: return kenwood_get_level(rig, vfo, level, val); diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 85ea6589..ce8ec5b2 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -117,18 +117,20 @@ struct kenwood_priv_data int k2_ext_lvl; /* Initial K2 extension level */ int k3_ext_lvl; /* Initial K3 extension level */ int k2_md_rtty; /* K2 RTTY mode available flag, 1 = RTTY, 0 = N/A */ - char *fw_rev; /* firmware revision level */ - int trn_state; /* AI state discovered at startup */ + int has_kpa3; /* Elecraft K3 has k3pa for PC command */ + int has_kpa100; /* Elecraft KX3/KX2 has kpa100 for PC command */ + char *fw_rev; /* firmware revision level */ + int trn_state; /* AI state discovered at startup */ unsigned fw_rev_uint; /* firmware revision as a number 1.07 -> 107 */ char verify_cmd[4]; /* command used to verify set commands */ int is_emulation; /* flag for TS-2000 emulations */ void *data; /* model specific data */ - rmode_t curr_mode; /* used for is_emulation to avoid get_mode on VFOB */ + rmode_t curr_mode; /* used for is_emulation to avoid get_mode on VFOB */ struct timespec cache_start; char last_if_response[KENWOOD_MAX_BUF_LEN]; - int poweron; /* to avoid powering on more than once */ - int has_rit2; /* rig has set 2 rit command */ - int ag_format; /* which AG command is being used...see LEVEL_AF in kenwood.c*/ + int poweron; /* to avoid powering on more than once */ + int has_rit2; /* rig has set 2 rit command */ + int ag_format; /* which AG command is being used...see LEVEL_AF in kenwood.c*/ }; commit 614627d8ba5e4c37aed6964c6a2d4bddd2f121b3 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Oct 1 09:46:01 2020 -0700 Change KX3 MICGAIN level to 0-80 diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index bff4f9a6..c1846d3e 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -1985,8 +1985,8 @@ int kx3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) snprintf(cmdbuf, sizeof(cmdbuf), "AG%03d", (int)(val.f * 60.0f)); return kenwood_transaction(rig, cmdbuf, NULL, 0); case RIG_LEVEL_MICGAIN: - // manual says 0-255 as of Rev G5 but experiment says 0-99 - snprintf(cmdbuf, sizeof(cmdbuf), "MG%03d", (int)(val.f * 99.0f)); + // manual says 0-255 as of Rev G5 but experiment says 0-80 + snprintf(cmdbuf, sizeof(cmdbuf), "MG%03d", (int)(val.f * 80.0f)); return kenwood_transaction(rig, cmdbuf, NULL, 0); } @@ -2017,7 +2017,7 @@ int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_MICGAIN: retval = get_kenwood_level(rig, "MG", NULL, &val->i); if (retval != RIG_OK) { return retval; } - val->f = val->i / 99.0; + val->f = val->i / 80.0; return retval; case RIG_LEVEL_RFPOWER_METER: commit 5fdf98ec57982f6dc29e960dc4a6218d63e03a68 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Sep 30 21:35:06 2020 -0700 Remove unneeded k3 code from kenwood.c Implement RFPOWER for kx3 https://github.com/Hamlib/Hamlib/issues/388 diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 28bc75e1..bff4f9a6 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -1681,6 +1681,11 @@ int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) snprintf(levelbuf, sizeof(levelbuf), "ML%03d", (int)(val.f * 60.0f)); break; + case RIG_LEVEL_RFPOWER: + // range is 0-12 if there is no KPA3 installed + snprintf(levelbuf, sizeof(levelbuf), "PC%03d", (int)(val.f * 12.0f)); + break; + default: return kenwood_set_level(rig, vfo, level, val); } diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index beca782a..94e33e4f 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2203,15 +2203,7 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) /* * Best estimate: 1.0 corresponds to 100W */ - if (RIG_IS_K3 || RIG_IS_KX3 || RIG_IS_KX2) - { - kenwood_val = val.f * 12; - } // range is 0-12 if there is no KPA3 installed - else - { - kenwood_val = val.f * 100; - } - + kenwood_val = val.f * 100; snprintf(levelbuf, sizeof(levelbuf), "PC%03d", kenwood_val); break; @@ -2247,14 +2239,8 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_MICGAIN: - /* XXX check level range */ - if (RIG_IS_KX2 || RIG_IS_KX3 || RIG_IS_K2 || RIG_IS_K3 || RIG_IS_K3S) { // range is 0-255 - kenwood_val = val.f * 100 * (60.0/255.0); - } - else { // range is 0-100 - kenwood_val = val.f * 100; - } - + if (val.f > 1.0 || val.f < 0) { return -RIG_EINVAL; } + kenwood_val = val.f * 100; snprintf(levelbuf, sizeof(levelbuf), "MG%03d", kenwood_val); break; @@ -2262,21 +2248,8 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) /* XXX check level range */ // KX2 and KX3 have range -190 to 250 - if (val.f > 1.0) { return -RIG_EINVAL; } - - if (RIG_IS_KX2 || RIG_IS_KX3) - { - kenwood_val = val.f * (250.0 - 190.0) + 190; - } - else if (RIG_IS_K3 || RIG_IS_K3S) - { - kenwood_val = val.f * (250.0 / 100.0); - } - else // other kenwood rigs - { - kenwood_val = val.f * 255.0; - } - + if (val.f > 1.0 || val.f < 0) { return -RIG_EINVAL; } + kenwood_val = val.f * 255.0; snprintf(levelbuf, sizeof(levelbuf), "RG%03d", kenwood_val); break; @@ -2587,23 +2560,11 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_RFPOWER: -#if 0 // TBD - if (RIG_IS_K3) { // see if KPA3 is enabled - ret = get_kenwood_level(rig, "MP055", NULL, &val->i); - if (val->i == - } -#endif /* * an answer "PC100" means 100 Watt */ ret = get_kenwood_level(rig, "PC", NULL, &val->i); - if (RIG_IS_K3 || RIG_IS_KX3 || RIG_IS_KX2) - { // range is 0-12 if there is no KPA3 installed - val->f = val->i / 12.0; - } - else { - val->f = val->f / 100.0; - } + val->f = val->f / 100.0; return ret; case RIG_LEVEL_AF: @@ -2700,12 +2661,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) rig_debug(RIG_DEBUG_ERR, "%s: Error getting MICGAIN\n", __func__); return ret; } - if (RIG_IS_KX2 || RIG_IS_KX3 || RIG_IS_K2 || RIG_IS_K3 || RIG_IS_K3S) { - val->f = val->i * (255.0/60.0); - } - else { - val->f = val->i / 255.0; - } + val->f = val->i / 255.0; return RIG_OK; case RIG_LEVEL_AGC: commit 8020450559bfc4c713b11e3db78f95e76dd75788 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Sep 30 21:17:11 2020 -0700 Fix KX3 MICGAIN set/get https://github.com/Hamlib/Hamlib/issues/388 diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 34ffe597..28bc75e1 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -1979,6 +1979,10 @@ int kx3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) // manual says 0-255 as of Rev G5 but experiment says 0-60 snprintf(cmdbuf, sizeof(cmdbuf), "AG%03d", (int)(val.f * 60.0f)); return kenwood_transaction(rig, cmdbuf, NULL, 0); + case RIG_LEVEL_MICGAIN: + // manual says 0-255 as of Rev G5 but experiment says 0-99 + snprintf(cmdbuf, sizeof(cmdbuf), "MG%03d", (int)(val.f * 99.0f)); + return kenwood_transaction(rig, cmdbuf, NULL, 0); } return k3_set_level(rig, vfo, level, val); @@ -2005,6 +2009,12 @@ int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->f = (val->i - 190.0) / (250.0-190.0); return retval; + case RIG_LEVEL_MICGAIN: + retval = get_kenwood_level(rig, "MG", NULL, &val->i); + if (retval != RIG_OK) { return retval; } + val->f = val->i / 99.0; + return retval; + case RIG_LEVEL_RFPOWER_METER: { int tx_status = 0; commit bbde85064a4858265cf2de5c00a8b523f6e189d5 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Sep 30 20:49:37 2020 -0700 Fix KX3 LEVEL_AF https://github.com/Hamlib/Hamlib/issues/388 diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index c38a2bd7..34ffe597 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -1693,7 +1693,7 @@ int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) */ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { - char lvlbuf[50]; + char levelbuf[16]; int retval; int lvl; struct kenwood_priv_data *priv = rig->state.priv; @@ -1725,14 +1725,14 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { cal_table_t str_cal = K3_SM_CAL; - retval = kenwood_safe_transaction(rig, "SM", lvlbuf, sizeof(lvlbuf), 6); + retval = kenwood_safe_transaction(rig, "SM", levelbuf, sizeof(levelbuf), 6); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%d", &val->i); /* rawstr */ + sscanf(levelbuf + 2, "%d", &val->i); /* rawstr */ val->i = (int) rig_raw2val(val->i, &str_cal); } @@ -1740,14 +1740,14 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { cal_table_t str_cal = K3_SMH_CAL; - retval = kenwood_safe_transaction(rig, "SMH", lvlbuf, sizeof(lvlbuf), 6); + retval = kenwood_safe_transaction(rig, "SMH", levelbuf, sizeof(levelbuf), 6); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 3, "%d", &val->i); /* rawstr */ + sscanf(levelbuf + 3, "%d", &val->i); /* rawstr */ val->i = (int) rig_raw2val(val->i, &str_cal); } @@ -1809,14 +1809,14 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } case RIG_LEVEL_AGC: - retval = kenwood_safe_transaction(rig, "GT", lvlbuf, sizeof(lvlbuf), 5); + retval = kenwood_safe_transaction(rig, "GT", levelbuf, sizeof(levelbuf), 5); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%d", &lvl); + sscanf(levelbuf + 2, "%d", &lvl); if (lvl == 0) { @@ -1838,14 +1838,14 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_ATT: - retval = kenwood_safe_transaction(rig, "RA", lvlbuf, sizeof(lvlbuf), 4); + retval = kenwood_safe_transaction(rig, "RA", levelbuf, sizeof(levelbuf), 4); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%d", &lvl); + sscanf(levelbuf + 2, "%d", &lvl); if (lvl == 0) { @@ -1879,62 +1879,62 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_MICGAIN: - retval = kenwood_safe_transaction(rig, "MG", lvlbuf, sizeof(lvlbuf), 5); + retval = kenwood_safe_transaction(rig, "MG", levelbuf, sizeof(levelbuf), 5); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%d", &lvl); + sscanf(levelbuf + 2, "%d", &lvl); val->f = (float) lvl / 60.0f; break; case RIG_LEVEL_COMP: - retval = kenwood_safe_transaction(rig, "CP", lvlbuf, sizeof(lvlbuf), 5); + retval = kenwood_safe_transaction(rig, "CP", levelbuf, sizeof(levelbuf), 5); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%d", &lvl); + sscanf(levelbuf + 2, "%d", &lvl); val->f = (float) lvl / 40.0f; break; case RIG_LEVEL_SQL: - retval = kenwood_safe_transaction(rig, "SQ", lvlbuf, sizeof(lvlbuf), 5); + retval = kenwood_safe_transaction(rig, "SQ", levelbuf, sizeof(levelbuf), 5); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%d", &lvl); + sscanf(levelbuf + 2, "%d", &lvl); val->f = (float) lvl / 29.0f; break; case RIG_LEVEL_RF: - retval = kenwood_safe_transaction(rig, "RG", lvlbuf, sizeof(lvlbuf), 5); + retval = kenwood_safe_transaction(rig, "RG", levelbuf, sizeof(levelbuf), 5); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%d", &lvl); + sscanf(levelbuf + 2, "%d", &lvl); val->f = (float) lvl / 250.0f; break; case RIG_LEVEL_AF: - retval = kenwood_safe_transaction(rig, "AG", lvlbuf, sizeof(lvlbuf), 5); + retval = kenwood_safe_transaction(rig, "AG", levelbuf, sizeof(levelbuf), 5); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%d", &lvl); + sscanf(levelbuf + 2, "%d", &lvl); val->f = (float) lvl / 250.0f; break; @@ -1942,14 +1942,14 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return k3_get_nb_level(rig, &val->f, NULL); case RIG_LEVEL_MONITOR_GAIN: - retval = kenwood_safe_transaction(rig, "ML", lvlbuf, sizeof(lvlbuf), 5); + retval = kenwood_safe_transaction(rig, "ML", levelbuf, sizeof(levelbuf), 5); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%d", &lvl); + sscanf(levelbuf + 2, "%d", &lvl); val->f = (float) lvl / 60.0f; break; @@ -1975,7 +1975,12 @@ int kx3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) ival = val.f * (250.0 - 190.0) + 190.0; snprintf(cmdbuf,sizeof(cmdbuf)-1,"RG%03d", ival); return kenwood_transaction(rig, cmdbuf, NULL, 0); + case RIG_LEVEL_AF: + // manual says 0-255 as of Rev G5 but experiment says 0-60 + snprintf(cmdbuf, sizeof(cmdbuf), "AG%03d", (int)(val.f * 60.0f)); + return kenwood_transaction(rig, cmdbuf, NULL, 0); } + return k3_set_level(rig, vfo, level, val); } @@ -1987,13 +1992,19 @@ int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) switch (level) { + case RIG_LEVEL_AF: + retval = get_kenwood_level(rig, "AG", NULL, &val->i); + if (retval != RIG_OK) { return retval; } + // manual says 0-255 as of Rev G5 but experiment says 0-60 + val->f = val->i / 60.0; + return retval; + case RIG_LEVEL_RF: retval = get_kenwood_level(rig, "RG", NULL, &val->i); if (retval != RIG_OK) { return retval; } val->f = (val->i - 190.0) / (250.0-190.0); return retval; - case RIG_LEVEL_RFPOWER_METER: { int tx_status = 0; @@ -2021,14 +2032,11 @@ int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } val->f = pwr; - break; + return retval; } - - default: - return k3_get_level(rig, vfo, level, val); } - return RIG_OK; + return k3_get_level(rig, vfo, level, val); } @@ -2147,7 +2155,7 @@ int set_rit_xit(RIG *rig, shortfreq_t rit) int k3_set_nb_level(RIG *rig, float dsp_nb, float if_nb) { - char lvlbuf[16]; + char levelbuf[16]; int dsp_nb_raw = 0; int if_nb_raw = 0; @@ -2168,14 +2176,14 @@ int k3_set_nb_level(RIG *rig, float dsp_nb, float if_nb) int current_dsp_nb_raw; int current_if_nb_raw; - int retval = kenwood_safe_transaction(rig, "NL", lvlbuf, sizeof(lvlbuf), 6); + int retval = kenwood_safe_transaction(rig, "NL", levelbuf, sizeof(levelbuf), 6); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%02d%02d", ¤t_dsp_nb_raw, ¤t_if_nb_raw); + sscanf(levelbuf + 2, "%02d%02d", ¤t_dsp_nb_raw, ¤t_if_nb_raw); if (dsp_nb < 0) { @@ -2188,28 +2196,28 @@ int k3_set_nb_level(RIG *rig, float dsp_nb, float if_nb) } } - snprintf(lvlbuf, sizeof(lvlbuf), "NL%02d%02d", dsp_nb_raw, if_nb_raw); + snprintf(levelbuf, sizeof(levelbuf), "NL%02d%02d", dsp_nb_raw, if_nb_raw); - return kenwood_transaction(rig, lvlbuf, NULL, 0); + return kenwood_transaction(rig, levelbuf, NULL, 0); } int k3_get_nb_level(RIG *rig, float *dsp_nb, float *if_nb) { - char lvlbuf[16]; + char levelbuf[16]; int retval; int dsp_nb_raw; int if_nb_raw; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - retval = kenwood_safe_transaction(rig, "NL", lvlbuf, sizeof(lvlbuf), 6); + retval = kenwood_safe_transaction(rig, "NL", levelbuf, sizeof(levelbuf), 6); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%02d%02d", &dsp_nb_raw, &if_nb_raw); + sscanf(levelbuf + 2, "%02d%02d", &dsp_nb_raw, &if_nb_raw); if (dsp_nb != NULL) { @@ -2227,7 +2235,7 @@ 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) { - char lvlbuf[16]; + char levelbuf[16]; int retval; int tm_raw; int bg_raw; @@ -2243,14 +2251,14 @@ int k3_get_bar_graph_level(RIG *rig, float *smeter, float *pwr, float *alc, return retval; } - retval = kenwood_safe_transaction(rig, "BG", lvlbuf, sizeof(lvlbuf), 5); + retval = kenwood_safe_transaction(rig, "BG", levelbuf, sizeof(levelbuf), 5); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%02d%c", &bg_raw, &mode); + sscanf(levelbuf + 2, "%02d%c", &bg_raw, &mode); if (mode == 'R') { @@ -2324,20 +2332,20 @@ int k3_get_bar_graph_level(RIG *rig, float *smeter, float *pwr, float *alc, int kx3_get_bar_graph_level(RIG *rig, float *level) { - char lvlbuf[16]; + char levelbuf[16]; int retval; int bg_raw; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - retval = kenwood_safe_transaction(rig, "BG", lvlbuf, sizeof(lvlbuf), 4); + retval = kenwood_safe_transaction(rig, "BG", levelbuf, sizeof(levelbuf), 4); if (retval != RIG_OK) { return retval; } - sscanf(lvlbuf + 2, "%02d", &bg_raw); + sscanf(levelbuf + 2, "%02d", &bg_raw); if (bg_raw >= 0 && bg_raw <= 10) { commit b6ed9b53e6d20a938e9ab830d1408b73207e3e58 Author: root <root@rigpi4.local> Date: Wed Sep 30 16:07:10 2020 -0700 Fix K3X LEVEL_RF https://github.com/Hamlib/Hamlib/issues/388 diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 0b00a1fa..c38a2bd7 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -152,6 +152,7 @@ int k3_get_split_mode(RIG *rig, vfo_t vfo, rmode_t *tx_mode, pbwidth_t *tx_width); int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); +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); @@ -758,7 +759,7 @@ const struct rig_caps kx3_caps = .get_func = k3_get_func, .set_ext_parm = kenwood_set_ext_parm, .get_ext_parm = kenwood_get_ext_parm, - .set_level = k3_set_level, + .set_level = kx3_set_level, .get_level = kx3_get_level, .set_ext_level = k3_set_ext_level, .get_ext_level = k3_get_ext_level, @@ -907,7 +908,7 @@ const struct rig_caps kx2_caps = .get_func = k3_get_func, .set_ext_parm = kenwood_set_ext_parm, .get_ext_parm = kenwood_get_ext_parm, - .set_level = k3_set_level, + .set_level = kx3_set_level, .get_level = kx3_get_level, .set_ext_level = k3_set_ext_level, .get_ext_level = k3_get_ext_level, @@ -1913,8 +1914,8 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->f = (float) lvl / 29.0f; break; - case RIG_LEVEL_AF: - retval = kenwood_safe_transaction(rig, "AG", lvlbuf, sizeof(lvlbuf), 5); + case RIG_LEVEL_RF: + retval = kenwood_safe_transaction(rig, "RG", lvlbuf, sizeof(lvlbuf), 5); if (retval != RIG_OK) { @@ -1923,10 +1924,10 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) sscanf(lvlbuf + 2, "%d", &lvl); val->f = (float) lvl / 250.0f; - break; + break; - case RIG_LEVEL_RF: - retval = kenwood_safe_transaction(rig, "RG", lvlbuf, sizeof(lvlbuf), 5); + case RIG_LEVEL_AF: + retval = kenwood_safe_transaction(rig, "AG", lvlbuf, sizeof(lvlbuf), 5); if (retval != RIG_OK) { @@ -1959,17 +1960,47 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return RIG_OK; } +int kx3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) +{ + int ival; + char cmdbuf[32]; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + if (val.f > 1.0 || val.f < 0) { return -RIG_EINVAL; } + + switch (level) + { + case RIG_LEVEL_RF: + ival = val.f * (250.0 - 190.0) + 190.0; + snprintf(cmdbuf,sizeof(cmdbuf)-1,"RG%03d", ival); + return kenwood_transaction(rig, cmdbuf, NULL, 0); + } + return k3_set_level(rig, vfo, level, val); +} + int kx3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { + int retval; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + switch (level) { + case RIG_LEVEL_RF: + retval = get_kenwood_level(rig, "RG", NULL, &val->i); + if (retval != RIG_OK) { return retval; } + val->f = (val->i - 190.0) / (250.0-190.0); + return retval; + + case RIG_LEVEL_RFPOWER_METER: { int tx_status = 0; float pwr; // Return zero RF power when not in TX mode - int retval = get_kenwood_func(rig, "TQ", &tx_status); + retval = get_kenwood_func(rig, "TQ", &tx_status); if (retval != RIG_OK) { diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 0ebc0b6b..beca782a 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2687,27 +2687,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } case RIG_LEVEL_RF: - retval = get_kenwood_level(rig, "RG", NULL, &val->i); - - if (retval != RIG_OK) { return retval; } - - // KX2 and KX3 have range 190 to 250 - if (RIG_IS_KX2 || RIG_IS_KX3) - { - val->f = (val->i - 190.0) / (250.0 - 190.0); - } - // K3 is 0 to 250 - else if (RIG_IS_K3 || RIG_IS_K3S) - { - val->f = val->i / 250.0; - } - // all others default to 0-255 - else - { - val->f = val->i / 255.0; - } - - return retval; + return get_kenwood_level(rig, "RG", &val->f, NULL); case RIG_LEVEL_SQL: return get_kenwood_level(rig, "SQ", &val->f, NULL); commit 0e50906ca1bb122fdddf1a03374e79ca8fbdd43f Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Sep 30 16:46:10 2020 -0500 Fix RF_POWER for K3/KX3/KX2 for non-KPA3 and non-KXPA100 mode diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index dd1fb03f..0ebc0b6b 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2202,9 +2202,15 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) /* * Best estimate: 1.0 corresponds to 100W - * Anything better must be done in rig-specific files. */ - if (RIG_LEVEL_IS_FLOAT(level)) { kenwood_val = val.f * 100; } + if (RIG_IS_K3 || RIG_IS_KX3 || RIG_IS_KX2) + { + kenwood_val = val.f * 12; + } // range is 0-12 if there is no KPA3 installed + else + { + kenwood_val = val.f * 100; + } snprintf(levelbuf, sizeof(levelbuf), "PC%03d", kenwood_val); break; @@ -2589,11 +2595,15 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) #endif /* * an answer "PC100" means 100 Watt - * which is val=1.0 on most rigs, but - * get_kenwood_level maps 0...255 onto 0.0 ... 1.0 */ - ret = get_kenwood_level(rig, "PC", &val->f, NULL); - val->f = val->f * (255.0 / 100.0); + ret = get_kenwood_level(rig, "PC", NULL, &val->i); + if (RIG_IS_K3 || RIG_IS_KX3 || RIG_IS_KX2) + { // range is 0-12 if there is no KPA3 installed + val->f = val->i / 12.0; + } + else { + val->f = val->f / 100.0; + } return ret; case RIG_LEVEL_AF: commit 58c5f52de8db78c0fffab1cd375fe784f7df77cb Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Sep 30 16:34:01 2020 -0500 Fix kenwood RIG_LEVEL_RF set https://github.com/Hamlib/Hamlib/issues/388 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 13560a4c..dd1fb03f 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -113,7 +113,7 @@ static const struct kenwood_id_string kenwood_id_string_list[] = { RIG_MODEL_TS950SDX, "012" }, { RIG_MODEL_TS50, "013" }, { RIG_MODEL_TS870S, "015" }, - { RIG_MODEL_TS570D, "017" }, /* Elecraft K2|K3 also returns 17 */ + { RIG_MODEL_TS570D, "017" }, /* Elecraft K2|K3|KX3 also returns 17 */ { RIG_MODEL_TS570S, "018" }, { RIG_MODEL_TS2000, "019" }, { RIG_MODEL_TS480, "020" }, @@ -2242,7 +2242,12 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_MICGAIN: /* XXX check level range */ - if (RIG_LEVEL_IS_FLOAT(level)) { kenwood_val = val.f * 100; } + if (RIG_IS_KX2 || RIG_IS_KX3 || RIG_IS_K2 || RIG_IS_K3 || RIG_IS_K3S) { // range is 0-255 + kenwood_val = val.f * 100 * (60.0/255.0); + } + else { // range is 0-100 + kenwood_val = val.f * 100; + } snprintf(levelbuf, sizeof(levelbuf), "MG%03d", kenwood_val); break; @@ -2255,15 +2260,15 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) if (RIG_IS_KX2 || RIG_IS_KX3) { - val.f = val.f * (250.0 - 190.0) + 190; + kenwood_val = val.f * (250.0 - 190.0) + 190; } else if (RIG_IS_K3 || RIG_IS_K3S) { - val.f = val.f * (250.0 / 100.0); + kenwood_val = val.f * (250.0 / 100.0); } else // other kenwood rigs { - val.f = val.f * 255.0; + kenwood_val = val.f * 255.0; } snprintf(levelbuf, sizeof(levelbuf), "RG%03d", kenwood_val); @@ -2576,6 +2581,12 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_RFPOWER: +#if 0 // TBD + if (RIG_IS_K3) { // see if KPA3 is enabled + ret = get_kenwood_level(rig, "MP055", NULL, &val->i); + if (val->i == + } +#endif /* * an answer "PC100" means 100 Watt * which is val=1.0 on most rigs, but @@ -2692,15 +2703,19 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return get_kenwood_level(rig, "SQ", &val->f, NULL); case RIG_LEVEL_MICGAIN: - ret = get_kenwood_level(rig, "MG", &val->f, NULL); + ret = get_kenwood_level(rig, "MG", NULL, &val->i); if (ret != RIG_OK) { rig_debug(RIG_DEBUG_ERR, "%s: Error getting MICGAIN\n", __func__); return ret; } - - val->f = val->f * (255.0 / 100.0); + if (RIG_IS_KX2 || RIG_IS_KX3 || RIG_IS_K2 || RIG_IS_K3 || RIG_IS_K3S) { + val->f = val->i * (255.0/60.0); + } + else { + val->f = val->i / 255.0; + } return RIG_OK; case RIG_LEVEL_AGC: commit 92dcdcd952419dc27a68e413a785008bca4e8dca Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Sep 30 15:52:20 2020 -0500 Fix floating point compuation on KX3/KX2 LEVEL_RF diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 68057074..13560a4c 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2673,7 +2673,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) // KX2 and KX3 have range 190 to 250 if (RIG_IS_KX2 || RIG_IS_KX3) { - val->f = (val->i - 190) / (250 - 190); + val->f = (val->i - 190.0) / (250.0 - 190.0); } // K3 is 0 to 250 else if (RIG_IS_K3 || RIG_IS_K3S) commit 01364ba1baa2d97e7a4c0b79288720d7b4e3eb14 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Sep 30 15:08:37 2020 -0500 astyle flex6xxx.c diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index 3fca3604..328c2a93 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -651,19 +651,22 @@ int powersdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) switch (level) { case RIG_LEVEL_AF: - if (val.f > 1.0) return -RIG_EINVAL; + if (val.f > 1.0) { return -RIG_EINVAL; } + ival = val.f * 100; snprintf(cmd, sizeof(cmd) - 1, "ZZAG%03d", ival); break; case RIG_LEVEL_RF: - if (val.f > 1.0) return -RIG_EINVAL; + if (val.f > 1.0) { return -RIG_EINVAL; } + ival = val.f * (120 - -20) - 20; snprintf(cmd, sizeof(cmd) - 1, "ZZAR%+04d", ival); break; case RIG_LEVEL_MICGAIN: - if (val.f > 1.0) return -RIG_EINVAL; + if (val.f > 1.0) { return -RIG_EINVAL; } + ival = val.f * (10 - -40) - 40; snprintf(cmd, sizeof(cmd) - 1, "ZZMG%03d", ival); break; @@ -678,13 +681,15 @@ int powersdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) break; case RIG_LEVEL_VOXGAIN: - if (val.f > 1.0) return -RIG_EINVAL; + if (val.f > 1.0) { return -RIG_EINVAL; } + ival = val.f * 1000; snprintf(cmd, sizeof(cmd) - 1, "ZZVG%04d", ival); break; case RIG_LEVEL_SQL: - if (val.f > 1.0) return -RIG_EINVAL; + if (val.f > 1.0) { return -RIG_EINVAL; } + powersdr_get_mode(rig, vfo, &mode, &width); if (mode == RIG_MODE_FM) @@ -829,6 +834,7 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) __func__, lvlbuf); return -RIG_EPROTO; } + val->f = (val->i + 20.0) / (120.0 - -20.0); break; commit b47028c59d49ac562a1371df0fe75a5c643384b3 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Sep 30 15:08:16 2020 -0500 Add get/set LEVEL_RF to PowerSDR diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index ad1572f4..3fca3604 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -651,11 +651,19 @@ int powersdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) switch (level) { case RIG_LEVEL_AF: + if (val.f > 1.0) return -RIG_EINVAL; ival = val.f * 100; snprintf(cmd, sizeof(cmd) - 1, "ZZAG%03d", ival); break; + case RIG_LEVEL_RF: + if (val.f > 1.0) return -RIG_EINVAL; + ival = val.f * (120 - -20) - 20; + snprintf(cmd, sizeof(cmd) - 1, "ZZAR%+04d", ival); + break; + case RIG_LEVEL_MICGAIN: + if (val.f > 1.0) return -RIG_EINVAL; ival = val.f * (10 - -40) - 40; snprintf(cmd, sizeof(cmd) - 1, "ZZMG%03d", ival); break; @@ -670,11 +678,13 @@ int powersdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) break; case RIG_LEVEL_VOXGAIN: + if (val.f > 1.0) return -RIG_EINVAL; ival = val.f * 1000; snprintf(cmd, sizeof(cmd) - 1, "ZZVG%04d", ival); break; case RIG_LEVEL_SQL: + if (val.f > 1.0) return -RIG_EINVAL; powersdr_get_mode(rig, vfo, &mode, &width); if (mode == RIG_MODE_FM) @@ -784,7 +794,6 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) switch (level) { - int i; case RIG_LEVEL_AGC: n = sscanf(lvlbuf + len, "%d", &val->i); @@ -812,10 +821,7 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_RF: - n = sscanf(lvlbuf + len, "%d", &i); - val->i = i; - rig_debug(RIG_DEBUG_TRACE, "%s: lvlbuf+len=%s, len=%d, i=%d, val->i=%d\n", __func__, lvlbuf+len, len, i, val->i); - + n = sscanf(lvlbuf + len, "%d", &val->i); if (n != 1) { @@ -823,8 +829,7 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) __func__, lvlbuf); return -RIG_EPROTO; } - val->f = (val->i + 20) / (120 - -20); - rig_... [truncated message content] |
From: Michael B. <mdb...@us...> - 2020-09-28 15:30:37
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via c9cfd40e91a225184f8e9423cd93015c94a57385 (commit) via 5fbb58f3ee948f9c1df0782ff17af9f36c9699e8 (commit) from 1e1e2a5fbd05b7134e563efc6654c2565a18eb00 (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 c9cfd40e91a225184f8e9423cd93015c94a57385 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Sep 28 09:11:14 2020 -0500 Update newcat.c for FTDX101D MS command now using VFO selection https://github.com/Hamlib/Hamlib/issues/385 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index daeef4de..bbdad637 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -2527,6 +2527,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) int scale; int fpf; char main_sub_vfo = '0'; + char *format; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -2538,7 +2539,7 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) return err; } - if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) + if (rig->caps->targetable_vfo & RIG_TARGETABLE_PURE) { main_sub_vfo = (RIG_VFO_B == vfo) ? '1' : '0'; } @@ -2684,10 +2685,22 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { return -RIG_ENAVAIL; } + if (newcat_is_rig(rig, RIG_MODEL_TS890S)) // new format for the command with VFO selection + { + format = "MS0%d;"; + if (vfo == RIG_VFO_SUB) + { + format = "MS1%d"; + } + } + else + { + format = "MS%d"; + } switch (val.i) { - case RIG_METER_ALC: snprintf(priv->cmd_str, sizeof(priv->cmd_str), "MS1;"); + case RIG_METER_ALC: snprintf(priv->cmd_str, sizeof(priv->cmd_str), format, 1); break; case RIG_METER_PO: @@ -2697,21 +2710,21 @@ int newcat_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } else { - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "MS2;"); + snprintf(priv->cmd_str, sizeof(priv->cmd_str), format, 2); } break; - case RIG_METER_SWR: snprintf(priv->cmd_str, sizeof(priv->cmd_str), "MS3;"); + case RIG_METER_SWR: snprintf(priv->cmd_str, sizeof(priv->cmd_str), format, 3); break; - case RIG_METER_COMP: snprintf(priv->cmd_str, sizeof(priv->cmd_str), "MS0;"); + case RIG_METER_COMP: snprintf(priv->cmd_str, sizeof(priv->cmd_str), format, 0); break; - case RIG_METER_IC: snprintf(priv->cmd_str, sizeof(priv->cmd_str), "MS4;"); + case RIG_METER_IC: snprintf(priv->cmd_str, sizeof(priv->cmd_str), format, 4); break; - case RIG_METER_VDD: snprintf(priv->cmd_str, sizeof(priv->cmd_str), "MS5;"); + case RIG_METER_VDD: snprintf(priv->cmd_str, sizeof(priv->cmd_str), format, 5); break; default: return -RIG_EINVAL; commit 5fbb58f3ee948f9c1df0782ff17af9f36c9699e8 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Sep 28 08:54:19 2020 -0500 Add RIG_TARGETABLE_PURE to ftdx101 and ftdx5000 Change newcat_get_level and set_level check to RIG_TARGETABLE_PURE https://github.com/Hamlib/Hamlib/issues/385 diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c index 5e08ae29..bdb36ada 100644 --- a/rigs/yaesu/ft5000.c +++ b/rigs/yaesu/ft5000.c @@ -87,7 +87,7 @@ const struct rig_caps ftdx5000_caps = .max_xit = Hz(9999), .max_ifshift = Hz(1000), .vfo_ops = FTDX5000_VFO_OPS, - .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_TONE, + .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_FUNC | RIG_TARGETABLE_PURE, .transceive = RIG_TRN_OFF, /* May enable later as the 5000 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, @@ -422,7 +422,7 @@ const struct rig_caps ftdx101d_caps = .max_xit = Hz(9999), .max_ifshift = Hz(1000), .vfo_ops = FTDX5000_VFO_OPS, - .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_FUNC, + .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_FUNC | RIG_TARGETABLE_PURE, .transceive = RIG_TRN_OFF, /* May enable later as the 5000 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 7814c936..daeef4de 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -3060,7 +3060,7 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return err; } - if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) + if (rig->caps->targetable_vfo & RIG_TARGETABLE_PURE) { main_sub_vfo = (RIG_VFO_B == vfo) ? '1' : '0'; } diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 0fef21fd..b2c64f3c 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20200927" +#define NEWCAT_VER "20200928" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/ft5000.c | 4 ++-- rigs/yaesu/newcat.c | 29 +++++++++++++++++++++-------- rigs/yaesu/newcat.h | 2 +- 3 files changed, 24 insertions(+), 11 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-09-27 21:07: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 1e1e2a5fbd05b7134e563efc6654c2565a18eb00 (commit) from f0dc0f71d44bce269d88d8d259c4c1fb14223f2b (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 1e1e2a5fbd05b7134e563efc6654c2565a18eb00 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Sep 27 16:07:26 2020 -0500 Add debug to settings.c diff --git a/src/settings.c b/src/settings.c index 77aa4c18..4a81426a 100644 --- a/src/settings.c +++ b/src/settings.c @@ -534,6 +534,10 @@ int HAMLIB_API rig_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) return caps->set_func(rig, vfo, func, status); } + else { + int targetable = caps->targetable_vfo & RIG_TARGETABLE_FUNC; + rig_debug(RIG_DEBUG_TRACE, "%s: targetable=%d, vfo=%s, currvfo=%s\n", __func__, targetable, rig_strvfo(vfo), rig_strvfo(rig->state.current_vfo)); + } if (!caps->set_vfo) { ----------------------------------------------------------------------- Summary of changes: src/settings.c | 4 ++++ 1 file changed, 4 insertions(+) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-09-27 21:03:18
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via f0dc0f71d44bce269d88d8d259c4c1fb14223f2b (commit) from 37cff7ffc1e270e8214f5565082d7e830c7879bc (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 f0dc0f71d44bce269d88d8d259c4c1fb14223f2b Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Sep 27 16:01:48 2020 -0500 Add RIG_TARGETABLE_FUNC and RIG_TARGETABLE_TONE to ftdx101d Ensure VFO is only set on FUNC calls when TARGETABLE_FUNC is on for newcat.c https://github.com/Hamlib/Hamlib/issues/385 diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c index 7602e647..5e08ae29 100644 --- a/rigs/yaesu/ft5000.c +++ b/rigs/yaesu/ft5000.c @@ -87,7 +87,7 @@ const struct rig_caps ftdx5000_caps = .max_xit = Hz(9999), .max_ifshift = Hz(1000), .vfo_ops = FTDX5000_VFO_OPS, - .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, + .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_TONE, .transceive = RIG_TRN_OFF, /* May enable later as the 5000 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, @@ -387,7 +387,7 @@ const struct rig_caps ftdx101d_caps = RIG_MODEL(RIG_MODEL_FTDX101D), .model_name = "FT-DX101D", .mfg_name = "Yaesu", - .version = NEWCAT_VER ".0", + .version = NEWCAT_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -422,7 +422,7 @@ const struct rig_caps ftdx101d_caps = .max_xit = Hz(9999), .max_ifshift = Hz(1000), .vfo_ops = FTDX5000_VFO_OPS, - .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE, + .targetable_vfo = RIG_TARGETABLE_FREQ | RIG_TARGETABLE_MODE | RIG_TARGETABLE_FUNC, .transceive = RIG_TRN_OFF, /* May enable later as the 5000 has an Auto Info command */ .bank_qty = 0, .chan_desc_sz = 0, diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index e275c99a..7814c936 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -3550,7 +3550,7 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) return err; } - if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) + if (rig->caps->targetable_vfo & (RIG_TARGETABLE_MODE | RIG_TARGETABLE_TONE)) { main_sub_vfo = (RIG_VFO_B == vfo) ? '1' : '0'; } @@ -3607,7 +3607,12 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%d%c", status ? 2 : 0, cat_term); - priv->cmd_str[2] = main_sub_vfo; + + if (rig->caps->targetable_vfo & RIG_TARGETABLE_TONE) + { + priv->cmd_str[2] = main_sub_vfo; + } + break; case RIG_FUNC_TSQL: @@ -3618,7 +3623,12 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%d%c", status ? 1 : 0, cat_term); - priv->cmd_str[2] = main_sub_vfo; + + if (rig->caps->targetable_vfo & RIG_TARGETABLE_TONE) + { + priv->cmd_str[2] = main_sub_vfo; + } + break; case RIG_FUNC_LOCK: @@ -3649,7 +3659,9 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "NB0%d%c", status ? 1 : 0, cat_term); + if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE){ priv->cmd_str[2] = main_sub_vfo; + } break; case RIG_FUNC_NR: @@ -3660,7 +3672,9 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "NR0%d%c", status ? 1 : 0, cat_term); + if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE){ priv->cmd_str[2] = main_sub_vfo; + } break; case RIG_FUNC_COMP: @@ -3780,7 +3794,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%c", cat_term); - if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) + if (rig->caps->targetable_vfo & RIG_TARGETABLE_TONE) { priv->cmd_str[2] = main_sub_vfo; } @@ -3795,7 +3809,7 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%c", cat_term); - if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) + if (rig->caps->targetable_vfo & RIG_TARGETABLE_TONE) { priv->cmd_str[2] = main_sub_vfo; } @@ -6485,56 +6499,56 @@ int newcat_get_cmd(RIG *rig) } // any command that is read only should not expire cache - is_read_cmd = - strcmp(priv->cmd_str,"AG0;")==0 - || strcmp(priv->cmd_str,"AG1;")==0 - || strcmp(priv->cmd_str,"AN0;")==0 - || strcmp(priv->cmd_str,"AN1;")==0 - || strcmp(priv->cmd_str,"BP00;")==0 - || strcmp(priv->cmd_str,"BP01;")==0 - || strcmp(priv->cmd_str,"BP10;")==0 - || strcmp(priv->cmd_str,"BP11;")==0 - || strcmp(priv->cmd_str,"CN00;")==0 - || strcmp(priv->cmd_str,"CN10;")==0 - || strcmp(priv->cmd_str,"CO00;")==0 - || strcmp(priv->cmd_str,"CO01;")==0 - || strcmp(priv->cmd_str,"CO02;")==0 - || strcmp(priv->cmd_str,"CO03;")==0 - || strcmp(priv->cmd_str,"CO10;")==0 - || strcmp(priv->cmd_str,"CO11;")==0 - || strcmp(priv->cmd_str,"CO12;")==0 - || strcmp(priv->cmd_str,"CO13;")==0 - || strcmp(priv->cmd_str,"IS1;")==0 - || strcmp(priv->cmd_str,"IS0;")==0 - || strcmp(priv->cmd_str,"IS1;")==0 - || strcmp(priv->cmd_str,"MD0;")==0 - || strcmp(priv->cmd_str,"MD1;")==0 - || strcmp(priv->cmd_str,"NA0;")==0 - || strcmp(priv->cmd_str,"NA1;")==0 - || strcmp(priv->cmd_str,"NB0;")==0 - || strcmp(priv->cmd_str,"NB1;")==0 - || strcmp(priv->cmd_str,"NL0;")==0 - || strcmp(priv->cmd_str,"NL1;")==0 - || strcmp(priv->cmd_str,"NR0;")==0 - || strcmp(priv->cmd_str,"NR1;")==0 - || strcmp(priv->cmd_str,"OS0;")==0 - || strcmp(priv->cmd_str,"OS1;")==0 - || strcmp(priv->cmd_str,"PA0;")==0 - || strcmp(priv->cmd_str,"PA1;")==0 - || strcmp(priv->cmd_str,"RA0;")==0 - || strcmp(priv->cmd_str,"RA1;")==0 - || strcmp(priv->cmd_str,"RF0;")==0 - || strcmp(priv->cmd_str,"RF1;")==0 - || strcmp(priv->cmd_str,"RL0;")==0 - || strcmp(priv->cmd_str,"RL1;")==0 - || strcmp(priv->cmd_str,"RM0;")==0 - || strcmp(priv->cmd_str,"RM1;")==0 - || strcmp(priv->cmd_str,"SM0;")==0 - || strcmp(priv->cmd_str,"SM1;")==0 - || strcmp(priv->cmd_str,"SQ0;")==0 - || strcmp(priv->cmd_str,"SQ1;")==0 - || strcmp(priv->cmd_str,"VT0;")==0 - || strcmp(priv->cmd_str,"VT1;")==0; + is_read_cmd = + strcmp(priv->cmd_str, "AG0;") == 0 + || strcmp(priv->cmd_str, "AG1;") == 0 + || strcmp(priv->cmd_str, "AN0;") == 0 + || strcmp(priv->cmd_str, "AN1;") == 0 + || strcmp(priv->cmd_str, "BP00;") == 0 + || strcmp(priv->cmd_str, "BP01;") == 0 + || strcmp(priv->cmd_str, "BP10;") == 0 + || strcmp(priv->cmd_str, "BP11;") == 0 + || strcmp(priv->cmd_str, "CN00;") == 0 + || strcmp(priv->cmd_str, "CN10;") == 0 + || strcmp(priv->cmd_str, "CO00;") == 0 + || strcmp(priv->cmd_str, "CO01;") == 0 + || strcmp(priv->cmd_str, "CO02;") == 0 + || strcmp(priv->cmd_str, "CO03;") == 0 + || strcmp(priv->cmd_str, "CO10;") == 0 + || strcmp(priv->cmd_str, "CO11;") == 0 + || strcmp(priv->cmd_str, "CO12;") == 0 + || strcmp(priv->cmd_str, "CO13;") == 0 + || strcmp(priv->cmd_str, "IS1;") == 0 + || strcmp(priv->cmd_str, "IS0;") == 0 + || strcmp(priv->cmd_str, "IS1;") == 0 + || strcmp(priv->cmd_str, "MD0;") == 0 + || strcmp(priv->cmd_str, "MD1;") == 0 + || strcmp(priv->cmd_str, "NA0;") == 0 + || strcmp(priv->cmd_str, "NA1;") == 0 + || strcmp(priv->cmd_str, "NB0;") == 0 + || strcmp(priv->cmd_str, "NB1;") == 0 + || strcmp(priv->cmd_str, "NL0;") == 0 + || strcmp(priv->cmd_str, "NL1;") == 0 + || strcmp(priv->cmd_str, "NR0;") == 0 + || strcmp(priv->cmd_str, "NR1;") == 0 + || strcmp(priv->cmd_str, "OS0;") == 0 + || strcmp(priv->cmd_str, "OS1;") == 0 + || strcmp(priv->cmd_str, "PA0;") == 0 + || strcmp(priv->cmd_str, "PA1;") == 0 + || strcmp(priv->cmd_str, "RA0;") == 0 + || strcmp(priv->cmd_str, "RA1;") == 0 + || strcmp(priv->cmd_str, "RF0;") == 0 + || strcmp(priv->cmd_str, "RF1;") == 0 + || strcmp(priv->cmd_str, "RL0;") == 0 + || strcmp(priv->cmd_str, "RL1;") == 0 + || strcmp(priv->cmd_str, "RM0;") == 0 + || strcmp(priv->cmd_str, "RM1;") == 0 + || strcmp(priv->cmd_str, "SM0;") == 0 + || strcmp(priv->cmd_str, "SM1;") == 0 + || strcmp(priv->cmd_str, "SQ0;") == 0 + || strcmp(priv->cmd_str, "SQ1;") == 0 + || strcmp(priv->cmd_str, "VT0;") == 0 + || strcmp(priv->cmd_str, "VT1;") == 0; if (priv->cmd_str[2] != ';' && !is_read_cmd) // then we must be setting something so we'll invalidate the cache diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 05dd5519..0fef21fd 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20200926" +#define NEWCAT_VER "20200927" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/ft5000.c | 6 +-- rigs/yaesu/newcat.c | 124 +++++++++++++++++++++++++++++----------------------- rigs/yaesu/newcat.h | 2 +- 3 files changed, 73 insertions(+), 59 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Nate B. <n0...@us...> - 2020-09-27 14:01:05
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, Hamlib-4.0 has been updated via 89b290f946062e878b9f249f4205c73d7a6c6707 (commit) via e92ce18a7b654279ca625a09be6830bc24148b30 (commit) via a5ff863702865023dc6070d785fc75028fe6865d (commit) via 93eb0fe1dbe5067f58ee08a4698c4b041826eec8 (commit) via 7e4b0882fbb28cd11baa9eb1c0ca3d08b422c1ea (commit) via 15939de0018eb601e88c85a0cf662a141aae84b3 (commit) via 31fb3e96d4c8473b2de26af35d42bf3fb70430bf (commit) via a1fbfafbdd5d39304d65b89be56a6a18306e1ff8 (commit) via 0f0f71eb4fb777f8d29d340da6193b7925c7fc8b (commit) via f7c24262e97b6b49cf460c4ae623500075a526b7 (commit) via a690a40ababf413522366c01019eccab07bda1ac (commit) via 06f89c7bb7e754eb0996e66ee101bc871eb559ab (commit) via 5a8e11ae9d45895a1356ee1029b6f9bb585e2479 (commit) via db8dc5d345164463bef5123c7b76a987d79c621e (commit) via 94f90cb6c79c9c9c3ab3db3208e7df3205890da3 (commit) via 789855f4abc9240fb5f38a765e9f1160e15d703e (commit) via 4674a7228471c73344fe5cfda84b98155737bb2d (commit) via 61e4b4db5448aece25ec28ca74ad53c56e4b6904 (commit) via 6570916bb143669fc5c7ee8d956736a00b4ab211 (commit) via e83fac63d68c9580bff4d6472218881af76dfb4a (commit) via ad1d5f0b77eaff781837444ee5f5e65553d156b0 (commit) via b2598a386a1b7656bcb2ab4a19e4b486d88b4786 (commit) via 2563f7cadc96fcba80cd3cfb4115585a1f8312d6 (commit) via 862db049f1eef6e3cf2d2a6cdc071788cffb8b40 (commit) via efed1ae303ace29475859852b3523708e20aac35 (commit) via 21d8d4a8f71693ecd7b682d812c5b0717c60764e (commit) via 7e34c6fba1b31c44372f70df06f6fbdbbc298c4b (commit) from b1a5fc3a2ca2a6e0b7d60ecba318da39ff951f3c (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 89b290f946062e878b9f249f4205c73d7a6c6707 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 26 23:10:29 2020 -0500 Update newcat version https://github.com/Hamlib/Hamlib/issues/385 (cherry picked from commit 37cff7ffc1e270e8214f5565082d7e830c7879bc) diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 0173388f..05dd5519 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20200804" +#define NEWCAT_VER "20200926" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit e92ce18a7b654279ca625a09be6830bc24148b30 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 26 22:34:02 2020 -0500 Add comment to is_read_cmd newcat.c and remove redundant check https://github.com/Hamlib/Hamlib/issues/385 (cherry picked from commit 359f7549dca6396732a4afa56a2b81c92c5b3e5a) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index ce813933..e275c99a 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -6484,6 +6484,7 @@ int newcat_get_cmd(RIG *rig) // we drop through and do the real IF command } + // any command that is read only should not expire cache is_read_cmd = strcmp(priv->cmd_str,"AG0;")==0 || strcmp(priv->cmd_str,"AG1;")==0 @@ -6533,8 +6534,7 @@ int newcat_get_cmd(RIG *rig) || strcmp(priv->cmd_str,"SQ0;")==0 || strcmp(priv->cmd_str,"SQ1;")==0 || strcmp(priv->cmd_str,"VT0;")==0 - || strcmp(priv->cmd_str,"VT1;")==0 - || strcmp(priv->cmd_str,"SQ1;")==0; + || strcmp(priv->cmd_str,"VT1;")==0; if (priv->cmd_str[2] != ';' && !is_read_cmd) // then we must be setting something so we'll invalidate the cache commit a5ff863702865023dc6070d785fc75028fe6865d Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 26 17:45:45 2020 -0500 Allow yaesu 3+char read cmds to not invalidate the IF cache https://github.com/Hamlib/Hamlib/issues/385 (cherry picked from commit 60201aab40a9e3d59e8347fbef8a5679248b7c6f) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 21b98e8a..ce813933 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -889,7 +889,7 @@ int newcat_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) } /* - * rig_set_vfo + * newcat_set_vfo * * set vfo and store requested vfo for later RIG_VFO_CURR * requests. @@ -3779,7 +3779,12 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%c", cat_term); - priv->cmd_str[2] = main_sub_vfo; + + if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) + { + priv->cmd_str[2] = main_sub_vfo; + } + break; case RIG_FUNC_TSQL: @@ -3789,7 +3794,12 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%c", cat_term); - priv->cmd_str[2] = main_sub_vfo; + + if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) + { + priv->cmd_str[2] = main_sub_vfo; + } + break; case RIG_FUNC_LOCK: @@ -3817,7 +3827,12 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "NB0%c", cat_term); - priv->cmd_str[2] = main_sub_vfo; + + if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) + { + priv->cmd_str[2] = main_sub_vfo; + } + break; case RIG_FUNC_NR: @@ -3827,7 +3842,12 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "NR0%c", cat_term); - priv->cmd_str[2] = main_sub_vfo; + + if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) + { + priv->cmd_str[2] = main_sub_vfo; + } + break; case RIG_FUNC_COMP: @@ -6442,6 +6462,7 @@ int newcat_get_cmd(RIG *rig) struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; int retry_count = 0; int rc = -RIG_EPROTO; + int is_read_cmd = 0; // try to cache rapid repeats of the IF command // this is for WSJT-X/JTDX sequence of v/f/m/t @@ -6463,8 +6484,60 @@ int newcat_get_cmd(RIG *rig) // we drop through and do the real IF command } + is_read_cmd = + strcmp(priv->cmd_str,"AG0;")==0 + || strcmp(priv->cmd_str,"AG1;")==0 + || strcmp(priv->cmd_str,"AN0;")==0 + || strcmp(priv->cmd_str,"AN1;")==0 + || strcmp(priv->cmd_str,"BP00;")==0 + || strcmp(priv->cmd_str,"BP01;")==0 + || strcmp(priv->cmd_str,"BP10;")==0 + || strcmp(priv->cmd_str,"BP11;")==0 + || strcmp(priv->cmd_str,"CN00;")==0 + || strcmp(priv->cmd_str,"CN10;")==0 + || strcmp(priv->cmd_str,"CO00;")==0 + || strcmp(priv->cmd_str,"CO01;")==0 + || strcmp(priv->cmd_str,"CO02;")==0 + || strcmp(priv->cmd_str,"CO03;")==0 + || strcmp(priv->cmd_str,"CO10;")==0 + || strcmp(priv->cmd_str,"CO11;")==0 + || strcmp(priv->cmd_str,"CO12;")==0 + || strcmp(priv->cmd_str,"CO13;")==0 + || strcmp(priv->cmd_str,"IS1;")==0 + || strcmp(priv->cmd_str,"IS0;")==0 + || strcmp(priv->cmd_str,"IS1;")==0 + || strcmp(priv->cmd_str,"MD0;")==0 + || strcmp(priv->cmd_str,"MD1;")==0 + || strcmp(priv->cmd_str,"NA0;")==0 + || strcmp(priv->cmd_str,"NA1;")==0 + || strcmp(priv->cmd_str,"NB0;")==0 + || strcmp(priv->cmd_str,"NB1;")==0 + || strcmp(priv->cmd_str,"NL0;")==0 + || strcmp(priv->cmd_str,"NL1;")==0 + || strcmp(priv->cmd_str,"NR0;")==0 + || strcmp(priv->cmd_str,"NR1;")==0 + || strcmp(priv->cmd_str,"OS0;")==0 + || strcmp(priv->cmd_str,"OS1;")==0 + || strcmp(priv->cmd_str,"PA0;")==0 + || strcmp(priv->cmd_str,"PA1;")==0 + || strcmp(priv->cmd_str,"RA0;")==0 + || strcmp(priv->cmd_str,"RA1;")==0 + || strcmp(priv->cmd_str,"RF0;")==0 + || strcmp(priv->cmd_str,"RF1;")==0 + || strcmp(priv->cmd_str,"RL0;")==0 + || strcmp(priv->cmd_str,"RL1;")==0 + || strcmp(priv->cmd_str,"RM0;")==0 + || strcmp(priv->cmd_str,"RM1;")==0 + || strcmp(priv->cmd_str,"SM0;")==0 + || strcmp(priv->cmd_str,"SM1;")==0 + || strcmp(priv->cmd_str,"SQ0;")==0 + || strcmp(priv->cmd_str,"SQ1;")==0 + || strcmp(priv->cmd_str,"VT0;")==0 + || strcmp(priv->cmd_str,"VT1;")==0 + || strcmp(priv->cmd_str,"SQ1;")==0; + if (priv->cmd_str[2] != - ';') // then we must be setting something so we'll invalidate the cache + ';' && !is_read_cmd) // then we must be setting something so we'll invalidate the cache { rig_debug(RIG_DEBUG_TRACE, "%s: cache invalidated\n", __func__); priv->cache_start.tv_sec = 0; commit 93eb0fe1dbe5067f58ee08a4698c4b041826eec8 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 19 16:09:44 2020 -0500 Add suppress for AST broken bug in cppcheck (cherry picked from commit 7bee01f785d65dafae25d1dc1dd26e62d3bf89e7) diff --git a/cppcheck.sh b/cppcheck.sh index d5dfb598..bba1f980 100755 --- a/cppcheck.sh +++ b/cppcheck.sh @@ -55,6 +55,7 @@ CHECK="\ -D DECLARE_INITRIG_BACKEND \ -D DECLARE_INITRROT_BACKEND \ -D DECLARE_INITAMP_BACKEND \ +-D B230400 -U RIG_LEVEL_LINEOUT \ -U O_ASYNC \ -U F_SETSIG \ diff --git a/rigs/aor/ar3030.c b/rigs/aor/ar3030.c index b1445954..f7fe52fb 100644 --- a/rigs/aor/ar3030.c +++ b/rigs/aor/ar3030.c @@ -799,6 +799,7 @@ int ar3030_get_channel(RIG *rig, channel_t *chan, int read_only) rig_passband_normal(rig, chan->mode); + // cppcheck-suppress * chan->levels[LVL_ATT].i = infobuf[6] == '0' ? 0 : rig->caps->attenuator[infobuf[4] - '1']; diff --git a/rigs/aor/ar7030.c b/rigs/aor/ar7030.c index a10a6a22..2a932479 100644 --- a/rigs/aor/ar7030.c +++ b/rigs/aor/ar7030.c @@ -809,6 +809,7 @@ const struct rig_caps ar7030_caps = .has_get_parm = AR7030_PARM, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/aor/ar7030p.c b/rigs/aor/ar7030p.c index 4e16c58f..bcee8c3f 100644 --- a/rigs/aor/ar7030p.c +++ b/rigs/aor/ar7030p.c @@ -1675,6 +1675,7 @@ static int ar7030p_get_channel(RIG *rig, channel_t *chan, int read_only) if (RIG_OK == rc) { + // cppcheck-suppress * chan->levels[ LVL_SQL ].f = (float) v / 255.0; } diff --git a/rigs/icmarine/icm700pro.c b/rigs/icmarine/icm700pro.c index 9b1e843a..55b5f74f 100644 --- a/rigs/icmarine/icm700pro.c +++ b/rigs/icmarine/icm700pro.c @@ -83,6 +83,7 @@ const struct rig_caps icm700pro_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 8 } }, }, .parm_gran = {}, diff --git a/rigs/icmarine/icm710.c b/rigs/icmarine/icm710.c index 53076a47..76e5f028 100644 --- a/rigs/icmarine/icm710.c +++ b/rigs/icmarine/icm710.c @@ -96,6 +96,7 @@ const struct rig_caps icm710_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 8 } }, }, .parm_gran = {}, diff --git a/rigs/icmarine/icm802.c b/rigs/icmarine/icm802.c index b20a5e22..b39b5f10 100644 --- a/rigs/icmarine/icm802.c +++ b/rigs/icmarine/icm802.c @@ -84,6 +84,7 @@ const struct rig_caps icm802_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 8 } }, }, .parm_gran = {}, diff --git a/rigs/icmarine/icm803.c b/rigs/icmarine/icm803.c index 989836e0..4daea784 100644 --- a/rigs/icmarine/icm803.c +++ b/rigs/icmarine/icm803.c @@ -84,6 +84,7 @@ const struct rig_caps icm803_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 8 } }, }, .parm_gran = {}, diff --git a/rigs/icom/ic2730.c b/rigs/icom/ic2730.c index 82033d5f..dedf6d44 100644 --- a/rigs/icom/ic2730.c +++ b/rigs/icom/ic2730.c @@ -93,6 +93,7 @@ const struct rig_caps ic2730_caps = .has_get_parm = IC2730_PARM_ALL, .has_set_parm = IC2730_PARM_ALL, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/ic7000.c b/rigs/icom/ic7000.c index 874213c7..b2169943 100644 --- a/rigs/icom/ic7000.c +++ b/rigs/icom/ic7000.c @@ -183,6 +183,7 @@ const struct rig_caps ic7000_caps = .has_get_parm = IC7000_PARMS, .has_set_parm = RIG_PARM_SET(IC7000_PARMS), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic703.c b/rigs/icom/ic703.c index 95ff4a26..419bc17b 100644 --- a/rigs/icom/ic703.c +++ b/rigs/icom/ic703.c @@ -113,6 +113,7 @@ const struct rig_caps ic703_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/ic706.c b/rigs/icom/ic706.c index f9a6f25d..95d3a400 100644 --- a/rigs/icom/ic706.c +++ b/rigs/icom/ic706.c @@ -477,6 +477,7 @@ const struct rig_caps ic706mkiig_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/ic7100.c b/rigs/icom/ic7100.c index 42dce0ee..1f303f53 100644 --- a/rigs/icom/ic7100.c +++ b/rigs/icom/ic7100.c @@ -220,6 +220,7 @@ const struct rig_caps ic7100_caps = .has_get_parm = IC7100_PARM_ALL, .has_set_parm = IC7100_PARM_ALL, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic718.c b/rigs/icom/ic718.c index 5583694e..8d4b6692 100644 --- a/rigs/icom/ic718.c +++ b/rigs/icom/ic718.c @@ -105,6 +105,7 @@ const struct rig_caps ic718_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/ic7200.c b/rigs/icom/ic7200.c index c7703c8d..a0f56ad5 100644 --- a/rigs/icom/ic7200.c +++ b/rigs/icom/ic7200.c @@ -143,6 +143,7 @@ const struct rig_caps ic7200_caps = .has_get_parm = IC7200_PARMS, .has_set_parm = RIG_PARM_SET(IC7200_PARMS), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index a7dc437d..4f059a0d 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -305,6 +305,7 @@ const struct rig_caps ic7300_caps = .has_get_parm = IC7300_PARMS, .has_set_parm = RIG_PARM_SET(IC7300_PARMS), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = {.min = {.i = 0}, .max = {.i = 255}}, [LVL_VOXDELAY] = {.min = {.i = 0}, .max = {.i = 20}, .step = {.i = 1}}, [LVL_KEYSPD] = {.min = {.i = 6}, .max = {.i = 48}, .step = {.i = 1}}, diff --git a/rigs/icom/ic7410.c b/rigs/icom/ic7410.c index e922ee08..be194227 100644 --- a/rigs/icom/ic7410.c +++ b/rigs/icom/ic7410.c @@ -142,6 +142,7 @@ const struct rig_caps ic7410_caps = .has_get_parm = IC7410_PARMS, .has_set_parm = RIG_PARM_SET(IC7410_PARMS), /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic746.c b/rigs/icom/ic746.c index 1037e898..04be36ea 100644 --- a/rigs/icom/ic746.c +++ b/rigs/icom/ic746.c @@ -208,6 +208,7 @@ const struct rig_caps ic746_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_ANN, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic751.c b/rigs/icom/ic751.c index 4b682182..707e1d84 100644 --- a/rigs/icom/ic751.c +++ b/rigs/icom/ic751.c @@ -114,6 +114,7 @@ const struct rig_caps ic751_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/ic756.c b/rigs/icom/ic756.c index 95ae2684..26d322d7 100644 --- a/rigs/icom/ic756.c +++ b/rigs/icom/ic756.c @@ -171,6 +171,7 @@ const struct rig_caps ic756_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/ic7600.c b/rigs/icom/ic7600.c index 28ddd476..dec54753 100644 --- a/rigs/icom/ic7600.c +++ b/rigs/icom/ic7600.c @@ -183,6 +183,7 @@ const struct rig_caps ic7600_caps = .has_get_parm = IC7600_PARMS, .has_set_parm = RIG_PARM_SET(IC7600_PARMS), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic7610.c b/rigs/icom/ic7610.c index 8b0dcb1e..66670451 100644 --- a/rigs/icom/ic7610.c +++ b/rigs/icom/ic7610.c @@ -181,6 +181,7 @@ const struct rig_caps ic7610_caps = .has_get_parm = IC7610_PARMS, .has_set_parm = RIG_PARM_SET(IC7610_PARMS), /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic7700.c b/rigs/icom/ic7700.c index f8c9fa9d..03f4d5c6 100644 --- a/rigs/icom/ic7700.c +++ b/rigs/icom/ic7700.c @@ -166,6 +166,7 @@ const struct rig_caps ic7700_caps = .has_get_parm = IC7700_PARMS, .has_set_parm = RIG_PARM_SET(IC7700_PARMS), /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic78.c b/rigs/icom/ic78.c index 1a079176..7a97a137 100644 --- a/rigs/icom/ic78.c +++ b/rigs/icom/ic78.c @@ -97,6 +97,7 @@ const struct rig_caps ic78_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/ic7800.c b/rigs/icom/ic7800.c index be9d82e3..e3ad8de4 100644 --- a/rigs/icom/ic7800.c +++ b/rigs/icom/ic7800.c @@ -169,6 +169,7 @@ const struct rig_caps ic7800_caps = .has_get_parm = IC7800_PARMS, .has_set_parm = RIG_PARM_SET(IC7800_PARMS), /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic785x.c b/rigs/icom/ic785x.c index 70bf71c7..f100d238 100644 --- a/rigs/icom/ic785x.c +++ b/rigs/icom/ic785x.c @@ -175,6 +175,7 @@ const struct rig_caps ic785x_caps = .has_get_parm = IC785x_PARMS, .has_set_parm = RIG_PARM_SET(IC785x_PARMS), /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic910.c b/rigs/icom/ic910.c index b6caf4af..8156bbbe 100644 --- a/rigs/icom/ic910.c +++ b/rigs/icom/ic910.c @@ -488,6 +488,7 @@ const struct rig_caps ic910_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, }, diff --git a/rigs/icom/ic9100.c b/rigs/icom/ic9100.c index 3ab05461..ae74b355 100644 --- a/rigs/icom/ic9100.c +++ b/rigs/icom/ic9100.c @@ -138,6 +138,7 @@ const struct rig_caps ic9100_caps = .has_get_parm = IC9100_PARM_ALL, .has_set_parm = IC9100_PARM_ALL, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, }, diff --git a/rigs/icom/ic92d.c b/rigs/icom/ic92d.c index e000c0bd..f8355631 100644 --- a/rigs/icom/ic92d.c +++ b/rigs/icom/ic92d.c @@ -125,6 +125,7 @@ const struct rig_caps ic92d_caps = .has_get_parm = IC92D_PARM_ALL, .has_set_parm = IC92D_PARM_ALL, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/icr10.c b/rigs/icom/icr10.c index 83e228f1..be9cd16f 100644 --- a/rigs/icom/icr10.c +++ b/rigs/icom/icr10.c @@ -84,6 +84,7 @@ const struct rig_caps icr10_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/icr20.c b/rigs/icom/icr20.c index a35d1af3..b79fed5e 100644 --- a/rigs/icom/icr20.c +++ b/rigs/icom/icr20.c @@ -84,6 +84,7 @@ const struct rig_caps icr20_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/icr30.c b/rigs/icom/icr30.c index 6300b986..92f48677 100644 --- a/rigs/icom/icr30.c +++ b/rigs/icom/icr30.c @@ -158,6 +158,7 @@ const struct rig_caps icr30_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/icr6.c b/rigs/icom/icr6.c index 6403436e..60ba0e1d 100644 --- a/rigs/icom/icr6.c +++ b/rigs/icom/icr6.c @@ -85,6 +85,7 @@ const struct rig_caps icr6_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/icr7000.c b/rigs/icom/icr7000.c index dbc5ca8c..517b02b0 100644 --- a/rigs/icom/icr7000.c +++ b/rigs/icom/icr7000.c @@ -204,6 +204,7 @@ const struct rig_caps icr7100_caps = .has_get_parm = ICR7100_PARMS, .has_set_parm = RIG_PARM_SET(ICR7100_PARMS), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/icr75.c b/rigs/icom/icr75.c index a813f557..2f509322 100644 --- a/rigs/icom/icr75.c +++ b/rigs/icom/icr75.c @@ -135,6 +135,7 @@ const struct rig_caps icr75_caps = .has_get_parm = ICR75_PARM_ALL, .has_set_parm = RIG_PARM_SET(ICR75_PARM_ALL), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_PBT_IN] = { .min = { .f = -1280 }, .max = { .f = +1280 }, .step = { .f = 15 } }, [LVL_PBT_OUT] = { .min = { .f = -1280 }, .max = { .f = +1280 }, .step = { .f = 15 } }, diff --git a/rigs/icom/icr8500.c b/rigs/icom/icr8500.c index 115bde8c..ae6d1abe 100644 --- a/rigs/icom/icr8500.c +++ b/rigs/icom/icr8500.c @@ -104,6 +104,7 @@ const struct rig_caps icr8500_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_IF] = { .min = { .i = 0 }, .max = { .i = 255 }, .step = { .i = 1 } }, }, diff --git a/rigs/icom/icr8600.c b/rigs/icom/icr8600.c index a945cc22..be5368d4 100644 --- a/rigs/icom/icr8600.c +++ b/rigs/icom/icr8600.c @@ -137,6 +137,7 @@ const struct rig_caps icr8600_caps = .has_set_level = RIG_LEVEL_SET(ICR8600_LEVEL_ALL), .has_get_parm = ICR8600_PARM_ALL, .has_set_parm = RIG_PARM_SET(ICR8600_PARM_ALL), + // cppcheck-suppress * .level_gran = { [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } } }, .parm_gran = { [PARM_TIME] = { .min = { .i = 0 }, .max = { .i = 86399} } }, .ext_tokens = icr8600_tokens, diff --git a/rigs/icom/icr9000.c b/rigs/icom/icr9000.c index c8d7918b..b2aedba0 100644 --- a/rigs/icom/icr9000.c +++ b/rigs/icom/icr9000.c @@ -100,6 +100,7 @@ const struct rig_caps icr9000_caps = .has_get_parm = ICR9000_PARMS, .has_set_parm = RIG_PARM_SET(ICR9000_PARMS), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/icr9500.c b/rigs/icom/icr9500.c index 2b56d301..74b42336 100644 --- a/rigs/icom/icr9500.c +++ b/rigs/icom/icr9500.c @@ -116,6 +116,7 @@ const struct rig_caps icr9500_caps = .has_get_parm = ICR9500_PARMS, .has_set_parm = RIG_PARM_SET(ICR9500_PARMS), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/icrx7.c b/rigs/icom/icrx7.c index 42d933f9..b5ba39d2 100644 --- a/rigs/icom/icrx7.c +++ b/rigs/icom/icrx7.c @@ -82,6 +82,7 @@ const struct rig_caps icrx7_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/id1.c b/rigs/icom/id1.c index 4fef87e6..70dee3be 100644 --- a/rigs/icom/id1.c +++ b/rigs/icom/id1.c @@ -101,6 +101,7 @@ const struct rig_caps id1_caps = .has_get_parm = ID1_PARM_ALL, .has_set_parm = ID1_PARM_ALL, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/id31.c b/rigs/icom/id31.c index 8da4fda4..46f97d9c 100644 --- a/rigs/icom/id31.c +++ b/rigs/icom/id31.c @@ -109,6 +109,7 @@ const struct rig_caps id31_caps = .has_get_parm = ID31_PARM_ALL, .has_set_parm = ID31_PARM_ALL, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .extparms = icom_ext_parms, diff --git a/rigs/icom/id4100.c b/rigs/icom/id4100.c index 72c300a7..df3e1d3d 100644 --- a/rigs/icom/id4100.c +++ b/rigs/icom/id4100.c @@ -113,6 +113,7 @@ const struct rig_caps id4100_caps = .has_get_parm = ID4100_PARM_ALL, .has_set_parm = ID4100_PARM_ALL, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .extparms = icom_ext_parms, diff --git a/rigs/icom/id51.c b/rigs/icom/id51.c index b871f51c..61289000 100644 --- a/rigs/icom/id51.c +++ b/rigs/icom/id51.c @@ -117,6 +117,7 @@ const struct rig_caps id51_caps = .has_get_parm = ID51_PARM_ALL, .has_set_parm = ID51_PARM_ALL, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .ext_tokens = id51_tokens, diff --git a/rigs/icom/id5100.c b/rigs/icom/id5100.c index 822afe46..ba17b4ca 100644 --- a/rigs/icom/id5100.c +++ b/rigs/icom/id5100.c @@ -113,6 +113,7 @@ const struct rig_caps id5100_caps = .has_get_parm = ID5100_PARM_ALL, .has_set_parm = ID5100_PARM_ALL, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .extparms = icom_ext_parms, diff --git a/rigs/icom/os456.c b/rigs/icom/os456.c index a39c15cf..c7152817 100644 --- a/rigs/icom/os456.c +++ b/rigs/icom/os456.c @@ -102,6 +102,7 @@ const struct rig_caps os456_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/os535.c b/rigs/icom/os535.c index bd355472..26df5afe 100644 --- a/rigs/icom/os535.c +++ b/rigs/icom/os535.c @@ -94,6 +94,7 @@ const struct rig_caps os535_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/x108g.c b/rigs/icom/x108g.c index cd2e6ade..f8f64208 100644 --- a/rigs/icom/x108g.c +++ b/rigs/icom/x108g.c @@ -162,6 +162,7 @@ const struct rig_caps x108g_caps = .has_get_parm = X108G_PARMS, .has_set_parm = RIG_PARM_SET(X108G_PARMS), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/jrc/nrd535.c b/rigs/jrc/nrd535.c index c4667ee1..e7527569 100644 --- a/rigs/jrc/nrd535.c +++ b/rigs/jrc/nrd535.c @@ -123,6 +123,7 @@ const struct rig_caps nrd535_caps = .has_get_parm = RIG_PARM_TIME, .has_set_parm = RIG_PARM_SET(NRD535_PARM), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 20 } }, [LVL_IF] = { .min = { .i = -2000 }, .max = { .i = 2000 } }, diff --git a/rigs/jrc/nrd545.c b/rigs/jrc/nrd545.c index 90687ddb..ed4ba980 100644 --- a/rigs/jrc/nrd545.c +++ b/rigs/jrc/nrd545.c @@ -121,6 +121,7 @@ const struct rig_caps nrd545_caps = .has_get_parm = RIG_PARM_TIME, .has_set_parm = RIG_PARM_SET(NRD545_PARM), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 20 } }, [LVL_IF] = { .min = { .i = -2550 }, .max = { .i = 2550 }, .step = { .i = 10} }, diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 3ae0afc8..0b00a1fa 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -205,6 +205,7 @@ const struct rig_caps k3_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_KEYSPD] = { .min = { .i = 8 }, .max = { .i = 50 }, .step = { .i = 1 } }, }, .parm_gran = {}, diff --git a/rigs/kenwood/thd7.c b/rigs/kenwood/thd7.c index 205afe27..ccfdf9ff 100644 --- a/rigs/kenwood/thd7.c +++ b/rigs/kenwood/thd7.c @@ -111,6 +111,7 @@ const struct rig_caps thd7a_caps = .has_get_parm = THD7_PARMS, .has_set_parm = THD7_PARMS, /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 5 } }, [LVL_SQL] = { .min = { .i = 0 }, .max = { .i = 5 } }, [LVL_RFPOWER] = { .min = { .i = 3 }, .max = { .i = 0 } }, diff --git a/rigs/kenwood/thf6a.c b/rigs/kenwood/thf6a.c index 2e309b2d..9fc73e53 100644 --- a/rigs/kenwood/thf6a.c +++ b/rigs/kenwood/thf6a.c @@ -147,6 +147,7 @@ const struct rig_caps thf6a_caps = .has_get_parm = THF6_PARMS, .has_set_parm = THF6_PARMS, .level_gran = { + // cppcheck-suppress * [LVL_SQL] = { .min = { .i = 0 }, .max = { .i = 5 } }, [LVL_RFPOWER] = { .min = { .i = 2 }, .max = { .i = 0 } }, }, diff --git a/rigs/kenwood/thf7.c b/rigs/kenwood/thf7.c index 821b7753..68a8d5f5 100644 --- a/rigs/kenwood/thf7.c +++ b/rigs/kenwood/thf7.c @@ -141,6 +141,7 @@ const struct rig_caps thf7e_caps = .has_get_parm = THF7_PARMS, .has_set_parm = THF7_PARMS, .level_gran = { + // cppcheck-suppress * [LVL_SQL] = { .min = { .i = 0 }, .max = { .i = 5 } }, [LVL_RFPOWER] = { .min = { .i = 2 }, .max = { .i = 0 } }, }, diff --git a/rigs/kenwood/thg71.c b/rigs/kenwood/thg71.c index b2a1c46a..39e62446 100644 --- a/rigs/kenwood/thg71.c +++ b/rigs/kenwood/thg71.c @@ -112,6 +112,7 @@ const struct rig_caps thg71_caps = .has_get_level = THG71_LEVEL_ALL, .has_set_level = RIG_LEVEL_SET(THG71_LEVEL_ALL), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 5 } }, [LVL_SQL] = { .min = { .i = 0 }, .max = { .i = 5 } }, [LVL_RFPOWER] = { .min = { .i = 3 }, .max = { .i = 0 } }, diff --git a/rigs/kenwood/tmd700.c b/rigs/kenwood/tmd700.c index d01ebaf7..13805a6d 100644 --- a/rigs/kenwood/tmd700.c +++ b/rigs/kenwood/tmd700.c @@ -125,6 +125,7 @@ const struct rig_caps tmd700_caps = .has_get_parm = TMD700_PARMS, .has_set_parm = TMD700_PARMS, /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 7 } }, [LVL_SQL] = { .min = { .i = 0 }, .max = { .i = 0x1f }, .step = { .f = 1. / 0x1f } }, [LVL_RFPOWER] = { .min = { .i = 2 }, .max = { .i = 0 }, .step = { .f = 1. / 3. } }, diff --git a/rigs/pcr/pcr100.c b/rigs/pcr/pcr100.c index 5d8e9dd3..74d0409d 100644 --- a/rigs/pcr/pcr100.c +++ b/rigs/pcr/pcr100.c @@ -91,6 +91,7 @@ const struct rig_caps pcr100_caps = .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, /* XXX check this */ [LVL_IF] = { .min = { .i = -1270 }, .max = { .i = 1270 }, .step = { .i = 10 } }, diff --git a/rigs/pcr/pcr1000.c b/rigs/pcr/pcr1000.c index 12efd74a..aa0d7042 100644 --- a/rigs/pcr/pcr1000.c +++ b/rigs/pcr/pcr1000.c @@ -84,6 +84,7 @@ const struct rig_caps pcr1000_caps = .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, /* XXX check this */ [LVL_IF] = { .min = { .i = -1270 }, .max = { .i = 1270 }, .step = { .i = 10 } }, diff --git a/rigs/pcr/pcr1500.c b/rigs/pcr/pcr1500.c index 5d7edc59..c6bac2b0 100644 --- a/rigs/pcr/pcr1500.c +++ b/rigs/pcr/pcr1500.c @@ -87,6 +87,7 @@ const struct rig_caps pcr1500_caps = .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 }, .step = { .i = 1 } }, [LVL_NR] = { .min = { .f = 0 }, .max = { .f = 16.0 }, .step = { .f = 1.0 } }, /* XXX check this */ diff --git a/rigs/pcr/pcr2500.c b/rigs/pcr/pcr2500.c index d796e6c5..7fd5f857 100644 --- a/rigs/pcr/pcr2500.c +++ b/rigs/pcr/pcr2500.c @@ -96,6 +96,7 @@ const struct rig_caps pcr2500_caps = .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, /* XXX check this */ [LVL_IF] = { .min = { .i = -1270 }, .max = { .i = 1270 }, .step = { .i = 10 } }, diff --git a/rigs/prm80/prm80.c b/rigs/prm80/prm80.c index 01424046..1eefa60b 100644 --- a/rigs/prm80/prm80.c +++ b/rigs/prm80/prm80.c @@ -321,6 +321,7 @@ int prm80_get_channel(RIG *rig, channel_t *chan, int read_only) (chanstate & 0x04) ? RIG_RPT_SHIFT_PLUS : RIG_RPT_SHIFT_NONE; chan->flags = (chanstate & 0x08) ? RIG_CHFLAG_SKIP : 0; + // cppcheck-suppress * chan->levels[LVL_SQL].f = ((float)(hhtoi(statebuf + 6) >> 4)) / 15.; chan->levels[LVL_AF].f = ((float)(hhtoi(statebuf + 8) >> 4)) / 15.; /* same as chanstate bit 1 */ diff --git a/rigs/racal/ra3702.c b/rigs/racal/ra3702.c index 28378979..587e2b66 100644 --- a/rigs/racal/ra3702.c +++ b/rigs/racal/ra3702.c @@ -80,6 +80,7 @@ const struct rig_caps ra3702_caps = .has_get_parm = RA3702_PARM_ALL, .has_set_parm = RIG_PARM_SET(RA3702_PARM_ALL), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .vfo_ops = RA3702_VFO_OPS, diff --git a/rigs/tentec/pegasus.c b/rigs/tentec/pegasus.c index fdedead5..6a98a2cb 100644 --- a/rigs/tentec/pegasus.c +++ b/rigs/tentec/pegasus.c @@ -95,6 +95,7 @@ const struct rig_caps tt550_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = {.min = {.i = 0}, .max = {.i = 65535}}, }, .parm_gran = {}, diff --git a/rigs/tentec/rx320.c b/rigs/tentec/rx320.c index 0f4c68d4..f5ea64c3 100644 --- a/rigs/tentec/rx320.c +++ b/rigs/tentec/rx320.c @@ -104,6 +104,7 @@ const struct rig_caps rx320_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 10000 } }, [LVL_AF] = { .min = { .f = 0 }, .max = { .f = 1 }, .step = { .f = 1.0 / 64 } }, [LVL_IF] = { .min = { .i = -2000 }, .max = { .i = 2000 }, .step = { .i = 10} }, diff --git a/rigs/tuner/v4l.c b/rigs/tuner/v4l.c index 9691718a..74ee90b8 100644 --- a/rigs/tuner/v4l.c +++ b/rigs/tuner/v4l.c @@ -94,6 +94,7 @@ const struct rig_caps v4l_caps = .has_set_parm = RIG_PARM_SET(V4L_PARM_ALL), .vfo_ops = RIG_OP_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 65535 } }, }, .preamp = { RIG_DBLST_END }, diff --git a/rigs/tuner/v4l2.c b/rigs/tuner/v4l2.c index 1fb9f99e..4e1dea2a 100644 --- a/rigs/tuner/v4l2.c +++ b/rigs/tuner/v4l2.c @@ -94,6 +94,7 @@ const struct rig_caps v4l2_caps = .has_set_parm = RIG_PARM_SET(V4L2_PARM_ALL), .vfo_ops = RIG_OP_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 65535 } }, }, .preamp = { RIG_DBLST_END }, diff --git a/rigs/uniden/uniden.c b/rigs/uniden/uniden.c index 377e328c..31a1885d 100644 --- a/rigs/uniden/uniden.c +++ b/rigs/uniden/uniden.c @@ -637,6 +637,7 @@ int uniden_get_channel(RIG *rig, channel_t *chan, int read_only) /* TODO: Trunk, Delay, Recording */ chan->flags = (membuf[22] == 'N') ? RIG_CHFLAG_SKIP : 0; + // cppcheck-suppress * chan->levels[LVL_ATT].i = (membuf[25] == 'N') ? rig->state.attenuator[0] : 0; sscanf(membuf + 41, "%d", &tone); diff --git a/rigs/wj/wj8888.c b/rigs/wj/wj8888.c index 38423cd8..ea1ce7b1 100644 --- a/rigs/wj/wj8888.c +++ b/rigs/wj/wj8888.c @@ -87,6 +87,7 @@ const struct rig_caps wj8888_caps = .preamp = { RIG_DBLST_END }, .attenuator = { RIG_DBLST_END }, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 0x7f } }, }, .max_rit = Hz(0), diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index 6a37a7aa..2b41b2ca 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -769,8 +769,8 @@ int ft1000mp_set_freq(RIG *rig, vfo_t vfo, freq_t freq) to_bcd(p->p_cmd, freq / 10, 8); /* store bcd format in in p_cmd */ /* TODO -- fix 10Hz resolution -- FS */ - rig_debug(RIG_DEBUG_TRACE, - "%s: requested freq after conversion = %"PRIll" Hz\n", __func__, + // cppcheck-suppress * + rig_debug(RIG_DEBUG_TRACE, "%s: freq = %"PRIll" Hz\n", __func__, (int64_t)from_bcd(p->p_cmd, 8) * 10); cmd = p->p_cmd; /* get native sequence */ diff --git a/rigs/yaesu/ft1200.c b/rigs/yaesu/ft1200.c index 68faac7e..604d55b9 100644 --- a/rigs/yaesu/ft1200.c +++ b/rigs/yaesu/ft1200.c @@ -76,6 +76,7 @@ const struct rig_caps ft1200_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 10 } }, }, diff --git a/rigs/yaesu/ft2000.c b/rigs/yaesu/ft2000.c index e52c7819..68ca3398 100644 --- a/rigs/yaesu/ft2000.c +++ b/rigs/yaesu/ft2000.c @@ -75,6 +75,7 @@ const struct rig_caps ft2000_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } }, }, diff --git a/rigs/yaesu/ft450.c b/rigs/yaesu/ft450.c index b0c71148..057c86e9 100644 --- a/rigs/yaesu/ft450.c +++ b/rigs/yaesu/ft450.c @@ -74,6 +74,7 @@ const struct rig_caps ft450_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_CWPITCH] = { .min = { .i = 400 }, .max = { .i = 800 }, .step = { .i = 100 } }, }, diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c index 8ccef479..7602e647 100644 --- a/rigs/yaesu/ft5000.c +++ b/rigs/yaesu/ft5000.c @@ -75,6 +75,7 @@ const struct rig_caps ftdx5000_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } }, }, diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index 8b3fc5b8..0f958b32 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -79,6 +79,7 @@ const struct rig_caps ft891_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } }, }, diff --git a/rigs/yaesu/ft9000.c b/rigs/yaesu/ft9000.c index a5dd7165..b0d626ae 100644 --- a/rigs/yaesu/ft9000.c +++ b/rigs/yaesu/ft9000.c @@ -75,6 +75,7 @@ const struct rig_caps ft9000_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } }, }, diff --git a/rigs/yaesu/ft950.c b/rigs/yaesu/ft950.c index 2bdd9d05..6703daa9 100644 --- a/rigs/yaesu/ft950.c +++ b/rigs/yaesu/ft950.c @@ -74,6 +74,7 @@ const struct rig_caps ft950_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } }, }, diff --git a/rigs/yaesu/ft991.c b/rigs/yaesu/ft991.c index 82acde25..06e53aef 100644 --- a/rigs/yaesu/ft991.c +++ b/rigs/yaesu/ft991.c @@ -80,6 +80,7 @@ const struct rig_caps ft991_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } }, }, diff --git a/rigs/yaesu/vx1700.c b/rigs/yaesu/vx1700.c index cb59ea9d..4f9e8911 100644 --- a/rigs/yaesu/vx1700.c +++ b/rigs/yaesu/vx1700.c @@ -129,6 +129,7 @@ const struct rig_caps vx1700_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RFPOWER] = { .min = { .i = 0 }, .max = { .i = 2 } }, }, .parm_gran = {}, diff --git a/tests/rigctl_parse.h b/tests/rigctl_parse.h index 873f9ada..a741742f 100644 --- a/tests/rigctl_parse.h +++ b/tests/rigctl_parse.h @@ -25,7 +25,6 @@ #ifndef RIGCTL_PARSE_H #define RIGCTL_PARSE_H -// cppcheck-suppress * #include <stdio.h> #include <hamlib/rig.h> commit 7e4b0882fbb28cd11baa9eb1c0ca3d08b422c1ea Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 19 14:38:00 2020 -0500 Clean up cppcheck warning (cherry picked from commit 8d60a82f5405fc7e5f5d783058b2bbc773078244) diff --git a/rigs/tentec/tentec2.c b/rigs/tentec/tentec2.c index ac59d7a3..88417981 100644 --- a/rigs/tentec/tentec2.c +++ b/rigs/tentec/tentec2.c @@ -699,6 +699,7 @@ const char *tentec2_get_info(RIG *rig) /* * protocol version */ + buf[0] = 0; firmware_len = 100; retval = tentec_transaction(rig, "?V\r", 3, buf, &firmware_len); @@ -710,14 +711,5 @@ const char *tentec2_get_info(RIG *rig) return NULL; } - if (firmware_len < 100) - { - buf[firmware_len] = 0; - } - else - { - buf[0] = 0; - } - return buf; } commit 15939de0018eb601e88c85a0cf662a141aae84b3 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 19 14:33:27 2020 -0500 Clean up cppcheck scope (cherry picked from commit 2362d2fe1cd332dee85158e00102568987fc44cb) diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index b031f860..63a42451 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -806,6 +806,14 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_MICGAIN: n = sscanf(lvlbuf + len, "%f", &val->f); + + if (n != 1) + { + rig_debug(RIG_DEBUG_ERR, "%s: Error parsing value from lvlbuf='%s'\n", + __func__, lvlbuf); + return -RIG_EPROTO; + } + // Thetis returns -40 to 10 -- does PowerSDR do the same? // Setting val->f = (val->f - -40) / (10 - -40); @@ -814,12 +822,28 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_VOXGAIN: // return is 0-1000 n = sscanf(lvlbuf + len, "%f", &val->f); + + if (n != 1) + { + rig_debug(RIG_DEBUG_ERR, "%s: Error parsing value from lvlbuf='%s'\n", + __func__, lvlbuf); + return -RIG_EPROTO; + } + val->f /= 1000; break; case RIG_LEVEL_SQL: n = sscanf(lvlbuf + len, "%f", &val->f); + if (n != 1) + { + rig_debug(RIG_DEBUG_ERR, "%s: Error parsing value from lvlbuf='%s'\n", + __func__, lvlbuf); + return -RIG_EPROTO; + } + + powersdr_get_mode(rig, vfo, &mode, &width); if (mode == RIG_MODE_FM) commit 31fb3e96d4c8473b2de26af35d42bf3fb70430bf Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 19 14:31:54 2020 -0500 Clean up cppcheck scope (cherry picked from commit 88291fed86ecb2e251c8d1b16ce042910f522966) diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 3602969f..a7dc437d 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -896,12 +896,12 @@ const struct rig_caps ic705_caps = int ic7300_set_parm(RIG *rig, setting_t parm, value_t val) { - unsigned char prmbuf[MAXFRAMELEN]; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); switch (parm) { + unsigned char prmbuf[MAXFRAMELEN]; + case RIG_PARM_ANN: { int ann_mode = -1; commit a1fbfafbdd5d39304d65b89be56a6a18306e1ff8 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 19 12:55:47 2020 -0500 Remove redundant check in ar3030.c (cherry picked from commit 865fa7d540ccb2765f852cad7b9878615a61464a) diff --git a/rigs/aor/ar3030.c b/rigs/aor/ar3030.c index edacb729..b1445954 100644 --- a/rigs/aor/ar3030.c +++ b/rigs/aor/ar3030.c @@ -266,7 +266,7 @@ static int ar3030_transaction(RIG *rig, const char *cmd, int cmd_len, *data_len = 0; /* only set data_len non-zero if not a command response */ - if (retval > 0 && data[0] != 0x00 && data[0] != 0x0d) + if (data[0] != 0x00 && data[0] != 0x0d) { *data_len = retval; } commit 0f0f71eb4fb777f8d29d340da6193b7925c7fc8b Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Sep 18 16:45:37 2020 -0500 Add FUNC RIT XIT and LEVEL AGC to PowerSDR (cherry picked from commit 42b2b1ed69c279dcffa40b293f59200e9d0ad910) diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index 5e4021ab..b031f860 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -49,9 +49,9 @@ #define F6K_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3) /* PowerSDR differences */ -#define POWERSDR_FUNC_ALL (RIG_FUNC_VOX|RIG_FUNC_SQL|RIG_FUNC_NB|RIG_FUNC_ANF|RIG_FUNC_MUTE) +#define POWERSDR_FUNC_ALL (RIG_FUNC_VOX|RIG_FUNC_SQL|RIG_FUNC_NB|RIG_FUNC_ANF|RIG_FUNC_MUTE|RIG_FUNC_RIT|RIG_FUNC_XIT) -#define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_MICGAIN|RIG_LEVEL_VOXGAIN|RIG_LEVEL_SQL|RIG_LEVEL_AF) +#define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_MICGAIN|RIG_LEVEL_VOXGAIN|RIG_LEVEL_SQL|RIG_LEVEL_AF|RIG_LEVEL_AGC) static rmode_t flex_mode_table[KENWOOD_MODE_TABLE_MAX] = @@ -660,6 +660,15 @@ int powersdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) snprintf(cmd, sizeof(cmd) - 1, "ZZMG%03d", ival); break; + case RIG_LEVEL_AGC: + if (val.i > 5) + { + val.i = 5; /* 0.. 255 */ + } + + snprintf(cmd, sizeof(cmd), "GT%03d", (int)val.i); + break; + case RIG_LEVEL_VOXGAIN: ival = val.f * 1000; snprintf(cmd, sizeof(cmd) - 1, "ZZVG%04d", ival); @@ -718,6 +727,12 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) switch (level) { + case RIG_LEVEL_AGC: + cmd = "GT"; + len = 2; + ans = 3; + break; + case RIG_LEVEL_AF: cmd = "ZZAG"; len = 4; @@ -763,6 +778,18 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) switch (level) { + case RIG_LEVEL_AGC: + n = sscanf(lvlbuf + len, "%d", &val->i); + + if (n != 1) + { + rig_debug(RIG_DEBUG_ERR, "%s: Error parsing value from lvlbuf='%s'\n", + __func__, lvlbuf); + return -RIG_EPROTO; + } + + break; + case RIG_LEVEL_AF: case RIG_LEVEL_RFPOWER_METER: n = sscanf(lvlbuf + len, "%f", &val->f); commit f7c24262e97b6b49cf460c4ae623500075a526b7 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Sep 18 16:17:26 2020 -0500 Add func NB ANF MUTE to PowerSDR (cherry picked from commit f401d6dd942c5a69f21e16201a7165921f92fc18) diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index f027e698..5e4021ab 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -49,7 +49,7 @@ #define F6K_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3) /* PowerSDR differences */ -#define POWERSDR_FUNC_ALL (RIG_FUNC_VOX|RIG_FUNC_SQL) +#define POWERSDR_FUNC_ALL (RIG_FUNC_VOX|RIG_FUNC_SQL|RIG_FUNC_NB|RIG_FUNC_ANF|RIG_FUNC_MUTE) #define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_MICGAIN|RIG_LEVEL_VOXGAIN|RIG_LEVEL_SQL|RIG_LEVEL_AF) @@ -654,6 +654,7 @@ int powersdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) ival = val.f * 100; snprintf(cmd, sizeof(cmd) - 1, "ZZAG%03d", ival); break; + case RIG_LEVEL_MICGAIN: ival = val.f * (10 - -40) - 40; snprintf(cmd, sizeof(cmd) - 1, "ZZMG%03d", ival); @@ -722,6 +723,7 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) len = 4; ans = 3; break; + case RIG_LEVEL_RFPOWER_METER: cmd = "ZZRM5"; len = 5; @@ -819,6 +821,10 @@ int powersdr_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) switch (func) { + case RIG_FUNC_MUTE: + snprintf(cmd, sizeof(cmd) - 1, "ZZMA%01d", status); + break; + case RIG_FUNC_VOX: snprintf(cmd, sizeof(cmd) - 1, "ZZVE%01d", status); break; @@ -850,6 +856,12 @@ int powersdr_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) switch (func) { + case RIG_FUNC_MUTE: + cmd = "ZZMA"; + len = 4; + ans = 1; + break; + case RIG_FUNC_VOX: cmd = "ZZVE"; len = 4; @@ -875,10 +887,8 @@ int powersdr_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) switch (func) { + case RIG_FUNC_MUTE: case RIG_FUNC_VOX: - sscanf(lvlbuf + len, "%d", status); - break; - case RIG_FUNC_SQL: sscanf(lvlbuf + len, "%d", status); break; commit a690a40ababf413522366c01019eccab07bda1ac Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Sep 18 15:50:08 2020 -0500 Add LEVEL_AF to PowerSDR (cherry picked from commit 10700186e3f4955a9f77dd50f675ff9ccbd11c38) diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index 8364e0f4..f027e698 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -51,7 +51,7 @@ /* PowerSDR differences */ #define POWERSDR_FUNC_ALL (RIG_FUNC_VOX|RIG_FUNC_SQL) -#define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_MICGAIN|RIG_LEVEL_VOXGAIN|RIG_LEVEL_SQL) +#define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_MICGAIN|RIG_LEVEL_VOXGAIN|RIG_LEVEL_SQL|RIG_LEVEL_AF) static rmode_t flex_mode_table[KENWOOD_MODE_TABLE_MAX] = @@ -650,6 +650,10 @@ int powersdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) switch (level) { + case RIG_LEVEL_AF: + ival = val.f * 100; + snprintf(cmd, sizeof(cmd) - 1, "ZZAG%03d", ival); + break; case RIG_LEVEL_MICGAIN: ival = val.f * (10 - -40) - 40; snprintf(cmd, sizeof(cmd) - 1, "ZZMG%03d", ival); @@ -713,6 +717,11 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) switch (level) { + case RIG_LEVEL_AF: + cmd = "ZZAG"; + len = 4; + ans = 3; + break; case RIG_LEVEL_RFPOWER_METER: cmd = "ZZRM5"; len = 5; @@ -752,12 +761,13 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) switch (level) { + case RIG_LEVEL_AF: case RIG_LEVEL_RFPOWER_METER: n = sscanf(lvlbuf + len, "%f", &val->f); if (n != 1) { - rig_debug(RIG_DEBUG_ERR, "%s: Error parsing RFPOWER from lvlbuf='%s'\n", + rig_debug(RIG_DEBUG_ERR, "%s: Error parsing value from lvlbuf='%s'\n", __func__, lvlbuf); return -RIG_EPROTO; } commit 06f89c7bb7e754eb0996e66ee101bc871eb559ab Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Sep 18 13:07:19 2020 -0500 Add Thetis/ANAN to PowerSDR description (cherry picked from commit 3811071f9e80a570a7cbd2ff4d1d5ba6d4708312) diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index 2b132cf6..8364e0f4 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -1010,9 +1010,9 @@ const struct rig_caps f6k_caps = const struct rig_caps powersdr_caps = { RIG_MODEL(RIG_MODEL_POWERSDR), - .model_name = "PowerSDR", - .mfg_name = "FlexRadio", - .version = "20200716.0", + .model_name = "PowerSDR/Thetis", + .mfg_name = "FlexRadio/ANAN", + .version = "20200918.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 5a8e11ae9d45895a1356ee1029b6f9bb585e2479 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Sep 18 13:04:31 2020 -0500 Add SQL to PowerSDR (cherry picked from commit 2a378919dbd8fb39eafaf7089785a96853ea979c) diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index a9b5f6ee..2b132cf6 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -28,6 +28,7 @@ #endif #include <stdlib.h> +#include <math.h> #include <hamlib/rig.h> #include "kenwood.h" @@ -48,9 +49,9 @@ #define F6K_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3) /* PowerSDR differences */ -#define POWERSDR_FUNC_ALL (RIG_FUNC_VOX) +#define POWERSDR_FUNC_ALL (RIG_FUNC_VOX|RIG_FUNC_SQL) -#define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_MICGAIN|RIG_LEVEL_VOXGAIN) +#define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_MICGAIN|RIG_LEVEL_VOXGAIN|RIG_LEVEL_SQL) static rmode_t flex_mode_table[KENWOOD_MODE_TABLE_MAX] = @@ -642,6 +643,8 @@ int powersdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) char cmd[KENWOOD_MAX_BUF_LEN]; int retval; int ival; + rmode_t mode; + pbwidth_t width; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -650,31 +653,40 @@ int powersdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_MICGAIN: ival = val.f * (10 - -40) - 40; snprintf(cmd, sizeof(cmd) - 1, "ZZMG%03d", ival); - retval = kenwood_transaction(rig, cmd, NULL, 0); - - if (retval != RIG_OK) - { - return retval; - ... [truncated message content] |
From: Michael B. <mdb...@us...> - 2020-09-27 04:11:02
|
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 37cff7ffc1e270e8214f5565082d7e830c7879bc (commit) from 359f7549dca6396732a4afa56a2b81c92c5b3e5a (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 37cff7ffc1e270e8214f5565082d7e830c7879bc Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 26 23:10:29 2020 -0500 Update newcat version https://github.com/Hamlib/Hamlib/issues/385 diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 0173388f..05dd5519 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20200804" +#define NEWCAT_VER "20200926" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-09-27 03:35: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 359f7549dca6396732a4afa56a2b81c92c5b3e5a (commit) from 60201aab40a9e3d59e8347fbef8a5679248b7c6f (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 359f7549dca6396732a4afa56a2b81c92c5b3e5a Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 26 22:34:02 2020 -0500 Add comment to is_read_cmd newcat.c and remove redundant check https://github.com/Hamlib/Hamlib/issues/385 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index ce813933..e275c99a 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -6484,6 +6484,7 @@ int newcat_get_cmd(RIG *rig) // we drop through and do the real IF command } + // any command that is read only should not expire cache is_read_cmd = strcmp(priv->cmd_str,"AG0;")==0 || strcmp(priv->cmd_str,"AG1;")==0 @@ -6533,8 +6534,7 @@ int newcat_get_cmd(RIG *rig) || strcmp(priv->cmd_str,"SQ0;")==0 || strcmp(priv->cmd_str,"SQ1;")==0 || strcmp(priv->cmd_str,"VT0;")==0 - || strcmp(priv->cmd_str,"VT1;")==0 - || strcmp(priv->cmd_str,"SQ1;")==0; + || strcmp(priv->cmd_str,"VT1;")==0; if (priv->cmd_str[2] != ';' && !is_read_cmd) // then we must be setting something so we'll invalidate the cache ----------------------------------------------------------------------- Summary of changes: rigs/yaesu/newcat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-09-26 22:48: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 60201aab40a9e3d59e8347fbef8a5679248b7c6f (commit) via 7bee01f785d65dafae25d1dc1dd26e62d3bf89e7 (commit) via 8d60a82f5405fc7e5f5d783058b2bbc773078244 (commit) via 2362d2fe1cd332dee85158e00102568987fc44cb (commit) via 88291fed86ecb2e251c8d1b16ce042910f522966 (commit) via 865fa7d540ccb2765f852cad7b9878615a61464a (commit) via 42b2b1ed69c279dcffa40b293f59200e9d0ad910 (commit) via f401d6dd942c5a69f21e16201a7165921f92fc18 (commit) via 10700186e3f4955a9f77dd50f675ff9ccbd11c38 (commit) from 3811071f9e80a570a7cbd2ff4d1d5ba6d4708312 (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 60201aab40a9e3d59e8347fbef8a5679248b7c6f Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 26 17:45:45 2020 -0500 Allow yaesu 3+char read cmds to not invalidate the IF cache https://github.com/Hamlib/Hamlib/issues/385 diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 21b98e8a..ce813933 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -889,7 +889,7 @@ int newcat_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) } /* - * rig_set_vfo + * newcat_set_vfo * * set vfo and store requested vfo for later RIG_VFO_CURR * requests. @@ -3779,7 +3779,12 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%c", cat_term); - priv->cmd_str[2] = main_sub_vfo; + + if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) + { + priv->cmd_str[2] = main_sub_vfo; + } + break; case RIG_FUNC_TSQL: @@ -3789,7 +3794,12 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "CT0%c", cat_term); - priv->cmd_str[2] = main_sub_vfo; + + if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) + { + priv->cmd_str[2] = main_sub_vfo; + } + break; case RIG_FUNC_LOCK: @@ -3817,7 +3827,12 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "NB0%c", cat_term); - priv->cmd_str[2] = main_sub_vfo; + + if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) + { + priv->cmd_str[2] = main_sub_vfo; + } + break; case RIG_FUNC_NR: @@ -3827,7 +3842,12 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) } snprintf(priv->cmd_str, sizeof(priv->cmd_str), "NR0%c", cat_term); - priv->cmd_str[2] = main_sub_vfo; + + if (rig->caps->targetable_vfo & RIG_TARGETABLE_MODE) + { + priv->cmd_str[2] = main_sub_vfo; + } + break; case RIG_FUNC_COMP: @@ -6442,6 +6462,7 @@ int newcat_get_cmd(RIG *rig) struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; int retry_count = 0; int rc = -RIG_EPROTO; + int is_read_cmd = 0; // try to cache rapid repeats of the IF command // this is for WSJT-X/JTDX sequence of v/f/m/t @@ -6463,8 +6484,60 @@ int newcat_get_cmd(RIG *rig) // we drop through and do the real IF command } + is_read_cmd = + strcmp(priv->cmd_str,"AG0;")==0 + || strcmp(priv->cmd_str,"AG1;")==0 + || strcmp(priv->cmd_str,"AN0;")==0 + || strcmp(priv->cmd_str,"AN1;")==0 + || strcmp(priv->cmd_str,"BP00;")==0 + || strcmp(priv->cmd_str,"BP01;")==0 + || strcmp(priv->cmd_str,"BP10;")==0 + || strcmp(priv->cmd_str,"BP11;")==0 + || strcmp(priv->cmd_str,"CN00;")==0 + || strcmp(priv->cmd_str,"CN10;")==0 + || strcmp(priv->cmd_str,"CO00;")==0 + || strcmp(priv->cmd_str,"CO01;")==0 + || strcmp(priv->cmd_str,"CO02;")==0 + || strcmp(priv->cmd_str,"CO03;")==0 + || strcmp(priv->cmd_str,"CO10;")==0 + || strcmp(priv->cmd_str,"CO11;")==0 + || strcmp(priv->cmd_str,"CO12;")==0 + || strcmp(priv->cmd_str,"CO13;")==0 + || strcmp(priv->cmd_str,"IS1;")==0 + || strcmp(priv->cmd_str,"IS0;")==0 + || strcmp(priv->cmd_str,"IS1;")==0 + || strcmp(priv->cmd_str,"MD0;")==0 + || strcmp(priv->cmd_str,"MD1;")==0 + || strcmp(priv->cmd_str,"NA0;")==0 + || strcmp(priv->cmd_str,"NA1;")==0 + || strcmp(priv->cmd_str,"NB0;")==0 + || strcmp(priv->cmd_str,"NB1;")==0 + || strcmp(priv->cmd_str,"NL0;")==0 + || strcmp(priv->cmd_str,"NL1;")==0 + || strcmp(priv->cmd_str,"NR0;")==0 + || strcmp(priv->cmd_str,"NR1;")==0 + || strcmp(priv->cmd_str,"OS0;")==0 + || strcmp(priv->cmd_str,"OS1;")==0 + || strcmp(priv->cmd_str,"PA0;")==0 + || strcmp(priv->cmd_str,"PA1;")==0 + || strcmp(priv->cmd_str,"RA0;")==0 + || strcmp(priv->cmd_str,"RA1;")==0 + || strcmp(priv->cmd_str,"RF0;")==0 + || strcmp(priv->cmd_str,"RF1;")==0 + || strcmp(priv->cmd_str,"RL0;")==0 + || strcmp(priv->cmd_str,"RL1;")==0 + || strcmp(priv->cmd_str,"RM0;")==0 + || strcmp(priv->cmd_str,"RM1;")==0 + || strcmp(priv->cmd_str,"SM0;")==0 + || strcmp(priv->cmd_str,"SM1;")==0 + || strcmp(priv->cmd_str,"SQ0;")==0 + || strcmp(priv->cmd_str,"SQ1;")==0 + || strcmp(priv->cmd_str,"VT0;")==0 + || strcmp(priv->cmd_str,"VT1;")==0 + || strcmp(priv->cmd_str,"SQ1;")==0; + if (priv->cmd_str[2] != - ';') // then we must be setting something so we'll invalidate the cache + ';' && !is_read_cmd) // then we must be setting something so we'll invalidate the cache { rig_debug(RIG_DEBUG_TRACE, "%s: cache invalidated\n", __func__); priv->cache_start.tv_sec = 0; commit 7bee01f785d65dafae25d1dc1dd26e62d3bf89e7 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 19 16:09:44 2020 -0500 Add suppress for AST broken bug in cppcheck diff --git a/cppcheck.sh b/cppcheck.sh index d5dfb598..bba1f980 100755 --- a/cppcheck.sh +++ b/cppcheck.sh @@ -55,6 +55,7 @@ CHECK="\ -D DECLARE_INITRIG_BACKEND \ -D DECLARE_INITRROT_BACKEND \ -D DECLARE_INITAMP_BACKEND \ +-D B230400 -U RIG_LEVEL_LINEOUT \ -U O_ASYNC \ -U F_SETSIG \ diff --git a/rigs/aor/ar3030.c b/rigs/aor/ar3030.c index b1445954..f7fe52fb 100644 --- a/rigs/aor/ar3030.c +++ b/rigs/aor/ar3030.c @@ -799,6 +799,7 @@ int ar3030_get_channel(RIG *rig, channel_t *chan, int read_only) rig_passband_normal(rig, chan->mode); + // cppcheck-suppress * chan->levels[LVL_ATT].i = infobuf[6] == '0' ? 0 : rig->caps->attenuator[infobuf[4] - '1']; diff --git a/rigs/aor/ar7030.c b/rigs/aor/ar7030.c index a10a6a22..2a932479 100644 --- a/rigs/aor/ar7030.c +++ b/rigs/aor/ar7030.c @@ -809,6 +809,7 @@ const struct rig_caps ar7030_caps = .has_get_parm = AR7030_PARM, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/aor/ar7030p.c b/rigs/aor/ar7030p.c index 4e16c58f..bcee8c3f 100644 --- a/rigs/aor/ar7030p.c +++ b/rigs/aor/ar7030p.c @@ -1675,6 +1675,7 @@ static int ar7030p_get_channel(RIG *rig, channel_t *chan, int read_only) if (RIG_OK == rc) { + // cppcheck-suppress * chan->levels[ LVL_SQL ].f = (float) v / 255.0; } diff --git a/rigs/icmarine/icm700pro.c b/rigs/icmarine/icm700pro.c index 9b1e843a..55b5f74f 100644 --- a/rigs/icmarine/icm700pro.c +++ b/rigs/icmarine/icm700pro.c @@ -83,6 +83,7 @@ const struct rig_caps icm700pro_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 8 } }, }, .parm_gran = {}, diff --git a/rigs/icmarine/icm710.c b/rigs/icmarine/icm710.c index 53076a47..76e5f028 100644 --- a/rigs/icmarine/icm710.c +++ b/rigs/icmarine/icm710.c @@ -96,6 +96,7 @@ const struct rig_caps icm710_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 8 } }, }, .parm_gran = {}, diff --git a/rigs/icmarine/icm802.c b/rigs/icmarine/icm802.c index b20a5e22..b39b5f10 100644 --- a/rigs/icmarine/icm802.c +++ b/rigs/icmarine/icm802.c @@ -84,6 +84,7 @@ const struct rig_caps icm802_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 8 } }, }, .parm_gran = {}, diff --git a/rigs/icmarine/icm803.c b/rigs/icmarine/icm803.c index 989836e0..4daea784 100644 --- a/rigs/icmarine/icm803.c +++ b/rigs/icmarine/icm803.c @@ -84,6 +84,7 @@ const struct rig_caps icm803_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 8 } }, }, .parm_gran = {}, diff --git a/rigs/icom/ic2730.c b/rigs/icom/ic2730.c index 82033d5f..dedf6d44 100644 --- a/rigs/icom/ic2730.c +++ b/rigs/icom/ic2730.c @@ -93,6 +93,7 @@ const struct rig_caps ic2730_caps = .has_get_parm = IC2730_PARM_ALL, .has_set_parm = IC2730_PARM_ALL, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/ic7000.c b/rigs/icom/ic7000.c index 874213c7..b2169943 100644 --- a/rigs/icom/ic7000.c +++ b/rigs/icom/ic7000.c @@ -183,6 +183,7 @@ const struct rig_caps ic7000_caps = .has_get_parm = IC7000_PARMS, .has_set_parm = RIG_PARM_SET(IC7000_PARMS), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic703.c b/rigs/icom/ic703.c index 95ff4a26..419bc17b 100644 --- a/rigs/icom/ic703.c +++ b/rigs/icom/ic703.c @@ -113,6 +113,7 @@ const struct rig_caps ic703_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/ic706.c b/rigs/icom/ic706.c index f9a6f25d..95d3a400 100644 --- a/rigs/icom/ic706.c +++ b/rigs/icom/ic706.c @@ -477,6 +477,7 @@ const struct rig_caps ic706mkiig_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/ic7100.c b/rigs/icom/ic7100.c index 42dce0ee..1f303f53 100644 --- a/rigs/icom/ic7100.c +++ b/rigs/icom/ic7100.c @@ -220,6 +220,7 @@ const struct rig_caps ic7100_caps = .has_get_parm = IC7100_PARM_ALL, .has_set_parm = IC7100_PARM_ALL, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic718.c b/rigs/icom/ic718.c index 5583694e..8d4b6692 100644 --- a/rigs/icom/ic718.c +++ b/rigs/icom/ic718.c @@ -105,6 +105,7 @@ const struct rig_caps ic718_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/ic7200.c b/rigs/icom/ic7200.c index c7703c8d..a0f56ad5 100644 --- a/rigs/icom/ic7200.c +++ b/rigs/icom/ic7200.c @@ -143,6 +143,7 @@ const struct rig_caps ic7200_caps = .has_get_parm = IC7200_PARMS, .has_set_parm = RIG_PARM_SET(IC7200_PARMS), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index a7dc437d..4f059a0d 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -305,6 +305,7 @@ const struct rig_caps ic7300_caps = .has_get_parm = IC7300_PARMS, .has_set_parm = RIG_PARM_SET(IC7300_PARMS), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = {.min = {.i = 0}, .max = {.i = 255}}, [LVL_VOXDELAY] = {.min = {.i = 0}, .max = {.i = 20}, .step = {.i = 1}}, [LVL_KEYSPD] = {.min = {.i = 6}, .max = {.i = 48}, .step = {.i = 1}}, diff --git a/rigs/icom/ic7410.c b/rigs/icom/ic7410.c index e922ee08..be194227 100644 --- a/rigs/icom/ic7410.c +++ b/rigs/icom/ic7410.c @@ -142,6 +142,7 @@ const struct rig_caps ic7410_caps = .has_get_parm = IC7410_PARMS, .has_set_parm = RIG_PARM_SET(IC7410_PARMS), /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic746.c b/rigs/icom/ic746.c index 1037e898..04be36ea 100644 --- a/rigs/icom/ic746.c +++ b/rigs/icom/ic746.c @@ -208,6 +208,7 @@ const struct rig_caps ic746_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_ANN, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic751.c b/rigs/icom/ic751.c index 4b682182..707e1d84 100644 --- a/rigs/icom/ic751.c +++ b/rigs/icom/ic751.c @@ -114,6 +114,7 @@ const struct rig_caps ic751_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/ic756.c b/rigs/icom/ic756.c index 95ae2684..26d322d7 100644 --- a/rigs/icom/ic756.c +++ b/rigs/icom/ic756.c @@ -171,6 +171,7 @@ const struct rig_caps ic756_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/ic7600.c b/rigs/icom/ic7600.c index 28ddd476..dec54753 100644 --- a/rigs/icom/ic7600.c +++ b/rigs/icom/ic7600.c @@ -183,6 +183,7 @@ const struct rig_caps ic7600_caps = .has_get_parm = IC7600_PARMS, .has_set_parm = RIG_PARM_SET(IC7600_PARMS), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic7610.c b/rigs/icom/ic7610.c index 8b0dcb1e..66670451 100644 --- a/rigs/icom/ic7610.c +++ b/rigs/icom/ic7610.c @@ -181,6 +181,7 @@ const struct rig_caps ic7610_caps = .has_get_parm = IC7610_PARMS, .has_set_parm = RIG_PARM_SET(IC7610_PARMS), /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic7700.c b/rigs/icom/ic7700.c index f8c9fa9d..03f4d5c6 100644 --- a/rigs/icom/ic7700.c +++ b/rigs/icom/ic7700.c @@ -166,6 +166,7 @@ const struct rig_caps ic7700_caps = .has_get_parm = IC7700_PARMS, .has_set_parm = RIG_PARM_SET(IC7700_PARMS), /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic78.c b/rigs/icom/ic78.c index 1a079176..7a97a137 100644 --- a/rigs/icom/ic78.c +++ b/rigs/icom/ic78.c @@ -97,6 +97,7 @@ const struct rig_caps ic78_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/ic7800.c b/rigs/icom/ic7800.c index be9d82e3..e3ad8de4 100644 --- a/rigs/icom/ic7800.c +++ b/rigs/icom/ic7800.c @@ -169,6 +169,7 @@ const struct rig_caps ic7800_caps = .has_get_parm = IC7800_PARMS, .has_set_parm = RIG_PARM_SET(IC7800_PARMS), /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic785x.c b/rigs/icom/ic785x.c index 70bf71c7..f100d238 100644 --- a/rigs/icom/ic785x.c +++ b/rigs/icom/ic785x.c @@ -175,6 +175,7 @@ const struct rig_caps ic785x_caps = .has_get_parm = IC785x_PARMS, .has_set_parm = RIG_PARM_SET(IC785x_PARMS), /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, [LVL_KEYSPD] = { .min = { .i = 6 }, .max = { .i = 48 }, .step = { .i = 1 } }, diff --git a/rigs/icom/ic910.c b/rigs/icom/ic910.c index b6caf4af..8156bbbe 100644 --- a/rigs/icom/ic910.c +++ b/rigs/icom/ic910.c @@ -488,6 +488,7 @@ const struct rig_caps ic910_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, }, diff --git a/rigs/icom/ic9100.c b/rigs/icom/ic9100.c index 3ab05461..ae74b355 100644 --- a/rigs/icom/ic9100.c +++ b/rigs/icom/ic9100.c @@ -138,6 +138,7 @@ const struct rig_caps ic9100_caps = .has_get_parm = IC9100_PARM_ALL, .has_set_parm = IC9100_PARM_ALL, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_VOXDELAY] = { .min = { .i = 0 }, .max = { .i = 20 }, .step = { .i = 1 } }, }, diff --git a/rigs/icom/ic92d.c b/rigs/icom/ic92d.c index e000c0bd..f8355631 100644 --- a/rigs/icom/ic92d.c +++ b/rigs/icom/ic92d.c @@ -125,6 +125,7 @@ const struct rig_caps ic92d_caps = .has_get_parm = IC92D_PARM_ALL, .has_set_parm = IC92D_PARM_ALL, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/icr10.c b/rigs/icom/icr10.c index 83e228f1..be9cd16f 100644 --- a/rigs/icom/icr10.c +++ b/rigs/icom/icr10.c @@ -84,6 +84,7 @@ const struct rig_caps icr10_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/icr20.c b/rigs/icom/icr20.c index a35d1af3..b79fed5e 100644 --- a/rigs/icom/icr20.c +++ b/rigs/icom/icr20.c @@ -84,6 +84,7 @@ const struct rig_caps icr20_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/icr30.c b/rigs/icom/icr30.c index 6300b986..92f48677 100644 --- a/rigs/icom/icr30.c +++ b/rigs/icom/icr30.c @@ -158,6 +158,7 @@ const struct rig_caps icr30_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/icr6.c b/rigs/icom/icr6.c index 6403436e..60ba0e1d 100644 --- a/rigs/icom/icr6.c +++ b/rigs/icom/icr6.c @@ -85,6 +85,7 @@ const struct rig_caps icr6_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/icr7000.c b/rigs/icom/icr7000.c index dbc5ca8c..517b02b0 100644 --- a/rigs/icom/icr7000.c +++ b/rigs/icom/icr7000.c @@ -204,6 +204,7 @@ const struct rig_caps icr7100_caps = .has_get_parm = ICR7100_PARMS, .has_set_parm = RIG_PARM_SET(ICR7100_PARMS), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/icr75.c b/rigs/icom/icr75.c index a813f557..2f509322 100644 --- a/rigs/icom/icr75.c +++ b/rigs/icom/icr75.c @@ -135,6 +135,7 @@ const struct rig_caps icr75_caps = .has_get_parm = ICR75_PARM_ALL, .has_set_parm = RIG_PARM_SET(ICR75_PARM_ALL), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_PBT_IN] = { .min = { .f = -1280 }, .max = { .f = +1280 }, .step = { .f = 15 } }, [LVL_PBT_OUT] = { .min = { .f = -1280 }, .max = { .f = +1280 }, .step = { .f = 15 } }, diff --git a/rigs/icom/icr8500.c b/rigs/icom/icr8500.c index 115bde8c..ae6d1abe 100644 --- a/rigs/icom/icr8500.c +++ b/rigs/icom/icr8500.c @@ -104,6 +104,7 @@ const struct rig_caps icr8500_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_IF] = { .min = { .i = 0 }, .max = { .i = 255 }, .step = { .i = 1 } }, }, diff --git a/rigs/icom/icr8600.c b/rigs/icom/icr8600.c index a945cc22..be5368d4 100644 --- a/rigs/icom/icr8600.c +++ b/rigs/icom/icr8600.c @@ -137,6 +137,7 @@ const struct rig_caps icr8600_caps = .has_set_level = RIG_LEVEL_SET(ICR8600_LEVEL_ALL), .has_get_parm = ICR8600_PARM_ALL, .has_set_parm = RIG_PARM_SET(ICR8600_PARM_ALL), + // cppcheck-suppress * .level_gran = { [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } } }, .parm_gran = { [PARM_TIME] = { .min = { .i = 0 }, .max = { .i = 86399} } }, .ext_tokens = icr8600_tokens, diff --git a/rigs/icom/icr9000.c b/rigs/icom/icr9000.c index c8d7918b..b2aedba0 100644 --- a/rigs/icom/icr9000.c +++ b/rigs/icom/icr9000.c @@ -100,6 +100,7 @@ const struct rig_caps icr9000_caps = .has_get_parm = ICR9000_PARMS, .has_set_parm = RIG_PARM_SET(ICR9000_PARMS), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/icr9500.c b/rigs/icom/icr9500.c index 2b56d301..74b42336 100644 --- a/rigs/icom/icr9500.c +++ b/rigs/icom/icr9500.c @@ -116,6 +116,7 @@ const struct rig_caps icr9500_caps = .has_get_parm = ICR9500_PARMS, .has_set_parm = RIG_PARM_SET(ICR9500_PARMS), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/icrx7.c b/rigs/icom/icrx7.c index 42d933f9..b5ba39d2 100644 --- a/rigs/icom/icrx7.c +++ b/rigs/icom/icrx7.c @@ -82,6 +82,7 @@ const struct rig_caps icrx7_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/id1.c b/rigs/icom/id1.c index 4fef87e6..70dee3be 100644 --- a/rigs/icom/id1.c +++ b/rigs/icom/id1.c @@ -101,6 +101,7 @@ const struct rig_caps id1_caps = .has_get_parm = ID1_PARM_ALL, .has_set_parm = ID1_PARM_ALL, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/id31.c b/rigs/icom/id31.c index 8da4fda4..46f97d9c 100644 --- a/rigs/icom/id31.c +++ b/rigs/icom/id31.c @@ -109,6 +109,7 @@ const struct rig_caps id31_caps = .has_get_parm = ID31_PARM_ALL, .has_set_parm = ID31_PARM_ALL, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .extparms = icom_ext_parms, diff --git a/rigs/icom/id4100.c b/rigs/icom/id4100.c index 72c300a7..df3e1d3d 100644 --- a/rigs/icom/id4100.c +++ b/rigs/icom/id4100.c @@ -113,6 +113,7 @@ const struct rig_caps id4100_caps = .has_get_parm = ID4100_PARM_ALL, .has_set_parm = ID4100_PARM_ALL, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .extparms = icom_ext_parms, diff --git a/rigs/icom/id51.c b/rigs/icom/id51.c index b871f51c..61289000 100644 --- a/rigs/icom/id51.c +++ b/rigs/icom/id51.c @@ -117,6 +117,7 @@ const struct rig_caps id51_caps = .has_get_parm = ID51_PARM_ALL, .has_set_parm = ID51_PARM_ALL, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .ext_tokens = id51_tokens, diff --git a/rigs/icom/id5100.c b/rigs/icom/id5100.c index 822afe46..ba17b4ca 100644 --- a/rigs/icom/id5100.c +++ b/rigs/icom/id5100.c @@ -113,6 +113,7 @@ const struct rig_caps id5100_caps = .has_get_parm = ID5100_PARM_ALL, .has_set_parm = ID5100_PARM_ALL, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .extparms = icom_ext_parms, diff --git a/rigs/icom/os456.c b/rigs/icom/os456.c index a39c15cf..c7152817 100644 --- a/rigs/icom/os456.c +++ b/rigs/icom/os456.c @@ -102,6 +102,7 @@ const struct rig_caps os456_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/os535.c b/rigs/icom/os535.c index bd355472..26df5afe 100644 --- a/rigs/icom/os535.c +++ b/rigs/icom/os535.c @@ -94,6 +94,7 @@ const struct rig_caps os535_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/icom/x108g.c b/rigs/icom/x108g.c index cd2e6ade..f8f64208 100644 --- a/rigs/icom/x108g.c +++ b/rigs/icom/x108g.c @@ -162,6 +162,7 @@ const struct rig_caps x108g_caps = .has_get_parm = X108G_PARMS, .has_set_parm = RIG_PARM_SET(X108G_PARMS), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .parm_gran = {}, diff --git a/rigs/jrc/nrd535.c b/rigs/jrc/nrd535.c index c4667ee1..e7527569 100644 --- a/rigs/jrc/nrd535.c +++ b/rigs/jrc/nrd535.c @@ -123,6 +123,7 @@ const struct rig_caps nrd535_caps = .has_get_parm = RIG_PARM_TIME, .has_set_parm = RIG_PARM_SET(NRD535_PARM), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 20 } }, [LVL_IF] = { .min = { .i = -2000 }, .max = { .i = 2000 } }, diff --git a/rigs/jrc/nrd545.c b/rigs/jrc/nrd545.c index 90687ddb..ed4ba980 100644 --- a/rigs/jrc/nrd545.c +++ b/rigs/jrc/nrd545.c @@ -121,6 +121,7 @@ const struct rig_caps nrd545_caps = .has_get_parm = RIG_PARM_TIME, .has_set_parm = RIG_PARM_SET(NRD545_PARM), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_ATT] = { .min = { .i = 0 }, .max = { .i = 20 } }, [LVL_IF] = { .min = { .i = -2550 }, .max = { .i = 2550 }, .step = { .i = 10} }, diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 3ae0afc8..0b00a1fa 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -205,6 +205,7 @@ const struct rig_caps k3_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_KEYSPD] = { .min = { .i = 8 }, .max = { .i = 50 }, .step = { .i = 1 } }, }, .parm_gran = {}, diff --git a/rigs/kenwood/thd7.c b/rigs/kenwood/thd7.c index 205afe27..ccfdf9ff 100644 --- a/rigs/kenwood/thd7.c +++ b/rigs/kenwood/thd7.c @@ -111,6 +111,7 @@ const struct rig_caps thd7a_caps = .has_get_parm = THD7_PARMS, .has_set_parm = THD7_PARMS, /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 5 } }, [LVL_SQL] = { .min = { .i = 0 }, .max = { .i = 5 } }, [LVL_RFPOWER] = { .min = { .i = 3 }, .max = { .i = 0 } }, diff --git a/rigs/kenwood/thf6a.c b/rigs/kenwood/thf6a.c index 2e309b2d..9fc73e53 100644 --- a/rigs/kenwood/thf6a.c +++ b/rigs/kenwood/thf6a.c @@ -147,6 +147,7 @@ const struct rig_caps thf6a_caps = .has_get_parm = THF6_PARMS, .has_set_parm = THF6_PARMS, .level_gran = { + // cppcheck-suppress * [LVL_SQL] = { .min = { .i = 0 }, .max = { .i = 5 } }, [LVL_RFPOWER] = { .min = { .i = 2 }, .max = { .i = 0 } }, }, diff --git a/rigs/kenwood/thf7.c b/rigs/kenwood/thf7.c index 821b7753..68a8d5f5 100644 --- a/rigs/kenwood/thf7.c +++ b/rigs/kenwood/thf7.c @@ -141,6 +141,7 @@ const struct rig_caps thf7e_caps = .has_get_parm = THF7_PARMS, .has_set_parm = THF7_PARMS, .level_gran = { + // cppcheck-suppress * [LVL_SQL] = { .min = { .i = 0 }, .max = { .i = 5 } }, [LVL_RFPOWER] = { .min = { .i = 2 }, .max = { .i = 0 } }, }, diff --git a/rigs/kenwood/thg71.c b/rigs/kenwood/thg71.c index b2a1c46a..39e62446 100644 --- a/rigs/kenwood/thg71.c +++ b/rigs/kenwood/thg71.c @@ -112,6 +112,7 @@ const struct rig_caps thg71_caps = .has_get_level = THG71_LEVEL_ALL, .has_set_level = RIG_LEVEL_SET(THG71_LEVEL_ALL), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 5 } }, [LVL_SQL] = { .min = { .i = 0 }, .max = { .i = 5 } }, [LVL_RFPOWER] = { .min = { .i = 3 }, .max = { .i = 0 } }, diff --git a/rigs/kenwood/tmd700.c b/rigs/kenwood/tmd700.c index d01ebaf7..13805a6d 100644 --- a/rigs/kenwood/tmd700.c +++ b/rigs/kenwood/tmd700.c @@ -125,6 +125,7 @@ const struct rig_caps tmd700_caps = .has_get_parm = TMD700_PARMS, .has_set_parm = TMD700_PARMS, /* FIXME: parms */ .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 7 } }, [LVL_SQL] = { .min = { .i = 0 }, .max = { .i = 0x1f }, .step = { .f = 1. / 0x1f } }, [LVL_RFPOWER] = { .min = { .i = 2 }, .max = { .i = 0 }, .step = { .f = 1. / 3. } }, diff --git a/rigs/pcr/pcr100.c b/rigs/pcr/pcr100.c index 5d8e9dd3..74d0409d 100644 --- a/rigs/pcr/pcr100.c +++ b/rigs/pcr/pcr100.c @@ -91,6 +91,7 @@ const struct rig_caps pcr100_caps = .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, /* XXX check this */ [LVL_IF] = { .min = { .i = -1270 }, .max = { .i = 1270 }, .step = { .i = 10 } }, diff --git a/rigs/pcr/pcr1000.c b/rigs/pcr/pcr1000.c index 12efd74a..aa0d7042 100644 --- a/rigs/pcr/pcr1000.c +++ b/rigs/pcr/pcr1000.c @@ -84,6 +84,7 @@ const struct rig_caps pcr1000_caps = .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, /* XXX check this */ [LVL_IF] = { .min = { .i = -1270 }, .max = { .i = 1270 }, .step = { .i = 10 } }, diff --git a/rigs/pcr/pcr1500.c b/rigs/pcr/pcr1500.c index 5d7edc59..c6bac2b0 100644 --- a/rigs/pcr/pcr1500.c +++ b/rigs/pcr/pcr1500.c @@ -87,6 +87,7 @@ const struct rig_caps pcr1500_caps = .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 }, .step = { .i = 1 } }, [LVL_NR] = { .min = { .f = 0 }, .max = { .f = 16.0 }, .step = { .f = 1.0 } }, /* XXX check this */ diff --git a/rigs/pcr/pcr2500.c b/rigs/pcr/pcr2500.c index d796e6c5..7fd5f857 100644 --- a/rigs/pcr/pcr2500.c +++ b/rigs/pcr/pcr2500.c @@ -96,6 +96,7 @@ const struct rig_caps pcr2500_caps = .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, /* XXX check this */ [LVL_IF] = { .min = { .i = -1270 }, .max = { .i = 1270 }, .step = { .i = 10 } }, diff --git a/rigs/prm80/prm80.c b/rigs/prm80/prm80.c index 01424046..1eefa60b 100644 --- a/rigs/prm80/prm80.c +++ b/rigs/prm80/prm80.c @@ -321,6 +321,7 @@ int prm80_get_channel(RIG *rig, channel_t *chan, int read_only) (chanstate & 0x04) ? RIG_RPT_SHIFT_PLUS : RIG_RPT_SHIFT_NONE; chan->flags = (chanstate & 0x08) ? RIG_CHFLAG_SKIP : 0; + // cppcheck-suppress * chan->levels[LVL_SQL].f = ((float)(hhtoi(statebuf + 6) >> 4)) / 15.; chan->levels[LVL_AF].f = ((float)(hhtoi(statebuf + 8) >> 4)) / 15.; /* same as chanstate bit 1 */ diff --git a/rigs/racal/ra3702.c b/rigs/racal/ra3702.c index 28378979..587e2b66 100644 --- a/rigs/racal/ra3702.c +++ b/rigs/racal/ra3702.c @@ -80,6 +80,7 @@ const struct rig_caps ra3702_caps = .has_get_parm = RA3702_PARM_ALL, .has_set_parm = RIG_PARM_SET(RA3702_PARM_ALL), .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, }, .vfo_ops = RA3702_VFO_OPS, diff --git a/rigs/tentec/pegasus.c b/rigs/tentec/pegasus.c index fdedead5..6a98a2cb 100644 --- a/rigs/tentec/pegasus.c +++ b/rigs/tentec/pegasus.c @@ -95,6 +95,7 @@ const struct rig_caps tt550_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = {.min = {.i = 0}, .max = {.i = 65535}}, }, .parm_gran = {}, diff --git a/rigs/tentec/rx320.c b/rigs/tentec/rx320.c index 0f4c68d4..f5ea64c3 100644 --- a/rigs/tentec/rx320.c +++ b/rigs/tentec/rx320.c @@ -104,6 +104,7 @@ const struct rig_caps rx320_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 10000 } }, [LVL_AF] = { .min = { .f = 0 }, .max = { .f = 1 }, .step = { .f = 1.0 / 64 } }, [LVL_IF] = { .min = { .i = -2000 }, .max = { .i = 2000 }, .step = { .i = 10} }, diff --git a/rigs/tuner/v4l.c b/rigs/tuner/v4l.c index 9691718a..74ee90b8 100644 --- a/rigs/tuner/v4l.c +++ b/rigs/tuner/v4l.c @@ -94,6 +94,7 @@ const struct rig_caps v4l_caps = .has_set_parm = RIG_PARM_SET(V4L_PARM_ALL), .vfo_ops = RIG_OP_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 65535 } }, }, .preamp = { RIG_DBLST_END }, diff --git a/rigs/tuner/v4l2.c b/rigs/tuner/v4l2.c index 1fb9f99e..4e1dea2a 100644 --- a/rigs/tuner/v4l2.c +++ b/rigs/tuner/v4l2.c @@ -94,6 +94,7 @@ const struct rig_caps v4l2_caps = .has_set_parm = RIG_PARM_SET(V4L2_PARM_ALL), .vfo_ops = RIG_OP_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 65535 } }, }, .preamp = { RIG_DBLST_END }, diff --git a/rigs/uniden/uniden.c b/rigs/uniden/uniden.c index 377e328c..31a1885d 100644 --- a/rigs/uniden/uniden.c +++ b/rigs/uniden/uniden.c @@ -637,6 +637,7 @@ int uniden_get_channel(RIG *rig, channel_t *chan, int read_only) /* TODO: Trunk, Delay, Recording */ chan->flags = (membuf[22] == 'N') ? RIG_CHFLAG_SKIP : 0; + // cppcheck-suppress * chan->levels[LVL_ATT].i = (membuf[25] == 'N') ? rig->state.attenuator[0] : 0; sscanf(membuf + 41, "%d", &tone); diff --git a/rigs/wj/wj8888.c b/rigs/wj/wj8888.c index 38423cd8..ea1ce7b1 100644 --- a/rigs/wj/wj8888.c +++ b/rigs/wj/wj8888.c @@ -87,6 +87,7 @@ const struct rig_caps wj8888_caps = .preamp = { RIG_DBLST_END }, .attenuator = { RIG_DBLST_END }, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 0x7f } }, }, .max_rit = Hz(0), diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index 6a37a7aa..2b41b2ca 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -769,8 +769,8 @@ int ft1000mp_set_freq(RIG *rig, vfo_t vfo, freq_t freq) to_bcd(p->p_cmd, freq / 10, 8); /* store bcd format in in p_cmd */ /* TODO -- fix 10Hz resolution -- FS */ - rig_debug(RIG_DEBUG_TRACE, - "%s: requested freq after conversion = %"PRIll" Hz\n", __func__, + // cppcheck-suppress * + rig_debug(RIG_DEBUG_TRACE, "%s: freq = %"PRIll" Hz\n", __func__, (int64_t)from_bcd(p->p_cmd, 8) * 10); cmd = p->p_cmd; /* get native sequence */ diff --git a/rigs/yaesu/ft1200.c b/rigs/yaesu/ft1200.c index 68faac7e..604d55b9 100644 --- a/rigs/yaesu/ft1200.c +++ b/rigs/yaesu/ft1200.c @@ -76,6 +76,7 @@ const struct rig_caps ft1200_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 10 } }, }, diff --git a/rigs/yaesu/ft2000.c b/rigs/yaesu/ft2000.c index e52c7819..68ca3398 100644 --- a/rigs/yaesu/ft2000.c +++ b/rigs/yaesu/ft2000.c @@ -75,6 +75,7 @@ const struct rig_caps ft2000_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } }, }, diff --git a/rigs/yaesu/ft450.c b/rigs/yaesu/ft450.c index b0c71148..057c86e9 100644 --- a/rigs/yaesu/ft450.c +++ b/rigs/yaesu/ft450.c @@ -74,6 +74,7 @@ const struct rig_caps ft450_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_CWPITCH] = { .min = { .i = 400 }, .max = { .i = 800 }, .step = { .i = 100 } }, }, diff --git a/rigs/yaesu/ft5000.c b/rigs/yaesu/ft5000.c index 8ccef479..7602e647 100644 --- a/rigs/yaesu/ft5000.c +++ b/rigs/yaesu/ft5000.c @@ -75,6 +75,7 @@ const struct rig_caps ftdx5000_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } }, }, diff --git a/rigs/yaesu/ft891.c b/rigs/yaesu/ft891.c index 8b3fc5b8..0f958b32 100644 --- a/rigs/yaesu/ft891.c +++ b/rigs/yaesu/ft891.c @@ -79,6 +79,7 @@ const struct rig_caps ft891_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } }, }, diff --git a/rigs/yaesu/ft9000.c b/rigs/yaesu/ft9000.c index a5dd7165..b0d626ae 100644 --- a/rigs/yaesu/ft9000.c +++ b/rigs/yaesu/ft9000.c @@ -75,6 +75,7 @@ const struct rig_caps ft9000_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } }, }, diff --git a/rigs/yaesu/ft950.c b/rigs/yaesu/ft950.c index 2bdd9d05..6703daa9 100644 --- a/rigs/yaesu/ft950.c +++ b/rigs/yaesu/ft950.c @@ -74,6 +74,7 @@ const struct rig_caps ft950_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } }, }, diff --git a/rigs/yaesu/ft991.c b/rigs/yaesu/ft991.c index 82acde25..06e53aef 100644 --- a/rigs/yaesu/ft991.c +++ b/rigs/yaesu/ft991.c @@ -80,6 +80,7 @@ const struct rig_caps ft991_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RAWSTR] = { .min = { .i = 0 }, .max = { .i = 255 } }, [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 1050 }, .step = { .i = 50 } }, }, diff --git a/rigs/yaesu/vx1700.c b/rigs/yaesu/vx1700.c index cb59ea9d..4f9e8911 100644 --- a/rigs/yaesu/vx1700.c +++ b/rigs/yaesu/vx1700.c @@ -129,6 +129,7 @@ const struct rig_caps vx1700_caps = .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, .level_gran = { + // cppcheck-suppress * [LVL_RFPOWER] = { .min = { .i = 0 }, .max = { .i = 2 } }, }, .parm_gran = {}, diff --git a/tests/rigctl_parse.h b/tests/rigctl_parse.h index 873f9ada..a741742f 100644 --- a/tests/rigctl_parse.h +++ b/tests/rigctl_parse.h @@ -25,7 +25,6 @@ #ifndef RIGCTL_PARSE_H #define RIGCTL_PARSE_H -// cppcheck-suppress * #include <stdio.h> #include <hamlib/rig.h> commit 8d60a82f5405fc7e5f5d783058b2bbc773078244 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 19 14:38:00 2020 -0500 Clean up cppcheck warning diff --git a/rigs/tentec/tentec2.c b/rigs/tentec/tentec2.c index ac59d7a3..88417981 100644 --- a/rigs/tentec/tentec2.c +++ b/rigs/tentec/tentec2.c @@ -699,6 +699,7 @@ const char *tentec2_get_info(RIG *rig) /* * protocol version */ + buf[0] = 0; firmware_len = 100; retval = tentec_transaction(rig, "?V\r", 3, buf, &firmware_len); @@ -710,14 +711,5 @@ const char *tentec2_get_info(RIG *rig) return NULL; } - if (firmware_len < 100) - { - buf[firmware_len] = 0; - } - else - { - buf[0] = 0; - } - return buf; } commit 2362d2fe1cd332dee85158e00102568987fc44cb Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 19 14:33:27 2020 -0500 Clean up cppcheck scope diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index b031f860..63a42451 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -806,6 +806,14 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_MICGAIN: n = sscanf(lvlbuf + len, "%f", &val->f); + + if (n != 1) + { + rig_debug(RIG_DEBUG_ERR, "%s: Error parsing value from lvlbuf='%s'\n", + __func__, lvlbuf); + return -RIG_EPROTO; + } + // Thetis returns -40 to 10 -- does PowerSDR do the same? // Setting val->f = (val->f - -40) / (10 - -40); @@ -814,12 +822,28 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_VOXGAIN: // return is 0-1000 n = sscanf(lvlbuf + len, "%f", &val->f); + + if (n != 1) + { + rig_debug(RIG_DEBUG_ERR, "%s: Error parsing value from lvlbuf='%s'\n", + __func__, lvlbuf); + return -RIG_EPROTO; + } + val->f /= 1000; break; case RIG_LEVEL_SQL: n = sscanf(lvlbuf + len, "%f", &val->f); + if (n != 1) + { + rig_debug(RIG_DEBUG_ERR, "%s: Error parsing value from lvlbuf='%s'\n", + __func__, lvlbuf); + return -RIG_EPROTO; + } + + powersdr_get_mode(rig, vfo, &mode, &width); if (mode == RIG_MODE_FM) commit 88291fed86ecb2e251c8d1b16ce042910f522966 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 19 14:31:54 2020 -0500 Clean up cppcheck scope diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 3602969f..a7dc437d 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -896,12 +896,12 @@ const struct rig_caps ic705_caps = int ic7300_set_parm(RIG *rig, setting_t parm, value_t val) { - unsigned char prmbuf[MAXFRAMELEN]; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); switch (parm) { + unsigned char prmbuf[MAXFRAMELEN]; + case RIG_PARM_ANN: { int ann_mode = -1; commit 865fa7d540ccb2765f852cad7b9878615a61464a Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 19 12:55:47 2020 -0500 Remove redundant check in ar3030.c diff --git a/rigs/aor/ar3030.c b/rigs/aor/ar3030.c index edacb729..b1445954 100644 --- a/rigs/aor/ar3030.c +++ b/rigs/aor/ar3030.c @@ -266,7 +266,7 @@ static int ar3030_transaction(RIG *rig, const char *cmd, int cmd_len, *data_len = 0; /* only set data_len non-zero if not a command response */ - if (retval > 0 && data[0] != 0x00 && data[0] != 0x0d) + if (data[0] != 0x00 && data[0] != 0x0d) { *data_len = retval; } commit 42b2b1ed69c279dcffa40b293f59200e9d0ad910 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Sep 18 16:45:37 2020 -0500 Add FUNC RIT XIT and LEVEL AGC to PowerSDR diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index 5e4021ab..b031f860 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -49,9 +49,9 @@ #define F6K_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3) /* PowerSDR differences */ -#define POWERSDR_FUNC_ALL (RIG_FUNC_VOX|RIG_FUNC_SQL|RIG_FUNC_NB|RIG_FUNC_ANF|RIG_FUNC_MUTE) +#define POWERSDR_FUNC_ALL (RIG_FUNC_VOX|RIG_FUNC_SQL|RIG_FUNC_NB|RIG_FUNC_ANF|RIG_FUNC_MUTE|RIG_FUNC_RIT|RIG_FUNC_XIT) -#define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_MICGAIN|RIG_LEVEL_VOXGAIN|RIG_LEVEL_SQL|RIG_LEVEL_AF) +#define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_MICGAIN|RIG_LEVEL_VOXGAIN|RIG_LEVEL_SQL|RIG_LEVEL_AF|RIG_LEVEL_AGC) static rmode_t flex_mode_table[KENWOOD_MODE_TABLE_MAX] = @@ -660,6 +660,15 @@ int powersdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) snprintf(cmd, sizeof(cmd) - 1, "ZZMG%03d", ival); break; + case RIG_LEVEL_AGC: + if (val.i > 5) + { + val.i = 5; /* 0.. 255 */ + } + + snprintf(cmd, sizeof(cmd), "GT%03d", (int)val.i); + break; + case RIG_LEVEL_VOXGAIN: ival = val.f * 1000; snprintf(cmd, sizeof(cmd) - 1, "ZZVG%04d", ival); @@ -718,6 +727,12 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) switch (level) { + case RIG_LEVEL_AGC: + cmd = "GT"; + len = 2; + ans = 3; + break; + case RIG_LEVEL_AF: cmd = "ZZAG"; len = 4; @@ -763,6 +778,18 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) switch (level) { + case RIG_LEVEL_AGC: + n = sscanf(lvlbuf + len, "%d", &val->i); + + if (n != 1) + { + rig_debug(RIG_DEBUG_ERR, "%s: Error parsing value from lvlbuf='%s'\n", + __func__, lvlbuf); + return -RIG_EPROTO; + } + + break; + case RIG_LEVEL_AF: case RIG_LEVEL_RFPOWER_METER: n = sscanf(lvlbuf + len, "%f", &val->f); commit f401d6dd942c5a69f21e16201a7165921f92fc18 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Sep 18 16:17:26 2020 -0500 Add func NB ANF MUTE to PowerSDR diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index f027e698..5e4021ab 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -49,7 +49,7 @@ #define F6K_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3) /* PowerSDR differences */ -#define POWERSDR_FUNC_ALL (RIG_FUNC_VOX|RIG_FUNC_SQL) +#define POWERSDR_FUNC_ALL (RIG_FUNC_VOX|RIG_FUNC_SQL|RIG_FUNC_NB|RIG_FUNC_ANF|RIG_FUNC_MUTE) #define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_MICGAIN|RIG_LEVEL_VOXGAIN|RIG_LEVEL_SQL|RIG_LEVEL_AF) @@ -654,6 +654,7 @@ int powersdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) ival = val.f * 100; snprintf(cmd, sizeof(cmd) - 1, "ZZAG%03d", ival); break; + case RIG_LEVEL_MICGAIN: ival = val.f * (10 - -40) - 40; snprintf(cmd, sizeof(cmd) - 1, "ZZMG%03d", ival); @@ -722,6 +723,7 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) len = 4; ans = 3; break; + case RIG_LEVEL_RFPOWER_METER: cmd = "ZZRM5"; len = 5; @@ -819,6 +821,10 @@ int powersdr_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) switch (func) { + case RIG_FUNC_MUTE: + snprintf(cmd, sizeof(cmd) - 1, "ZZMA%01d", status); + break; + case RIG_FUNC_VOX: snprintf(cmd, sizeof(cmd) - 1, "ZZVE%01d", status); break; @@ -850,6 +856,12 @@ int powersdr_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) switch (func) { + case RIG_FUNC_MUTE: + cmd = "ZZMA"; + len = 4; + ans = 1; + break; + case RIG_FUNC_VOX: cmd = "ZZVE"; len = 4; @@ -875,10 +887,8 @@ int powersdr_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) switch (func) { + case RIG_FUNC_MUTE: case RIG_FUNC_VOX: - sscanf(lvlbuf + len, "%d", status); - break; - case RIG_FUNC_SQL: sscanf(lvlbuf + len, "%d", status); break; commit 10700186e3f4955a9f77dd50f675ff9ccbd11c38 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Sep 18 15:50:08 2020 -0500 Add LEVEL_AF to PowerSDR diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index 8364e0f4..f027e698 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -51,7 +51,7 @@ /* PowerSDR differences */ #define POWERSDR_FUNC_ALL (RIG_FUNC_VOX|RIG_FUNC_SQL) -#define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_MICGAIN|RIG_LEVEL_VOXGAIN|RIG_LEVEL_SQL) +#define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_MICGAIN|RIG_LEVEL_VOXGAIN|RIG_LEVEL_SQL|RIG_LEVEL_AF) static rmode_t flex_mode_table[KENWOOD_MODE_TABLE_MAX] = @@ -650,6 +650,10 @@ int powersdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) switch (level) { + case RIG_LEVEL_AF: + ival = val.f * 100; + snprintf(cmd, sizeof(cmd) - 1, "ZZAG%03d", ival); + break; case RIG_LEVEL_MICGAIN: ival = val.f * (10 - -40) - 40; snprintf(cmd, sizeof(cmd) - 1, "ZZMG%03d", ival); @@ -713,6 +717,11 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) switch (level) { + case RIG_LEVEL_AF: + cmd = "ZZAG"; + len = 4; + ans = 3; + break; case RIG_LEVEL_RFPOWER_METER: cmd = "ZZRM5"; len = 5; @@ -752,12 +761,13 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) switch (level) { + case RIG_LEVEL_AF: case RIG_LEVEL_RFPOWER_METER: n = sscanf(lvlbuf + len, "%f", &val->f); if (n != 1) { - rig_debug(RIG_DEBUG_ERR, "%s: Error parsing RFPOWER from lvlbuf='%s'\n", + rig_debug(RIG_DEBUG_ERR, "%s: Error parsing value from lvlbuf='%s'\n", __func__, lvlbuf); return -RIG_EPROTO; } ----------------------------------------------------------------------- Summary of changes: cppcheck.sh | 1 + rigs/aor/ar3030.c | 3 +- rigs/aor/ar7030.c | 1 + rigs/aor/ar7030p.c | 1 + rigs/icmarine/icm700pro.c | 1 + rigs/icmarine/icm710.c | 1 + rigs/icmarine/icm802.c | 1 + rigs/icmarine/icm803.c | 1 + rigs/icom/ic2730.c | 1 + rigs/icom/ic7000.c | 1 + rigs/icom/ic703.c | 1 + rigs/icom/ic706.c | 1 + rigs/icom/ic7100.c | 1 + rigs/icom/ic718.c | 1 + rigs/icom/ic7200.c | 1 + rigs/icom/ic7300.c | 5 +-- rigs/icom/ic7410.c | 1 + rigs/icom/ic746.c | 1 + rigs/icom/ic751.c | 1 + rigs/icom/ic756.c | 1 + rigs/icom/ic7600.c | 1 + rigs/icom/ic7610.c | 1 + rigs/icom/ic7700.c | 1 + rigs/icom/ic78.c | 1 + rigs/icom/ic7800.c | 1 + rigs/icom/ic785x.c | 1 + rigs/icom/ic910.c | 1 + rigs/icom/ic9100.c | 1 + rigs/icom/ic92d.c | 1 + rigs/icom/icr10.c | 1 + rigs/icom/icr20.c | 1 + rigs/icom/icr30.c | 1 + rigs/icom/icr6.c | 1 + rigs/icom/icr7000.c | 1 + rigs/icom/icr75.c | 1 + rigs/icom/icr8500.c | 1 + rigs/icom/icr8600.c | 1 + rigs/icom/icr9000.c | 1 + rigs/icom/icr9500.c | 1 + rigs/icom/icrx7.c | 1 + rigs/icom/id1.c | 1 + rigs/icom/id31.c | 1 + rigs/icom/id4100.c | 1 + rigs/icom/id51.c | 1 + rigs/icom/id5100.c | 1 + rigs/icom/os456.c | 1 + rigs/icom/os535.c | 1 + rigs/icom/x108g.c | 1 + rigs/jrc/nrd535.c | 1 + rigs/jrc/nrd545.c | 1 + rigs/kenwood/flex6xxx.c | 83 +++++++++++++++++++++++++++++++++++++++++---- rigs/kenwood/k3.c | 1 + rigs/kenwood/thd7.c | 1 + rigs/kenwood/thf6a.c | 1 + rigs/kenwood/thf7.c | 1 + rigs/kenwood/thg71.c | 1 + rigs/kenwood/tmd700.c | 1 + rigs/pcr/pcr100.c | 1 + rigs/pcr/pcr1000.c | 1 + rigs/pcr/pcr1500.c | 1 + rigs/pcr/pcr2500.c | 1 + rigs/prm80/prm80.c | 1 + rigs/racal/ra3702.c | 1 + rigs/tentec/pegasus.c | 1 + rigs/tentec/rx320.c | 1 + rigs/tentec/tentec2.c | 10 +----- rigs/tuner/v4l.c | 1 + rigs/tuner/v4l2.c | 1 + rigs/uniden/uniden.c | 1 + rigs/wj/wj8888.c | 1 + rigs/yaesu/ft1000mp.c | 4 +-- rigs/yaesu/ft1200.c | 1 + rigs/yaesu/ft2000.c | 1 + rigs/yaesu/ft450.c | 1 + rigs/yaesu/ft5000.c | 1 + rigs/yaesu/ft891.c | 1 + rigs/yaesu/ft9000.c | 1 + rigs/yaesu/ft950.c | 1 + rigs/yaesu/ft991.c | 1 + rigs/yaesu/newcat.c | 85 +++++++++++++++++++++++++++++++++++++++++++---- rigs/yaesu/vx1700.c | 1 + tests/rigctl_parse.h | 1 - 82 files changed, 239 insertions(+), 27 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-09-18 20:39:04
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via 3811071f9e80a570a7cbd2ff4d1d5ba6d4708312 (commit) via 2a378919dbd8fb39eafaf7089785a96853ea979c (commit) via fd7ba5e8d089182a24a0b2b63e90dfc4b88f44d8 (commit) from 2b2786cd4761f604c3b752089c0216a39621e37c (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 3811071f9e80a570a7cbd2ff4d1d5ba6d4708312 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Sep 18 13:07:19 2020 -0500 Add Thetis/ANAN to PowerSDR description diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index 2b132cf6..8364e0f4 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -1010,9 +1010,9 @@ const struct rig_caps f6k_caps = const struct rig_caps powersdr_caps = { RIG_MODEL(RIG_MODEL_POWERSDR), - .model_name = "PowerSDR", - .mfg_name = "FlexRadio", - .version = "20200716.0", + .model_name = "PowerSDR/Thetis", + .mfg_name = "FlexRadio/ANAN", + .version = "20200918.0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, commit 2a378919dbd8fb39eafaf7089785a96853ea979c Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Sep 18 13:04:31 2020 -0500 Add SQL to PowerSDR diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index a9b5f6ee..2b132cf6 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -28,6 +28,7 @@ #endif #include <stdlib.h> +#include <math.h> #include <hamlib/rig.h> #include "kenwood.h" @@ -48,9 +49,9 @@ #define F6K_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3) /* PowerSDR differences */ -#define POWERSDR_FUNC_ALL (RIG_FUNC_VOX) +#define POWERSDR_FUNC_ALL (RIG_FUNC_VOX|RIG_FUNC_SQL) -#define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_MICGAIN|RIG_LEVEL_VOXGAIN) +#define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_MICGAIN|RIG_LEVEL_VOXGAIN|RIG_LEVEL_SQL) static rmode_t flex_mode_table[KENWOOD_MODE_TABLE_MAX] = @@ -642,6 +643,8 @@ int powersdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) char cmd[KENWOOD_MAX_BUF_LEN]; int retval; int ival; + rmode_t mode; + pbwidth_t width; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -650,31 +653,40 @@ int powersdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_MICGAIN: ival = val.f * (10 - -40) - 40; snprintf(cmd, sizeof(cmd) - 1, "ZZMG%03d", ival); - retval = kenwood_transaction(rig, cmd, NULL, 0); - - if (retval != RIG_OK) - { - return retval; - } - break; case RIG_LEVEL_VOXGAIN: ival = val.f * 1000; snprintf(cmd, sizeof(cmd) - 1, "ZZVG%04d", ival); - retval = kenwood_transaction(rig, cmd, NULL, 0); + break; - if (retval != RIG_OK) + case RIG_LEVEL_SQL: + powersdr_get_mode(rig, vfo, &mode, &width); + + if (mode == RIG_MODE_FM) { - return retval; + ival = val.f * 100; // FM mode is 0 to 100 + } + else + { + ival = 160 - (val.f * 160); // all other modes 0 to 160 } + snprintf(cmd, sizeof(cmd) - 1, "ZZSQ%03d", ival); break; default: return kenwood_set_level(rig, vfo, level, val); } + retval = kenwood_transaction(rig, cmd, NULL, 0); + + if (retval != RIG_OK) + { + return retval; + } + + rig_debug(RIG_DEBUG_VERBOSE, "%s exiting\n", __func__); return RIG_OK; @@ -689,6 +701,8 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) char *cmd; int retval; int len, ans; + rmode_t mode; + pbwidth_t width; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -717,6 +731,12 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) ans = 4; break; + case RIG_LEVEL_SQL: + cmd = "ZZSQ"; + len = 4; + ans = 3; + break; + default: return kenwood_get_level(rig, vfo, level, val); } @@ -758,6 +778,22 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->f /= 1000; break; + case RIG_LEVEL_SQL: + n = sscanf(lvlbuf + len, "%f", &val->f); + + powersdr_get_mode(rig, vfo, &mode, &width); + + if (mode == RIG_MODE_FM) + { + val->f /= 100; // FM mode is 0 to 100 + } + else + { + val->f = fabs((val->f - 160) / -160); // all other modes 0 to 160 + } + + break; + default: rig_debug(RIG_DEBUG_ERR, "%s: should never get here\n", __func__); } @@ -768,7 +804,6 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) int powersdr_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) { char cmd[KENWOOD_MAX_BUF_LEN]; - int retval; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -776,20 +811,17 @@ int powersdr_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) { case RIG_FUNC_VOX: snprintf(cmd, sizeof(cmd) - 1, "ZZVE%01d", status); - retval = kenwood_transaction(rig, cmd, NULL, 0); - - if (retval != RIG_OK) - { - return retval; - } + break; + case RIG_FUNC_SQL: + snprintf(cmd, sizeof(cmd) - 1, "ZZSO%01d", status); break; default: return kenwood_set_func(rig, vfo, func, status); } - return RIG_OK; + return kenwood_transaction(rig, cmd, NULL, 0); } int powersdr_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) @@ -814,6 +846,12 @@ int powersdr_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) ans = 1; break; + case RIG_FUNC_SQL: + cmd = "ZZSO"; + len = 4; + ans = 1; + break; + default: return kenwood_get_func(rig, vfo, func, status); } @@ -831,6 +869,10 @@ int powersdr_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) sscanf(lvlbuf + len, "%d", status); break; + case RIG_FUNC_SQL: + sscanf(lvlbuf + len, "%d", status); + break; + default: rig_debug(RIG_DEBUG_ERR, "%s: should never get here\n", __func__); } commit fd7ba5e8d089182a24a0b2b63e90dfc4b88f44d8 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Sep 18 12:14:32 2020 -0500 Added VOX and VOXGAIN to PowerSDR diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index 5571c6dd..a9b5f6ee 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -48,7 +48,9 @@ #define F6K_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3) /* PowerSDR differences */ -#define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_MICGAIN) +#define POWERSDR_FUNC_ALL (RIG_FUNC_VOX) + +#define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_MICGAIN|RIG_LEVEL_VOXGAIN) static rmode_t flex_mode_table[KENWOOD_MODE_TABLE_MAX] = @@ -657,6 +659,18 @@ int powersdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) break; + case RIG_LEVEL_VOXGAIN: + ival = val.f * 1000; + snprintf(cmd, sizeof(cmd) - 1, "ZZVG%04d", ival); + retval = kenwood_transaction(rig, cmd, NULL, 0); + + if (retval != RIG_OK) + { + return retval; + } + + break; + default: return kenwood_set_level(rig, vfo, level, val); } @@ -674,7 +688,7 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) char lvlbuf[KENWOOD_MAX_BUF_LEN]; char *cmd; int retval; - int len; + int len, ans; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -688,18 +702,26 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_RFPOWER_METER: cmd = "ZZRM5"; len = 5; + ans = 3; break; case RIG_LEVEL_MICGAIN: cmd = "ZZMG"; len = 4; + ans = 3; + break; + + case RIG_LEVEL_VOXGAIN: + cmd = "ZZVG"; + len = 4; + ans = 4; break; default: return kenwood_get_level(rig, vfo, level, val); } - retval = kenwood_safe_transaction(rig, cmd, lvlbuf, 10, len + 3); + retval = kenwood_safe_transaction(rig, cmd, lvlbuf, 10, len + ans); if (retval != RIG_OK) { @@ -729,11 +751,92 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) // Setting val->f = (val->f - -40) / (10 - -40); break; + + case RIG_LEVEL_VOXGAIN: + // return is 0-1000 + n = sscanf(lvlbuf + len, "%f", &val->f); + val->f /= 1000; + break; + + default: + rig_debug(RIG_DEBUG_ERR, "%s: should never get here\n", __func__); + } + + return RIG_OK; +} + +int powersdr_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) +{ + char cmd[KENWOOD_MAX_BUF_LEN]; + int retval; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + switch (func) + { + case RIG_FUNC_VOX: + snprintf(cmd, sizeof(cmd) - 1, "ZZVE%01d", status); + retval = kenwood_transaction(rig, cmd, NULL, 0); + + if (retval != RIG_OK) + { + return retval; + } + + break; + + default: + return kenwood_set_func(rig, vfo, func, status); } return RIG_OK; } +int powersdr_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) +{ + char lvlbuf[KENWOOD_MAX_BUF_LEN]; + char *cmd; + int retval; + int len, ans; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + if (!status) + { + return -RIG_EINVAL; + } + + switch (func) + { + case RIG_FUNC_VOX: + cmd = "ZZVE"; + len = 4; + ans = 1; + break; + + default: + return kenwood_get_func(rig, vfo, func, status); + } + + retval = kenwood_safe_transaction(rig, cmd, lvlbuf, 10, len + ans); + + if (retval != RIG_OK) + { + return retval; + } + + switch (func) + { + case RIG_FUNC_VOX: + sscanf(lvlbuf + len, "%d", status); + break; + + default: + rig_debug(RIG_DEBUG_ERR, "%s: should never get here\n", __func__); + } + + return RIG_OK; +} /* * F6K rig capabilities. @@ -889,8 +992,8 @@ const struct rig_caps powersdr_caps = .timeout = 800, // some band transitions can take 600ms .retry = 3, - .has_get_func = RIG_FUNC_NONE, /* has VOX but not implemented here */ - .has_set_func = RIG_FUNC_NONE, + .has_get_func = POWERSDR_FUNC_ALL, + .has_set_func = POWERSDR_FUNC_ALL, .has_get_level = POWERSDR_LEVEL_ALL, .has_set_level = POWERSDR_LEVEL_ALL, .has_get_parm = RIG_PARM_NONE, @@ -986,6 +1089,8 @@ const struct rig_caps powersdr_caps = // correctly - use actual values instead of indices .set_level = powersdr_set_level, .get_level = powersdr_get_level, + .get_func = powersdr_get_func, + .set_func = powersdr_set_func, //.set_ant = kenwood_set_ant_no_ack, //.get_ant = kenwood_get_ant, }; ----------------------------------------------------------------------- Summary of changes: rigs/kenwood/flex6xxx.c | 169 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 158 insertions(+), 11 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-09-18 04:26:14
|
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 2b2786cd4761f604c3b752089c0216a39621e37c (commit) from f58314852047b10a210f7b841598f52ff10e07bf (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 2b2786cd4761f604c3b752089c0216a39621e37c Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Sep 17 23:24:40 2020 -0500 Fix PowerSdr MICGAIN for levels -40 to 10 it returns https://github.com/Hamlib/Hamlib/issues/382 diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index 9ffcaf91..5571c6dd 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -48,7 +48,7 @@ #define F6K_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3) /* PowerSDR differences */ -#define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER) +#define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_MICGAIN) static rmode_t flex_mode_table[KENWOOD_MODE_TABLE_MAX] = @@ -631,6 +631,41 @@ int flex6k_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) return err; } + +/* + * powersdr_set_level + */ +int powersdr_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) +{ + char cmd[KENWOOD_MAX_BUF_LEN]; + int retval; + int ival; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + switch (level) + { + case RIG_LEVEL_MICGAIN: + ival = val.f * (10 - -40) - 40; + snprintf(cmd, sizeof(cmd) - 1, "ZZMG%03d", ival); + retval = kenwood_transaction(rig, cmd, NULL, 0); + + if (retval != RIG_OK) + { + return retval; + } + + break; + + default: + return kenwood_set_level(rig, vfo, level, val); + } + + rig_debug(RIG_DEBUG_VERBOSE, "%s exiting\n", __func__); + + return RIG_OK; +} + /* * powersdr_get_level */ @@ -655,6 +690,11 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) len = 5; break; + case RIG_LEVEL_MICGAIN: + cmd = "ZZMG"; + len = 4; + break; + default: return kenwood_get_level(rig, vfo, level, val); } @@ -682,6 +722,13 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->f /= 100; break; + + case RIG_LEVEL_MICGAIN: + n = sscanf(lvlbuf + len, "%f", &val->f); + // Thetis returns -40 to 10 -- does PowerSDR do the same? + // Setting + val->f = (val->f - -40) / (10 - -40); + break; } return RIG_OK; @@ -845,7 +892,7 @@ const struct rig_caps powersdr_caps = .has_get_func = RIG_FUNC_NONE, /* has VOX but not implemented here */ .has_set_func = RIG_FUNC_NONE, .has_get_level = POWERSDR_LEVEL_ALL, - .has_set_level = F6K_LEVEL_ALL, + .has_set_level = POWERSDR_LEVEL_ALL, .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ .level_gran = {}, /* FIXME: granularity */ @@ -937,7 +984,7 @@ const struct rig_caps powersdr_caps = .set_ptt = flex6k_set_ptt, // TODO copy over kenwood_[set|get]_level and modify to handle DSP filter values // correctly - use actual values instead of indices - .set_level = kenwood_set_level, + .set_level = powersdr_set_level, .get_level = powersdr_get_level, //.set_ant = kenwood_set_ant_no_ack, //.get_ant = kenwood_get_ant, ----------------------------------------------------------------------- Summary of changes: rigs/kenwood/flex6xxx.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 3 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-09-17 17:07: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 f58314852047b10a210f7b841598f52ff10e07bf (commit) via 548dcad2eec9ff60d33036b79c72f09a319ebec7 (commit) via 6d815cad13e6492a59026683c8e560f712d8e6e3 (commit) via c500b342a5633b9a2578656f878a8a5e6f59ef82 (commit) via f107faf71ef70b6ebf89b0109a88dec6f43f1d00 (commit) via 4e22e0d6e40787e3248cec8754398e5dfa1b1e6c (commit) via 499d17cd2019b656c496496f3f1be3a1fc6c3a56 (commit) via 7c4f0d025dfd95c6f24c44bbee320d751e618450 (commit) via 24b596c52b8b644ecbaf64ec25fd103c86d8a8b6 (commit) via 37311b50353f513598283da3c725332060fcabaa (commit) via 3c4bc6dbb19b11f5e2418ccb7c80fd60756a6e8d (commit) via 85981ed689b3b4d5068e8f142bd0dafc6d298373 (commit) via 52ec755f198f42f8dcfea4fe90e11d27a4f9f4af (commit) via 2f143aa8991f42f6b265d34217642bc8350ef09d (commit) via 23971f8e75907b13d67b4911448ca26fe5e1847c (commit) from d817aefa3602f78ea2fa5d77bb69650107177ad1 (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 f58314852047b10a210f7b841598f52ff10e07bf Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Sep 17 12:07:19 2020 -0500 astyle kenwood.c diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 52955bec..bcf160ad 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2240,8 +2240,10 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) break; case RIG_LEVEL_MICGAIN: + /* XXX check level range */ if (RIG_LEVEL_IS_FLOAT(level)) { kenwood_val = val.f * 100; } + snprintf(levelbuf, sizeof(levelbuf), "MG%03d", kenwood_val); break; @@ -2649,10 +2651,13 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_MICGAIN: ret = get_kenwood_level(rig, "MG", &val->f); - if (ret != RIG_OK) { + + if (ret != RIG_OK) + { rig_debug(RIG_DEBUG_ERR, "%s: Error getting MICGAIN\n", __func__); return ret; } + val->f = val->f * (255.0 / 100.0); return RIG_OK; commit 548dcad2eec9ff60d33036b79c72f09a319ebec7 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Sep 17 12:06:48 2020 -0500 Fix MICGAIN to 0-100 range in kenwood.c diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 8961bb7b..52955bec 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2241,6 +2241,7 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_MICGAIN: /* XXX check level range */ + if (RIG_LEVEL_IS_FLOAT(level)) { kenwood_val = val.f * 100; } snprintf(levelbuf, sizeof(levelbuf), "MG%03d", kenwood_val); break; @@ -2576,25 +2577,25 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) // 2 == AG0 (fixed VFO) // 3 == AG0/1 (with VFO arg) char buffer[KENWOOD_MAX_BUF_LEN]; - int err = kenwood_transaction(rig, "AG", buffer, sizeof(buffer)); + ret = kenwood_transaction(rig, "AG", buffer, sizeof(buffer)); - if (err == RIG_OK) + if (ret == RIG_OK) { priv->ag_format = 1; } else { - err = kenwood_transaction(rig, "AG1", buffer, sizeof(buffer)); + ret = kenwood_transaction(rig, "AG1", buffer, sizeof(buffer)); - if (err == RIG_OK) + if (ret == RIG_OK) { priv->ag_format = 3; } else { - err = kenwood_transaction(rig, "AG0", buffer, sizeof(buffer)); + ret = kenwood_transaction(rig, "AG0", buffer, sizeof(buffer)); - if (err == RIG_OK) + if (ret == RIG_OK) { priv->ag_format = 2; } @@ -2647,7 +2648,13 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return get_kenwood_level(rig, "SQ", &val->f); case RIG_LEVEL_MICGAIN: - return get_kenwood_level(rig, "MG", &val->f); + ret = get_kenwood_level(rig, "MG", &val->f); + if (ret != RIG_OK) { + rig_debug(RIG_DEBUG_ERR, "%s: Error getting MICGAIN\n", __func__); + return ret; + } + val->f = val->f * (255.0 / 100.0); + return RIG_OK; case RIG_LEVEL_AGC: ret = get_kenwood_level(rig, "GT", &val->f); commit 6d815cad13e6492a59026683c8e560f712d8e6e3 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Sep 17 11:50:23 2020 -0500 Add set_level MICGAIN to kenwood.c diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index a53eb569..8961bb7b 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2239,6 +2239,11 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } break; + case RIG_LEVEL_MICGAIN: + /* XXX check level range */ + snprintf(levelbuf, sizeof(levelbuf), "MG%03d", kenwood_val); + break; + case RIG_LEVEL_RF: /* XXX check level range */ snprintf(levelbuf, sizeof(levelbuf), "RG%03d", kenwood_val); diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 9949279c..4dab795b 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -27,7 +27,7 @@ #include <string.h> #include "token.h" -#define BACKEND_VER "20200916" +#define BACKEND_VER "20200917" #define EOM_KEN ';' #define EOM_TH '\r' commit c500b342a5633b9a2578656f878a8a5e6f59ef82 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Sep 17 10:37:22 2020 -0500 Update man pages for get_chan https://github.com/Hamlib/Hamlib/issues/370 diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index 6546a9d3..d9f4494e 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -959,12 +959,11 @@ data. Sets memory channel information . .TP -.BR h ", " get_channel -Get memory -.RI \(aq Channel \(aq -data. +.BR h ", " get_channel " \(aq" \fIreadonly\fP \(aq +Get channel memory. .IP -Returns programmed channel information for specified channel +If readonly!=0 then only channel data is returned and rig remains on the current channel. If readonly=0 then rig will be set to the channel requested. +data. . .TP .BR A ", " set_trn " \(aq" \fITransceive\fP \(aq diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index b5d51578..6b02055a 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -935,12 +935,11 @@ data. Not implemented yet. . .TP -.BR h ", " get_channel -Get memory -.RI \(aq Channel \(aq -data. +.BR h ", " get_channel " \(aq" \fIreadonly\fP \(aq +Get channel memory. .IP -Not implemented yet. +If readonly!=0 then only channel data is returned and rig remains on the current channel. If readonly=0 then rig will be set to the channel requested. +data. . .TP .BR A ", " set_trn " \(aq" \fITransceive\fP \(aq commit f107faf71ef70b6ebf89b0109a88dec6f43f1d00 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Sep 17 08:20:51 2020 -0500 Update man pages for set_ant diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index 7814e960..6546a9d3 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -667,7 +667,20 @@ and .IP Number is 1-based antenna# (\(oq1\(cq, \(oq2\(cq, \(oq3\(cq, ...). .IP -Option depends on rig..for Icom it probably sets the RX only flag as in the IC-7851. See your manual for specific option values. Most rigs don't care about the option. +Option depends on rig..for Icom it probably sets the Tx & Rx antennas as in the IC-7851. See your manual for rig specific option values. Most rigs don't care about the option. +.IP +For the IC-7851 (and perhaps others) it means this: +.IP +.in +4n +.EX +1 = TX/RX = ANT1 +2 = TX/RX = ANT2 +3 = TX/RX = ANT3 +4 = TX/RX = ANT1/ANT4 +5 = TX/RX = ANT2/ANT4 +6 = TX/RX = ANT3/ANT4 +.EE +.in . .TP .BR y ", " get_ant " \(aq" \fIAntenna\fP \(aq diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index 959b2425..b5d51578 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -648,6 +648,22 @@ above. Set .RI \(aq Antenna \(aq number (\(oq0\(cq, \(oq1\(cq, \(oq2\(cq, ...). +.IP +.IP +Option depends on rig..for Icom it probably sets the Tx & Rx antennas as in the IC-7851. See your manual for rig specific option values. Most rigs don't care about the option. +.IP +For the IC-7851 (and perhaps others) it means this: +.IP +.in +4n +.EX +1 = TX/RX = ANT1 +2 = TX/RX = ANT2 +3 = TX/RX = ANT3 +4 = TX/RX = ANT1/ANT4 +5 = TX/RX = ANT2/ANT4 +6 = TX/RX = ANT3/ANT4 +.EE +.in . .TP .BR y ", " get_ant commit 4e22e0d6e40787e3248cec8754398e5dfa1b1e6c Merge: 24b596c5 499d17cd Author: Michael Black <mdb...@ya...> Date: Wed Sep 16 15:18:38 2020 -0500 Merge pull request #381 from mikaelnousiainen/icom-extcmds-fixes-1 Icom extcmds fixes commit 499d17cd2019b656c496496f3f1be3a1fc6c3a56 Author: Mikael Nousiainen <mik...@ik...> Date: Wed Sep 16 22:33:39 2020 +0300 Fix errors in Icom extcmd definitions and handling. Migrate more commands on Icom rigs to use extcmds. Add extfuncs to dummy rig for testing. diff --git a/dummy/dummy.c b/dummy/dummy.c index 85682c63..5bfad894 100644 --- a/dummy/dummy.c +++ b/dummy/dummy.c @@ -73,6 +73,7 @@ struct dummy_priv_data channel_t vfo_b; channel_t mem[NB_CHAN]; + struct ext_list *ext_funcs; struct ext_list *ext_parms; char *magic_conf; @@ -104,6 +105,15 @@ static const struct confparams dummy_ext_levels[] = { RIG_CONF_END, NULL, } }; +static const struct confparams dummy_ext_funcs[] = +{ + { + TOK_EL_MAGICEXTFUNC, "MGEF", "Magic ext func", "Magic ext function, as an example", + NULL, RIG_CONF_CHECKBUTTON + }, + { RIG_CONF_END, NULL, } +}; + /* parms pertain to the whole rig */ static const struct confparams dummy_ext_parms[] = { @@ -270,6 +280,13 @@ static int dummy_init(RIG *rig) return -RIG_ENOMEM; } + priv->ext_funcs = alloc_init_ext(dummy_ext_funcs); + + if (!priv->ext_funcs) + { + return -RIG_ENOMEM; + } + priv->ext_parms = alloc_init_ext(dummy_ext_parms); if (!priv->ext_parms) @@ -309,6 +326,7 @@ static int dummy_cleanup(RIG *rig) free(priv->vfo_a.ext_levels); free(priv->vfo_b.ext_levels); + free(priv->ext_funcs); free(priv->ext_parms); free(priv->magic_conf); @@ -1240,6 +1258,93 @@ static int dummy_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val) } +static int dummy_set_ext_func(RIG *rig, vfo_t vfo, token_t token, int status) +{ + struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv; + const struct confparams *cfp; + struct ext_list *elp; + + cfp = rig_ext_lookup_tok(rig, token); + + if (!cfp) + { + return -RIG_EINVAL; + } + + switch (token) + { + case TOK_EL_MAGICEXTFUNC: + break; + + default: + return -RIG_EINVAL; + } + + switch (cfp->type) + { + case RIG_CONF_CHECKBUTTON: + break; + case RIG_CONF_BUTTON: + break; + default: + return -RIG_EINTERNAL; + } + + elp = find_ext(priv->ext_funcs, token); + + if (!elp) + { + return -RIG_EINTERNAL; + } + + /* store value */ + elp->val.i = status; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s %d\n", __func__, + cfp->name, status); + + return RIG_OK; +} + + +static int dummy_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status) +{ + struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv; + const struct confparams *cfp; + struct ext_list *elp; + + cfp = rig_ext_lookup_tok(rig, token); + + if (!cfp) + { + return -RIG_EINVAL; + } + + switch (token) + { + case TOK_EL_MAGICEXTFUNC: + break; + default: + return -RIG_EINVAL; + } + + elp = find_ext(priv->ext_funcs, token); + + if (!elp) + { + return -RIG_EINTERNAL; + } + + /* load value */ + *status = elp->val.i; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__, + cfp->name); + + return RIG_OK; +} + + static int dummy_set_powerstat(RIG *rig, powerstat_t status) { struct dummy_priv_data *priv = (struct dummy_priv_data *)rig->state.priv; @@ -2034,6 +2139,7 @@ struct rig_caps dummy_caps = .priv = NULL, /* priv */ .extlevels = dummy_ext_levels, + .extfuncs = dummy_ext_funcs, .extparms = dummy_ext_parms, .cfgparams = dummy_cfg_params, @@ -2062,6 +2168,8 @@ struct rig_caps dummy_caps = .get_parm = dummy_get_parm, .set_ext_level = dummy_set_ext_level, .get_ext_level = dummy_get_ext_level, + .set_ext_func = dummy_set_ext_func, + .get_ext_func = dummy_get_ext_func, .set_ext_parm = dummy_set_ext_parm, .get_ext_parm = dummy_get_ext_parm, @@ -2196,6 +2304,7 @@ struct rig_caps dummy_no_vfo_caps = .priv = NULL, /* priv */ .extlevels = dummy_ext_levels, + .extfuncs = dummy_ext_funcs, .extparms = dummy_ext_parms, .cfgparams = dummy_cfg_params, @@ -2224,6 +2333,8 @@ struct rig_caps dummy_no_vfo_caps = .get_parm = dummy_get_parm, .set_ext_level = dummy_set_ext_level, .get_ext_level = dummy_get_ext_level, + .set_ext_func = dummy_set_ext_func, + .get_ext_func = dummy_get_ext_func, .set_ext_parm = dummy_set_ext_parm, .get_ext_parm = dummy_get_ext_parm, diff --git a/dummy/dummy.h b/dummy/dummy.h index 5d93d5aa..61642549 100644 --- a/dummy/dummy.h +++ b/dummy/dummy.h @@ -31,11 +31,12 @@ /* ext_level's and ext_parm's tokens */ -#define TOK_EL_MAGICLEVEL TOKEN_BACKEND(1) -#define TOK_EL_MAGICFUNC TOKEN_BACKEND(2) -#define TOK_EL_MAGICOP TOKEN_BACKEND(3) -#define TOK_EP_MAGICPARM TOKEN_BACKEND(4) -#define TOK_EL_MAGICCOMBO TOKEN_BACKEND(5) +#define TOK_EL_MAGICLEVEL TOKEN_BACKEND(1) +#define TOK_EL_MAGICFUNC TOKEN_BACKEND(2) +#define TOK_EL_MAGICOP TOKEN_BACKEND(3) +#define TOK_EP_MAGICPARM TOKEN_BACKEND(4) +#define TOK_EL_MAGICCOMBO TOKEN_BACKEND(5) +#define TOK_EL_MAGICEXTFUNC TOKEN_BACKEND(6) extern struct rig_caps dummy_caps; diff --git a/rigs/icom/ic7000.c b/rigs/icom/ic7000.c index 5c9551af..874213c7 100644 --- a/rigs/icom/ic7000.c +++ b/rigs/icom/ic7000.c @@ -129,8 +129,11 @@ .levels = RIG_LEVEL_SET(IC7000_LEVELS), \ } -int ic7000_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); -int ic7000_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); +struct cmdparams ic7000_extcmds[] = +{ + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x17}, CMD_DAT_INT, 1 }, + { {.s = RIG_PARM_NONE} } +}; /* * IC-7000 rig capabilities. @@ -148,6 +151,7 @@ static const struct icom_priv_caps IC7000_priv_caps = { .level = RIG_AGC_SLOW, .icom_level = 3 }, { .level = -1, .icom_level = 0 }, }, + .extcmds = ic7000_extcmds, }; const struct rig_caps ic7000_caps = @@ -296,8 +300,8 @@ const struct rig_caps ic7000_caps = .get_ant = NULL, .decode_event = icom_decode_event, - .set_level = ic7000_set_level, - .get_level = ic7000_get_level, + .set_level = icom_set_level, + .get_level = icom_get_level, .set_func = icom_set_func, .get_func = icom_get_func, .set_parm = NULL, @@ -329,39 +333,3 @@ const struct rig_caps ic7000_caps = .get_split_vfo = NULL, }; - -int ic7000_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) -{ - unsigned char cmdbuf[MAXFRAMELEN]; - - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - - switch (level) - { - case RIG_LEVEL_VOXDELAY: - cmdbuf[0] = 0x01; - cmdbuf[1] = 0x17; - return icom_set_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, 1, val); - - default: - return icom_set_level(rig, vfo, level, val); - } -} - -int ic7000_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) -{ - unsigned char cmdbuf[MAXFRAMELEN]; - - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - - switch (level) - { - case RIG_LEVEL_VOXDELAY: - cmdbuf[0] = 0x01; - cmdbuf[1] = 0x17; - return icom_get_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, val); - - default: - return icom_get_level(rig, vfo, level, val); - } -} diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 90917f4b..3602969f 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -897,7 +897,6 @@ const struct rig_caps ic705_caps = int ic7300_set_parm(RIG *rig, setting_t parm, value_t val) { unsigned char prmbuf[MAXFRAMELEN]; - int min, hr; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -971,8 +970,7 @@ int ic7300_set_parm(RIG *rig, setting_t parm, value_t val) } default: - rig_debug(RIG_DEBUG_ERR, "Unsupported set_parm %s\n", rig_strparm(parm)); - return -RIG_EINVAL; + return icom_set_parm(rig, parm, val); } } diff --git a/rigs/icom/ic7610.c b/rigs/icom/ic7610.c index 013cc935..8b0dcb1e 100644 --- a/rigs/icom/ic7610.c +++ b/rigs/icom/ic7610.c @@ -121,13 +121,18 @@ { 241, 30.0f } \ } } -int ic7610_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); -int ic7610_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); +struct cmdparams ic7610_extcmds[] = +{ + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x02, 0x92}, CMD_DAT_INT, 1 }, + { { 0 } } +}; + +int ic7610_ext_tokens[] = { + TOK_DRIVE_GAIN, TOK_DIGI_SEL_FUNC, TOK_DIGI_SEL_LEVEL, TOK_BACKEND_NONE +}; /* * IC-7610 rig capabilities. - * - * TODO: complete command set (esp. the $1A bunch!) and testing.. */ static const struct icom_priv_caps ic7610_priv_caps = { @@ -144,23 +149,7 @@ static const struct icom_priv_caps ic7610_priv_caps = { .level = RIG_AGC_SLOW, .icom_level = 3 }, { .level = -1, .icom_level = 0 }, }, -}; - -const struct confparams ic7610_ext_levels[] = -{ - { - TOK_DRIVE_GAIN, "drive_gain", "Drive gain", "Drive gain", - NULL, RIG_CONF_NUMERIC, { .n = { 0, 255, 1 } }, - }, - { - TOK_DIGI_SEL_FUNC, "digi_sel", "DIGI-SEL enable", "DIGI-SEL enable", - NULL, RIG_CONF_CHECKBUTTON, { }, - }, - { - TOK_DIGI_SEL_LEVEL, "digi_sel_level", "DIGI-SEL level", "DIGI-SEL level", - NULL, RIG_CONF_NUMERIC, { .n = { 0, 255, 1 } }, - }, - { RIG_CONF_END, NULL, } + .extcmds = ic7610_extcmds, }; const struct rig_caps ic7610_caps = @@ -198,7 +187,7 @@ const struct rig_caps ic7610_caps = [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 1 } }, }, .parm_gran = {}, - .extlevels = ic7610_ext_levels, + .ext_tokens = ic7610_ext_tokens, .ctcss_list = common_ctcss_list, .dcs_list = NULL, .preamp = { 10, 20, RIG_DBLST_END, }, /* FIXME: TBC */ @@ -308,8 +297,8 @@ const struct rig_caps ic7610_caps = .set_xit = icom_set_xit_new, .decode_event = icom_decode_event, - .set_level = ic7610_set_level, - .get_level = ic7610_get_level, + .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, @@ -338,39 +327,3 @@ const struct rig_caps ic7610_caps = .get_powerstat = icom_get_powerstat, .send_morse = icom_send_morse }; - -int ic7610_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) -{ - unsigned char cmdbuf[MAXFRAMELEN]; - - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - - switch (level) - { - case RIG_LEVEL_VOXDELAY: - cmdbuf[0] = 0x02; - cmdbuf[1] = 0x92; - return icom_set_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, 1, val); - - default: - return icom_set_level(rig, vfo, level, val); - } -} - -int ic7610_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) -{ - unsigned char cmdbuf[MAXFRAMELEN]; - - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - - switch (level) - { - case RIG_LEVEL_VOXDELAY: - cmdbuf[0] = 0x02; - cmdbuf[1] = 0x92; - return icom_get_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, val); - - default: - return icom_get_level(rig, vfo, level, val); - } -} diff --git a/rigs/icom/ic9100.c b/rigs/icom/ic9100.c index 61f36039..3ab05461 100644 --- a/rigs/icom/ic9100.c +++ b/rigs/icom/ic9100.c @@ -92,8 +92,12 @@ #define IC9100_HF_ANTS (RIG_ANT_1|RIG_ANT_2) -/* - */ +struct cmdparams ic9100_extcmds[] = +{ + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x27}, CMD_DAT_INT, 1 }, + { {.s = RIG_PARM_NONE} } +}; + static const struct icom_priv_caps ic9100_priv_caps = { 0x7c, /* default address */ @@ -102,6 +106,7 @@ static const struct icom_priv_caps ic9100_priv_caps = ic910_ts_sc_list, /* FIXME */ .antack_len = 2, .ant_count = 2, + .extcmds = ic9100_extcmds, }; const struct rig_caps ic9100_caps = @@ -279,45 +284,3 @@ const struct rig_caps ic9100_caps = .get_split_mode = icom_get_split_mode, }; - -#ifdef XXREMOVEDXX -// Not referenced anywhere -int ic9100_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) -{ - unsigned char cmdbuf[MAXFRAMELEN]; - - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - - switch (level) - { - case RIG_LEVEL_VOXDELAY: - cmdbuf[0] = 0x01; - cmdbuf[1] = 0x27; - return icom_set_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, 1, val); - - default: - return icom_set_level(rig, vfo, level, val); - } -} -#endif - -#ifdef XXREMOVEDXX -// Not referenced anywhere -int ic9100_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) -{ - unsigned char cmdbuf[MAXFRAMELEN]; - - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - - switch (level) - { - case RIG_LEVEL_VOXDELAY: - cmdbuf[0] = 0x01; - cmdbuf[1] = 0x27; - return icom_get_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, val); - - default: - return icom_get_level(rig, vfo, level, val); - } -} -#endif diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index d4783dd7..df5b4a59 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -486,9 +486,9 @@ const struct cmdparams icom_ext_cmd[] = { {.t = TOK_DSTAR_MY_CS}, CMD_PARAM_TYPE_TOKEN, C_CTL_DVT, S_DVT_DSMYCS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 12 }, { {.t = TOK_DSTAR_TX_CS}, CMD_PARAM_TYPE_TOKEN, C_CTL_DVT, S_DVT_DSTXCS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 24 }, { {.t = TOK_DSTAR_TX_MESS}, CMD_PARAM_TYPE_TOKEN, C_CTL_DVT, S_DVT_DSTXMS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 20 }, - { {.t = TOK_DRIVE_GAIN}, CMD_PARAM_TYPE_TOKEN, C_CTL_LVL, S_LVL_DRIVE, SC_MOD_RW, 1, {0}, CMD_DAT_FLT, 2 }, - { {.t = TOK_DIGI_SEL_FUNC}, CMD_PARAM_TYPE_TOKEN, C_CTL_FUNC, S_FUNC_DIGISEL, SC_MOD_RW, 1, {0}, CMD_DAT_BOL, 1 }, - { {.t = TOK_DIGI_SEL_LEVEL}, CMD_PARAM_TYPE_TOKEN, C_CTL_LVL, S_LVL_DIGI, SC_MOD_RW, 1, {0}, CMD_DAT_FLT, 2 }, + { {.t = TOK_DRIVE_GAIN}, CMD_PARAM_TYPE_TOKEN, C_CTL_LVL, S_LVL_DRIVE, SC_MOD_RW, 0, {0}, CMD_DAT_FLT, 2 }, + { {.t = TOK_DIGI_SEL_FUNC}, CMD_PARAM_TYPE_TOKEN, C_CTL_FUNC, S_FUNC_DIGISEL, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, + { {.t = TOK_DIGI_SEL_LEVEL}, CMD_PARAM_TYPE_TOKEN, C_CTL_LVL, S_LVL_DIGI, SC_MOD_RW, 0, {0}, CMD_DAT_FLT, 2 }, { {.t = TOK_SCOPE_DAT}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_DAT, SC_MOD_RD, 0, {0}, CMD_DAT_BUF, 481 }, { {.t = TOK_SCOPE_STS}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_STS, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, { {.t = TOK_SCOPE_DOP}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_DOP, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, @@ -2209,11 +2209,11 @@ int icom_set_cmd(RIG *rig, vfo_t vfo, struct cmdparams *par, value_t val) break; case CMD_DAT_FLT: - to_bcd_be(&cmdbuf[cmdlen], (int) val.f, (cmdlen * 2)); + to_bcd_be(&cmdbuf[cmdlen], (int) val.f, (par->datlen * 2)); break; case CMD_DAT_LVL: - to_bcd_be(&cmdbuf[cmdlen], (int)(val.f * 255.0), (cmdlen * 2)); + to_bcd_be(&cmdbuf[cmdlen], (int)(val.f * 255.0), (par->datlen * 2)); break; case CMD_DAT_TIM: // returned as seconds since midnight @@ -5598,13 +5598,13 @@ int icom_set_parm(RIG *rig, setting_t parm, value_t val) int i; const struct icom_priv_caps *priv = rig->caps->priv; - const struct cmdparams *cmd = priv->extcmds; + const struct cmdparams *extcmds = priv->extcmds; - for (i = 0; cmd && cmd[i].id.s != 0; i++) + for (i = 0; extcmds && extcmds[i].id.s != 0; i++) { - if (cmd[i].cmdparamtype == CMD_PARAM_TYPE_PARM && cmd[i].id.s == parm) + if (extcmds[i].cmdparamtype == CMD_PARAM_TYPE_PARM && extcmds[i].id.s == parm) { - return icom_set_cmd(rig, RIG_VFO_NONE, (struct cmdparams *)&cmd[i], val); + return icom_set_cmd(rig, RIG_VFO_NONE, (struct cmdparams *)&extcmds[i], val); } } diff --git a/src/settings.c b/src/settings.c index c0861f91..77aa4c18 100644 --- a/src/settings.c +++ b/src/settings.c @@ -787,7 +787,7 @@ int HAMLIB_API rig_set_ext_func(RIG *rig, caps = rig->caps; - if (caps->set_ext_level == NULL) + if (caps->set_ext_func == NULL) { return -RIG_ENAVAIL; } commit 7c4f0d025dfd95c6f24c44bbee320d751e618450 Merge: 23971f8e 24b596c5 Author: Mikael Nousiainen <mik...@ik...> Date: Wed Sep 16 22:31:30 2020 +0300 Merge branch 'master' into icom-extcmds-fixes-1 commit 24b596c52b8b644ecbaf64ec25fd103c86d8a8b6 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Sep 16 14:24:52 2020 -0500 Add MICGAIN to ts590 LEVEL set diff --git a/rigs/kenwood/ts590.c b/rigs/kenwood/ts590.c index 0149a190..e037c426 100644 --- a/rigs/kenwood/ts590.c +++ b/rigs/kenwood/ts590.c @@ -43,7 +43,8 @@ int ts590_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); #define TS590_LEVEL_ALL (RIG_LEVEL_RFPOWER|RIG_LEVEL_AF|RIG_LEVEL_RF|\ RIG_LEVEL_CWPITCH|RIG_LEVEL_METER|RIG_LEVEL_SWR|RIG_LEVEL_ALC|\ - RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|RIG_LEVEL_KEYSPD) + RIG_LEVEL_SQL|RIG_LEVEL_AGC|RIG_LEVEL_RAWSTR|RIG_LEVEL_STRENGTH|\ + RIG_LEVEL_MICGAIN|RIG_LEVEL_KEYSPD) #define TS590_FUNC_ALL (RIG_FUNC_LOCK|RIG_FUNC_AIP|RIG_FUNC_TONE|\ RIG_FUNC_NB|RIG_FUNC_COMP|RIG_FUNC_VOX|RIG_FUNC_NR|RIG_FUNC_NR|RIG_FUNC_BC) commit 37311b50353f513598283da3c725332060fcabaa Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Sep 16 13:03:05 2020 -0500 Add MICGAIN to ts590.c diff --git a/rigs/kenwood/ts590.c b/rigs/kenwood/ts590.c index ee29280f..0149a190 100644 --- a/rigs/kenwood/ts590.c +++ b/rigs/kenwood/ts590.c @@ -479,6 +479,7 @@ int ts590_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_RFPOWER: case RIG_LEVEL_RF: case RIG_LEVEL_AF: + case RIG_LEVEL_MICGAIN: return kenwood_get_level(rig, vfo, level, val); commit 3c4bc6dbb19b11f5e2418ccb7c80fd60756a6e8d Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Sep 16 12:42:14 2020 -0500 Fix ts590 LEVEL_AF diff --git a/rigs/kenwood/ts590.c b/rigs/kenwood/ts590.c index 64f2b088..ee29280f 100644 --- a/rigs/kenwood/ts590.c +++ b/rigs/kenwood/ts590.c @@ -478,10 +478,9 @@ int ts590_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_CWPITCH: case RIG_LEVEL_RFPOWER: case RIG_LEVEL_RF: + case RIG_LEVEL_AF: return kenwood_get_level(rig, vfo, level, val); - case RIG_LEVEL_AF: - return get_kenwood_level(rig, "AG0", &val->f); case RIG_LEVEL_METER: retval = kenwood_transaction(rig, "RM0", lvlbuf, sizeof(lvlbuf)); commit 85981ed689b3b4d5068e8f142bd0dafc6d298373 Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Sep 16 11:22:06 2020 -0500 Fix kenwood.c LEVEL_AF format 2 command diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 0e3b47df..a53eb569 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -2587,7 +2587,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) } else { - err = kenwood_transaction(rig, "AG1", buffer, sizeof(buffer)); + err = kenwood_transaction(rig, "AG0", buffer, sizeof(buffer)); if (err == RIG_OK) { commit 52ec755f198f42f8dcfea4fe90e11d27a4f9f4af Merge: 2f143aa8 d817aefa Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Sep 16 10:44:08 2020 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 2f143aa8991f42f6b265d34217642bc8350ef09d Author: Michael Black W9MDB <mdb...@ya...> Date: Wed Sep 16 10:41:24 2020 -0500 Make kenwood AG format determination automatically on first get_level call There are 3 formats supported, "AG" "AG0" and "AG0"/"AG1" This should work until Kenwood comes up with "AG2" or such https://github.com/Hamlib/Hamlib/issues/380 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 09f4788d..0e3b47df 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -703,6 +703,8 @@ int kenwood_init(RIG *rig) caps->if_len = 37; } + priv->ag_format = -1; // force determination of AG format + rig_debug(RIG_DEBUG_TRACE, "%s: if_len = %d\n", __func__, caps->if_len); return RIG_OK; @@ -811,9 +813,9 @@ int kenwood_open(RIG *rig) if (!RIG_IS_XG3 && -RIG_ETIMEOUT == err) { + char buffer[KENWOOD_MAX_BUF_LEN]; /* Some Kenwood emulations have no ID command response :( * Try an FA command to see if anyone is listening */ - char buffer[KENWOOD_MAX_BUF_LEN]; err = kenwood_transaction(rig, "FA", buffer, sizeof(buffer)); if (RIG_OK != err) @@ -2181,6 +2183,7 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { char levelbuf[16]; int i, kenwood_val; + struct kenwood_priv_data *priv = rig->state.priv; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -2208,11 +2211,31 @@ int kenwood_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) case RIG_LEVEL_AF: { + int vfo_set = vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN ? 0 : 1; + // some rigs only recognize 0 for vfo_set - // hopefully they are asking for VFOA or Main otherwise this might not work // https://github.com/Hamlib/Hamlib/issues/304 - int vfo_set = vfo == RIG_VFO_A || vfo == RIG_VFO_MAIN ? 0 : 1; - snprintf(levelbuf, sizeof(levelbuf), "AG%1d%03d", vfo_set, kenwood_val); + // This is now fixed for all rigs + // https://github.com/Hamlib/Hamlib/issues/380 + // ag_format is determined in kenwood_get_level + switch (priv->ag_format) + { + case 1: + snprintf(levelbuf, sizeof(levelbuf), "AG%03d", kenwood_val); + break; + + case 2: + snprintf(levelbuf, sizeof(levelbuf), "AG0%03d", kenwood_val); + break; + + case 3: + snprintf(levelbuf, sizeof(levelbuf), "AG%d%03d", vfo_set, kenwood_val); + break; + + default: + rig_debug(RIG_DEBUG_ERR, "%s: Unknown ag_format=%d\n", __func__, + priv->ag_format); + } } break; @@ -2376,6 +2399,7 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) int retval; int lvl; int i, ret, agclevel, len; + struct kenwood_priv_data *priv = rig->state.priv; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -2533,7 +2557,83 @@ int kenwood_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return ret; case RIG_LEVEL_AF: - return get_kenwood_level(rig, "AG", &val->f); + + // first time through we'll determine the AG format + // Can be "AG" "AG0" or "AG0/1" + // This could be done by rig but easy enough to make it automagic + if (priv->ag_format < 0) + { + rig_debug(RIG_DEBUG_TRACE, "%s: AF format check determination...\n", __func__); + // Determine AG format + // =-1 == Undetermine + // 0 == Unknown + // 1 == AG + // 2 == AG0 (fixed VFO) + // 3 == AG0/1 (with VFO arg) + char buffer[KENWOOD_MAX_BUF_LEN]; + int err = kenwood_transaction(rig, "AG", buffer, sizeof(buffer)); + + if (err == RIG_OK) + { + priv->ag_format = 1; + } + else + { + err = kenwood_transaction(rig, "AG1", buffer, sizeof(buffer)); + + if (err == RIG_OK) + { + priv->ag_format = 3; + } + else + { + err = kenwood_transaction(rig, "AG1", buffer, sizeof(buffer)); + + if (err == RIG_OK) + { + priv->ag_format = 2; + } + else + { + priv->ag_format = 0; // rats....can't figure it out + } + } + } + } + + rig_debug(RIG_DEBUG_TRACE, "%s: ag_format=%d\n", __func__, priv->ag_format); + + if (priv->ag_format == 0) + { + priv->ag_format = -1; // we'll keep trying next time + rig_debug(RIG_DEBUG_WARN, "%s: Unable to set AG format?\n", __func__); + return RIG_OK; // this is non-fatal for now + } + + switch (priv->ag_format) + { + case 0: + priv->ag_format = -1; // reset to try again + return RIG_OK; + break; + + case 1: + return get_kenwood_level(rig, "AG", &val->f); + break; + + case 2: + return get_kenwood_level(rig, "AG0", &val->f); + break; + + case 3: + return get_kenwood_level(rig, vfo == RIG_VFO_MAIN ? "AG0" : "AG1", &val->f); + break; + + default: + rig_debug(RIG_DEBUG_WARN, "%s: Invalid ag_format=%d?\n", __func__, + priv->ag_format); + return -RIG_EPROTO; + } case RIG_LEVEL_RF: return get_kenwood_level(rig, "RG", &val->f); diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index e6497802..9949279c 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -27,7 +27,7 @@ #include <string.h> #include "token.h" -#define BACKEND_VER "20200901" +#define BACKEND_VER "20200916" #define EOM_KEN ';' #define EOM_TH '\r' @@ -125,6 +125,7 @@ struct kenwood_priv_data char last_if_response[KENWOOD_MAX_BUF_LEN]; int poweron; /* to avoid powering on more than once */ int has_rit2; /* rig has set 2 rit command */ + int ag_format; /* which AG command is being used...see LEVEL_AF in kenwood.c*/ }; diff --git a/rigs/kenwood/pihpsdr.c b/rigs/kenwood/pihpsdr.c index 5c1b3838..3b69a69b 100644 --- a/rigs/kenwood/pihpsdr.c +++ b/rigs/kenwood/pihpsdr.c @@ -1033,25 +1033,7 @@ int pihpsdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_AF: - retval = kenwood_transaction(rig, "AG0", lvlbuf, sizeof(lvlbuf)); - - if (retval != RIG_OK) - { - return retval; - } - - lvl_len = strlen(lvlbuf); - - if (lvl_len != 6) - { - rig_debug(RIG_DEBUG_ERR, "%s: unexpected answer len=%d\n", __func__, - (int)lvl_len); - return -RIG_ERJCTED; - } - - sscanf(lvlbuf + 2, "%d", &lvl); - val->f = lvl / 255.0; - break; + return kenwood_get_level(rig, vfo, level, val); case RIG_LEVEL_RF: retval = kenwood_transaction(rig, "RG", lvlbuf, sizeof(lvlbuf)); diff --git a/rigs/kenwood/ts2000.c b/rigs/kenwood/ts2000.c index 2cef024c..f36b012b 100644 --- a/rigs/kenwood/ts2000.c +++ b/rigs/kenwood/ts2000.c @@ -910,25 +910,7 @@ int ts2000_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) break; case RIG_LEVEL_AF: - retval = kenwood_transaction(rig, "AG0", lvlbuf, sizeof(lvlbuf)); - - if (retval != RIG_OK) - { - return retval; - } - - lvl_len = strlen(lvlbuf); - - if (lvl_len != 6) - { - rig_debug(RIG_DEBUG_ERR, "%s: unexpected answer len=%d\n", __func__, - (int)lvl_len); - return -RIG_ERJCTED; - } - - sscanf(lvlbuf + 2, "%d", &lvl); - val->f = lvl / 255.0; - break; + return kenwood_get_level(rig, vfo, level, val); case RIG_LEVEL_RF: retval = kenwood_transaction(rig, "RG", lvlbuf, sizeof(lvlbuf)); diff --git a/rigs/kenwood/ts480.c b/rigs/kenwood/ts480.c index c3b9cf36..be13fc6d 100644 --- a/rigs/kenwood/ts480.c +++ b/rigs/kenwood/ts480.c @@ -116,18 +116,7 @@ kenwood_ts480_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) break; case RIG_LEVEL_AF: - kenwood_val = val.f * 255; /* possible values for TS480 are 000.. 255 */ - - if (rig->caps->rig_model == RIG_MODEL_TS890S) - { - sprintf(levelbuf, "AG%03d", kenwood_val); - } - else - { - sprintf(levelbuf, "AG0%03d", kenwood_val); - } - - break; + return kenwood_set_level(rig, vfo, level, val); case RIG_LEVEL_RF: if (rig->caps->rig_model == RIG_MODEL_TS890S) commit 23971f8e75907b13d67b4911448ca26fe5e1847c Author: Mikael Nousiainen <mik...@ik...> Date: Wed Sep 16 18:10:35 2020 +0300 Fix issues with Icom extcmds definitions, some ext_tokens missing. Refactor custom level implementations to use extcmds definitions. Print out extfuncs in caps dump. diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index b382f9d1..19b95b5a 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -2383,6 +2383,12 @@ rig_get_ext_parm HAMLIB_PARAMS((RIG *rig, value_t *val)); extern HAMLIB_EXPORT(int) +rig_ext_func_foreach HAMLIB_PARAMS((RIG *rig, + int (*cfunc)(RIG *, + const struct confparams *, + rig_ptr_t), + rig_ptr_t data)); +extern HAMLIB_EXPORT(int) rig_ext_level_foreach HAMLIB_PARAMS((RIG *rig, int (*cfunc)(RIG *, const struct confparams *, diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index a2c40c04..90917f4b 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -61,19 +61,6 @@ static int ic7300_get_parm(RIG *rig, setting_t parm, value_t *val); #define IC7300_ANTS (RIG_ANT_1) /* ant-1 is Hf-6m */ -struct cmdparams ic7300_extcmds[] = -{ - { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x23}, CMD_DAT_BOL, 1 }, - { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x81}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x95}, CMD_DAT_TIM, 2 }, - { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x59}, CMD_DAT_INT, 1 }, - { {.s = RIG_PARM_NONE} } -}; - -struct cmdparams ic7300_extlevels[] = -{ -}; - /* * IC-7300 S-meter levels measured from live signals on multiple bands. Provides a good approximation. */ @@ -153,15 +140,6 @@ struct cmdparams ic7300_extlevels[] = #define IC9700_ALL_TX_MODES (RIG_MODE_FM|RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_DSTAR|RIG_MODE_DD) #define IC9700_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_DSTAR|RIG_MODE_DD) -struct cmdparams ic9700_extcmds[] = -{ - { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x29}, CMD_DAT_BOL, 1 }, - { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x52}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_SCREENSAVER}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, CMD_DAT_INT, 1 }, - { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x30}, CMD_DAT_INT, 1 }, - { {0} } -}; - #define IC9700_STR_CAL { 7, \ { \ { 0, -54 }, \ @@ -216,6 +194,35 @@ struct cmdparams ic9700_extcmds[] = { 241, 20.0f } \ } } +struct cmdparams ic7300_extcmds[] = +{ + { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x23}, CMD_DAT_BOL, 1 }, + { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x81}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x95}, CMD_DAT_TIM, 2 }, + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x59}, CMD_DAT_INT, 1 }, + { {.s = RIG_PARM_NONE} } +}; + +struct cmdparams ic9700_extcmds[] = +{ + { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x29}, CMD_DAT_BOL, 1 }, + { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x52}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_SCREENSAVER}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, CMD_DAT_INT, 1 }, + { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x80}, CMD_DAT_TIM, 2 }, + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x30}, CMD_DAT_INT, 1 }, + { {0} } +}; + +struct cmdparams ic705_extcmds[] = +{ + { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x31}, CMD_DAT_BOL, 1 }, + { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x36}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_SCREENSAVER}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x38}, CMD_DAT_INT, 1 }, + { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x66}, CMD_DAT_TIM, 2 }, + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x59}, CMD_DAT_INT, 1 }, + { {0} } +}; + /* * IC-7300 rig capabilities. */ @@ -266,7 +273,7 @@ static const struct icom_priv_caps IC705_priv_caps = { .level = RIG_AGC_SLOW, .icom_level = 3 }, { .level = -1, .icom_level = 0 }, }, - .extcmds = ic7300_extcmds, /* Custom parameters */ + .extcmds = ic705_extcmds, /* Custom parameters */ }; const struct rig_caps ic7300_caps = @@ -391,7 +398,6 @@ const struct rig_caps ic7300_caps = .get_freq = icom_get_freq, .set_mode = icom_set_mode_with_data, .get_mode = icom_get_mode_with_data, -//.get_vfo = icom_get_vfo, .set_vfo = icom_set_vfo, .set_ant = NULL, .get_ant = NULL, @@ -640,7 +646,6 @@ const struct rig_caps ic9700_caps = .get_freq = icom_get_freq, .set_mode = icom_set_mode_with_data, .get_mode = icom_get_mode_with_data, -//.get_vfo = icom_get_vfo, .set_vfo = icom_set_vfo, .set_ant = NULL, .get_ant = NULL, @@ -841,7 +846,6 @@ const struct rig_caps ic705_caps = .get_freq = icom_get_freq, .set_mode = icom_set_mode_with_data, .get_mode = icom_get_mode_with_data, -//.get_vfo = icom_get_vfo, .set_vfo = icom_set_vfo, .set_ant = NULL, .get_ant = NULL, @@ -966,35 +970,6 @@ int ic7300_set_parm(RIG *rig, setting_t parm, value_t val) return -RIG_EINVAL; } - case RIG_PARM_TIME: - hr = (int)((float) val.i / 3600.0); - min = (int)((float)(val.i - (hr * 3600)) / 60.0); - - switch (rig->caps->rig_model) - { - case RIG_MODEL_IC7300: - prmbuf[0] = 0x00; - prmbuf[1] = 0x95; - break; - - case RIG_MODEL_IC9700: - prmbuf[0] = 0x01; - prmbuf[1] = 0x80; - break; - - case RIG_MODEL_IC705: - prmbuf[0] = 0x01; - prmbuf[1] = 0x66; - break; - - default: - return -RIG_ENIMPL; - } - - to_bcd_be(prmbuf + 2, (long long) hr, 2); - to_bcd_be(prmbuf + 3, (long long) min, 2); - return icom_set_raw(rig, C_CTL_MEM, S_MEM_PARM, 4, prmbuf, 0, 0); - default: rig_debug(RIG_DEBUG_ERR, "Unsupported set_parm %s\n", rig_strparm(parm)); return -RIG_EINVAL; @@ -1058,4 +1033,3 @@ int ic7300_get_parm(RIG *rig, setting_t parm, value_t *val) return RIG_OK; } - diff --git a/rigs/icom/ic7410.c b/rigs/icom/ic7410.c index 443fbf5c..e922ee08 100644 --- a/rigs/icom/ic7410.c +++ b/rigs/icom/ic7410.c @@ -85,8 +85,11 @@ { 213, 1.0f } \ } } -int ic7410_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); -int ic7410_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); +struct cmdparams ic7410_extcmds[] = +{ + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 1, {0x75 }, CMD_DAT_INT, 1 }, + { {0} } +}; /* * IC-7410 rig capabilities. @@ -240,8 +243,8 @@ const struct rig_caps ic7410_caps = .get_ant = icom_get_ant, .decode_event = icom_decode_event, - .set_level = ic7410_set_level, - .get_level = ic7410_get_level, + .set_level = icom_set_level, + .get_level = icom_get_level, .set_func = icom_set_func, .get_func = icom_get_func, .set_parm = icom_set_parm, @@ -271,37 +274,3 @@ const struct rig_caps ic7410_caps = .send_morse = icom_send_morse, }; - -int ic7410_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) -{ - unsigned char cmdbuf[MAXFRAMELEN]; - - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - - switch (level) - { - case RIG_LEVEL_VOXDELAY: - cmdbuf[0] = 0x75; - return icom_set_level_raw(rig, level, C_CTL_MEM, 0x05, 1, cmdbuf, 1, val); - - default: - return icom_set_level(rig, vfo, level, val); - } -} - -int ic7410_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) -{ - unsigned char cmdbuf[MAXFRAMELEN]; - - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - - switch (level) - { - case RIG_LEVEL_VOXDELAY: - cmdbuf[0] = 0x75; - return icom_get_level_raw(rig, level, C_CTL_MEM, 0x05, 1, cmdbuf, val); - - default: - return icom_get_level(rig, vfo, level, val); - } -} diff --git a/rigs/icom/ic7600.c b/rigs/icom/ic7600.c index 1b7add09..28ddd476 100644 --- a/rigs/icom/ic7600.c +++ b/rigs/icom/ic7600.c @@ -53,15 +53,6 @@ #define IC7600_ANTS (RIG_ANT_1|RIG_ANT_2) -struct cmdparams ic7600_extcmds[] = -{ - { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x59}, CMD_DAT_BOL, 1 }, - { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x38}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x54}, CMD_DAT_TIM, 2 }, - { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, CMD_DAT_INT, 1 }, - { {.s = RIG_PARM_NONE} } -}; - /* * Measurement by Roeland, PA3MET */ @@ -129,10 +120,21 @@ struct cmdparams ic7600_extcmds[] = { 241, 25.0f } \ } } +struct cmdparams ic7600_extcmds[] = +{ + { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x59}, CMD_DAT_BOL, 1 }, + { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x38}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x54}, CMD_DAT_TIM, 2 }, + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, CMD_DAT_INT, 1 }, + { { 0 } } +}; + +int ic7600_ext_tokens[] = { + TOK_DRIVE_GAIN, TOK_BACKEND_NONE +}; + /* * IC-7600 rig capabilities. - * - * TODO: complete command set (esp. the $1A bunch!) and testing.. */ static const struct icom_priv_caps ic7600_priv_caps = { @@ -152,15 +154,6 @@ static const struct icom_priv_caps ic7600_priv_caps = .extcmds = ic7600_extcmds, /* Custom op parameters */ }; -const struct confparams ic7600_ext_levels[] = -{ - { - TOK_DRIVE_GAIN, "drive_gain", "Drive gain", "Drive gain", - NULL, RIG_CONF_NUMERIC, { .n = { 0, 255, 1 } }, - }, - { RIG_CONF_END, NULL, } -}; - const struct rig_caps ic7600_caps = { RIG_MODEL(RIG_MODEL_IC7600), @@ -196,7 +189,10 @@ const struct rig_caps ic7600_caps = [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 1 } }, }, .parm_gran = {}, - .extlevels = ic7600_ext_levels, + .ext_tokens = ic7600_ext_tokens, + .extfuncs = icom_ext_funcs, + .extlevels = icom_ext_levels, + .extparms = icom_ext_parms, .ctcss_list = common_ctcss_list, .dcs_list = NULL, .preamp = { 10, 20, RIG_DBLST_END, }, /* FIXME: TBC */ diff --git a/rigs/icom/ic7700.c b/rigs/icom/ic7700.c index cd574d5d..f8c9fa9d 100644 --- a/rigs/icom/ic7700.c +++ b/rigs/icom/ic7700.c @@ -105,13 +105,18 @@ { 241, 15.0f } \ } } -int ic7700_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); -int ic7700_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); +struct cmdparams ic7700_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 ic7700_ext_tokens[] = { + TOK_DRIVE_GAIN, TOK_DIGI_SEL_FUNC, TOK_DIGI_SEL_LEVEL, TOK_BACKEND_NONE +}; /* * IC-7700 rig capabilities. - * - * TODO: complete command set (esp. the $1A bunch!) and testing.. */ static const struct icom_priv_caps ic7700_priv_caps = { @@ -129,23 +134,7 @@ static const struct icom_priv_caps ic7700_priv_caps = { .level = RIG_AGC_SLOW, .icom_level = 3 }, { .level = -1, .icom_level = 0 }, }, -}; - -const struct confparams ic7700_ext_levels[] = -{ - { - TOK_DRIVE_GAIN, "drive_gain", "Drive gain", "Drive gain", - NULL, RIG_CONF_NUMERIC, { .n = { 0, 255, 1 } }, - }, - { - TOK_DIGI_SEL_FUNC, "digi_sel", "DIGI-SEL enable", "DIGI-SEL enable", - NULL, RIG_CONF_CHECKBUTTON, { }, - }, - { - TOK_DIGI_SEL_LEVEL, "digi_sel_level", "DIGI-SEL level", "DIGI-SEL level", - NULL, RIG_CONF_NUMERIC, { .n = { 0, 255, 1 } }, - }, - { RIG_CONF_END, NULL, } + .extcmds = ic7700_extcmds, }; const struct rig_caps ic7700_caps = @@ -183,7 +172,7 @@ const struct rig_caps ic7700_caps = [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 1 } }, }, .parm_gran = {}, - .extlevels = ic7700_ext_levels, + .ext_tokens = ic7700_ext_tokens, .ctcss_list = common_ctcss_list, .dcs_list = NULL, .preamp = { 10, 20, RIG_DBLST_END, }, /* FIXME: TBC */ @@ -293,8 +282,8 @@ const struct rig_caps ic7700_caps = .set_xit = icom_set_xit_new, .decode_event = icom_decode_event, - .set_level = ic7700_set_level, - .get_level = ic7700_get_level, + .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, @@ -323,39 +312,3 @@ const struct rig_caps ic7700_caps = .get_powerstat = icom_get_powerstat, .send_morse = icom_send_morse }; - -int ic7700_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) -{ - unsigned char cmdbuf[MAXFRAMELEN]; - - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - - switch (level) - { - case RIG_LEVEL_VOXDELAY: - cmdbuf[0] = 0x01; - cmdbuf[1] = 0x82; - return icom_set_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, 1, val); - - default: - return icom_set_level(rig, vfo, level, val); - } -} - -int ic7700_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) -{ - unsigned char cmdbuf[MAXFRAMELEN]; - - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - - switch (level) - { - case RIG_LEVEL_VOXDELAY: - cmdbuf[0] = 0x01; - cmdbuf[1] = 0x82; - return icom_get_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, val); - - default: - return icom_get_level(rig, vfo, level, val); - } -} diff --git a/rigs/icom/ic7800.c b/rigs/icom/ic7800.c index 046d87f2..be9d82e3 100644 --- a/rigs/icom/ic7800.c +++ b/rigs/icom/ic7800.c @@ -108,10 +108,18 @@ int ic7800_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); int ic7800_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); +struct cmdparams ic7800_extcmds[] = +{ + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x83}, CMD_DAT_INT, 1 }, + { { 0 } } +}; + +int ic7800_ext_tokens[] = { + TOK_DRIVE_GAIN, TOK_DIGI_SEL_FUNC, TOK_DIGI_SEL_LEVEL, TOK_BACKEND_NONE +}; + /* * IC-7800 rig capabilities. - * - * TODO: complete command set (esp. the $1A bunch!) and testing.. */ static const struct icom_priv_caps ic7800_priv_caps = { @@ -129,23 +137,7 @@ static const struct icom_priv_caps ic7800_priv_caps = { .level = RIG_AGC_SLOW, .icom_level = 3 }, { .level = -1, .icom_level = 0 }, }, -}; - -const struct confparams ic7800_ext_levels[] = -{ - { - TOK_DRIVE_GAIN, "drive_gain", "Drive gain", "Drive gain", - NULL, RIG_CONF_NUMERIC, { .n = { 0, 255, 1 } }, - }, - { - TOK_DIGI_SEL_FUNC, "digi_sel", "DIGI-SEL enable", "DIGI-SEL enable", - NULL, RIG_CONF_CHECKBUTTON, { }, - }, - { - TOK_DIGI_SEL_LEVEL, "digi_sel_level", "DIGI-SEL level", "DIGI-SEL level", - NULL, RIG_CONF_NUMERIC, { .n = { 0, 255, 1 } }, - }, - { RIG_CONF_END, NULL, } + .extcmds = ic7800_extcmds, }; const struct rig_caps ic7800_caps = @@ -183,7 +175,7 @@ const struct rig_caps ic7800_caps = [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 1 } }, }, .parm_gran = {}, - .extlevels = ic7800_ext_levels, + .ext_tokens = ic7800_ext_tokens, .ctcss_list = common_ctcss_list, .dcs_list = NULL, .preamp = { 10, 20, RIG_DBLST_END, }, /* FIXME: TBC */ @@ -331,8 +323,6 @@ const struct rig_caps ic7800_caps = */ int ic7800_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { - unsigned char cmdbuf[MAXFRAMELEN]; - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); switch (level) @@ -356,12 +346,6 @@ int ic7800_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } return icom_set_level(rig, vfo, level, val); - - case RIG_LEVEL_VOXDELAY: - cmdbuf[0] = 0x01; - cmdbuf[1] = 0x83; - return icom_set_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, 1, val); - default: return icom_set_level(rig, vfo, level, val); } @@ -372,7 +356,6 @@ int ic7800_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) */ int ic7800_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { - unsigned char cmdbuf[MAXFRAMELEN]; int retval; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); @@ -394,14 +377,7 @@ int ic7800_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { val->i = rig->state.attenuator[val->i - 1]; } - break; - - case RIG_LEVEL_VOXDELAY: - cmdbuf[0] = 0x01; - cmdbuf[1] = 0x83; - return icom_get_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, val); - default: return icom_get_level(rig, vfo, level, val); } diff --git a/rigs/icom/ic785x.c b/rigs/icom/ic785x.c index bf7988ab..70bf71c7 100644 --- a/rigs/icom/ic785x.c +++ b/rigs/icom/ic785x.c @@ -113,10 +113,19 @@ extern int ic7800_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); int ic785x_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); int ic785x_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); +struct cmdparams ic785x_extcmds[] = +{ + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x09}, CMD_DAT_INT, 1 }, + { { 0 } } +}; + + +int ic785x_ext_tokens[] = { + TOK_DRIVE_GAIN, TOK_DIGI_SEL_FUNC, TOK_DIGI_SEL_LEVEL, TOK_BACKEND_NONE +}; + /* * IC-785x rig capabilities. - * - * TODO: complete command set (esp. the $1A bunch!) and testing.. */ static struct icom_priv_caps ic785x_priv_caps = { @@ -134,23 +143,7 @@ static struct icom_priv_caps ic785x_priv_caps = { .level = RIG_AGC_SLOW, .icom_level = 3 }, { .level = -1, .icom_level = 0 }, }, -}; - -const struct confparams ic785x_ext_levels[] = -{ - { - TOK_DRIVE_GAIN, "drive_gain", "Drive gain", "Drive gain", - NULL, RIG_CONF_NUMERIC, { .n = { 0, 255, 1 } }, - }, - { - TOK_DIGI_SEL_FUNC, "digi_sel", "DIGI-SEL enable", "DIGI-SEL enable", - NULL, RIG_CONF_CHECKBUTTON, { }, - }, - { - TOK_DIGI_SEL_LEVEL, "digi_sel_level", "DIGI-SEL level", "DIGI-SEL level", - NULL, RIG_CONF_NUMERIC, { .n = { 0, 255, 1 } }, - }, - { RIG_CONF_END, NULL, } + .extcmds = ic785x_extcmds, }; const struct rig_caps ic785x_caps = @@ -188,7 +181,7 @@ const struct rig_caps ic785x_caps = [LVL_CWPITCH] = { .min = { .i = 300 }, .max = { .i = 900 }, .step = { .i = 1 } }, }, .parm_gran = {}, - .extlevels = ic785x_ext_levels, + .ext_tokens = ic785x_ext_tokens, .ctcss_list = common_ctcss_list, .dcs_list = NULL, .preamp = { 10, 20, RIG_DBLST_END, }, /* FIXME: TBC */ @@ -332,36 +325,10 @@ const struct rig_caps ic785x_caps = int ic785x_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) { - unsigned char cmdbuf[MAXFRAMELEN]; - - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - - switch (level) - { - case RIG_LEVEL_VOXDELAY: - cmdbuf[0] = 0x03; - cmdbuf[1] = 0x09; - return icom_set_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, 1, val); - - default: - return ic7800_set_level(rig, vfo, level, val); - } + return ic7800_set_level(rig, vfo, level, val); } int ic785x_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { - unsigned char cmdbuf[MAXFRAMELEN]; - - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - - switch (level) - { - case RIG_LEVEL_VOXDELAY: - cmdbuf[0] = 0x03; - cmdbuf[1] = 0x09; - return icom_get_level_raw(rig, level, C_CTL_MEM, 0x05, 2, cmdbuf, val); - - default: - return ic7800_get_level(rig, vfo, level, val); - } + return ic7800_get_level(rig, vfo, level, val); } diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 0cad1438..d4783dd7 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -422,7 +422,8 @@ const struct confparams icom_cfg_params[] = */ const struct confparams icom_ext_funcs[] = { - {} + { TOK_DIGI_SEL_FUNC, "digi_sel", "DIGI-SEL enable", "", "", RIG_CONF_CHECKBUTTON, {} }, + { RIG_CONF_END, NULL, } }; ... [truncated message content] |
From: Nate B. <n0...@us...> - 2020-09-15 16:40: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, Hamlib-4.0 has been updated via b1a5fc3a2ca2a6e0b7d60ecba318da39ff951f3c (commit) via eeeb41ac4d88a6044b9b63a96a20a6b99f6fa526 (commit) via 6da8958787f110ec51eeb63dd4918b9662992ee9 (commit) via 39c8d186ef0a7eaa07a9c56d3978d5680f824f07 (commit) via 28fa1835dc04e7c34aa089df5ec6d8868d9c5e4a (commit) via 05dd3e80157686bcde4690fb9524a679abd04943 (commit) via bbc5e307d0b6c0f754bb7f991c04240a0097ac75 (commit) via 03a856642630bf64e4f6f49ae96fa06d061c9b44 (commit) via 57704aacf952102269afb7684d4444b5a141da02 (commit) via 5c906771038568f034ef82eea1a8e9fb42fc079c (commit) via a3caf7e400eb194234ffffb60e7a616d1b3f3f53 (commit) via b396d60921bd92584a5cd94eb4fcb16fc72b10f4 (commit) via aa352d1d14362d9392074e531aa81e305ca6dde3 (commit) via d519f2a596a56ca7576604cb93280b5811efe8f6 (commit) from 8120c068ec845f12bdb0e1c62a02837344587f03 (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 b1a5fc3a2ca2a6e0b7d60ecba318da39ff951f3c Author: Nate Bargmann <n0...@n0...> Date: Tue Sep 15 10:58:17 2020 -0500 Removed TODO from Makefile.am With the TODO file removed, 'make dist' was failing. (cherry picked from commit d817aefa3602f78ea2fa5d77bb69650107177ad1) diff --git a/Makefile.am b/Makefile.am index b5ebaaf5..0e6c93f2 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 TODO LICENSE hamlib.m4 hamlib.pc.in README.developer \ +EXTRA_DIST = PLAN LICENSE hamlib.m4 hamlib.pc.in README.developer \ README.betatester README.win32 Android.mk doc_DATA = ChangeLog COPYING COPYING.LIB LICENSE \ commit eeeb41ac4d88a6044b9b63a96a20a6b99f6fa526 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Sep 14 23:12:35 2020 -0500 astyle files (cherry picked from commit b97d05369cb4a8f27780837af8af99530c0665e0) diff --git a/lib/termios.c b/lib/termios.c index eb27729b..887b2ff6 100644 --- a/lib/termios.c +++ b/lib/termios.c @@ -828,7 +828,7 @@ int win32_serial_close(int fd) if ( index->filename ) free( index->filename ); */ free(index); - + LEAVE("serial_close"); return 0; @@ -2496,6 +2496,7 @@ int tcgetattr(int fd, struct termios *s_termios) myDCB.fParity = 1; #if 0 // redundant + if (myDCB.fParity) { #endif @@ -2524,12 +2525,14 @@ int tcgetattr(int fd, struct termios *s_termios) { s_termios->c_cflag &= ~(PARODD | CMSPAR | PARENB); } + #if 0 // see redundant above } else { s_termios->c_cflag &= ~PARENB; } + #endif /* CSIZE */ diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 658099cc..a2c40c04 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -324,9 +324,9 @@ const struct rig_caps ic7300_caps = RIG_CHAN_END, }, - .rx_range_list1 = { - {kHz(30), MHz(74.8), IC7300_ALL_RX_MODES, -1, -1, IC7300_VFOS}, RIG_FRNG_END, - }, + .rx_range_list1 = { + {kHz(30), MHz(74.8), IC7300_ALL_RX_MODES, -1, -1, IC7300_VFOS}, RIG_FRNG_END, + }, .tx_range_list1 = { FRQ_RNG_HF(1, IC7300_OTHER_TX_MODES, W(2), W(100), IC7300_VFOS, RIG_ANT_1), FRQ_RNG_60m(1, IC7300_OTHER_TX_MODES, W(2), W(100), IC7300_VFOS, RIG_ANT_1), @@ -741,46 +741,46 @@ const struct rig_caps ic705_caps = RIG_CHAN_END, }, - .rx_range_list1 = { + .rx_range_list1 = { {kHz(30), MHz(199.999999), IC705_ALL_RX_MODES, -1, -1, IC7300_VFOS, RIG_ANT_1, "USA"}, {MHz(400), MHz(470), IC705_ALL_RX_MODES, -1, -1, IC7300_VFOS, RIG_ANT_1, "USA"}, - RIG_FRNG_END, + RIG_FRNG_END, }, .tx_range_list1 = { - { kHz(1800), MHz(1.999999),IC705_ALL_TX_MODES, W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(3.5), MHz(3.999999),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(5.255), MHz(5.405),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(7.0), MHz(7.3),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(10.1), MHz(10.15),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(14.0), MHz(14.35),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(18.068), MHz(18.168),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(21.00), MHz(21.45),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(24.89), MHz(24.99),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(28.00), MHz(29.70),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(50.00), MHz(54.00),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(144.00), MHz(148.00),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(430.00), MHz(450.00),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, + { kHz(1800), MHz(1.999999), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(3.5), MHz(3.999999), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(5.255), MHz(5.405), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(7.0), MHz(7.3), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(10.1), MHz(10.15), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(14.0), MHz(14.35), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(18.068), MHz(18.168), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(21.00), MHz(21.45), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(24.89), MHz(24.99), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(28.00), MHz(29.70), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(50.00), MHz(54.00), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(144.00), MHz(148.00), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(430.00), MHz(450.00), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, RIG_FRNG_END, }, - .rx_range_list2 = { + .rx_range_list2 = { {kHz(30), MHz(199.999999), IC705_ALL_RX_MODES, -1, -1, IC7300_VFOS, RIG_ANT_1, "EUR"}, {MHz(400), MHz(470), IC705_ALL_RX_MODES, -1, -1, IC7300_VFOS, RIG_ANT_1, "EUR"}, - RIG_FRNG_END, + RIG_FRNG_END, }, .tx_range_list2 = { - { kHz(1810), MHz(1.999999),IC705_ALL_TX_MODES, W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, - { MHz(3.5), MHz(3.8),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, - { MHz(7.0), MHz(7.2),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, - { MHz(10.1), MHz(10.15),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, - { MHz(14.0), MHz(14.35),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, - { MHz(18.068), MHz(18.168),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, - { MHz(21.00), MHz(21.45),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, - { MHz(24.89), MHz(24.99),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, - { MHz(28.00), MHz(29.70),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, - { MHz(50.00), MHz(52.00),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, - { MHz(144.00), MHz(146.00),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, - { MHz(430.00), MHz(440.00),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, + { kHz(1810), MHz(1.999999), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, + { MHz(3.5), MHz(3.8), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, + { MHz(7.0), MHz(7.2), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, + { MHz(10.1), MHz(10.15), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, + { MHz(14.0), MHz(14.35), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, + { MHz(18.068), MHz(18.168), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, + { MHz(21.00), MHz(21.45), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, + { MHz(24.89), MHz(24.99), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, + { MHz(28.00), MHz(29.70), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, + { MHz(50.00), MHz(52.00), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, + { MHz(144.00), MHz(146.00), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, + { MHz(430.00), MHz(440.00), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, RIG_FRNG_END, }, @@ -936,19 +936,24 @@ int ic7300_set_parm(RIG *rig, setting_t parm, value_t val) { prmbuf[0] = 0x1a; prmbuf[1] = 0x05; - switch (rig->caps->rig_model) { + + switch (rig->caps->rig_model) + { case RIG_MODEL_IC7300: prmbuf[2] = 0x00; prmbuf[3] = 0x39; break; + case RIG_MODEL_IC9700: prmbuf[2] = 0x01; prmbuf[3] = 0x77; break; + case RIG_MODEL_IC705: prmbuf[2] = 0x00; prmbuf[3] = 0x53; break; + default: return -RIG_ENIMPL; } @@ -965,22 +970,27 @@ int ic7300_set_parm(RIG *rig, setting_t parm, value_t val) hr = (int)((float) val.i / 3600.0); min = (int)((float)(val.i - (hr * 3600)) / 60.0); - switch (rig->caps->rig_model) { + switch (rig->caps->rig_model) + { case RIG_MODEL_IC7300: prmbuf[0] = 0x00; prmbuf[1] = 0x95; break; + case RIG_MODEL_IC9700: prmbuf[0] = 0x01; prmbuf[1] = 0x80; break; + case RIG_MODEL_IC705: prmbuf[0] = 0x01; prmbuf[1] = 0x66; break; + default: return -RIG_ENIMPL; } + to_bcd_be(prmbuf + 2, (long long) hr, 2); to_bcd_be(prmbuf + 3, (long long) min, 2); return icom_set_raw(rig, C_CTL_MEM, S_MEM_PARM, 4, prmbuf, 0, 0); @@ -1008,8 +1018,9 @@ int ic7300_get_parm(RIG *rig, setting_t parm, value_t *val) return -RIG_ENIMPL; // How can we implement this? default: - rig_debug(RIG_DEBUG_TRACE, "%s: using icom routine for PARM=%s\n", __func__, rig_strparm(parm)); - return icom_get_parm(rig,parm,val); + rig_debug(RIG_DEBUG_TRACE, "%s: using icom routine for PARM=%s\n", __func__, + rig_strparm(parm)); + return icom_get_parm(rig, parm, val); } retval = icom_transaction(rig, prm_cn, prm_sc, prmbuf, prm_len, resbuf, @@ -1033,11 +1044,12 @@ int ic7300_get_parm(RIG *rig, setting_t parm, value_t *val) switch (parm) { - case RIG_PARM_ANN: + case RIG_PARM_ANN: rig_debug(RIG_DEBUG_WARN, "%s: not implemented\n", __func__); return -RIG_ENIMPL; + default: - return icom_get_parm(rig,parm,val); + return icom_get_parm(rig, parm, val); } diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 7207ac77..0cad1438 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2703,12 +2703,14 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) for (i = 0; cmd && cmd[i].id.s != 0; i++) { - rig_debug(RIG_DEBUG_TRACE, "%s: i=%d\n", __func__, i); + rig_debug(RIG_DEBUG_TRACE, "%s: i=%d\n", __func__, i); + if (cmd[i].cmdparamtype == CMD_PARAM_TYPE_LEVEL && cmd[i].id.s == level) { return icom_get_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val); } } + rig_debug(RIG_DEBUG_TRACE, "%s: no extcmd found\n", __func__); rs = &rig->state; @@ -3189,7 +3191,7 @@ int icom_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val) } else if (cfp[i].token == token) { - return icom_get_ext_cmd(rig, vfo, CMD_PARAM_TYPE_LEVEL, token, val); + return icom_get_ext_cmd(rig, vfo, CMD_PARAM_TYPE_LEVEL, token, val); } else { i++; } } @@ -3239,7 +3241,8 @@ int icom_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status) } else if (cfp[i].token == token) { - return icom_get_ext_cmd(rig, vfo, CMD_PARAM_TYPE_FUNC, token, (value_t *)status); + return icom_get_ext_cmd(rig, vfo, CMD_PARAM_TYPE_FUNC, token, + (value_t *)status); } else { i++; } } @@ -3297,7 +3300,8 @@ int icom_get_ext_parm(RIG *rig, token_t token, value_t *val) return -RIG_EINVAL; } -int icom_get_ext_cmd(RIG *rig, vfo_t vfo, cmd_param_t cmdparamtype, token_t token, value_t *val) +int icom_get_ext_cmd(RIG *rig, vfo_t vfo, cmd_param_t cmdparamtype, + token_t token, value_t *val) { int i; diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index 67959ac3..9ffcaf91 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -650,30 +650,40 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) switch (level) { - case RIG_LEVEL_RFPOWER_METER: - cmd = "ZZRM5"; - len = 5; - break; - default: - return kenwood_get_level(rig,vfo,level,val); + case RIG_LEVEL_RFPOWER_METER: + cmd = "ZZRM5"; + len = 5; + break; + + default: + return kenwood_get_level(rig, vfo, level, val); } + retval = kenwood_safe_transaction(rig, cmd, lvlbuf, 10, len + 3); + if (retval != RIG_OK) { return retval; } + int n; + switch (level) { - case RIG_LEVEL_RFPOWER_METER: - n = sscanf(lvlbuf + len, "%f", &val->f); - if (n != 1) { - rig_debug(RIG_DEBUG_ERR,"%s: Error parsing RFPOWER from lvlbuf='%s'\n",__func__,lvlbuf); - return -RIG_EPROTO; - } - val->f /= 100; - break; + case RIG_LEVEL_RFPOWER_METER: + n = sscanf(lvlbuf + len, "%f", &val->f); + + if (n != 1) + { + rig_debug(RIG_DEBUG_ERR, "%s: Error parsing RFPOWER from lvlbuf='%s'\n", + __func__, lvlbuf); + return -RIG_EPROTO; + } + + val->f /= 100; + break; } + return RIG_OK; } diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index f3f1df76..09f4788d 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -355,7 +355,8 @@ transaction_read: if (retval < 0) { rig_debug(RIG_DEBUG_WARN, - "%s: read_string retval < 0, retval = %d, retry_read=%d, rs->rigport.retry=%d\n", __func__, + "%s: read_string retval < 0, retval = %d, retry_read=%d, rs->rigport.retry=%d\n", + __func__, retval, retry_read, rs->rigport.retry); // only retry if we expect a response from the command @@ -476,8 +477,10 @@ transaction_read: rig_debug(RIG_DEBUG_ERR, "%s: wrong reply %c%c for command %c%c\n", __func__, buffer[0], buffer[1], cmdstr[0], cmdstr[1]); - rig_debug(RIG_DEBUG_ERR, "%s: retry_read=%d, rs->rigport.retry=%d\n", __func__, retry_read, rs->rigport.retry); - if (retry_read++ < rs->rigport.retry) + rig_debug(RIG_DEBUG_ERR, "%s: retry_read=%d, rs->rigport.retry=%d\n", __func__, + retry_read, rs->rigport.retry); + + if (retry_read++ < rs->rigport.retry) { goto transaction_write; } commit 6da8958787f110ec51eeb63dd4918b9662992ee9 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Sep 14 14:45:36 2020 -0700 Fix icom LEVELs (cherry picked from commit 6267d2674e08ef7dc512831f2d241d7f50a76c9e) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 06edd785..7207ac77 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2344,7 +2344,7 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) for (i = 0; cmd && cmd[i].id.s != 0; i++) { - if (cmd[i].id.s == level) + if (cmd[i].cmdparamtype == CMD_PARAM_TYPE_LEVEL && cmd[i].id.s == level) { return icom_set_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val); } commit 39c8d186ef0a7eaa07a9c56d3978d5680f824f07 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Sep 14 14:34:52 2020 -0700 Fix debug statement in ic7300.c (cherry picked from commit ebddade1dcdd588dcb4ce3f0dfa4616c82eb6037) diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 6cc8486b..658099cc 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -1008,7 +1008,7 @@ int ic7300_get_parm(RIG *rig, setting_t parm, value_t *val) return -RIG_ENIMPL; // How can we implement this? default: - rig_debug(RIG_DEBUG_TRACE, "%s: using icom routine for PARM=%s", __func__, rig_strparm(parm)); + rig_debug(RIG_DEBUG_TRACE, "%s: using icom routine for PARM=%s\n", __func__, rig_strparm(parm)); return icom_get_parm(rig,parm,val); } commit 28fa1835dc04e7c34aa089df5ec6d8868d9c5e4a Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Sep 14 09:18:43 2020 -0700 Fix IC7300 set_parm PARM_TIME (cherry picked from commit 9c5b7499f6767ca75b8e7da52dc0e1d5b6abea60) diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 3d2a0efc..6cc8486b 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -965,26 +965,25 @@ int ic7300_set_parm(RIG *rig, setting_t parm, value_t val) hr = (int)((float) val.i / 3600.0); min = (int)((float)(val.i - (hr * 3600)) / 60.0); - prmbuf[0] = 0x05; switch (rig->caps->rig_model) { case RIG_MODEL_IC7300: - prmbuf[2] = 0x00; - prmbuf[3] = 0x95; + prmbuf[0] = 0x00; + prmbuf[1] = 0x95; break; case RIG_MODEL_IC9700: - prmbuf[2] = 0x01; - prmbuf[3] = 0x80; + prmbuf[0] = 0x01; + prmbuf[1] = 0x80; break; case RIG_MODEL_IC705: - prmbuf[2] = 0x01; - prmbuf[3] = 0x66; + prmbuf[0] = 0x01; + prmbuf[1] = 0x66; break; default: return -RIG_ENIMPL; } - to_bcd_be(prmbuf + 3, (long long) hr, 2); - to_bcd_be(prmbuf + 4, (long long) min, 2); - return icom_set_raw(rig, C_CTL_MEM, S_MEM_PARM, 5, prmbuf, 0, 0); + to_bcd_be(prmbuf + 2, (long long) hr, 2); + to_bcd_be(prmbuf + 3, (long long) min, 2); + return icom_set_raw(rig, C_CTL_MEM, S_MEM_PARM, 4, prmbuf, 0, 0); default: rig_debug(RIG_DEBUG_ERR, "Unsupported set_parm %s\n", rig_strparm(parm)); diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 6fcd4f10..06edd785 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -5566,7 +5566,7 @@ int icom_set_parm(RIG *rig, setting_t parm, value_t val) for (i = 0; cmd && cmd[i].id.s != 0; i++) { - if (cmd[i].id.s == parm) + if (cmd[i].cmdparamtype == CMD_PARAM_TYPE_PARM && cmd[i].id.s == parm) { return icom_set_cmd(rig, RIG_VFO_NONE, (struct cmdparams *)&cmd[i], val); } commit 05dd3e80157686bcde4690fb9524a679abd04943 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Sep 14 11:08:38 2020 -0500 Add ic7300_get_parm and ic7300_set_parm (cherry picked from commit 15a879d5ea2d06a17ae88e1952ec14d05b78e105) diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 880dd0bf..3d2a0efc 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -38,6 +38,10 @@ #include "bandplan.h" #include "tones.h" +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); + + #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_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) @@ -404,8 +408,8 @@ const struct rig_caps ic7300_caps = .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_parm = ic7300_set_parm, + .get_parm = ic7300_get_parm, .set_mem = icom_set_mem, .vfo_op = icom_vfo_op, .scan = icom_scan, @@ -885,3 +889,162 @@ const struct rig_caps ic705_caps = .send_morse = icom_send_morse, .send_voice_mem = icom_send_voice_mem }; + +int ic7300_set_parm(RIG *rig, setting_t parm, value_t val) +{ + unsigned char prmbuf[MAXFRAMELEN]; + int min, hr; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + switch (parm) + { + case RIG_PARM_ANN: + { + int ann_mode = -1; + int ann_lang = -1; + + switch (val.i) + { + case RIG_ANN_OFF: + ann_mode = S_ANN_ALL; + break; + + case RIG_ANN_FREQ: + ann_mode = S_ANN_FREQ; + break; + + case RIG_ANN_RXMODE: + ann_mode = S_ANN_MODE; + break; + + case RIG_ANN_ENG: + case RIG_ANN_JAP: + ann_lang = (val.i == RIG_ANN_ENG) ? 0 : 1; + break; + + default: + rig_debug(RIG_DEBUG_ERR, "Unsupported RIG_PARM_ANN %d\n", val.i); + return -RIG_EINVAL; + } + + if (ann_mode >= 0) + { + return icom_set_raw(rig, C_CTL_ANN, ann_mode, 0, NULL, 0, 0); + } + else if (ann_lang >= 0) + { + prmbuf[0] = 0x1a; + prmbuf[1] = 0x05; + switch (rig->caps->rig_model) { + case RIG_MODEL_IC7300: + prmbuf[2] = 0x00; + prmbuf[3] = 0x39; + break; + case RIG_MODEL_IC9700: + prmbuf[2] = 0x01; + prmbuf[3] = 0x77; + break; + case RIG_MODEL_IC705: + prmbuf[2] = 0x00; + prmbuf[3] = 0x53; + break; + default: + return -RIG_ENIMPL; + } + + prmbuf[4] = ann_lang; + return icom_set_raw(rig, C_CTL_MEM, S_MEM_MODE_SLCT, 5, prmbuf, 0, 0); + } + + rig_debug(RIG_DEBUG_ERR, "Unsupported RIG_PARM_ANN %d\n", val.i); + return -RIG_EINVAL; + } + + case RIG_PARM_TIME: + hr = (int)((float) val.i / 3600.0); + min = (int)((float)(val.i - (hr * 3600)) / 60.0); + + prmbuf[0] = 0x05; + switch (rig->caps->rig_model) { + case RIG_MODEL_IC7300: + prmbuf[2] = 0x00; + prmbuf[3] = 0x95; + break; + case RIG_MODEL_IC9700: + prmbuf[2] = 0x01; + prmbuf[3] = 0x80; + break; + case RIG_MODEL_IC705: + prmbuf[2] = 0x01; + prmbuf[3] = 0x66; + break; + default: + return -RIG_ENIMPL; + } + to_bcd_be(prmbuf + 3, (long long) hr, 2); + to_bcd_be(prmbuf + 4, (long long) min, 2); + return icom_set_raw(rig, C_CTL_MEM, S_MEM_PARM, 5, prmbuf, 0, 0); + + default: + rig_debug(RIG_DEBUG_ERR, "Unsupported set_parm %s\n", rig_strparm(parm)); + return -RIG_EINVAL; + } +} + +int ic7300_get_parm(RIG *rig, setting_t parm, value_t *val) +{ + unsigned char prmbuf[MAXFRAMELEN], resbuf[MAXFRAMELEN]; + int prm_len, res_len; + int prm_cn, prm_sc; + int icom_val = 0; + int cmdhead; + int retval; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + switch (parm) + { + case RIG_PARM_ANN: + return -RIG_ENIMPL; // How can we implement this? + + default: + rig_debug(RIG_DEBUG_TRACE, "%s: using icom routine for PARM=%s", __func__, rig_strparm(parm)); + return icom_get_parm(rig,parm,val); + } + + retval = icom_transaction(rig, prm_cn, prm_sc, prmbuf, prm_len, resbuf, + &res_len); + + if (retval != RIG_OK) + { + return retval; + } + + cmdhead = 3; + res_len -= cmdhead; + + if (resbuf[0] != ACK && resbuf[0] != prm_cn) + { + rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, resbuf[0], + res_len); + return -RIG_ERJCTED; + } + + switch (parm) + { + + case RIG_PARM_ANN: + rig_debug(RIG_DEBUG_WARN, "%s: not implemented\n", __func__); + return -RIG_ENIMPL; + default: + return icom_get_parm(rig,parm,val); + } + + + rig_debug(RIG_DEBUG_TRACE, "%s: %d %d %d %f\n", __func__, res_len, icom_val, + val->i, val->f); + + return RIG_OK; +} + commit bbc5e307d0b6c0f754bb7f991c04240a0097ac75 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Sep 14 07:34:02 2020 -0500 Remove rptr functions from ic7300.c https://github.com/Hamlib/Hamlib/issues/373 (cherry picked from commit f41e07c0e68f70f95f8ba7e22dd488c20c3b0eda) diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 68987aef..880dd0bf 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -270,7 +270,7 @@ const struct rig_caps ic7300_caps = RIG_MODEL(RIG_MODEL_IC7300), .model_name = "IC-7300", .mfg_name = "Icom", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -414,10 +414,10 @@ const struct rig_caps ic7300_caps = .get_dcd = icom_get_dcd, .set_ts = icom_set_ts, .get_ts = icom_get_ts, - .set_rptr_shift = icom_set_rptr_shift, - .get_rptr_shift = icom_get_rptr_shift, - .set_rptr_offs = icom_set_rptr_offs, - .get_rptr_offs = icom_get_rptr_offs, + .set_rptr_shift = NULL, + .get_rptr_shift = NULL, + .set_rptr_offs = NULL, + .get_rptr_offs = NULL, .set_ctcss_tone = icom_set_ctcss_tone, .get_ctcss_tone = icom_get_ctcss_tone, .set_ctcss_sql = icom_set_ctcss_sql, commit 03a856642630bf64e4f6f49ae96fa06d061c9b44 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Sep 14 08:02:42 2020 -0500 Make ic75 parm functions static (cherry picked from commit 52764221ca674e239cbf9254c4eb0c55e40d5ba7) diff --git a/rigs/icom/icr75.c b/rigs/icom/icr75.c index 955a7ab5..a813f557 100644 --- a/rigs/icom/icr75.c +++ b/rigs/icom/icr75.c @@ -93,8 +93,8 @@ static int icr75_set_channel(RIG *rig, const channel_t *chan); static int icr75_get_channel(RIG *rig, channel_t *chan, int read_only); -int icr75_set_parm(RIG *rig, setting_t parm, value_t val); -int icr75_get_parm(RIG *rig, setting_t parm, value_t *val); +static int icr75_set_parm(RIG *rig, setting_t parm, value_t val); +static int icr75_get_parm(RIG *rig, setting_t parm, value_t *val); static struct icom_priv_caps icr75_priv_caps = { commit 57704aacf952102269afb7684d4444b5a141da02 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Sep 14 07:59:47 2020 -0500 Fix cppcheck warning in termios.c: (cherry picked from commit 12c2434dc7c925645950cd12c4b4ceee4c066098) diff --git a/lib/termios.c b/lib/termios.c index ac5ccb31..eb27729b 100644 --- a/lib/termios.c +++ b/lib/termios.c @@ -808,29 +808,27 @@ int win32_serial_close(int fd) first_tl = NULL; } - if (index) - { - if (index->rol.hEvent) { CloseHandle(index->rol.hEvent); } + if (index->rol.hEvent) { CloseHandle(index->rol.hEvent); } - if (index->wol.hEvent) { CloseHandle(index->wol.hEvent); } + if (index->wol.hEvent) { CloseHandle(index->wol.hEvent); } - if (index->sol.hEvent) { CloseHandle(index->sol.hEvent); } + if (index->sol.hEvent) { CloseHandle(index->sol.hEvent); } - if (index->hComm) { CloseHandle(index->hComm); } + if (index->hComm) { CloseHandle(index->hComm); } - if (index->ttyset) { free(index->ttyset); } + if (index->ttyset) { free(index->ttyset); } - if (index->astruct) { free(index->astruct); } + if (index->astruct) { free(index->astruct); } - if (index->sstruct) { free(index->sstruct); } + if (index->sstruct) { free(index->sstruct); } - if (index->sis) { free(index->sis); } + if (index->sis) { free(index->sis); } - /* had problems with strdup - if ( index->filename ) free( index->filename ); - */ - free(index); - } + /* had problems with strdup + if ( index->filename ) free( index->filename ); + */ + free(index); + LEAVE("serial_close"); return 0; @@ -1740,7 +1738,7 @@ int win32_serial_read(int fd, void *vb, int size) } } - sprintf(message, "end nBytes=%ld] ", nBytes); + sprintf(message, "end nBytes=%lu] ", nBytes); report(message); /* hl_usleep(1000); @@ -2497,8 +2495,10 @@ int tcgetattr(int fd, struct termios *s_termios) s_termios->c_cflag &= ~(PARENB | PARODD | CMSPAR); myDCB.fParity = 1; +#if 0 // redundant if (myDCB.fParity) { +#endif report("tcgetattr getting parity\n"); s_termios->c_cflag |= PARENB; @@ -2524,11 +2524,13 @@ int tcgetattr(int fd, struct termios *s_termios) { s_termios->c_cflag &= ~(PARODD | CMSPAR | PARENB); } +#if 0 // see redundant above } else { s_termios->c_cflag &= ~PARENB; } +#endif /* CSIZE */ s_termios->c_cflag |= bytesize_to_termios(myDCB.ByteSize); @@ -2752,11 +2754,11 @@ int tcsetattr(int fd, int when, struct termios *s_termios) if (dcb.EofChar != '\0') { - dcb.fBinary = 0; + dcb.fBinary = FALSE; } else { - dcb.fBinary = 1; + dcb.fBinary = TRUE; } if (EV_BREAK | EV_CTS | EV_DSR | EV_ERR | EV_RING | (EV_RLSD & EV_RXFLAG)) @@ -3536,38 +3538,10 @@ int win32_serial_ioctl(int fd, int request, ...) return -1; } - if (sistruct->frame != index->sis->frame) - { - sistruct->frame = index->sis->frame; - /* - printf( "---------------frame = %i\n", sistruct->frame++ ); - */ - } - - if (sistruct->overrun != index->sis->overrun) - { - /* - printf( "---------------overrun\n" ); - */ - sistruct->overrun = index->sis->overrun; - /* ErrCode &= ~CE_OVERRUN; */ - } - - if (sistruct->parity != index->sis->parity) - { - /* - printf( "---------------parity\n" ); - */ - sistruct->parity = index->sis->parity; - } - - if (sistruct->brk != index->sis->brk) - { - /* - printf( "---------------brk\n" ); - */ - sistruct->brk = index->sis->brk; - } + sistruct->frame = index->sis->frame; + sistruct->overrun = index->sis->overrun; + sistruct->parity = index->sis->parity; + sistruct->brk = index->sis->brk; va_end(ap); return 0; @@ -3777,7 +3751,7 @@ int win32_serial_select(int n, fd_set *readfds, fd_set *writefds, termios_setflags(fd, eventflags); } - if (!index || !index->event_flag) + if (!index->event_flag) { /* still setting up the port? hold off for a Sec so things can fire up commit 5c906771038568f034ef82eea1a8e9fb42fc079c Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Sep 13 08:30:10 2020 -0500 Remove TODO files as they have been replaced with github issues (cherry picked from commit cb2c757c6230767fd1191aed47c6d11a9c1900b3) diff --git a/TODO b/TODO deleted file mode 100644 index 9f1abb2b..00000000 --- a/TODO +++ /dev/null @@ -1,61 +0,0 @@ -hamlib - (C) Frank Singleton 2000 - - -GENERAL PROJECT TODO --------------------- - -1. Implement more interfaces/backends [ongoing] -2. Write More extensive Test Suites [ongoing] -3. Document API's [ongoing] -4. Document Limitations/Assumptions. -6. Encourage people to build cool GUI's using - our libs. (any GTK wiz's out here ..) -8. More safe checking during function calls (in rig_* wrappers). -13. ~/.hamlibrc and /etc/hamlibrc preferences file -14. Write the list of all functions that should be in the API -18. rewrite the post_write_delay. Active delay is a waste of cycles! [need test] -23. add support in the API for additional filters, DSP bandpass control -25. Write aclocal .m4 macro helpers for autoconf support [need test] -26. Write rig protocol simulator so no hardware is involved with Hamlib testing -27. complete memory bank support -28. add rig_srch_ctcss, rig_srch_dcs, etc. -29. emulate get_stuff (caching) if backend has no support for it -30. Write perl/python/etc. modules [ongoing] - -DONE ----- - -5. Build top level Makefile for maintenance - -7. Move common routines to a common area - and avoid duplication. - -9. If read from rig takes > "n" seconds, then no longer - block on read, just return error. - -10. Improve Makefiles (autoconf?) - -12. Add general rig capabilities handling. see rig.h - -15. Handle retransmissions (no more than n) if timeout (->backends) -16. Write .spec (rpm) and .deb (debian) package files - -17a. Add support for a configurable debug level (none, function calls, - packet traces) - -17b. In serial.c (and non serial too), use buffered IO instead of read/write, - for better performance. Use flushing with fwrite. - -18. Get Git updates mailed to our hamlib-cvs-digest list -19. specify how to access Reverse modes (CWR, RTTYR). through set_mode? -22. handle nicely different versions of same rig coming for - ITU region1/region2 ham band (-> freq ranges in capabilities) - -11. Add some scanning routines [ 1.1.2? ] - -20. adapt API include files to support C++ (__BEGIN_DECLS/__END_DECLS, etc.) -21. grab cygwin and test portability under Win32 (what about MacOS?) -24. Should Hamlib (the library itself) be LGPL'ed ? -31. Add some antenna tuner support -33. Merge dumpmem/dumpcaps into rigctl -32. Document C++/tcltk bindings, complete Hamlib API documentation using doxygen diff --git a/TODO.skeleton b/TODO.skeleton deleted file mode 100644 index 1f7dac7c..00000000 --- a/TODO.skeleton +++ /dev/null @@ -1,15 +0,0 @@ -hamlib - (C) Frank Singleton 2000 - -TODO.<your rig> - (C) <your name> 2000 -This shared library provides an API for communicating -via serial interface to a <your rig> using the <your interface> interface. - -TODO ----- - -1. Complete pcodes -2. Write More extensive Test Suite -3. Document API -4. Document Limitations/Assumptions. -5. - commit a3caf7e400eb194234ffffb60e7a616d1b3f3f53 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Sep 13 08:08:23 2020 -0500 Adding phpdemo (cherry picked from commit fb9acd8b5eda50a0a89d3ac0f756f703317d48bc) diff --git a/bindings/phpdemo.php b/bindings/phpdemo.php new file mode 100644 index 00000000..a1eb33aa --- /dev/null +++ b/bindings/phpdemo.php @@ -0,0 +1,41 @@ +<?php +// This example needs to be improved by adding get_freq, set_freq functions and such. +// Need to parse the returns from rigctl +print("Hamlib demo\n"); +$descriptorspec = array( + 0 => array("pipe", "r"), // stdin is a pipe that the child will read from + 1 => array("pipe", "w"), // stdout is a pipe that the child will write to + 2 => array("file", "/tmp/error-output.txt", "a") // stderr is a file to write to +); + +$cmd = "rigctl -m 2"; +$process = proc_open($cmd, $descriptorspec, $pipes); + +if (is_resource($process)) { + // $pipes now looks like this: + // 0 => writeable handle connected to child stdin + // 1 => readable handle connected to child stdout + // Any error output will be appended to /tmp/error-output.txt + + echo fread($pipes[1], 32); + + echo "Main Freq: "; + fwrite($pipes[0], "f Main\n"); + fread($pipes[1],32); + echo fread($pipes[1],64); + echo "\n"; + echo "=====\n"; + + fwrite($pipes[0], "f Sub\n"); + echo "Sub Freq:" ; + echo fread($pipes[1],32); + echo "\n"; + + fclose($pipes[0]); + fclose($pipes[1]); + + $return_value = proc_close($process); + + echo "command returned $return_value\n"; +} +?> commit b396d60921bd92584a5cd94eb4fcb16fc72b10f4 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 12 21:37:10 2020 -0700 Fix icom_get_parm to eliminate collisions (cherry picked from commit aeaa96bc3b471c8c09e86a1e436e14be92c49019) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index b25576ab..6fcd4f10 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2217,7 +2217,7 @@ int icom_set_cmd(RIG *rig, vfo_t vfo, struct cmdparams *par, value_t val) to_bcd_be(&cmdbuf[cmdlen], (int)(val.f * 255.0), (cmdlen * 2)); break; - case CMD_DAT_TIM: + case CMD_DAT_TIM: // returned as seconds since midnight to_bcd_be(&cmdbuf[cmdlen], ((((int)val.f / 3600) * 100) + (((int)val.f / 60) % 60)), (par->datlen * 2)); break; @@ -5628,7 +5628,7 @@ int icom_get_parm(RIG *rig, setting_t parm, value_t *val) for (i = 0; cmd && cmd[i].id.s != 0; i++) { - if (cmd[i].id.s == parm) + if (cmd[i].cmdparamtype == CMD_PARAM_TYPE_PARM && cmd[i].id.s == parm) { return icom_get_cmd(rig, RIG_VFO_NONE, (struct cmdparams *)&cmd[i], val); } diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index a1e1903c..9c23d651 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -31,7 +31,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20200911" +#define BACKEND_VER "20200912" /* * defines used by comp_cal_str in rig.c commit aa352d1d14362d9392074e531aa81e305ca6dde3 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 12 14:26:57 2020 -0700 Fix ic7300 VOXDELAY and other extcmd structures (cherry picked from commit 6e45a7ba785cccf756f086617f246fd0e3e5be36) diff --git a/rigs/icom/ic7100.c b/rigs/icom/ic7100.c index 5320c55e..42dce0ee 100644 --- a/rigs/icom/ic7100.c +++ b/rigs/icom/ic7100.c @@ -108,11 +108,11 @@ int ic7100_tokens[] = { TOK_DSTAR_CODE, TOK_DSTAR_DSQL, TOK_DSTAR_CALL_SIGN, TOK struct cmdparams ic7100_extcmds[] = { - { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x03}, CMD_DAT_BOL, 1 }, - { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x04}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_KEYLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x05}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x21}, CMD_DAT_TIM, 2 }, - { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x65}, CMD_DAT_INT, 1 }, + { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x03}, CMD_DAT_BOL, 1 }, + { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x04}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_KEYLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x05}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x21}, CMD_DAT_TIM, 2 }, + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x65}, CMD_DAT_INT, 1 }, { {.s = RIG_PARM_NONE} } }; diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 9ce7b994..68987aef 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -62,7 +62,7 @@ struct cmdparams ic7300_extcmds[] = { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x23}, CMD_DAT_BOL, 1 }, { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x81}, CMD_DAT_LVL, 2 }, { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x95}, CMD_DAT_TIM, 2 }, - { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x59}, CMD_DAT_INT, 1 }, + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x59}, CMD_DAT_INT, 1 }, { {.s = RIG_PARM_NONE} } }; diff --git a/rigs/icom/ic7600.c b/rigs/icom/ic7600.c index f39e3e26..1b7add09 100644 --- a/rigs/icom/ic7600.c +++ b/rigs/icom/ic7600.c @@ -55,10 +55,10 @@ struct cmdparams ic7600_extcmds[] = { - { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x59}, CMD_DAT_BOL, 1 }, - { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x38}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x54}, CMD_DAT_TIM, 2 }, - { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, CMD_DAT_INT, 1 }, + { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x59}, CMD_DAT_BOL, 1 }, + { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x38}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x54}, CMD_DAT_TIM, 2 }, + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, CMD_DAT_INT, 1 }, { {.s = RIG_PARM_NONE} } }; diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 68497030..b25576ab 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2700,13 +2700,16 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) const struct cmdparams *cmd = priv->extcmds; int i; + for (i = 0; cmd && cmd[i].id.s != 0; i++) { + rig_debug(RIG_DEBUG_TRACE, "%s: i=%d\n", __func__, i); if (cmd[i].cmdparamtype == CMD_PARAM_TYPE_LEVEL && cmd[i].id.s == level) { return icom_get_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val); } } + rig_debug(RIG_DEBUG_TRACE, "%s: no extcmd found\n", __func__); rs = &rig->state; commit d519f2a596a56ca7576604cb93280b5811efe8f6 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 12 11:21:33 2020 -0500 Added CMD_PARAM_TYPE values for icom rigs to distinguish the different ext cmd types https://github.com/Hamlib/Hamlib/issues/373 (cherry picked from commit 83667f4c65bf3b2ccb685c979734a1710b811695) diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 1cdcd0d1..9ce7b994 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -59,15 +59,15 @@ struct cmdparams ic7300_extcmds[] = { - { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x23}, CMD_DAT_BOL, 1 }, - { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x81}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x95}, CMD_DAT_TIM, 2 }, + { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x23}, CMD_DAT_BOL, 1 }, + { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x81}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x95}, CMD_DAT_TIM, 2 }, + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x59}, CMD_DAT_INT, 1 }, { {.s = RIG_PARM_NONE} } }; struct cmdparams ic7300_extlevels[] = { - { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x59}, CMD_DAT_INT, 1 }, }; /* @@ -151,15 +151,11 @@ struct cmdparams ic7300_extlevels[] = struct cmdparams ic9700_extcmds[] = { - { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x29}, CMD_DAT_BOL, 1 }, - { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x52}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_SCREENSAVER}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, CMD_DAT_INT, 1 }, - { {.s = RIG_PARM_NONE} } -}; - -struct cmdparams ic9700_extlevels[] = -{ - { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x30}, CMD_DAT_INT, 1 }, + { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x29}, CMD_DAT_BOL, 1 }, + { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x52}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_SCREENSAVER}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, CMD_DAT_INT, 1 }, + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x30}, CMD_DAT_INT, 1 }, + { {0} } }; #define IC9700_STR_CAL { 7, \ @@ -233,7 +229,6 @@ static const struct icom_priv_caps IC7300_priv_caps = { .level = -1, .icom_level = 0 }, }, .extcmds = ic7300_extcmds, /* Custom op parameters */ - .extlevels = ic7300_extlevels, /* Custom parameters */ }; static const struct icom_priv_caps IC9700_priv_caps = @@ -251,7 +246,6 @@ static const struct icom_priv_caps IC9700_priv_caps = { .level = -1, .icom_level = 0 }, }, .extcmds = ic9700_extcmds, /* Custom op parameters */ - .extlevels = ic9700_extlevels, /* Custom op parameters */ }; static const struct icom_priv_caps IC705_priv_caps = @@ -269,7 +263,6 @@ static const struct icom_priv_caps IC705_priv_caps = { .level = -1, .icom_level = 0 }, }, .extcmds = ic7300_extcmds, /* Custom parameters */ - .extlevels = ic7300_extlevels, /* Custom parameters */ }; const struct rig_caps ic7300_caps = diff --git a/rigs/icom/ic756.c b/rigs/icom/ic756.c index 730b802d..95ae2684 100644 --- a/rigs/icom/ic756.c +++ b/rigs/icom/ic756.c @@ -64,11 +64,11 @@ struct cmdparams ic756pro_cmdparms[] = { - { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x20}, CMD_DAT_BOL, 1 }, - { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x09}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x16}, CMD_DAT_TIM, 2 }, - { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x60}, CMD_DAT_INT, 1 }, - { {.s = RIG_PARM_NONE} } + { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x20}, CMD_DAT_BOL, 1 }, + { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x09}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x16}, CMD_DAT_TIM, 2 }, + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x60}, CMD_DAT_INT, 1 }, + { {0} } }; #define IC756PRO_STR_CAL { 16, \ diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 275f59da..68497030 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -476,34 +476,34 @@ const struct confparams icom_ext_parms[] = const struct cmdparams icom_ext_cmd[] = { - { {.t = TOK_DSTAR_DSQL}, C_CTL_DIG, S_DIG_DSCSQL, SC_MOD_RW, 1, {0}, CMD_DAT_BOL, 1 }, - { {.t = TOK_DSTAR_CALL_SIGN}, C_CTL_DIG, S_DIG_DSCALS, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 38 }, - { {.t = TOK_DSTAR_MESSAGE}, C_CTL_DIG, S_DIG_DSMESS, SC_MOD_RW12, 2, {0}, CMD_DAT_STR, 32 }, - { {.t = TOK_DSTAR_STATUS}, C_CTL_DIG, S_DIG_DSRSTS, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 1 }, - { {.t = TOK_DSTAR_GPS_DATA}, C_CTL_DIG, S_DIG_DSGPSD, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 52 }, - { {.t = TOK_DSTAR_GPS_MESS}, C_CTL_DIG, S_DIG_DSGPSM, SC_MOD_RW12, 2, {0}, CMD_DAT_STR, 52 }, - { {.t = TOK_DSTAR_CODE}, C_CTL_DIG, S_DIG_DSCSQL, SC_MOD_RW12, 2, {0}, CMD_DAT_FLT, 1 }, - { {.t = TOK_DSTAR_TX_DATA}, C_CTL_DSD, S_DSD_DSTXDT, SC_MOD_RW, 1, {0}, CMD_DAT_BUF, 30 }, - { {.t = TOK_DSTAR_MY_CS}, C_CTL_DVT, S_DVT_DSMYCS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 12 }, - { {.t = TOK_DSTAR_TX_CS}, C_CTL_DVT, S_DVT_DSTXCS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 24 }, - { {.t = TOK_DSTAR_TX_MESS}, C_CTL_DVT, S_DVT_DSTXMS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 20 }, - { {.t = TOK_DRIVE_GAIN}, C_CTL_LVL, S_LVL_DRIVE, SC_MOD_RW, 1, {0}, CMD_DAT_FLT, 2 }, - { {.t = TOK_DIGI_SEL_FUNC}, C_CTL_FUNC, S_FUNC_DIGISEL, SC_MOD_RW, 1, {0}, CMD_DAT_BOL, 1 }, - { {.t = TOK_DIGI_SEL_LEVEL}, C_CTL_LVL, S_LVL_DIGI, SC_MOD_RW, 1, {0}, CMD_DAT_FLT, 2 }, - { {.t = TOK_SCOPE_DAT}, C_CTL_SCP, S_SCP_DAT, SC_MOD_RD, 0, {0}, CMD_DAT_BUF, 481 }, - { {.t = TOK_SCOPE_STS}, C_CTL_SCP, S_SCP_STS, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, - { {.t = TOK_SCOPE_DOP}, C_CTL_SCP, S_SCP_DOP, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, - { {.t = TOK_SCOPE_MSS}, C_CTL_SCP, S_SCP_MSS, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, - { {.t = TOK_SCOPE_MOD}, C_CTL_SCP, S_SCP_MOD, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, - { {.t = TOK_SCOPE_SPN}, C_CTL_SCP, S_SCP_SPN, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 6 }, - { {.t = TOK_SCOPE_EDG}, C_CTL_SCP, S_SCP_EDG, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, - { {.t = TOK_SCOPE_HLD}, C_CTL_SCP, S_SCP_HLD, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, - { {.t = TOK_SCOPE_REF}, C_CTL_SCP, S_SCP_REF, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 4 }, - { {.t = TOK_SCOPE_SWP}, C_CTL_SCP, S_SCP_SWP, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, - { {.t = TOK_SCOPE_STX}, C_CTL_SCP, S_SCP_STX, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, - { {.t = TOK_SCOPE_TYP}, C_CTL_SCP, S_SCP_TYP, SC_MOD_RW, 0, {0}, CMD_DAT_INT, 1 }, - { {.t = TOK_SCOPE_VBW}, C_CTL_SCP, S_SCP_VBW, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, - { {.t = TOK_SCOPE_FEF}, C_CTL_SCP, S_SCP_FEF, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 12 }, + { {.t = TOK_DSTAR_DSQL}, CMD_PARAM_TYPE_TOKEN, C_CTL_DIG, S_DIG_DSCSQL, SC_MOD_RW, 1, {0}, CMD_DAT_BOL, 1 }, + { {.t = TOK_DSTAR_CALL_SIGN}, CMD_PARAM_TYPE_TOKEN, C_CTL_DIG, S_DIG_DSCALS, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 38 }, + { {.t = TOK_DSTAR_MESSAGE}, CMD_PARAM_TYPE_TOKEN, C_CTL_DIG, S_DIG_DSMESS, SC_MOD_RW12, 2, {0}, CMD_DAT_STR, 32 }, + { {.t = TOK_DSTAR_STATUS}, CMD_PARAM_TYPE_TOKEN, C_CTL_DIG, S_DIG_DSRSTS, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 1 }, + { {.t = TOK_DSTAR_GPS_DATA}, CMD_PARAM_TYPE_TOKEN, C_CTL_DIG, S_DIG_DSGPSD, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 52 }, + { {.t = TOK_DSTAR_GPS_MESS}, CMD_PARAM_TYPE_TOKEN, C_CTL_DIG, S_DIG_DSGPSM, SC_MOD_RW12, 2, {0}, CMD_DAT_STR, 52 }, + { {.t = TOK_DSTAR_CODE}, CMD_PARAM_TYPE_TOKEN, C_CTL_DIG, S_DIG_DSCSQL, SC_MOD_RW12, 2, {0}, CMD_DAT_FLT, 1 }, + { {.t = TOK_DSTAR_TX_DATA}, CMD_PARAM_TYPE_TOKEN, C_CTL_DSD, S_DSD_DSTXDT, SC_MOD_RW, 1, {0}, CMD_DAT_BUF, 30 }, + { {.t = TOK_DSTAR_MY_CS}, CMD_PARAM_TYPE_TOKEN, C_CTL_DVT, S_DVT_DSMYCS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 12 }, + { {.t = TOK_DSTAR_TX_CS}, CMD_PARAM_TYPE_TOKEN, C_CTL_DVT, S_DVT_DSTXCS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 24 }, + { {.t = TOK_DSTAR_TX_MESS}, CMD_PARAM_TYPE_TOKEN, C_CTL_DVT, S_DVT_DSTXMS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 20 }, + { {.t = TOK_DRIVE_GAIN}, CMD_PARAM_TYPE_TOKEN, C_CTL_LVL, S_LVL_DRIVE, SC_MOD_RW, 1, {0}, CMD_DAT_FLT, 2 }, + { {.t = TOK_DIGI_SEL_FUNC}, CMD_PARAM_TYPE_TOKEN, C_CTL_FUNC, S_FUNC_DIGISEL, SC_MOD_RW, 1, {0}, CMD_DAT_BOL, 1 }, + { {.t = TOK_DIGI_SEL_LEVEL}, CMD_PARAM_TYPE_TOKEN, C_CTL_LVL, S_LVL_DIGI, SC_MOD_RW, 1, {0}, CMD_DAT_FLT, 2 }, + { {.t = TOK_SCOPE_DAT}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_DAT, SC_MOD_RD, 0, {0}, CMD_DAT_BUF, 481 }, + { {.t = TOK_SCOPE_STS}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_STS, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, + { {.t = TOK_SCOPE_DOP}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_DOP, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, + { {.t = TOK_SCOPE_MSS}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_MSS, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, + { {.t = TOK_SCOPE_MOD}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_MOD, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, + { {.t = TOK_SCOPE_SPN}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_SPN, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 6 }, + { {.t = TOK_SCOPE_EDG}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_EDG, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, + { {.t = TOK_SCOPE_HLD}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_HLD, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, + { {.t = TOK_SCOPE_REF}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_REF, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 4 }, + { {.t = TOK_SCOPE_SWP}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_SWP, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, + { {.t = TOK_SCOPE_STX}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_STX, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, + { {.t = TOK_SCOPE_TYP}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_TYP, SC_MOD_RW, 0, {0}, CMD_DAT_INT, 1 }, + { {.t = TOK_SCOPE_VBW}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_VBW, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, + { {.t = TOK_SCOPE_FEF}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_FEF, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 12 }, { {0} } }; @@ -2340,7 +2340,7 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - const struct cmdparams *cmd = priv_caps->extlevels; + const struct cmdparams *cmd = priv_caps->extcmds; for (i = 0; cmd && cmd[i].id.s != 0; i++) { @@ -2697,12 +2697,12 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); const struct icom_priv_caps *priv = rig->caps->priv; - const struct cmdparams *cmd = priv->extlevels; + const struct cmdparams *cmd = priv->extcmds; int i; for (i = 0; cmd && cmd[i].id.s != 0; i++) { - if (cmd[i].id.s == level) + if (cmd[i].cmdparamtype == CMD_PARAM_TYPE_LEVEL && cmd[i].id.s == level) { return icom_get_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val); } @@ -3186,7 +3186,7 @@ int icom_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val) } else if (cfp[i].token == token) { - return icom_get_ext_cmd(rig, vfo, token, val); + return icom_get_ext_cmd(rig, vfo, CMD_PARAM_TYPE_LEVEL, token, val); } else { i++; } } @@ -3236,7 +3236,7 @@ int icom_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status) } else if (cfp[i].token == token) { - return icom_get_ext_cmd(rig, vfo, token, (value_t *)status); + return icom_get_ext_cmd(rig, vfo, CMD_PARAM_TYPE_FUNC, token, (value_t *)status); } else { i++; } } @@ -3286,7 +3286,7 @@ int icom_get_ext_parm(RIG *rig, token_t token, value_t *val) } else if (cfp[i].token == token) { - return icom_get_ext_cmd(rig, RIG_VFO_NONE, token, val); + return icom_get_ext_cmd(rig, RIG_VFO_NONE, CMD_PARAM_TYPE_PARM, token, val); } else { i++; } } @@ -3294,7 +3294,7 @@ int icom_get_ext_parm(RIG *rig, token_t token, value_t *val) return -RIG_EINVAL; } -int icom_get_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t *val) +int icom_get_ext_cmd(RIG *rig, vfo_t vfo, cmd_param_t cmdparamtype, token_t token, value_t *val) { int i; @@ -3316,7 +3316,7 @@ int icom_get_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t *val) cmd = icom_ext_cmd; i = 0; } - else if (cmd[i].id.t == token) + else if (cmd[i].cmdparamtype == cmdparamtype && cmd[i].id.t == token) { return icom_get_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val); } diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index fe259658..a1e1903c 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -106,11 +106,21 @@ struct icom_agc_level icom_level; /* Icom AGC level for C_CTL_FUNC (0x16), S_FUNC_AGC (0x12) command */ }; +typedef enum +{ + CMD_PARAM_TYPE_NONE, + CMD_PARAM_TYPE_LEVEL, + CMD_PARAM_TYPE_PARM, + CMD_PARAM_TYPE_TOKEN, + CMD_PARAM_TYPE_FUNC, +} cmd_param_t; + struct cmdparams { /* Lookup table item for levels & parms */ union { setting_t s; /* Level or parm */ token_t t; /* TOKEN_BACKEND */ } id; + cmd_param_t cmdparamtype; /* CMD_PARAM_TYPE_LEVEL or CMD_PARAM_TYPE_PARM */ int command; /* CI-V command */ int subcmd; /* CI-V Subcommand */ int submod; /* Subcommand modifier */ @@ -167,8 +177,6 @@ struct icom_priv_caps int agc_levels_present; /* Flag to indicate that agc_levels array is populated */ struct icom_agc_level agc_levels[RIG_AGC_LAST + 1]; /* Icom rig-specific AGC levels, the last entry should have level -1 */ struct cmdparams *extcmds; /* Pointer to extended operations array */ - struct cmdparams *extlevels; /* Pointer to extended operations array */ - struct cmdparams *extparms; /* Pointer to extended operations array */ }; @@ -282,7 +290,7 @@ int icom_get_parm(RIG *rig, setting_t parm, value_t *val); int icom_set_ext_parm(RIG *rig, token_t token, value_t val); int icom_get_ext_parm(RIG *rig, token_t token, value_t *val); int icom_set_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t val); -int icom_get_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t *val); +int icom_get_ext_cmd(RIG *rig, vfo_t vfo, cmd_param_t cmdparamtype, token_t token, value_t *val); int icom_set_conf(RIG *rig, token_t token, const char *val); int icom_get_conf(RIG *rig, token_t token, char *val); int icom_set_powerstat(RIG *rig, powerstat_t status); diff --git a/rigs/icom/icr30.c b/rigs/icom/icr30.c index 84014af0..6300b986 100644 --- a/rigs/icom/icr30.c +++ b/rigs/icom/icr30.c @@ -68,9 +68,9 @@ struct confparams icr30_ext[] = struct cmdparams icr30_extcmds[] = { - { {.t = TOK_ANL}, C_CTL_MEM, S_MEM_ANL, SC_MOD_RW, 0, {}, CMD_DAT_BOL, 1 }, - { {.t = TOK_EAR}, C_CTL_MEM, S_MEM_EAR, SC_MOD_RW, 0, {}, CMD_DAT_BOL, 1 }, - { {.t = TOK_REC}, C_CTL_MEM, S_MEM_REC, SC_MOD_WR, 0, {}, CMD_DAT_BOL, 1 }, + { {.t = TOK_ANL}, CMD_PARAM_TYPE_TOKEN, C_CTL_MEM, S_MEM_ANL, SC_MOD_RW, 0, {}, CMD_DAT_BOL, 1 }, + { {.t = TOK_EAR}, CMD_PARAM_TYPE_TOKEN, C_CTL_MEM, S_MEM_EAR, SC_MOD_RW, 0, {}, CMD_DAT_BOL, 1 }, + { {.t = TOK_REC}, CMD_PARAM_TYPE_TOKEN, C_CTL_MEM, S_MEM_REC, SC_MOD_WR, 0, {}, CMD_DAT_BOL, 1 }, { {0} } }; diff --git a/rigs/icom/icr8600.c b/rigs/icom/icr8600.c index 1cfe03ca..a945cc22 100644 --- a/rigs/icom/icr8600.c +++ b/rigs/icom/icr8600.c @@ -69,10 +69,10 @@ struct cmdparams icr8600_extcmds[] = { - { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x38}, CMD_DAT_BOL, 1 }, - { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x15}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_KEYLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x16}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x32}, CMD_DAT_TIM, 2 }, + { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_C... [truncated message content] |
From: Nate B. <n0...@us...> - 2020-09-15 15:59: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 d817aefa3602f78ea2fa5d77bb69650107177ad1 (commit) from b97d05369cb4a8f27780837af8af99530c0665e0 (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 d817aefa3602f78ea2fa5d77bb69650107177ad1 Author: Nate Bargmann <n0...@n0...> Date: Tue Sep 15 10:58:17 2020 -0500 Removed TODO from Makefile.am With the TODO file removed, 'make dist' was failing. diff --git a/Makefile.am b/Makefile.am index b5ebaaf5..0e6c93f2 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 TODO LICENSE hamlib.m4 hamlib.pc.in README.developer \ +EXTRA_DIST = PLAN LICENSE hamlib.m4 hamlib.pc.in README.developer \ README.betatester README.win32 Android.mk doc_DATA = ChangeLog COPYING COPYING.LIB LICENSE \ ----------------------------------------------------------------------- Summary of changes: Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-09-15 04:13:02
|
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 b97d05369cb4a8f27780837af8af99530c0665e0 (commit) via b397fc07bd7ad59550086027a6595b30785f281c (commit) via 6267d2674e08ef7dc512831f2d241d7f50a76c9e (commit) via ebddade1dcdd588dcb4ce3f0dfa4616c82eb6037 (commit) via 9c5b7499f6767ca75b8e7da52dc0e1d5b6abea60 (commit) via 15a879d5ea2d06a17ae88e1952ec14d05b78e105 (commit) via 1c5c44edd2921dcf7dc7d24646fce9430837a623 (commit) via 52764221ca674e239cbf9254c4eb0c55e40d5ba7 (commit) via 12c2434dc7c925645950cd12c4b4ceee4c066098 (commit) via 3e2949ddf934cfcd73bf469382506e378f5b4075 (commit) via f41e07c0e68f70f95f8ba7e22dd488c20c3b0eda (commit) from cb2c757c6230767fd1191aed47c6d11a9c1900b3 (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 b97d05369cb4a8f27780837af8af99530c0665e0 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Sep 14 23:12:35 2020 -0500 astyle files diff --git a/lib/termios.c b/lib/termios.c index eb27729b..887b2ff6 100644 --- a/lib/termios.c +++ b/lib/termios.c @@ -828,7 +828,7 @@ int win32_serial_close(int fd) if ( index->filename ) free( index->filename ); */ free(index); - + LEAVE("serial_close"); return 0; @@ -2496,6 +2496,7 @@ int tcgetattr(int fd, struct termios *s_termios) myDCB.fParity = 1; #if 0 // redundant + if (myDCB.fParity) { #endif @@ -2524,12 +2525,14 @@ int tcgetattr(int fd, struct termios *s_termios) { s_termios->c_cflag &= ~(PARODD | CMSPAR | PARENB); } + #if 0 // see redundant above } else { s_termios->c_cflag &= ~PARENB; } + #endif /* CSIZE */ diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 658099cc..a2c40c04 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -324,9 +324,9 @@ const struct rig_caps ic7300_caps = RIG_CHAN_END, }, - .rx_range_list1 = { - {kHz(30), MHz(74.8), IC7300_ALL_RX_MODES, -1, -1, IC7300_VFOS}, RIG_FRNG_END, - }, + .rx_range_list1 = { + {kHz(30), MHz(74.8), IC7300_ALL_RX_MODES, -1, -1, IC7300_VFOS}, RIG_FRNG_END, + }, .tx_range_list1 = { FRQ_RNG_HF(1, IC7300_OTHER_TX_MODES, W(2), W(100), IC7300_VFOS, RIG_ANT_1), FRQ_RNG_60m(1, IC7300_OTHER_TX_MODES, W(2), W(100), IC7300_VFOS, RIG_ANT_1), @@ -741,46 +741,46 @@ const struct rig_caps ic705_caps = RIG_CHAN_END, }, - .rx_range_list1 = { + .rx_range_list1 = { {kHz(30), MHz(199.999999), IC705_ALL_RX_MODES, -1, -1, IC7300_VFOS, RIG_ANT_1, "USA"}, {MHz(400), MHz(470), IC705_ALL_RX_MODES, -1, -1, IC7300_VFOS, RIG_ANT_1, "USA"}, - RIG_FRNG_END, + RIG_FRNG_END, }, .tx_range_list1 = { - { kHz(1800), MHz(1.999999),IC705_ALL_TX_MODES, W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(3.5), MHz(3.999999),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(5.255), MHz(5.405),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(7.0), MHz(7.3),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(10.1), MHz(10.15),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(14.0), MHz(14.35),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(18.068), MHz(18.168),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(21.00), MHz(21.45),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(24.89), MHz(24.99),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(28.00), MHz(29.70),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(50.00), MHz(54.00),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(144.00), MHz(148.00),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, - { MHz(430.00), MHz(450.00),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "USA" }, + { kHz(1800), MHz(1.999999), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(3.5), MHz(3.999999), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(5.255), MHz(5.405), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(7.0), MHz(7.3), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(10.1), MHz(10.15), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(14.0), MHz(14.35), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(18.068), MHz(18.168), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(21.00), MHz(21.45), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(24.89), MHz(24.99), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(28.00), MHz(29.70), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(50.00), MHz(54.00), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(144.00), MHz(148.00), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, + { MHz(430.00), MHz(450.00), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "USA" }, RIG_FRNG_END, }, - .rx_range_list2 = { + .rx_range_list2 = { {kHz(30), MHz(199.999999), IC705_ALL_RX_MODES, -1, -1, IC7300_VFOS, RIG_ANT_1, "EUR"}, {MHz(400), MHz(470), IC705_ALL_RX_MODES, -1, -1, IC7300_VFOS, RIG_ANT_1, "EUR"}, - RIG_FRNG_END, + RIG_FRNG_END, }, .tx_range_list2 = { - { kHz(1810), MHz(1.999999),IC705_ALL_TX_MODES, W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, - { MHz(3.5), MHz(3.8),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, - { MHz(7.0), MHz(7.2),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, - { MHz(10.1), MHz(10.15),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, - { MHz(14.0), MHz(14.35),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, - { MHz(18.068), MHz(18.168),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, - { MHz(21.00), MHz(21.45),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, - { MHz(24.89), MHz(24.99),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, - { MHz(28.00), MHz(29.70),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, - { MHz(50.00), MHz(52.00),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, - { MHz(144.00), MHz(146.00),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, - { MHz(430.00), MHz(440.00),IC705_ALL_TX_MODES ,W(0.1) , W(10) , IC7300_VFOS, RIG_ANT_1, "EUR" }, + { kHz(1810), MHz(1.999999), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, + { MHz(3.5), MHz(3.8), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, + { MHz(7.0), MHz(7.2), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, + { MHz(10.1), MHz(10.15), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, + { MHz(14.0), MHz(14.35), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, + { MHz(18.068), MHz(18.168), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, + { MHz(21.00), MHz(21.45), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, + { MHz(24.89), MHz(24.99), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, + { MHz(28.00), MHz(29.70), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, + { MHz(50.00), MHz(52.00), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, + { MHz(144.00), MHz(146.00), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, + { MHz(430.00), MHz(440.00), IC705_ALL_TX_MODES, W(0.1), W(10), IC7300_VFOS, RIG_ANT_1, "EUR" }, RIG_FRNG_END, }, @@ -936,19 +936,24 @@ int ic7300_set_parm(RIG *rig, setting_t parm, value_t val) { prmbuf[0] = 0x1a; prmbuf[1] = 0x05; - switch (rig->caps->rig_model) { + + switch (rig->caps->rig_model) + { case RIG_MODEL_IC7300: prmbuf[2] = 0x00; prmbuf[3] = 0x39; break; + case RIG_MODEL_IC9700: prmbuf[2] = 0x01; prmbuf[3] = 0x77; break; + case RIG_MODEL_IC705: prmbuf[2] = 0x00; prmbuf[3] = 0x53; break; + default: return -RIG_ENIMPL; } @@ -965,22 +970,27 @@ int ic7300_set_parm(RIG *rig, setting_t parm, value_t val) hr = (int)((float) val.i / 3600.0); min = (int)((float)(val.i - (hr * 3600)) / 60.0); - switch (rig->caps->rig_model) { + switch (rig->caps->rig_model) + { case RIG_MODEL_IC7300: prmbuf[0] = 0x00; prmbuf[1] = 0x95; break; + case RIG_MODEL_IC9700: prmbuf[0] = 0x01; prmbuf[1] = 0x80; break; + case RIG_MODEL_IC705: prmbuf[0] = 0x01; prmbuf[1] = 0x66; break; + default: return -RIG_ENIMPL; } + to_bcd_be(prmbuf + 2, (long long) hr, 2); to_bcd_be(prmbuf + 3, (long long) min, 2); return icom_set_raw(rig, C_CTL_MEM, S_MEM_PARM, 4, prmbuf, 0, 0); @@ -1008,8 +1018,9 @@ int ic7300_get_parm(RIG *rig, setting_t parm, value_t *val) return -RIG_ENIMPL; // How can we implement this? default: - rig_debug(RIG_DEBUG_TRACE, "%s: using icom routine for PARM=%s\n", __func__, rig_strparm(parm)); - return icom_get_parm(rig,parm,val); + rig_debug(RIG_DEBUG_TRACE, "%s: using icom routine for PARM=%s\n", __func__, + rig_strparm(parm)); + return icom_get_parm(rig, parm, val); } retval = icom_transaction(rig, prm_cn, prm_sc, prmbuf, prm_len, resbuf, @@ -1033,11 +1044,12 @@ int ic7300_get_parm(RIG *rig, setting_t parm, value_t *val) switch (parm) { - case RIG_PARM_ANN: + case RIG_PARM_ANN: rig_debug(RIG_DEBUG_WARN, "%s: not implemented\n", __func__); return -RIG_ENIMPL; + default: - return icom_get_parm(rig,parm,val); + return icom_get_parm(rig, parm, val); } diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 7207ac77..0cad1438 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2703,12 +2703,14 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) for (i = 0; cmd && cmd[i].id.s != 0; i++) { - rig_debug(RIG_DEBUG_TRACE, "%s: i=%d\n", __func__, i); + rig_debug(RIG_DEBUG_TRACE, "%s: i=%d\n", __func__, i); + if (cmd[i].cmdparamtype == CMD_PARAM_TYPE_LEVEL && cmd[i].id.s == level) { return icom_get_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val); } } + rig_debug(RIG_DEBUG_TRACE, "%s: no extcmd found\n", __func__); rs = &rig->state; @@ -3189,7 +3191,7 @@ int icom_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val) } else if (cfp[i].token == token) { - return icom_get_ext_cmd(rig, vfo, CMD_PARAM_TYPE_LEVEL, token, val); + return icom_get_ext_cmd(rig, vfo, CMD_PARAM_TYPE_LEVEL, token, val); } else { i++; } } @@ -3239,7 +3241,8 @@ int icom_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status) } else if (cfp[i].token == token) { - return icom_get_ext_cmd(rig, vfo, CMD_PARAM_TYPE_FUNC, token, (value_t *)status); + return icom_get_ext_cmd(rig, vfo, CMD_PARAM_TYPE_FUNC, token, + (value_t *)status); } else { i++; } } @@ -3297,7 +3300,8 @@ int icom_get_ext_parm(RIG *rig, token_t token, value_t *val) return -RIG_EINVAL; } -int icom_get_ext_cmd(RIG *rig, vfo_t vfo, cmd_param_t cmdparamtype, token_t token, value_t *val) +int icom_get_ext_cmd(RIG *rig, vfo_t vfo, cmd_param_t cmdparamtype, + token_t token, value_t *val) { int i; diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index 67959ac3..9ffcaf91 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -650,30 +650,40 @@ int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) switch (level) { - case RIG_LEVEL_RFPOWER_METER: - cmd = "ZZRM5"; - len = 5; - break; - default: - return kenwood_get_level(rig,vfo,level,val); + case RIG_LEVEL_RFPOWER_METER: + cmd = "ZZRM5"; + len = 5; + break; + + default: + return kenwood_get_level(rig, vfo, level, val); } + retval = kenwood_safe_transaction(rig, cmd, lvlbuf, 10, len + 3); + if (retval != RIG_OK) { return retval; } + int n; + switch (level) { - case RIG_LEVEL_RFPOWER_METER: - n = sscanf(lvlbuf + len, "%f", &val->f); - if (n != 1) { - rig_debug(RIG_DEBUG_ERR,"%s: Error parsing RFPOWER from lvlbuf='%s'\n",__func__,lvlbuf); - return -RIG_EPROTO; - } - val->f /= 100; - break; + case RIG_LEVEL_RFPOWER_METER: + n = sscanf(lvlbuf + len, "%f", &val->f); + + if (n != 1) + { + rig_debug(RIG_DEBUG_ERR, "%s: Error parsing RFPOWER from lvlbuf='%s'\n", + __func__, lvlbuf); + return -RIG_EPROTO; + } + + val->f /= 100; + break; } + return RIG_OK; } diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index f3f1df76..09f4788d 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -355,7 +355,8 @@ transaction_read: if (retval < 0) { rig_debug(RIG_DEBUG_WARN, - "%s: read_string retval < 0, retval = %d, retry_read=%d, rs->rigport.retry=%d\n", __func__, + "%s: read_string retval < 0, retval = %d, retry_read=%d, rs->rigport.retry=%d\n", + __func__, retval, retry_read, rs->rigport.retry); // only retry if we expect a response from the command @@ -476,8 +477,10 @@ transaction_read: rig_debug(RIG_DEBUG_ERR, "%s: wrong reply %c%c for command %c%c\n", __func__, buffer[0], buffer[1], cmdstr[0], cmdstr[1]); - rig_debug(RIG_DEBUG_ERR, "%s: retry_read=%d, rs->rigport.retry=%d\n", __func__, retry_read, rs->rigport.retry); - if (retry_read++ < rs->rigport.retry) + rig_debug(RIG_DEBUG_ERR, "%s: retry_read=%d, rs->rigport.retry=%d\n", __func__, + retry_read, rs->rigport.retry); + + if (retry_read++ < rs->rigport.retry) { goto transaction_write; } commit b397fc07bd7ad59550086027a6595b30785f281c Merge: 1c5c44ed 6267d267 Author: Michael Black <mdb...@ya...> Date: Mon Sep 14 16:48:57 2020 -0500 Merge pull request #379 from mdblack98/master Fix icom levels commit 6267d2674e08ef7dc512831f2d241d7f50a76c9e Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Sep 14 14:45:36 2020 -0700 Fix icom LEVELs diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 06edd785..7207ac77 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2344,7 +2344,7 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) for (i = 0; cmd && cmd[i].id.s != 0; i++) { - if (cmd[i].id.s == level) + if (cmd[i].cmdparamtype == CMD_PARAM_TYPE_LEVEL && cmd[i].id.s == level) { return icom_set_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val); } commit ebddade1dcdd588dcb4ce3f0dfa4616c82eb6037 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Sep 14 14:34:52 2020 -0700 Fix debug statement in ic7300.c diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 6cc8486b..658099cc 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -1008,7 +1008,7 @@ int ic7300_get_parm(RIG *rig, setting_t parm, value_t *val) return -RIG_ENIMPL; // How can we implement this? default: - rig_debug(RIG_DEBUG_TRACE, "%s: using icom routine for PARM=%s", __func__, rig_strparm(parm)); + rig_debug(RIG_DEBUG_TRACE, "%s: using icom routine for PARM=%s\n", __func__, rig_strparm(parm)); return icom_get_parm(rig,parm,val); } commit 9c5b7499f6767ca75b8e7da52dc0e1d5b6abea60 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Sep 14 09:18:43 2020 -0700 Fix IC7300 set_parm PARM_TIME diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 3d2a0efc..6cc8486b 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -965,26 +965,25 @@ int ic7300_set_parm(RIG *rig, setting_t parm, value_t val) hr = (int)((float) val.i / 3600.0); min = (int)((float)(val.i - (hr * 3600)) / 60.0); - prmbuf[0] = 0x05; switch (rig->caps->rig_model) { case RIG_MODEL_IC7300: - prmbuf[2] = 0x00; - prmbuf[3] = 0x95; + prmbuf[0] = 0x00; + prmbuf[1] = 0x95; break; case RIG_MODEL_IC9700: - prmbuf[2] = 0x01; - prmbuf[3] = 0x80; + prmbuf[0] = 0x01; + prmbuf[1] = 0x80; break; case RIG_MODEL_IC705: - prmbuf[2] = 0x01; - prmbuf[3] = 0x66; + prmbuf[0] = 0x01; + prmbuf[1] = 0x66; break; default: return -RIG_ENIMPL; } - to_bcd_be(prmbuf + 3, (long long) hr, 2); - to_bcd_be(prmbuf + 4, (long long) min, 2); - return icom_set_raw(rig, C_CTL_MEM, S_MEM_PARM, 5, prmbuf, 0, 0); + to_bcd_be(prmbuf + 2, (long long) hr, 2); + to_bcd_be(prmbuf + 3, (long long) min, 2); + return icom_set_raw(rig, C_CTL_MEM, S_MEM_PARM, 4, prmbuf, 0, 0); default: rig_debug(RIG_DEBUG_ERR, "Unsupported set_parm %s\n", rig_strparm(parm)); diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 6fcd4f10..06edd785 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -5566,7 +5566,7 @@ int icom_set_parm(RIG *rig, setting_t parm, value_t val) for (i = 0; cmd && cmd[i].id.s != 0; i++) { - if (cmd[i].id.s == parm) + if (cmd[i].cmdparamtype == CMD_PARAM_TYPE_PARM && cmd[i].id.s == parm) { return icom_set_cmd(rig, RIG_VFO_NONE, (struct cmdparams *)&cmd[i], val); } commit 15a879d5ea2d06a17ae88e1952ec14d05b78e105 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Sep 14 11:08:38 2020 -0500 Add ic7300_get_parm and ic7300_set_parm diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 880dd0bf..3d2a0efc 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -38,6 +38,10 @@ #include "bandplan.h" #include "tones.h" +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); + + #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_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) @@ -404,8 +408,8 @@ const struct rig_caps ic7300_caps = .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_parm = ic7300_set_parm, + .get_parm = ic7300_get_parm, .set_mem = icom_set_mem, .vfo_op = icom_vfo_op, .scan = icom_scan, @@ -885,3 +889,162 @@ const struct rig_caps ic705_caps = .send_morse = icom_send_morse, .send_voice_mem = icom_send_voice_mem }; + +int ic7300_set_parm(RIG *rig, setting_t parm, value_t val) +{ + unsigned char prmbuf[MAXFRAMELEN]; + int min, hr; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + switch (parm) + { + case RIG_PARM_ANN: + { + int ann_mode = -1; + int ann_lang = -1; + + switch (val.i) + { + case RIG_ANN_OFF: + ann_mode = S_ANN_ALL; + break; + + case RIG_ANN_FREQ: + ann_mode = S_ANN_FREQ; + break; + + case RIG_ANN_RXMODE: + ann_mode = S_ANN_MODE; + break; + + case RIG_ANN_ENG: + case RIG_ANN_JAP: + ann_lang = (val.i == RIG_ANN_ENG) ? 0 : 1; + break; + + default: + rig_debug(RIG_DEBUG_ERR, "Unsupported RIG_PARM_ANN %d\n", val.i); + return -RIG_EINVAL; + } + + if (ann_mode >= 0) + { + return icom_set_raw(rig, C_CTL_ANN, ann_mode, 0, NULL, 0, 0); + } + else if (ann_lang >= 0) + { + prmbuf[0] = 0x1a; + prmbuf[1] = 0x05; + switch (rig->caps->rig_model) { + case RIG_MODEL_IC7300: + prmbuf[2] = 0x00; + prmbuf[3] = 0x39; + break; + case RIG_MODEL_IC9700: + prmbuf[2] = 0x01; + prmbuf[3] = 0x77; + break; + case RIG_MODEL_IC705: + prmbuf[2] = 0x00; + prmbuf[3] = 0x53; + break; + default: + return -RIG_ENIMPL; + } + + prmbuf[4] = ann_lang; + return icom_set_raw(rig, C_CTL_MEM, S_MEM_MODE_SLCT, 5, prmbuf, 0, 0); + } + + rig_debug(RIG_DEBUG_ERR, "Unsupported RIG_PARM_ANN %d\n", val.i); + return -RIG_EINVAL; + } + + case RIG_PARM_TIME: + hr = (int)((float) val.i / 3600.0); + min = (int)((float)(val.i - (hr * 3600)) / 60.0); + + prmbuf[0] = 0x05; + switch (rig->caps->rig_model) { + case RIG_MODEL_IC7300: + prmbuf[2] = 0x00; + prmbuf[3] = 0x95; + break; + case RIG_MODEL_IC9700: + prmbuf[2] = 0x01; + prmbuf[3] = 0x80; + break; + case RIG_MODEL_IC705: + prmbuf[2] = 0x01; + prmbuf[3] = 0x66; + break; + default: + return -RIG_ENIMPL; + } + to_bcd_be(prmbuf + 3, (long long) hr, 2); + to_bcd_be(prmbuf + 4, (long long) min, 2); + return icom_set_raw(rig, C_CTL_MEM, S_MEM_PARM, 5, prmbuf, 0, 0); + + default: + rig_debug(RIG_DEBUG_ERR, "Unsupported set_parm %s\n", rig_strparm(parm)); + return -RIG_EINVAL; + } +} + +int ic7300_get_parm(RIG *rig, setting_t parm, value_t *val) +{ + unsigned char prmbuf[MAXFRAMELEN], resbuf[MAXFRAMELEN]; + int prm_len, res_len; + int prm_cn, prm_sc; + int icom_val = 0; + int cmdhead; + int retval; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + switch (parm) + { + case RIG_PARM_ANN: + return -RIG_ENIMPL; // How can we implement this? + + default: + rig_debug(RIG_DEBUG_TRACE, "%s: using icom routine for PARM=%s", __func__, rig_strparm(parm)); + return icom_get_parm(rig,parm,val); + } + + retval = icom_transaction(rig, prm_cn, prm_sc, prmbuf, prm_len, resbuf, + &res_len); + + if (retval != RIG_OK) + { + return retval; + } + + cmdhead = 3; + res_len -= cmdhead; + + if (resbuf[0] != ACK && resbuf[0] != prm_cn) + { + rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, resbuf[0], + res_len); + return -RIG_ERJCTED; + } + + switch (parm) + { + + case RIG_PARM_ANN: + rig_debug(RIG_DEBUG_WARN, "%s: not implemented\n", __func__); + return -RIG_ENIMPL; + default: + return icom_get_parm(rig,parm,val); + } + + + rig_debug(RIG_DEBUG_TRACE, "%s: %d %d %d %f\n", __func__, res_len, icom_val, + val->i, val->f); + + return RIG_OK; +} + commit 1c5c44edd2921dcf7dc7d24646fce9430837a623 Merge: 52764221 3e2949dd Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Sep 14 08:02:52 2020 -0500 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 52764221ca674e239cbf9254c4eb0c55e40d5ba7 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Sep 14 08:02:42 2020 -0500 Make ic75 parm functions static diff --git a/rigs/icom/icr75.c b/rigs/icom/icr75.c index 955a7ab5..a813f557 100644 --- a/rigs/icom/icr75.c +++ b/rigs/icom/icr75.c @@ -93,8 +93,8 @@ static int icr75_set_channel(RIG *rig, const channel_t *chan); static int icr75_get_channel(RIG *rig, channel_t *chan, int read_only); -int icr75_set_parm(RIG *rig, setting_t parm, value_t val); -int icr75_get_parm(RIG *rig, setting_t parm, value_t *val); +static int icr75_set_parm(RIG *rig, setting_t parm, value_t val); +static int icr75_get_parm(RIG *rig, setting_t parm, value_t *val); static struct icom_priv_caps icr75_priv_caps = { commit 12c2434dc7c925645950cd12c4b4ceee4c066098 Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Sep 14 07:59:47 2020 -0500 Fix cppcheck warning in termios.c: diff --git a/lib/termios.c b/lib/termios.c index ac5ccb31..eb27729b 100644 --- a/lib/termios.c +++ b/lib/termios.c @@ -808,29 +808,27 @@ int win32_serial_close(int fd) first_tl = NULL; } - if (index) - { - if (index->rol.hEvent) { CloseHandle(index->rol.hEvent); } + if (index->rol.hEvent) { CloseHandle(index->rol.hEvent); } - if (index->wol.hEvent) { CloseHandle(index->wol.hEvent); } + if (index->wol.hEvent) { CloseHandle(index->wol.hEvent); } - if (index->sol.hEvent) { CloseHandle(index->sol.hEvent); } + if (index->sol.hEvent) { CloseHandle(index->sol.hEvent); } - if (index->hComm) { CloseHandle(index->hComm); } + if (index->hComm) { CloseHandle(index->hComm); } - if (index->ttyset) { free(index->ttyset); } + if (index->ttyset) { free(index->ttyset); } - if (index->astruct) { free(index->astruct); } + if (index->astruct) { free(index->astruct); } - if (index->sstruct) { free(index->sstruct); } + if (index->sstruct) { free(index->sstruct); } - if (index->sis) { free(index->sis); } + if (index->sis) { free(index->sis); } - /* had problems with strdup - if ( index->filename ) free( index->filename ); - */ - free(index); - } + /* had problems with strdup + if ( index->filename ) free( index->filename ); + */ + free(index); + LEAVE("serial_close"); return 0; @@ -1740,7 +1738,7 @@ int win32_serial_read(int fd, void *vb, int size) } } - sprintf(message, "end nBytes=%ld] ", nBytes); + sprintf(message, "end nBytes=%lu] ", nBytes); report(message); /* hl_usleep(1000); @@ -2497,8 +2495,10 @@ int tcgetattr(int fd, struct termios *s_termios) s_termios->c_cflag &= ~(PARENB | PARODD | CMSPAR); myDCB.fParity = 1; +#if 0 // redundant if (myDCB.fParity) { +#endif report("tcgetattr getting parity\n"); s_termios->c_cflag |= PARENB; @@ -2524,11 +2524,13 @@ int tcgetattr(int fd, struct termios *s_termios) { s_termios->c_cflag &= ~(PARODD | CMSPAR | PARENB); } +#if 0 // see redundant above } else { s_termios->c_cflag &= ~PARENB; } +#endif /* CSIZE */ s_termios->c_cflag |= bytesize_to_termios(myDCB.ByteSize); @@ -2752,11 +2754,11 @@ int tcsetattr(int fd, int when, struct termios *s_termios) if (dcb.EofChar != '\0') { - dcb.fBinary = 0; + dcb.fBinary = FALSE; } else { - dcb.fBinary = 1; + dcb.fBinary = TRUE; } if (EV_BREAK | EV_CTS | EV_DSR | EV_ERR | EV_RING | (EV_RLSD & EV_RXFLAG)) @@ -3536,38 +3538,10 @@ int win32_serial_ioctl(int fd, int request, ...) return -1; } - if (sistruct->frame != index->sis->frame) - { - sistruct->frame = index->sis->frame; - /* - printf( "---------------frame = %i\n", sistruct->frame++ ); - */ - } - - if (sistruct->overrun != index->sis->overrun) - { - /* - printf( "---------------overrun\n" ); - */ - sistruct->overrun = index->sis->overrun; - /* ErrCode &= ~CE_OVERRUN; */ - } - - if (sistruct->parity != index->sis->parity) - { - /* - printf( "---------------parity\n" ); - */ - sistruct->parity = index->sis->parity; - } - - if (sistruct->brk != index->sis->brk) - { - /* - printf( "---------------brk\n" ); - */ - sistruct->brk = index->sis->brk; - } + sistruct->frame = index->sis->frame; + sistruct->overrun = index->sis->overrun; + sistruct->parity = index->sis->parity; + sistruct->brk = index->sis->brk; va_end(ap); return 0; @@ -3777,7 +3751,7 @@ int win32_serial_select(int n, fd_set *readfds, fd_set *writefds, termios_setflags(fd, eventflags); } - if (!index || !index->event_flag) + if (!index->event_flag) { /* still setting up the port? hold off for a Sec so things can fire up commit 3e2949ddf934cfcd73bf469382506e378f5b4075 Merge: cb2c757c f41e07c0 Author: Michael Black <mdb...@ya...> Date: Mon Sep 14 07:37:16 2020 -0500 Merge pull request #378 from mdblack98/master Remove rptr functions from ic7300.c commit f41e07c0e68f70f95f8ba7e22dd488c20c3b0eda Author: Michael Black W9MDB <mdb...@ya...> Date: Mon Sep 14 07:34:02 2020 -0500 Remove rptr functions from ic7300.c https://github.com/Hamlib/Hamlib/issues/373 diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 68987aef..880dd0bf 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -270,7 +270,7 @@ const struct rig_caps ic7300_caps = RIG_MODEL(RIG_MODEL_IC7300), .model_name = "IC-7300", .mfg_name = "Icom", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -414,10 +414,10 @@ const struct rig_caps ic7300_caps = .get_dcd = icom_get_dcd, .set_ts = icom_set_ts, .get_ts = icom_get_ts, - .set_rptr_shift = icom_set_rptr_shift, - .get_rptr_shift = icom_get_rptr_shift, - .set_rptr_offs = icom_set_rptr_offs, - .get_rptr_offs = icom_get_rptr_offs, + .set_rptr_shift = NULL, + .get_rptr_shift = NULL, + .set_rptr_offs = NULL, + .get_rptr_offs = NULL, .set_ctcss_tone = icom_set_ctcss_tone, .get_ctcss_tone = icom_get_ctcss_tone, .set_ctcss_sql = icom_set_ctcss_sql, ----------------------------------------------------------------------- Summary of changes: lib/termios.c | 79 ++++++--------- rigs/icom/ic7300.c | 252 ++++++++++++++++++++++++++++++++++++++++-------- rigs/icom/icom.c | 16 +-- rigs/icom/icr75.c | 4 +- rigs/kenwood/flex6xxx.c | 38 +++++--- rigs/kenwood/kenwood.c | 9 +- 6 files changed, 283 insertions(+), 115 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Michael B. <mdb...@us...> - 2020-09-13 13:30:41
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via cb2c757c6230767fd1191aed47c6d11a9c1900b3 (commit) via fb9acd8b5eda50a0a89d3ac0f756f703317d48bc (commit) via 1dd62dc5d32333ab01d2b912b841175e4fd8a844 (commit) via aeaa96bc3b471c8c09e86a1e436e14be92c49019 (commit) via 6e45a7ba785cccf756f086617f246fd0e3e5be36 (commit) via 83667f4c65bf3b2ccb685c979734a1710b811695 (commit) via d47987db8502aa0ab486df1bb32780c0d8d37739 (commit) via 03ad7a953f4a31ab4b5c78a8394d6a5d62604801 (commit) via 54c522ef99014c0085d8f2ac9697002a4cf3900d (commit) from 975824c61856af7be12459f60296b5fbf15ced00 (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 cb2c757c6230767fd1191aed47c6d11a9c1900b3 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Sep 13 08:30:10 2020 -0500 Remove TODO files as they have been replaced with github issues diff --git a/TODO b/TODO deleted file mode 100644 index 9f1abb2b..00000000 --- a/TODO +++ /dev/null @@ -1,61 +0,0 @@ -hamlib - (C) Frank Singleton 2000 - - -GENERAL PROJECT TODO --------------------- - -1. Implement more interfaces/backends [ongoing] -2. Write More extensive Test Suites [ongoing] -3. Document API's [ongoing] -4. Document Limitations/Assumptions. -6. Encourage people to build cool GUI's using - our libs. (any GTK wiz's out here ..) -8. More safe checking during function calls (in rig_* wrappers). -13. ~/.hamlibrc and /etc/hamlibrc preferences file -14. Write the list of all functions that should be in the API -18. rewrite the post_write_delay. Active delay is a waste of cycles! [need test] -23. add support in the API for additional filters, DSP bandpass control -25. Write aclocal .m4 macro helpers for autoconf support [need test] -26. Write rig protocol simulator so no hardware is involved with Hamlib testing -27. complete memory bank support -28. add rig_srch_ctcss, rig_srch_dcs, etc. -29. emulate get_stuff (caching) if backend has no support for it -30. Write perl/python/etc. modules [ongoing] - -DONE ----- - -5. Build top level Makefile for maintenance - -7. Move common routines to a common area - and avoid duplication. - -9. If read from rig takes > "n" seconds, then no longer - block on read, just return error. - -10. Improve Makefiles (autoconf?) - -12. Add general rig capabilities handling. see rig.h - -15. Handle retransmissions (no more than n) if timeout (->backends) -16. Write .spec (rpm) and .deb (debian) package files - -17a. Add support for a configurable debug level (none, function calls, - packet traces) - -17b. In serial.c (and non serial too), use buffered IO instead of read/write, - for better performance. Use flushing with fwrite. - -18. Get Git updates mailed to our hamlib-cvs-digest list -19. specify how to access Reverse modes (CWR, RTTYR). through set_mode? -22. handle nicely different versions of same rig coming for - ITU region1/region2 ham band (-> freq ranges in capabilities) - -11. Add some scanning routines [ 1.1.2? ] - -20. adapt API include files to support C++ (__BEGIN_DECLS/__END_DECLS, etc.) -21. grab cygwin and test portability under Win32 (what about MacOS?) -24. Should Hamlib (the library itself) be LGPL'ed ? -31. Add some antenna tuner support -33. Merge dumpmem/dumpcaps into rigctl -32. Document C++/tcltk bindings, complete Hamlib API documentation using doxygen diff --git a/TODO.skeleton b/TODO.skeleton deleted file mode 100644 index 1f7dac7c..00000000 --- a/TODO.skeleton +++ /dev/null @@ -1,15 +0,0 @@ -hamlib - (C) Frank Singleton 2000 - -TODO.<your rig> - (C) <your name> 2000 -This shared library provides an API for communicating -via serial interface to a <your rig> using the <your interface> interface. - -TODO ----- - -1. Complete pcodes -2. Write More extensive Test Suite -3. Document API -4. Document Limitations/Assumptions. -5. - commit fb9acd8b5eda50a0a89d3ac0f756f703317d48bc Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Sep 13 08:08:23 2020 -0500 Adding phpdemo diff --git a/bindings/phpdemo.php b/bindings/phpdemo.php new file mode 100644 index 00000000..a1eb33aa --- /dev/null +++ b/bindings/phpdemo.php @@ -0,0 +1,41 @@ +<?php +// This example needs to be improved by adding get_freq, set_freq functions and such. +// Need to parse the returns from rigctl +print("Hamlib demo\n"); +$descriptorspec = array( + 0 => array("pipe", "r"), // stdin is a pipe that the child will read from + 1 => array("pipe", "w"), // stdout is a pipe that the child will write to + 2 => array("file", "/tmp/error-output.txt", "a") // stderr is a file to write to +); + +$cmd = "rigctl -m 2"; +$process = proc_open($cmd, $descriptorspec, $pipes); + +if (is_resource($process)) { + // $pipes now looks like this: + // 0 => writeable handle connected to child stdin + // 1 => readable handle connected to child stdout + // Any error output will be appended to /tmp/error-output.txt + + echo fread($pipes[1], 32); + + echo "Main Freq: "; + fwrite($pipes[0], "f Main\n"); + fread($pipes[1],32); + echo fread($pipes[1],64); + echo "\n"; + echo "=====\n"; + + fwrite($pipes[0], "f Sub\n"); + echo "Sub Freq:" ; + echo fread($pipes[1],32); + echo "\n"; + + fclose($pipes[0]); + fclose($pipes[1]); + + $return_value = proc_close($process); + + echo "command returned $return_value\n"; +} +?> commit 1dd62dc5d32333ab01d2b912b841175e4fd8a844 Merge: d47987db aeaa96bc Author: Michael Black <mdb...@ya...> Date: Sat Sep 12 23:42:39 2020 -0500 Merge pull request #376 from mdblack98/master Fix collisions between PARM, LEVEL, FUNC, TOKEN commit aeaa96bc3b471c8c09e86a1e436e14be92c49019 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 12 21:37:10 2020 -0700 Fix icom_get_parm to eliminate collisions diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index b25576ab..6fcd4f10 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2217,7 +2217,7 @@ int icom_set_cmd(RIG *rig, vfo_t vfo, struct cmdparams *par, value_t val) to_bcd_be(&cmdbuf[cmdlen], (int)(val.f * 255.0), (cmdlen * 2)); break; - case CMD_DAT_TIM: + case CMD_DAT_TIM: // returned as seconds since midnight to_bcd_be(&cmdbuf[cmdlen], ((((int)val.f / 3600) * 100) + (((int)val.f / 60) % 60)), (par->datlen * 2)); break; @@ -5628,7 +5628,7 @@ int icom_get_parm(RIG *rig, setting_t parm, value_t *val) for (i = 0; cmd && cmd[i].id.s != 0; i++) { - if (cmd[i].id.s == parm) + if (cmd[i].cmdparamtype == CMD_PARAM_TYPE_PARM && cmd[i].id.s == parm) { return icom_get_cmd(rig, RIG_VFO_NONE, (struct cmdparams *)&cmd[i], val); } diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index a1e1903c..9c23d651 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -31,7 +31,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20200911" +#define BACKEND_VER "20200912" /* * defines used by comp_cal_str in rig.c commit 6e45a7ba785cccf756f086617f246fd0e3e5be36 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 12 14:26:57 2020 -0700 Fix ic7300 VOXDELAY and other extcmd structures diff --git a/rigs/icom/ic7100.c b/rigs/icom/ic7100.c index 5320c55e..42dce0ee 100644 --- a/rigs/icom/ic7100.c +++ b/rigs/icom/ic7100.c @@ -108,11 +108,11 @@ int ic7100_tokens[] = { TOK_DSTAR_CODE, TOK_DSTAR_DSQL, TOK_DSTAR_CALL_SIGN, TOK struct cmdparams ic7100_extcmds[] = { - { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x03}, CMD_DAT_BOL, 1 }, - { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x04}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_KEYLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x05}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x21}, CMD_DAT_TIM, 2 }, - { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x65}, CMD_DAT_INT, 1 }, + { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x03}, CMD_DAT_BOL, 1 }, + { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x04}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_KEYLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x05}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x21}, CMD_DAT_TIM, 2 }, + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x65}, CMD_DAT_INT, 1 }, { {.s = RIG_PARM_NONE} } }; diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 9ce7b994..68987aef 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -62,7 +62,7 @@ struct cmdparams ic7300_extcmds[] = { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x23}, CMD_DAT_BOL, 1 }, { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x81}, CMD_DAT_LVL, 2 }, { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x95}, CMD_DAT_TIM, 2 }, - { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x59}, CMD_DAT_INT, 1 }, + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x59}, CMD_DAT_INT, 1 }, { {.s = RIG_PARM_NONE} } }; diff --git a/rigs/icom/ic7600.c b/rigs/icom/ic7600.c index f39e3e26..1b7add09 100644 --- a/rigs/icom/ic7600.c +++ b/rigs/icom/ic7600.c @@ -55,10 +55,10 @@ struct cmdparams ic7600_extcmds[] = { - { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x59}, CMD_DAT_BOL, 1 }, - { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x38}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x54}, CMD_DAT_TIM, 2 }, - { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, CMD_DAT_INT, 1 }, + { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x59}, CMD_DAT_BOL, 1 }, + { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x38}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x54}, CMD_DAT_TIM, 2 }, + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, CMD_DAT_INT, 1 }, { {.s = RIG_PARM_NONE} } }; diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 68497030..b25576ab 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2700,13 +2700,16 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) const struct cmdparams *cmd = priv->extcmds; int i; + for (i = 0; cmd && cmd[i].id.s != 0; i++) { + rig_debug(RIG_DEBUG_TRACE, "%s: i=%d\n", __func__, i); if (cmd[i].cmdparamtype == CMD_PARAM_TYPE_LEVEL && cmd[i].id.s == level) { return icom_get_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val); } } + rig_debug(RIG_DEBUG_TRACE, "%s: no extcmd found\n", __func__); rs = &rig->state; commit 83667f4c65bf3b2ccb685c979734a1710b811695 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 12 11:21:33 2020 -0500 Added CMD_PARAM_TYPE values for icom rigs to distinguish the different ext cmd types https://github.com/Hamlib/Hamlib/issues/373 diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 1cdcd0d1..9ce7b994 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -59,15 +59,15 @@ struct cmdparams ic7300_extcmds[] = { - { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x23}, CMD_DAT_BOL, 1 }, - { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x81}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x95}, CMD_DAT_TIM, 2 }, + { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x23}, CMD_DAT_BOL, 1 }, + { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x81}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x95}, CMD_DAT_TIM, 2 }, + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x59}, CMD_DAT_INT, 1 }, { {.s = RIG_PARM_NONE} } }; struct cmdparams ic7300_extlevels[] = { - { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x59}, CMD_DAT_INT, 1 }, }; /* @@ -151,15 +151,11 @@ struct cmdparams ic7300_extlevels[] = struct cmdparams ic9700_extcmds[] = { - { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x29}, CMD_DAT_BOL, 1 }, - { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x52}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_SCREENSAVER}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, CMD_DAT_INT, 1 }, - { {.s = RIG_PARM_NONE} } -}; - -struct cmdparams ic9700_extlevels[] = -{ - { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x30}, CMD_DAT_INT, 1 }, + { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x29}, CMD_DAT_BOL, 1 }, + { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x52}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_SCREENSAVER}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, CMD_DAT_INT, 1 }, + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x30}, CMD_DAT_INT, 1 }, + { {0} } }; #define IC9700_STR_CAL { 7, \ @@ -233,7 +229,6 @@ static const struct icom_priv_caps IC7300_priv_caps = { .level = -1, .icom_level = 0 }, }, .extcmds = ic7300_extcmds, /* Custom op parameters */ - .extlevels = ic7300_extlevels, /* Custom parameters */ }; static const struct icom_priv_caps IC9700_priv_caps = @@ -251,7 +246,6 @@ static const struct icom_priv_caps IC9700_priv_caps = { .level = -1, .icom_level = 0 }, }, .extcmds = ic9700_extcmds, /* Custom op parameters */ - .extlevels = ic9700_extlevels, /* Custom op parameters */ }; static const struct icom_priv_caps IC705_priv_caps = @@ -269,7 +263,6 @@ static const struct icom_priv_caps IC705_priv_caps = { .level = -1, .icom_level = 0 }, }, .extcmds = ic7300_extcmds, /* Custom parameters */ - .extlevels = ic7300_extlevels, /* Custom parameters */ }; const struct rig_caps ic7300_caps = diff --git a/rigs/icom/ic756.c b/rigs/icom/ic756.c index 730b802d..95ae2684 100644 --- a/rigs/icom/ic756.c +++ b/rigs/icom/ic756.c @@ -64,11 +64,11 @@ struct cmdparams ic756pro_cmdparms[] = { - { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x20}, CMD_DAT_BOL, 1 }, - { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x09}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x16}, CMD_DAT_TIM, 2 }, - { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x60}, CMD_DAT_INT, 1 }, - { {.s = RIG_PARM_NONE} } + { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x20}, CMD_DAT_BOL, 1 }, + { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x09}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x16}, CMD_DAT_TIM, 2 }, + { {.s = RIG_LEVEL_VOXDELAY}, CMD_PARAM_TYPE_LEVEL, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x60}, CMD_DAT_INT, 1 }, + { {0} } }; #define IC756PRO_STR_CAL { 16, \ diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 275f59da..68497030 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -476,34 +476,34 @@ const struct confparams icom_ext_parms[] = const struct cmdparams icom_ext_cmd[] = { - { {.t = TOK_DSTAR_DSQL}, C_CTL_DIG, S_DIG_DSCSQL, SC_MOD_RW, 1, {0}, CMD_DAT_BOL, 1 }, - { {.t = TOK_DSTAR_CALL_SIGN}, C_CTL_DIG, S_DIG_DSCALS, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 38 }, - { {.t = TOK_DSTAR_MESSAGE}, C_CTL_DIG, S_DIG_DSMESS, SC_MOD_RW12, 2, {0}, CMD_DAT_STR, 32 }, - { {.t = TOK_DSTAR_STATUS}, C_CTL_DIG, S_DIG_DSRSTS, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 1 }, - { {.t = TOK_DSTAR_GPS_DATA}, C_CTL_DIG, S_DIG_DSGPSD, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 52 }, - { {.t = TOK_DSTAR_GPS_MESS}, C_CTL_DIG, S_DIG_DSGPSM, SC_MOD_RW12, 2, {0}, CMD_DAT_STR, 52 }, - { {.t = TOK_DSTAR_CODE}, C_CTL_DIG, S_DIG_DSCSQL, SC_MOD_RW12, 2, {0}, CMD_DAT_FLT, 1 }, - { {.t = TOK_DSTAR_TX_DATA}, C_CTL_DSD, S_DSD_DSTXDT, SC_MOD_RW, 1, {0}, CMD_DAT_BUF, 30 }, - { {.t = TOK_DSTAR_MY_CS}, C_CTL_DVT, S_DVT_DSMYCS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 12 }, - { {.t = TOK_DSTAR_TX_CS}, C_CTL_DVT, S_DVT_DSTXCS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 24 }, - { {.t = TOK_DSTAR_TX_MESS}, C_CTL_DVT, S_DVT_DSTXMS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 20 }, - { {.t = TOK_DRIVE_GAIN}, C_CTL_LVL, S_LVL_DRIVE, SC_MOD_RW, 1, {0}, CMD_DAT_FLT, 2 }, - { {.t = TOK_DIGI_SEL_FUNC}, C_CTL_FUNC, S_FUNC_DIGISEL, SC_MOD_RW, 1, {0}, CMD_DAT_BOL, 1 }, - { {.t = TOK_DIGI_SEL_LEVEL}, C_CTL_LVL, S_LVL_DIGI, SC_MOD_RW, 1, {0}, CMD_DAT_FLT, 2 }, - { {.t = TOK_SCOPE_DAT}, C_CTL_SCP, S_SCP_DAT, SC_MOD_RD, 0, {0}, CMD_DAT_BUF, 481 }, - { {.t = TOK_SCOPE_STS}, C_CTL_SCP, S_SCP_STS, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, - { {.t = TOK_SCOPE_DOP}, C_CTL_SCP, S_SCP_DOP, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, - { {.t = TOK_SCOPE_MSS}, C_CTL_SCP, S_SCP_MSS, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, - { {.t = TOK_SCOPE_MOD}, C_CTL_SCP, S_SCP_MOD, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, - { {.t = TOK_SCOPE_SPN}, C_CTL_SCP, S_SCP_SPN, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 6 }, - { {.t = TOK_SCOPE_EDG}, C_CTL_SCP, S_SCP_EDG, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, - { {.t = TOK_SCOPE_HLD}, C_CTL_SCP, S_SCP_HLD, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, - { {.t = TOK_SCOPE_REF}, C_CTL_SCP, S_SCP_REF, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 4 }, - { {.t = TOK_SCOPE_SWP}, C_CTL_SCP, S_SCP_SWP, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, - { {.t = TOK_SCOPE_STX}, C_CTL_SCP, S_SCP_STX, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, - { {.t = TOK_SCOPE_TYP}, C_CTL_SCP, S_SCP_TYP, SC_MOD_RW, 0, {0}, CMD_DAT_INT, 1 }, - { {.t = TOK_SCOPE_VBW}, C_CTL_SCP, S_SCP_VBW, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, - { {.t = TOK_SCOPE_FEF}, C_CTL_SCP, S_SCP_FEF, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 12 }, + { {.t = TOK_DSTAR_DSQL}, CMD_PARAM_TYPE_TOKEN, C_CTL_DIG, S_DIG_DSCSQL, SC_MOD_RW, 1, {0}, CMD_DAT_BOL, 1 }, + { {.t = TOK_DSTAR_CALL_SIGN}, CMD_PARAM_TYPE_TOKEN, C_CTL_DIG, S_DIG_DSCALS, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 38 }, + { {.t = TOK_DSTAR_MESSAGE}, CMD_PARAM_TYPE_TOKEN, C_CTL_DIG, S_DIG_DSMESS, SC_MOD_RW12, 2, {0}, CMD_DAT_STR, 32 }, + { {.t = TOK_DSTAR_STATUS}, CMD_PARAM_TYPE_TOKEN, C_CTL_DIG, S_DIG_DSRSTS, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 1 }, + { {.t = TOK_DSTAR_GPS_DATA}, CMD_PARAM_TYPE_TOKEN, C_CTL_DIG, S_DIG_DSGPSD, SC_MOD_RW12, 2, {0}, CMD_DAT_BUF, 52 }, + { {.t = TOK_DSTAR_GPS_MESS}, CMD_PARAM_TYPE_TOKEN, C_CTL_DIG, S_DIG_DSGPSM, SC_MOD_RW12, 2, {0}, CMD_DAT_STR, 52 }, + { {.t = TOK_DSTAR_CODE}, CMD_PARAM_TYPE_TOKEN, C_CTL_DIG, S_DIG_DSCSQL, SC_MOD_RW12, 2, {0}, CMD_DAT_FLT, 1 }, + { {.t = TOK_DSTAR_TX_DATA}, CMD_PARAM_TYPE_TOKEN, C_CTL_DSD, S_DSD_DSTXDT, SC_MOD_RW, 1, {0}, CMD_DAT_BUF, 30 }, + { {.t = TOK_DSTAR_MY_CS}, CMD_PARAM_TYPE_TOKEN, C_CTL_DVT, S_DVT_DSMYCS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 12 }, + { {.t = TOK_DSTAR_TX_CS}, CMD_PARAM_TYPE_TOKEN, C_CTL_DVT, S_DVT_DSTXCS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 24 }, + { {.t = TOK_DSTAR_TX_MESS}, CMD_PARAM_TYPE_TOKEN, C_CTL_DVT, S_DVT_DSTXMS, SC_MOD_RW, 1, {0}, CMD_DAT_STR, 20 }, + { {.t = TOK_DRIVE_GAIN}, CMD_PARAM_TYPE_TOKEN, C_CTL_LVL, S_LVL_DRIVE, SC_MOD_RW, 1, {0}, CMD_DAT_FLT, 2 }, + { {.t = TOK_DIGI_SEL_FUNC}, CMD_PARAM_TYPE_TOKEN, C_CTL_FUNC, S_FUNC_DIGISEL, SC_MOD_RW, 1, {0}, CMD_DAT_BOL, 1 }, + { {.t = TOK_DIGI_SEL_LEVEL}, CMD_PARAM_TYPE_TOKEN, C_CTL_LVL, S_LVL_DIGI, SC_MOD_RW, 1, {0}, CMD_DAT_FLT, 2 }, + { {.t = TOK_SCOPE_DAT}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_DAT, SC_MOD_RD, 0, {0}, CMD_DAT_BUF, 481 }, + { {.t = TOK_SCOPE_STS}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_STS, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, + { {.t = TOK_SCOPE_DOP}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_DOP, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, + { {.t = TOK_SCOPE_MSS}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_MSS, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, + { {.t = TOK_SCOPE_MOD}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_MOD, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, + { {.t = TOK_SCOPE_SPN}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_SPN, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 6 }, + { {.t = TOK_SCOPE_EDG}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_EDG, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, + { {.t = TOK_SCOPE_HLD}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_HLD, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, + { {.t = TOK_SCOPE_REF}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_REF, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 4 }, + { {.t = TOK_SCOPE_SWP}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_SWP, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, + { {.t = TOK_SCOPE_STX}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_STX, SC_MOD_RW, 0, {0}, CMD_DAT_BOL, 1 }, + { {.t = TOK_SCOPE_TYP}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_TYP, SC_MOD_RW, 0, {0}, CMD_DAT_INT, 1 }, + { {.t = TOK_SCOPE_VBW}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_VBW, SC_MOD_RW, 0, {0}, CMD_DAT_WRD, 2 }, + { {.t = TOK_SCOPE_FEF}, CMD_PARAM_TYPE_TOKEN, C_CTL_SCP, S_SCP_FEF, SC_MOD_RW, 0, {0}, CMD_DAT_BUF, 12 }, { {0} } }; @@ -2340,7 +2340,7 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - const struct cmdparams *cmd = priv_caps->extlevels; + const struct cmdparams *cmd = priv_caps->extcmds; for (i = 0; cmd && cmd[i].id.s != 0; i++) { @@ -2697,12 +2697,12 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); const struct icom_priv_caps *priv = rig->caps->priv; - const struct cmdparams *cmd = priv->extlevels; + const struct cmdparams *cmd = priv->extcmds; int i; for (i = 0; cmd && cmd[i].id.s != 0; i++) { - if (cmd[i].id.s == level) + if (cmd[i].cmdparamtype == CMD_PARAM_TYPE_LEVEL && cmd[i].id.s == level) { return icom_get_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val); } @@ -3186,7 +3186,7 @@ int icom_get_ext_level(RIG *rig, vfo_t vfo, token_t token, value_t *val) } else if (cfp[i].token == token) { - return icom_get_ext_cmd(rig, vfo, token, val); + return icom_get_ext_cmd(rig, vfo, CMD_PARAM_TYPE_LEVEL, token, val); } else { i++; } } @@ -3236,7 +3236,7 @@ int icom_get_ext_func(RIG *rig, vfo_t vfo, token_t token, int *status) } else if (cfp[i].token == token) { - return icom_get_ext_cmd(rig, vfo, token, (value_t *)status); + return icom_get_ext_cmd(rig, vfo, CMD_PARAM_TYPE_FUNC, token, (value_t *)status); } else { i++; } } @@ -3286,7 +3286,7 @@ int icom_get_ext_parm(RIG *rig, token_t token, value_t *val) } else if (cfp[i].token == token) { - return icom_get_ext_cmd(rig, RIG_VFO_NONE, token, val); + return icom_get_ext_cmd(rig, RIG_VFO_NONE, CMD_PARAM_TYPE_PARM, token, val); } else { i++; } } @@ -3294,7 +3294,7 @@ int icom_get_ext_parm(RIG *rig, token_t token, value_t *val) return -RIG_EINVAL; } -int icom_get_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t *val) +int icom_get_ext_cmd(RIG *rig, vfo_t vfo, cmd_param_t cmdparamtype, token_t token, value_t *val) { int i; @@ -3316,7 +3316,7 @@ int icom_get_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t *val) cmd = icom_ext_cmd; i = 0; } - else if (cmd[i].id.t == token) + else if (cmd[i].cmdparamtype == cmdparamtype && cmd[i].id.t == token) { return icom_get_cmd(rig, vfo, (struct cmdparams *)&cmd[i], val); } diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index fe259658..a1e1903c 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -106,11 +106,21 @@ struct icom_agc_level icom_level; /* Icom AGC level for C_CTL_FUNC (0x16), S_FUNC_AGC (0x12) command */ }; +typedef enum +{ + CMD_PARAM_TYPE_NONE, + CMD_PARAM_TYPE_LEVEL, + CMD_PARAM_TYPE_PARM, + CMD_PARAM_TYPE_TOKEN, + CMD_PARAM_TYPE_FUNC, +} cmd_param_t; + struct cmdparams { /* Lookup table item for levels & parms */ union { setting_t s; /* Level or parm */ token_t t; /* TOKEN_BACKEND */ } id; + cmd_param_t cmdparamtype; /* CMD_PARAM_TYPE_LEVEL or CMD_PARAM_TYPE_PARM */ int command; /* CI-V command */ int subcmd; /* CI-V Subcommand */ int submod; /* Subcommand modifier */ @@ -167,8 +177,6 @@ struct icom_priv_caps int agc_levels_present; /* Flag to indicate that agc_levels array is populated */ struct icom_agc_level agc_levels[RIG_AGC_LAST + 1]; /* Icom rig-specific AGC levels, the last entry should have level -1 */ struct cmdparams *extcmds; /* Pointer to extended operations array */ - struct cmdparams *extlevels; /* Pointer to extended operations array */ - struct cmdparams *extparms; /* Pointer to extended operations array */ }; @@ -282,7 +290,7 @@ int icom_get_parm(RIG *rig, setting_t parm, value_t *val); int icom_set_ext_parm(RIG *rig, token_t token, value_t val); int icom_get_ext_parm(RIG *rig, token_t token, value_t *val); int icom_set_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t val); -int icom_get_ext_cmd(RIG *rig, vfo_t vfo, token_t token, value_t *val); +int icom_get_ext_cmd(RIG *rig, vfo_t vfo, cmd_param_t cmdparamtype, token_t token, value_t *val); int icom_set_conf(RIG *rig, token_t token, const char *val); int icom_get_conf(RIG *rig, token_t token, char *val); int icom_set_powerstat(RIG *rig, powerstat_t status); diff --git a/rigs/icom/icr30.c b/rigs/icom/icr30.c index 84014af0..6300b986 100644 --- a/rigs/icom/icr30.c +++ b/rigs/icom/icr30.c @@ -68,9 +68,9 @@ struct confparams icr30_ext[] = struct cmdparams icr30_extcmds[] = { - { {.t = TOK_ANL}, C_CTL_MEM, S_MEM_ANL, SC_MOD_RW, 0, {}, CMD_DAT_BOL, 1 }, - { {.t = TOK_EAR}, C_CTL_MEM, S_MEM_EAR, SC_MOD_RW, 0, {}, CMD_DAT_BOL, 1 }, - { {.t = TOK_REC}, C_CTL_MEM, S_MEM_REC, SC_MOD_WR, 0, {}, CMD_DAT_BOL, 1 }, + { {.t = TOK_ANL}, CMD_PARAM_TYPE_TOKEN, C_CTL_MEM, S_MEM_ANL, SC_MOD_RW, 0, {}, CMD_DAT_BOL, 1 }, + { {.t = TOK_EAR}, CMD_PARAM_TYPE_TOKEN, C_CTL_MEM, S_MEM_EAR, SC_MOD_RW, 0, {}, CMD_DAT_BOL, 1 }, + { {.t = TOK_REC}, CMD_PARAM_TYPE_TOKEN, C_CTL_MEM, S_MEM_REC, SC_MOD_WR, 0, {}, CMD_DAT_BOL, 1 }, { {0} } }; diff --git a/rigs/icom/icr8600.c b/rigs/icom/icr8600.c index 1cfe03ca..a945cc22 100644 --- a/rigs/icom/icr8600.c +++ b/rigs/icom/icr8600.c @@ -69,10 +69,10 @@ struct cmdparams icr8600_extcmds[] = { - { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x38}, CMD_DAT_BOL, 1 }, - { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x15}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_KEYLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x16}, CMD_DAT_LVL, 2 }, - { {.s = RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x32}, CMD_DAT_TIM, 2 }, + { {.s = RIG_PARM_BEEP}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x38}, CMD_DAT_BOL, 1 }, + { {.s = RIG_PARM_BACKLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x15}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_KEYLIGHT}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x16}, CMD_DAT_LVL, 2 }, + { {.s = RIG_PARM_TIME}, CMD_PARAM_TYPE_PARM, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x32}, CMD_DAT_TIM, 2 }, { {.s = RIG_PARM_NONE} } }; commit d47987db8502aa0ab486df1bb32780c0d8d37739 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 12 08:59:55 2020 -0500 Fix bindings since itu_region has been deprecated diff --git a/bindings/luatest.lua b/bindings/luatest.lua index 05de17b0..dd768745 100755 --- a/bindings/luatest.lua +++ b/bindings/luatest.lua @@ -22,15 +22,11 @@ function doStartup() my_rig:set_conf("retry", "5") my_rig:open() - -- 1073741944 is token value for "itu_region" - -- but using get_conf is much more convenient - region = my_rig:get_conf(1073741944) - regionstr = my_rig:get_conf("itu_region") tpath = my_rig:get_conf("rig_pathname") retry = my_rig:get_conf("retry") print (string.format("status(str):\t\t%s", Hamlib.rigerror(my_rig.error_status))) - print (string.format("get_conf:\t\tpath = %s, retry = %s, ITU region = %s, ITU region (str) = %s", tpath, retry, region, regionstr)) + print (string.format("get_conf:\t\tpath = %s, retry = %s", tpath, retry)) my_rig:set_freq(Hamlib.RIG_VFO_B, 5700000000) my_rig:set_vfo(Hamlib.RIG_VFO_B) @@ -45,7 +41,6 @@ function doStartup() mode, width = my_rig:get_mode() print(string.format("mode:\t\t\t%s\nbandwidth:\t\t%d", Hamlib.rig_strrmode(mode), width)) - print(string.format("ITU_region:\t\t%s", my_rig.state.itu_region)) print(string.format("Backend copyright:\t%s",my_rig.caps.copyright)) print(string.format("Model:\t\t\t%s", my_rig.caps.model_name)) diff --git a/bindings/perltest.pl b/bindings/perltest.pl index e5c9db74..91652ad2 100755 --- a/bindings/perltest.pl +++ b/bindings/perltest.pl @@ -15,12 +15,9 @@ $rig->set_conf("rig_pathname","/dev/Rig"); $rig->open(); -# 1073741944 is token value for "itu_region" -# but using get_conf is much more convenient -$region = $rig->get_conf(1073741944); $rpath = $rig->get_conf("rig_pathname"); $retry = $rig->get_conf("retry"); -print "get_conf:\t\tpath = \"$rpath\", retry = $retry, ITU region = $region\n"; +print "get_conf:\t\tpath = \"$rpath\", retry = $retry\n"; $rig->set_freq($Hamlib::RIG_VFO_A, 14266000); @@ -38,7 +35,6 @@ $rig->set_vfo($Hamlib::RIG_VFO_B); $rig->set_mode($Hamlib::RIG_MODE_CW, $Hamlib::RIG_PASSBAND_NORMAL); -print "ITU region:\t\t$rig->{state}->{itu_region}\n"; print "Backend copyright:\t$rig->{caps}->{copyright}\n"; print "Model:\t\t\t$rig->{caps}->{model_name}\n"; print "Manufacturer:\t\t$rig->{caps}->{mfg_name}\n"; diff --git a/bindings/py3test.py b/bindings/py3test.py index dd5b7456..8ed1cf42 100755 --- a/bindings/py3test.py +++ b/bindings/py3test.py @@ -25,15 +25,12 @@ def StartUp(): my_rig.open () - # 1073741944 is token value for "itu_region" - # but using get_conf is much more convenient - region = my_rig.get_conf(1073741944) rpath = my_rig.get_conf("rig_pathname") retry = my_rig.get_conf("retry") print("status(str):\t\t%s" % Hamlib.rigerror(my_rig.error_status)) - print("get_conf:\t\tpath = %s, retry = %s, ITU region = %s" \ - % (rpath, retry, region)) + print("get_conf:\t\tpath = %s, retry = %s" \ + % (rpath, retry)) my_rig.set_freq(Hamlib.RIG_VFO_B, 5700000000) my_rig.set_vfo(Hamlib.RIG_VFO_B) @@ -50,7 +47,6 @@ def StartUp(): print("mode:\t\t\t%s\nbandwidth:\t\t%s" % (Hamlib.rig_strrmode(mode), width)) - print("ITU_region:\t\t%s" % my_rig.state.itu_region) print("Backend copyright:\t%s" % my_rig.caps.copyright) print("Model:\t\t\t%s" % my_rig.caps.model_name) print("Manufacturer:\t\t%s" % my_rig.caps.mfg_name) diff --git a/bindings/pytest.py b/bindings/pytest.py index 797aa020..b271834a 100755 --- a/bindings/pytest.py +++ b/bindings/pytest.py @@ -25,15 +25,12 @@ def StartUp(verbose): my_rig.open() - # 1073741944 is token value for "itu_region" - # but using get_conf is much more convenient - region = my_rig.get_conf(1073741944) rpath = my_rig.get_conf("rig_pathname") retry = my_rig.get_conf("retry") print "status(str):\t\t", Hamlib.rigerror(my_rig.error_status) - print "get_conf:\t\tpath = %s, retry = %s, ITU region = %s" \ - % (rpath, retry, region) + print "get_conf:\t\tpath = %s, retry = %s" \ + % (rpath, retry) my_rig.set_freq(Hamlib.RIG_VFO_B, 5700000000) my_rig.set_vfo(Hamlib.RIG_VFO_B) @@ -50,7 +47,6 @@ def StartUp(verbose): print "mode:\t\t\t", Hamlib.rig_strrmode(mode), "\nbandwidth:\t\t", width - print "ITU_region:\t\t", my_rig.state.itu_region print "Backend copyright:\t", my_rig.caps.copyright print "Model:\t\t\t", my_rig.caps.model_name print "Manufacturer:\t\t", my_rig.caps.mfg_name diff --git a/bindings/tcltest.tcl.in b/bindings/tcltest.tcl.in index 107085bc..51e9c0b7 100644 --- a/bindings/tcltest.tcl.in +++ b/bindings/tcltest.tcl.in @@ -31,10 +31,8 @@ set mode [rig_strrmode [lindex $moderes 0]] puts "mode:\t\t$mode\nbandwidth:\t[lindex $moderes 1]Hz" set state [my_rig cget -state] -puts "ITU_region:\t[$state cget -itu_region]" # The following works well also -# puts ITU_region:[[my_rig cget -state] cget -itu_region] set rigcaps [my_rig cget -caps] #set model [$rigcaps cget -model_name] commit 03ad7a953f4a31ab4b5c78a8394d6a5d62604801 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Sep 11 22:44:35 2020 -0500 Update codeql diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 985121e8..1cdcd0d1 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -62,16 +62,12 @@ struct cmdparams ic7300_extcmds[] = { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x23}, CMD_DAT_BOL, 1 }, { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x81}, CMD_DAT_LVL, 2 }, { {.s = RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x95}, CMD_DAT_TIM, 2 }, - { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x91}, CMD_DAT_INT, 1 }, { {.s = RIG_PARM_NONE} } }; -struct cmdparams ic705_extcmds[] = +struct cmdparams ic7300_extlevels[] = { - { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x29}, CMD_DAT_BOL, 1 }, { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x59}, CMD_DAT_INT, 1 }, - { {.s = RIG_PARM_SCREENSAVER}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x38}, CMD_DAT_INT, 1 }, - { {.s = RIG_PARM_NONE} } }; /* @@ -157,11 +153,15 @@ struct cmdparams ic9700_extcmds[] = { { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x29}, CMD_DAT_BOL, 1 }, { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x52}, CMD_DAT_LVL, 2 }, - { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x30}, CMD_DAT_INT, 1 }, { {.s = RIG_PARM_SCREENSAVER}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, CMD_DAT_INT, 1 }, { {.s = RIG_PARM_NONE} } }; +struct cmdparams ic9700_extlevels[] = +{ + { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x30}, CMD_DAT_INT, 1 }, +}; + #define IC9700_STR_CAL { 7, \ { \ { 0, -54 }, \ @@ -233,6 +233,7 @@ static const struct icom_priv_caps IC7300_priv_caps = { .level = -1, .icom_level = 0 }, }, .extcmds = ic7300_extcmds, /* Custom op parameters */ + .extlevels = ic7300_extlevels, /* Custom parameters */ }; static const struct icom_priv_caps IC9700_priv_caps = @@ -250,6 +251,7 @@ static const struct icom_priv_caps IC9700_priv_caps = { .level = -1, .icom_level = 0 }, }, .extcmds = ic9700_extcmds, /* Custom op parameters */ + .extlevels = ic9700_extlevels, /* Custom op parameters */ }; static const struct icom_priv_caps IC705_priv_caps = @@ -266,7 +268,8 @@ static const struct icom_priv_caps IC705_priv_caps = { .level = RIG_AGC_SLOW, .icom_level = 3 }, { .level = -1, .icom_level = 0 }, }, - .extcmds = ic705_extcmds, /* Custom op parameters */ + .extcmds = ic7300_extcmds, /* Custom parameters */ + .extlevels = ic7300_extlevels, /* Custom parameters */ }; const struct rig_caps ic7300_caps = diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 059310bc..275f59da 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2340,7 +2340,7 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - const struct cmdparams *cmd = priv_caps->extcmds; + const struct cmdparams *cmd = priv_caps->extlevels; for (i = 0; cmd && cmd[i].id.s != 0; i++) { @@ -2697,7 +2697,7 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); const struct icom_priv_caps *priv = rig->caps->priv; - const struct cmdparams *cmd = priv->extcmds; + const struct cmdparams *cmd = priv->extlevels; int i; for (i = 0; cmd && cmd[i].id.s != 0; i++) commit 54c522ef99014c0085d8f2ac9697002a4cf3900d Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Sep 11 09:49:47 2020 -0500 Start of migrating Icom rigs to separate LEVEL and PARM values to avoid collisions https://github.com/Hamlib/Hamlib/issues/373 diff --git a/rigs/icom/ic756.c b/rigs/icom/ic756.c index 9c740424..730b802d 100644 --- a/rigs/icom/ic756.c +++ b/rigs/icom/ic756.c @@ -542,7 +542,7 @@ const struct rig_caps ic756pro2_caps = RIG_MODEL(RIG_MODEL_IC756PROII), .model_name = "IC-756PROII", .mfg_name = "Icom", - .version = BACKEND_VER ".1", + .version = BACKEND_VER ".0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 90fb245e..fe259658 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -31,7 +31,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20200910" +#define BACKEND_VER "20200911" /* * defines used by comp_cal_str in rig.c @@ -167,6 +167,8 @@ struct icom_priv_caps int agc_levels_present; /* Flag to indicate that agc_levels array is populated */ struct icom_agc_level agc_levels[RIG_AGC_LAST + 1]; /* Icom rig-specific AGC levels, the last entry should have level -1 */ struct cmdparams *extcmds; /* Pointer to extended operations array */ + struct cmdparams *extlevels; /* Pointer to extended operations array */ + struct cmdparams *extparms; /* Pointer to extended operations array */ }; ----------------------------------------------------------------------- Summary of changes: TODO | 61 ---------------------------------------- TODO.skeleton | 15 ---------- bindings/luatest.lua | 7 +---- bindings/perltest.pl | 6 +--- bindings/phpdemo.php | 41 +++++++++++++++++++++++++++ bindings/py3test.py | 8 ++---- bindings/pytest.py | 8 ++---- bindings/tcltest.tcl.in | 2 -- rigs/icom/ic7100.c | 10 +++---- rigs/icom/ic7300.c | 26 ++++++++--------- rigs/icom/ic756.c | 12 ++++---- rigs/icom/ic7600.c | 8 +++--- rigs/icom/icom.c | 75 +++++++++++++++++++++++++------------------------ rigs/icom/icom.h | 14 +++++++-- rigs/icom/icr30.c | 6 ++-- rigs/icom/icr8600.c | 8 +++--- 16 files changed, 131 insertions(+), 176 deletions(-) delete mode 100644 TODO delete mode 100644 TODO.skeleton create mode 100644 bindings/phpdemo.php hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Nate B. <n0...@us...> - 2020-09-12 17:52:01
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, Hamlib-4.0 has been updated via 8120c068ec845f12bdb0e1c62a02837344587f03 (commit) from 99a92d63b4ac027282ffee1a85e81e5c211bf026 (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 8120c068ec845f12bdb0e1c62a02837344587f03 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Sep 12 08:59:55 2020 -0500 Fix bindings since itu_region has been deprecated diff --git a/bindings/luatest.lua b/bindings/luatest.lua index 05de17b0..dd768745 100755 --- a/bindings/luatest.lua +++ b/bindings/luatest.lua @@ -22,15 +22,11 @@ function doStartup() my_rig:set_conf("retry", "5") my_rig:open() - -- 1073741944 is token value for "itu_region" - -- but using get_conf is much more convenient - region = my_rig:get_conf(1073741944) - regionstr = my_rig:get_conf("itu_region") tpath = my_rig:get_conf("rig_pathname") retry = my_rig:get_conf("retry") print (string.format("status(str):\t\t%s", Hamlib.rigerror(my_rig.error_status))) - print (string.format("get_conf:\t\tpath = %s, retry = %s, ITU region = %s, ITU region (str) = %s", tpath, retry, region, regionstr)) + print (string.format("get_conf:\t\tpath = %s, retry = %s", tpath, retry)) my_rig:set_freq(Hamlib.RIG_VFO_B, 5700000000) my_rig:set_vfo(Hamlib.RIG_VFO_B) @@ -45,7 +41,6 @@ function doStartup() mode, width = my_rig:get_mode() print(string.format("mode:\t\t\t%s\nbandwidth:\t\t%d", Hamlib.rig_strrmode(mode), width)) - print(string.format("ITU_region:\t\t%s", my_rig.state.itu_region)) print(string.format("Backend copyright:\t%s",my_rig.caps.copyright)) print(string.format("Model:\t\t\t%s", my_rig.caps.model_name)) diff --git a/bindings/perltest.pl b/bindings/perltest.pl index e5c9db74..91652ad2 100755 --- a/bindings/perltest.pl +++ b/bindings/perltest.pl @@ -15,12 +15,9 @@ $rig->set_conf("rig_pathname","/dev/Rig"); $rig->open(); -# 1073741944 is token value for "itu_region" -# but using get_conf is much more convenient -$region = $rig->get_conf(1073741944); $rpath = $rig->get_conf("rig_pathname"); $retry = $rig->get_conf("retry"); -print "get_conf:\t\tpath = \"$rpath\", retry = $retry, ITU region = $region\n"; +print "get_conf:\t\tpath = \"$rpath\", retry = $retry\n"; $rig->set_freq($Hamlib::RIG_VFO_A, 14266000); @@ -38,7 +35,6 @@ $rig->set_vfo($Hamlib::RIG_VFO_B); $rig->set_mode($Hamlib::RIG_MODE_CW, $Hamlib::RIG_PASSBAND_NORMAL); -print "ITU region:\t\t$rig->{state}->{itu_region}\n"; print "Backend copyright:\t$rig->{caps}->{copyright}\n"; print "Model:\t\t\t$rig->{caps}->{model_name}\n"; print "Manufacturer:\t\t$rig->{caps}->{mfg_name}\n"; diff --git a/bindings/py3test.py b/bindings/py3test.py index dd5b7456..8ed1cf42 100755 --- a/bindings/py3test.py +++ b/bindings/py3test.py @@ -25,15 +25,12 @@ def StartUp(): my_rig.open () - # 1073741944 is token value for "itu_region" - # but using get_conf is much more convenient - region = my_rig.get_conf(1073741944) rpath = my_rig.get_conf("rig_pathname") retry = my_rig.get_conf("retry") print("status(str):\t\t%s" % Hamlib.rigerror(my_rig.error_status)) - print("get_conf:\t\tpath = %s, retry = %s, ITU region = %s" \ - % (rpath, retry, region)) + print("get_conf:\t\tpath = %s, retry = %s" \ + % (rpath, retry)) my_rig.set_freq(Hamlib.RIG_VFO_B, 5700000000) my_rig.set_vfo(Hamlib.RIG_VFO_B) @@ -50,7 +47,6 @@ def StartUp(): print("mode:\t\t\t%s\nbandwidth:\t\t%s" % (Hamlib.rig_strrmode(mode), width)) - print("ITU_region:\t\t%s" % my_rig.state.itu_region) print("Backend copyright:\t%s" % my_rig.caps.copyright) print("Model:\t\t\t%s" % my_rig.caps.model_name) print("Manufacturer:\t\t%s" % my_rig.caps.mfg_name) diff --git a/bindings/pytest.py b/bindings/pytest.py index 797aa020..b271834a 100755 --- a/bindings/pytest.py +++ b/bindings/pytest.py @@ -25,15 +25,12 @@ def StartUp(verbose): my_rig.open() - # 1073741944 is token value for "itu_region" - # but using get_conf is much more convenient - region = my_rig.get_conf(1073741944) rpath = my_rig.get_conf("rig_pathname") retry = my_rig.get_conf("retry") print "status(str):\t\t", Hamlib.rigerror(my_rig.error_status) - print "get_conf:\t\tpath = %s, retry = %s, ITU region = %s" \ - % (rpath, retry, region) + print "get_conf:\t\tpath = %s, retry = %s" \ + % (rpath, retry) my_rig.set_freq(Hamlib.RIG_VFO_B, 5700000000) my_rig.set_vfo(Hamlib.RIG_VFO_B) @@ -50,7 +47,6 @@ def StartUp(verbose): print "mode:\t\t\t", Hamlib.rig_strrmode(mode), "\nbandwidth:\t\t", width - print "ITU_region:\t\t", my_rig.state.itu_region print "Backend copyright:\t", my_rig.caps.copyright print "Model:\t\t\t", my_rig.caps.model_name print "Manufacturer:\t\t", my_rig.caps.mfg_name diff --git a/bindings/tcltest.tcl.in b/bindings/tcltest.tcl.in index 107085bc..51e9c0b7 100644 --- a/bindings/tcltest.tcl.in +++ b/bindings/tcltest.tcl.in @@ -31,10 +31,8 @@ set mode [rig_strrmode [lindex $moderes 0]] puts "mode:\t\t$mode\nbandwidth:\t[lindex $moderes 1]Hz" set state [my_rig cget -state] -puts "ITU_region:\t[$state cget -itu_region]" # The following works well also -# puts ITU_region:[[my_rig cget -state] cget -itu_region] set rigcaps [my_rig cget -caps] #set model [$rigcaps cget -model_name] ----------------------------------------------------------------------- Summary of changes: bindings/luatest.lua | 7 +------ bindings/perltest.pl | 6 +----- bindings/py3test.py | 8 ++------ bindings/pytest.py | 8 ++------ bindings/tcltest.tcl.in | 2 -- 5 files changed, 6 insertions(+), 25 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |
From: Nate B. <n0...@us...> - 2020-09-12 13:53:40
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, Hamlib-4.0 has been updated via 99a92d63b4ac027282ffee1a85e81e5c211bf026 (commit) via 7377068a508a4a74e46b44571fa161cadcd94379 (commit) via 33c81771e3897c2fcae2c0a36bf00041f91053c6 (commit) via b8f789149fa3fc616cd77882a8e543e598392eb0 (commit) via cc994ee0fc47636d80efb62821646223bb264769 (commit) via c120c9990cd18c8fcd88d54e7689f4286d636912 (commit) via fd7a795473868ac50b17a0af9eb0b3c4601c7bb3 (commit) via 5af1ef3be6c243e45b3ed81dad0d7aaef827309c (commit) via 5e7b46eeeea9bbed648da059c0e428cc8c807a02 (commit) via 4f65a03bff6a828e27b6c0047629b4c67abd17b3 (commit) from 03bc9386288dad95cb917eab8bae66ef751df9fc (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 99a92d63b4ac027282ffee1a85e81e5c211bf026 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Sep 11 22:44:35 2020 -0500 Update codeql diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 985121e8..1cdcd0d1 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -62,16 +62,12 @@ struct cmdparams ic7300_extcmds[] = { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x23}, CMD_DAT_BOL, 1 }, { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x81}, CMD_DAT_LVL, 2 }, { {.s = RIG_PARM_TIME}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x95}, CMD_DAT_TIM, 2 }, - { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x91}, CMD_DAT_INT, 1 }, { {.s = RIG_PARM_NONE} } }; -struct cmdparams ic705_extcmds[] = +struct cmdparams ic7300_extlevels[] = { - { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x29}, CMD_DAT_BOL, 1 }, { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x59}, CMD_DAT_INT, 1 }, - { {.s = RIG_PARM_SCREENSAVER}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x38}, CMD_DAT_INT, 1 }, - { {.s = RIG_PARM_NONE} } }; /* @@ -157,11 +153,15 @@ struct cmdparams ic9700_extcmds[] = { { {.s = RIG_PARM_BEEP}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x00, 0x29}, CMD_DAT_BOL, 1 }, { {.s = RIG_PARM_BACKLIGHT}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x52}, CMD_DAT_LVL, 2 }, - { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x30}, CMD_DAT_INT, 1 }, { {.s = RIG_PARM_SCREENSAVER}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x01, 0x67}, CMD_DAT_INT, 1 }, { {.s = RIG_PARM_NONE} } }; +struct cmdparams ic9700_extlevels[] = +{ + { {.s = RIG_LEVEL_VOXDELAY}, C_CTL_MEM, S_MEM_PARM, SC_MOD_RW, 2, {0x03, 0x30}, CMD_DAT_INT, 1 }, +}; + #define IC9700_STR_CAL { 7, \ { \ { 0, -54 }, \ @@ -233,6 +233,7 @@ static const struct icom_priv_caps IC7300_priv_caps = { .level = -1, .icom_level = 0 }, }, .extcmds = ic7300_extcmds, /* Custom op parameters */ + .extlevels = ic7300_extlevels, /* Custom parameters */ }; static const struct icom_priv_caps IC9700_priv_caps = @@ -250,6 +251,7 @@ static const struct icom_priv_caps IC9700_priv_caps = { .level = -1, .icom_level = 0 }, }, .extcmds = ic9700_extcmds, /* Custom op parameters */ + .extlevels = ic9700_extlevels, /* Custom op parameters */ }; static const struct icom_priv_caps IC705_priv_caps = @@ -266,7 +268,8 @@ static const struct icom_priv_caps IC705_priv_caps = { .level = RIG_AGC_SLOW, .icom_level = 3 }, { .level = -1, .icom_level = 0 }, }, - .extcmds = ic705_extcmds, /* Custom op parameters */ + .extcmds = ic7300_extcmds, /* Custom parameters */ + .extlevels = ic7300_extlevels, /* Custom parameters */ }; const struct rig_caps ic7300_caps = diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 059310bc..275f59da 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2340,7 +2340,7 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - const struct cmdparams *cmd = priv_caps->extcmds; + const struct cmdparams *cmd = priv_caps->extlevels; for (i = 0; cmd && cmd[i].id.s != 0; i++) { @@ -2697,7 +2697,7 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); const struct icom_priv_caps *priv = rig->caps->priv; - const struct cmdparams *cmd = priv->extcmds; + const struct cmdparams *cmd = priv->extlevels; int i; for (i = 0; cmd && cmd[i].id.s != 0; i++) commit 7377068a508a4a74e46b44571fa161cadcd94379 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Sep 11 09:49:47 2020 -0500 Start of migrating Icom rigs to separate LEVEL and PARM values to avoid collisions https://github.com/Hamlib/Hamlib/issues/373 diff --git a/rigs/icom/ic756.c b/rigs/icom/ic756.c index 9c740424..730b802d 100644 --- a/rigs/icom/ic756.c +++ b/rigs/icom/ic756.c @@ -542,7 +542,7 @@ const struct rig_caps ic756pro2_caps = RIG_MODEL(RIG_MODEL_IC756PROII), .model_name = "IC-756PROII", .mfg_name = "Icom", - .version = BACKEND_VER ".1", + .version = BACKEND_VER ".0", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 90fb245e..fe259658 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -31,7 +31,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20200910" +#define BACKEND_VER "20200911" /* * defines used by comp_cal_str in rig.c @@ -167,6 +167,8 @@ struct icom_priv_caps int agc_levels_present; /* Flag to indicate that agc_levels array is populated */ struct icom_agc_level agc_levels[RIG_AGC_LAST + 1]; /* Icom rig-specific AGC levels, the last entry should have level -1 */ struct cmdparams *extcmds; /* Pointer to extended operations array */ + struct cmdparams *extlevels; /* Pointer to extended operations array */ + struct cmdparams *extparms; /* Pointer to extended operations array */ }; commit 33c81771e3897c2fcae2c0a36bf00041f91053c6 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Sep 11 08:40:07 2020 -0500 Update rigctl.1 set_ant diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index ff0b3c6b..7814e960 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -667,7 +667,7 @@ and .IP Number is 1-based antenna# (\(oq1\(cq, \(oq2\(cq, \(oq3\(cq, ...). .IP -Option depends on rig..for Icom it probably sets the RX only flag. See your manual for specific option values. +Option depends on rig..for Icom it probably sets the RX only flag as in the IC-7851. See your manual for specific option values. Most rigs don't care about the option. . .TP .BR y ", " get_ant " \(aq" \fIAntenna\fP \(aq commit b8f789149fa3fc616cd77882a8e543e598392eb0 Author: Michael Black W9MDB <mdb...@ya...> Date: Fri Sep 11 08:04:43 2020 -0500 Remove RIG_LEVEL_BRIGHT from dumpmem.c diff --git a/tests/dumpmem.c b/tests/dumpmem.c index 97cf6edc..9f965b53 100644 --- a/tests/dumpmem.c +++ b/tests/dumpmem.c @@ -397,10 +397,5 @@ int dump_chan(RIG *rig, int chan_num) printf("BKINDL: %d\n", chan.levels[rig_setting2idx(RIG_LEVEL_BKINDL)].i); } - if (rig_has_set_level(rig, RIG_LEVEL_BRIGHT)) - { - printf("BRIGHT: %d\n", chan.levels[rig_setting2idx(RIG_LEVEL_BRIGHT)].i); - } - return 0; } commit cc994ee0fc47636d80efb62821646223bb264769 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Sep 10 15:32:17 2020 -0500 Add RIG_LEVEL_AF to k3.c diff --git a/rigs/kenwood/k3.c b/rigs/kenwood/k3.c index 08e2a873..3ae0afc8 100644 --- a/rigs/kenwood/k3.c +++ b/rigs/kenwood/k3.c @@ -180,7 +180,7 @@ const struct rig_caps k3_caps = RIG_MODEL(RIG_MODEL_K3), .model_name = "K3", .mfg_name = "Elecraft", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -329,7 +329,7 @@ const struct rig_caps k3s_caps = RIG_MODEL(RIG_MODEL_K3S), .model_name = "K3S", .mfg_name = "Elecraft", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -479,7 +479,7 @@ const struct rig_caps k4_caps = RIG_MODEL(RIG_MODEL_K4), .model_name = "K4", .mfg_name = "Elecraft", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_ALPHA, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -628,7 +628,7 @@ const struct rig_caps kx3_caps = RIG_MODEL(RIG_MODEL_KX3), .model_name = "KX3", .mfg_name = "Elecraft", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -777,7 +777,7 @@ const struct rig_caps kx2_caps = RIG_MODEL(RIG_MODEL_KX2), .model_name = "KX2", .mfg_name = "Elecraft", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_TRANSCEIVER, @@ -1664,6 +1664,10 @@ int k3_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) snprintf(levelbuf, sizeof(levelbuf), "SQ%03d", (int)(val.f * 29.0f)); break; + case RIG_LEVEL_AF: + snprintf(levelbuf, sizeof(levelbuf), "AG%03d", (int)(val.f * 250.0f)); + break; + case RIG_LEVEL_RF: snprintf(levelbuf, sizeof(levelbuf), "RG%03d", (int)(val.f * 250.0f)); break; @@ -1908,6 +1912,18 @@ int k3_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->f = (float) lvl / 29.0f; break; + case RIG_LEVEL_AF: + retval = kenwood_safe_transaction(rig, "AG", lvlbuf, sizeof(lvlbuf), 5); + + if (retval != RIG_OK) + { + return retval; + } + + sscanf(lvlbuf + 2, "%d", &lvl); + val->f = (float) lvl / 250.0f; + break; + case RIG_LEVEL_RF: retval = kenwood_safe_transaction(rig, "RG", lvlbuf, sizeof(lvlbuf), 5); commit c120c9990cd18c8fcd88d54e7689f4286d636912 Author: Michael Black W9MDB <mdb...@ya...> Date: Thu Sep 10 10:07:11 2020 -0500 Remove redundant RIG_LEVEL_BRIGHT diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 57f9c32f..b382f9d1 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -880,7 +880,7 @@ enum rig_level_e { RIG_LEVEL_NOTCHF_RAW = CONSTANT_64BIT_FLAG(36), /*!< \c NOTCHF_RAW -- Notch Freq., arg float [0.0 ... 1.0] */ RIG_LEVEL_MONITOR_GAIN = CONSTANT_64BIT_FLAG(37), /*!< \c MONITOR_GAIN -- Monitor gain (level for monitoring of transmitted audio), arg float [0.0 ... 1.0] */ RIG_LEVEL_NB = CONSTANT_64BIT_FLAG(38), /*!< \c NB -- Noise Blanker level, arg float [0.0 ... 1.0] */ - RIG_LEVEL_BRIGHT = CONSTANT_64BIT_FLAG(39), /*!< \c Display brightness */ + RIG_LEVEL_39 = CONSTANT_64BIT_FLAG(39), /*!< \c Future use */ RIG_LEVEL_40 = CONSTANT_64BIT_FLAG(40), /*!< \c Future use */ RIG_LEVEL_41 = CONSTANT_64BIT_FLAG(41), /*!< \c Future use */ RIG_LEVEL_42 = CONSTANT_64BIT_FLAG(42), /*!< \c Future use */ diff --git a/rigs/icom/ic7300.c b/rigs/icom/ic7300.c index 26df43b9..985121e8 100644 --- a/rigs/icom/ic7300.c +++ b/rigs/icom/ic7300.c @@ -139,7 +139,7 @@ struct cmdparams ic705_extcmds[] = #define IC705_ALL_TX_MODES (RIG_MODE_FM|RIG_MODE_AM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_DSTAR) #define IC705_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|RIG_MODE_DSTAR) #define IC705_OTHER_TX_MODES (RIG_MODE_FM|RIG_MODE_CW|RIG_MODE_CWR|RIG_MODE_SSB|RIG_MODE_RTTY|RIG_MODE_RTTYR|RIG_MODE_DSTAR) -#define IC705_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|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_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB|RIG_LEVEL_BRIGHT) +#define IC705_LEVELS (RIG_LEVEL_PREAMP|RIG_LEVEL_ATT|RIG_LEVEL_AGC|RIG_LEVEL_COMP|RIG_LEVEL_BKINDL|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_VOXGAIN|RIG_LEVEL_ANTIVOX|RIG_LEVEL_VOXDELAY|RIG_LEVEL_SWR|RIG_LEVEL_ALC|RIG_LEVEL_RFPOWER_METER|RIG_LEVEL_COMP_METER|RIG_LEVEL_VD_METER|RIG_LEVEL_ID_METER|RIG_LEVEL_MONITOR_GAIN|RIG_LEVEL_NB) /* * IC9700 items that differ from IC7300 diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 24a6cd32..059310bc 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -2653,11 +2653,6 @@ int icom_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) lvl_sc = S_LVL_MON; break; - case RIG_LEVEL_BRIGHT: - lvl_cn = C_CTL_LVL; - lvl_sc = S_LVL_BRIGHT; - break; - default: rig_debug(RIG_DEBUG_ERR, "%s: unsupported set_level %s", __func__, rig_strlevel(level)); diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index b5959882..90fb245e 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -31,7 +31,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20200906" +#define BACKEND_VER "20200910" /* * defines used by comp_cal_str in rig.c diff --git a/rigs/kenwood/flex6xxx.c b/rigs/kenwood/flex6xxx.c index a1f598c2..67959ac3 100644 --- a/rigs/kenwood/flex6xxx.c +++ b/rigs/kenwood/flex6xxx.c @@ -47,6 +47,9 @@ #define F6K_ANTS (RIG_ANT_1|RIG_ANT_2|RIG_ANT_3) +/* PowerSDR differences */ +#define POWERSDR_LEVEL_ALL (RIG_LEVEL_SLOPE_HIGH|RIG_LEVEL_SLOPE_LOW|RIG_LEVEL_KEYSPD|RIG_LEVEL_RFPOWER_METER) + static rmode_t flex_mode_table[KENWOOD_MODE_TABLE_MAX] = { @@ -628,6 +631,52 @@ int flex6k_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) return err; } +/* + * powersdr_get_level + */ +int powersdr_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) +{ + char lvlbuf[KENWOOD_MAX_BUF_LEN]; + char *cmd; + int retval; + int len; + + rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); + + if (!val) + { + return -RIG_EINVAL; + } + + switch (level) + { + case RIG_LEVEL_RFPOWER_METER: + cmd = "ZZRM5"; + len = 5; + break; + default: + return kenwood_get_level(rig,vfo,level,val); + } + retval = kenwood_safe_transaction(rig, cmd, lvlbuf, 10, len + 3); + if (retval != RIG_OK) + { + return retval; + } + int n; + switch (level) + { + case RIG_LEVEL_RFPOWER_METER: + n = sscanf(lvlbuf + len, "%f", &val->f); + if (n != 1) { + rig_debug(RIG_DEBUG_ERR,"%s: Error parsing RFPOWER from lvlbuf='%s'\n",__func__,lvlbuf); + return -RIG_EPROTO; + } + val->f /= 100; + break; + } + return RIG_OK; +} + /* * F6K rig capabilities. @@ -785,7 +834,7 @@ const struct rig_caps powersdr_caps = .has_get_func = RIG_FUNC_NONE, /* has VOX but not implemented here */ .has_set_func = RIG_FUNC_NONE, - .has_get_level = F6K_LEVEL_ALL, + .has_get_level = POWERSDR_LEVEL_ALL, .has_set_level = F6K_LEVEL_ALL, .has_get_parm = RIG_PARM_NONE, .has_set_parm = RIG_PARM_NONE, /* FIXME: parms */ @@ -879,7 +928,8 @@ const struct rig_caps powersdr_caps = // TODO copy over kenwood_[set|get]_level and modify to handle DSP filter values // correctly - use actual values instead of indices .set_level = kenwood_set_level, - .get_level = kenwood_get_level, + .get_level = powersdr_get_level, //.set_ant = kenwood_set_ant_no_ack, //.get_ant = kenwood_get_ant, }; + diff --git a/src/misc.c b/src/misc.c index 56c3656a..a8c81175 100644 --- a/src/misc.c +++ b/src/misc.c @@ -683,7 +683,6 @@ static struct { RIG_LEVEL_NOTCHF_RAW, "NOTCHF_RAW" }, { RIG_LEVEL_MONITOR_GAIN, "MONITOR_GAIN" }, { RIG_LEVEL_NB, "NB" }, - { RIG_LEVEL_BRIGHT, "BRIGHT" }, { RIG_LEVEL_NONE, "" }, }; commit fd7a795473868ac50b17a0af9eb0b3c4601c7bb3 Author: Mikael Nousiainen <mik...@ik...> Date: Wed Sep 9 18:12:17 2020 +0300 Propagate variable read_only value to rig implementation of get_channel diff --git a/src/mem.c b/src/mem.c index cd3e82fb..837ec149 100644 --- a/src/mem.c +++ b/src/mem.c @@ -853,7 +853,7 @@ int HAMLIB_API rig_get_channel(RIG *rig, channel_t *chan, int read_only) if (rc->get_channel) { - return rc->get_channel(rig, chan, 0); + return rc->get_channel(rig, chan, read_only); } /* commit 5af1ef3be6c243e45b3ed81dad0d7aaef827309c Author: Nate Bargmann <n0...@n0...> Date: Thu Sep 10 08:40:04 2020 -0500 Update informational man pages for Hamlib 4.0 diff --git a/doc/man7/hamlib-primer.7 b/doc/man7/hamlib-primer.7 index dea2ee5a..b15a7205 100644 --- a/doc/man7/hamlib-primer.7 +++ b/doc/man7/hamlib-primer.7 @@ -5,7 +5,7 @@ .\" .\" Please keep this file in sync with doc/getting_started.texi .\" -.TH HAMLIB-PRIMER "7" "2018-05-27" "Hamlib" "Hamlib Information Manual" +.TH HAMLIB-PRIMER "7" "2020-09-08" "Hamlib" "Hamlib Information Manual" . . .SH NAME @@ -73,11 +73,13 @@ SourceForge.net Hamlib files .UE Web page. . -As a convenience, release archives are also mirrored at the -.UR https://github.com/Hamlib/Hamlib/releases -GitHub Hamlib releases -.UE -page. +.\" It appears as of early September 2020 that the uploaded releases have been +.\" deleted from GitHub +'\" As a convenience, release archives are also mirrored at the +.\" .UR https://github.com/Hamlib/Hamlib/releases +.\" GitHub Hamlib releases +'\" .UE +.\" page. . The most recent release is listed first. . @@ -87,14 +89,17 @@ The most recent release is listed first. Testing release candidates (RCs) are posted during the period (often a few weeks) before a planned release. . -Beginning with the 3.2 release, RCs are hosted by the -.UR https://github.com/Hamlib/Hamlib/releases -GitHub release archive -.UE . +Beginning with the 4.0 release, RCs are hosted by the +.UR http://sourceforge.net/projects/hamlib/files/hamlib/ +SourceForge.net Hamlib files +.UE +Web page. . RCs are identifed by having a -.I ~rc -suffix. +.I ~rcX +suffix where the +.I X +is replace by a numeral for successive release candidates. . .PP Daily snapshots of the development repository are available via the World Wide @@ -140,21 +145,21 @@ None of the meta-data is hidden away on some central server. .PP To clone the repository use the following command: . -.sp -.RS 0.5i +.PP +.in +4n .EX -git clone https://git.code.sf.net/p/hamlib/code hamlib +.B git clone https://git.code.sf.net/p/hamlib/code hamlib .EE -.RE +.in . .PP or: -.sp -.RS 0.5i +.PP +.in +4n .EX -git clone https://github.com/Hamlib/Hamlib.git +.B git clone https://github.com/Hamlib/Hamlib.git .EE -.RE +.in . .PP . @@ -194,18 +199,22 @@ Any is a good reason to build from the source code archive. .PP Before going further, this manual assumes familiarity with working from the command prompt in a Linux/BSD/Unix like system's -.I shell -environment, either in a +.I Bourne shell +environment (compatible Bourne shells include +.BR bash (1), +.BR ksh (1), +.BR zsh (1), +and several more) either in a .I virtual console (a text only screen with no graphics) or in a .I terminal in a desktop environment -.RB ( xterm , -.BR rxvt , -.BR konsole , -.BR gnome\-terminal , -.BR xfce4\-terminal , -.BR terminal , +.RB ( xterm (1), +.BR rxvt (1), +.BR konsole "(1) (included with the KDE desktop)," +.BR gnome\-terminal (1), +.BR xfce4\-terminal (1), +.BR terminal "(1) (included in macOS)," etc.). . If this is new to you, take some time and read up on using the shell. @@ -250,14 +259,14 @@ or daily development snapshot follows the same set of commands, known as the .I three step which are each run from the top-level directory: . -.sp -.RS 0.5i +.PP +.in +4n .EX -\&./configure -make -sudo make install +.B ./configure +.B make +.B sudo make install .EE -.RE +.in . .SS configure . @@ -279,12 +288,12 @@ command could be lurking elsewhere and we don't want to run that! .PP Run: . -.sp -.RS 0.5i +.PP +.in +4n .EX -\&./configure +.B ./configure .EE -.RE +.in . .PP from the top-level directory. @@ -346,12 +355,12 @@ file system hierarchy. . Perhaps you want to install to your home directory instead: . -.sp -.RS 0.5i +.PP +.in +4n .EX -\&./configure \-\-prefix=$HOME/local +.B ./configure \-\-prefix=$HOME/local .EE -.RE +.in . .IP .BR Note : @@ -365,7 +374,7 @@ installed to .IR $HOME/local . . .PP -All of the files will be installed in the +As a result of this option, all of the files will be installed in the .I local directory of your home directory. . @@ -381,6 +390,26 @@ or superuser (administrator) privileges are not required when running On the other hand, some extra work will need to be done so other programs can use the library. . +The utilities that are compiled as a part of the Hamlib build system will work +as they are +.I linked +to the library installed under +.IR local . +. +Running them will require declaring the complete path: +. +.PP +.in +4n +.EX +.B local/bin/rigctl +.EE +.in +. +.PP +or modifying your shell's +.I PATH +environment variable (see the shell tutorial site above). +. .\" (TODO: describe library hackery in an appendix). . .PP @@ -397,7 +426,7 @@ combination to scroll back up. . Conversely, Shift\-PageDown can be used to scroll down toward the end of the output and the shell prompt (Shift\-UpArrow/Shift\-DownArrow may also work to -scroll one line at a time). +scroll one line at a time (terminal dependent)). . .PP After a fair amount of time, depending on your computer, and a lot of screen @@ -411,7 +440,7 @@ or some such failure message Hamlib is ready to be compiled. If there is an error and all of the required packages listed in .I README.betatester have been installed, please ask for help on the -.MT hamlib\-developer@@lists.sourceforge.net +.MT hamlib\-de...@li... hamlib-developer mailing list .ME . . @@ -435,12 +464,12 @@ library files and its executable programs. .PP Run: . -.sp -.RS 0.5i +.PP +.in +4n .EX -make +.B make .EE -.RE +.in . .PP from the top-level directory. @@ -449,7 +478,7 @@ from the top-level directory. Any error that causes .B make to stop early is cause for a question to the -.MT hamlib\-developer@@lists.sourceforge.net +.MT hamlib\-de...@li... hamlib-developer mailing list .ME . . @@ -460,9 +489,9 @@ will take longer than .B configure to complete its run. . -As it is a system command, and therefore found in the -.BR PATH , -prefixing +As it is a system command, and therefore found in the shell's +.B PATH +environment variable, prefixing .B make with .I ./ @@ -490,16 +519,44 @@ family of distributions. .PP Run: . -.sp -.RS 0.5i +.PP +.in +4n .EX -sudo make install +.B sudo make install .EE -.RE +.in +. +.PP +or: +. +.PP +.in +4n +.EX +.RB $ " su -l" +Password: +.RB # " make install" +.EE +.in . .PP as root from the top-level directory. . +.IP +.BR Note : +The shell session is shown to show the change in prompt from a normal user +account to the root accout. +. +.PP +The +.B \-l +option to +.B su +forces a +.I login +shell so that environment variables such as +.I PATH +are set correctly. +. .PP Running .B make install @@ -536,22 +593,22 @@ It too will need to be run with root privileges: .PP Run: . -.sp -.RS 0.5i +.PP +.in +4n .EX -sudo ldconfig +.B sudo ldconfig .EE -.RE +.in . .PP -as root from any directory. +as root from any directory or while logged in as root from above. . -.PP +.IP .BR Note : Subsequent installations of Hamlib will not need to have .B ldconfig run after each installation if a newer version of Hamlib was not installed, -i.e. when recompiling the same version during development. +i.e., when recompiling the same version during development. . .PP On some distributions a bit of configuration will be needed before @@ -637,7 +694,7 @@ executable files generated by running .B make freeing up considerable disk space. . -.PP +.IP .BR Note : During development of individual source files, it is not necessary to run @@ -709,12 +766,12 @@ the needed compiler and linker options are passed as environment variables. . .PP Run: -.sp -.RS 0.5i +.PP +.in +4n .EX -\&../hamlib/configure CFLAGS="-ggdb3 -O0" CXXFLAGS="-ggdb3 -O0" +.B ../hamlib/configure CFLAGS="-ggdb3 -O0" CXXFLAGS="-ggdb3 -O0" .EE -.RE +.in . .PP from a sibling build directory intended for a debugging build. @@ -738,7 +795,7 @@ and .B CXXFLAGS may be set independently for each compiler. . -.PP +.IP .BR Note : There are a number compiler options available for controlling debugging symbols and setting optimization levels. @@ -748,7 +805,7 @@ Please consult the compiler's manual for all the details. . .SS Compiling for Microsoft Windows . -Currently compiling is done on a Debian 8 (Jessie) virtual machine using +Currently compiling is done on a Debian 10 (Buster) virtual machine using .UR http://www.mingw.org MinGW .UE . @@ -764,16 +821,18 @@ Pre-compiled binaries for Microsoft Windows 32 and 64 bit architectures (Windows NT and newer) are available for both official releases and daily development snapshots. . +.PP Official releases are available through the .UR http://sourceforge.net/projects/hamlib/files/hamlib/ SourceForge.net file download service .UE . . -As an alternative, official releases are also available though the -.UR https://github.com/Hamlib/Hamlib/releases -Hamlib archive at GitHub -.UE . +.\"As an alternative, official releases are also available though the +.\".UR https://github.com/Hamlib/Hamlib/releases +.\"Hamlib archive at GitHub +.\".UE . . +.PP Daily development snapshots are available from the .UR http://n0nb.users.sourceforge.net/ daily snapshots page @@ -786,7 +845,7 @@ available. Among its features are selecting which portions of Hamlib are installed. . The -.B PATH +.I PATH environment variable will need to be set manually per the included .I README.w32-bin or @@ -799,7 +858,7 @@ extracting installer. . .PP Bug reports and questions about these archives should be sent to the -.MT hamlib-developer@@lists.sourceforge.net +.MT ham...@li... hamlib-developer mailing list .ME . . @@ -811,7 +870,7 @@ radio and rotator control functions for developers of software primarily of interest to radio amateurs and those interested in radio communications. . .PP -Copyright \(co 2001-2018 Hamlib Group (various contributors) +Copyright \(co 2001-2020 Hamlib Group (various contributors) . .PP This is free software; see the file COPYING for copying conditions. There is @@ -831,8 +890,8 @@ NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .SH COLOPHON . Links to the Hamlib Wiki, Git repository, release archives, and daily snapshot -archives: -.IP +archives are available via +. .UR http://www.hamlib.org hamlib.org .UE . diff --git a/doc/man7/hamlib-utilities.7 b/doc/man7/hamlib-utilities.7 index 8b369c08..866bdd68 100644 --- a/doc/man7/hamlib-utilities.7 +++ b/doc/man7/hamlib-utilities.7 @@ -5,7 +5,7 @@ .\" .\" Please keep this file in sync with doc/utility-programs.texi .\" -.TH HAMLIB-UTILITIES "7" "2018-05-27" "Hamlib" "Hamlib Information Manual" +.TH HAMLIB-UTILITIES "7" "2020-09-08" "Hamlib" "Hamlib Information Manual" . . .SH NAME @@ -26,17 +26,20 @@ library functions both through the .SM API. . .PP -This page summarizes the two test programs, +This page summarizes the three test programs, +.BR ampctl (1) +for testing amplifier back ends, .BR rigctl (1) -for testing radio back ends and +for testing radio back ends, and .BR rotctl (1) -for testing rotator back ends and the two network daemons, -.BR rigctld (1) +for testing rotator back ends and the three network daemons, +.BR ampctld (1), +.BR rigctld (1), and .BR rotcltd (1) -for radio and rotator access via network sockets. +for amplifier, radio, and rotator access via network sockets. . -Also included are three demonstation utilities, +Also included are three demonstration utilities, .BR rigmem (1), .BR rigsmtr (1), and @@ -70,42 +73,40 @@ additional commands. . .PP In its most simple use as a -.I "command line" +.I command line program, rigctl is used to set frequency and mode by typing commands after any rigctl options: . -.sp -.RS 0.5i +.PP +.in +4n .EX -rigctl F 14205000 -.br -rigctl M USB 2400 +.B rigctl F 14205000 +.B rigctl M USB 2400 .EE -.RE +.in . .PP and then query those values: . -.sp -.RS 0.5i +.PP +.in +4n .EX -rigctl f -.br -rigctl m +.B rigctl f +.B rigctl m .EE -.RE +.in . .PP Entering -.I "interactive mode" +.I interactive mode is a simple matter of not placing any commands after any rigctl options: . -.sp -.RS 0.5i +.PP +.in +4n .EX -rigctl +.B rigctl .EE -.RE +.in . .PP Entering interactive mode allows successive commands to be entered without @@ -121,35 +122,31 @@ library. .PP Interactive mode is indicated by the spartan prompt: . -.sp -.RS 0.5i +.PP +.in +4n .EX Rig command: .EE -.RE +.in . .PP Commands are given at the prompt and follow the general rule that upper case letters set a value and lower case letters query a value: . -.sp -.RS 0.5i +.PP +.in +4n .EX -Rig command: M -.br -Mode: USB -.br -Passband: 2500 -.sp -Rig command: m -.br +.RB "Rig command: " M +.RB "Mode: " USB +.RB "Passband: " 2500 + +.RB "Rig command: " m Mode: USB -.br Passband: 2500 -.sp + Rig command: .EE -.RE +.in . .PP An additional prompt is printed when more information is required by the @@ -168,7 +165,7 @@ The above examples invoked rigctl without specifying a radio model. . This is a feature where the Hamlib internal radio model 1 .I dummy -is used instead. +is used. . The dummy radio provides a way to test Hamlib functions without the need for actual radio hardware. @@ -179,32 +176,29 @@ the actual radio connected to the computer is necessary for debugging. .PP For example, to quickly set frequency on an Elecraft K3: . -.sp -.RS 0.5i +.PP +.in +4n .EX -rigctl -m 229 -r /dev/rig F 3900000 +.B rigctl -m 2029 -r /dev/rig F 3900000 .EE -.RE +.in . .PP and to query the frequency and then mode: . -.sp -.RS 0.5i +.PP +.in +4n .EX -rigctl -m 229 -r /dev/rig f -.br +.B rigctl -m 2029 -r /dev/rig f 3900000 -.sp -rigctl -m 229 -r /dev/rig m -.br + +.B rigctl -m 2029 -r /dev/rig m LSB -.br 2000 .EE -.RE +.in . -.PP +.IP .BR Note : the returned values do not have the prompt strings associated with interactive mode as shown above. @@ -220,40 +214,29 @@ option takes the path to the port device on .SM POSIX and the device name on Microsoft Windows. . -.PP +.IP .BR Note : A complete list of supported radio models may be seen by use of the .B -l option: . -.sp -.RS 0.5i +.PP +.in +4n .EX -rigctl -l -.br +.B rigctl -l Rig # Mfg Model Version Status -.br 1 Hamlib Dummy 0.5 Beta -.br 2 Hamlib NET rigctl 0.3 Beta -.br - 101 Yaesu FT-847 0.5 Beta -.br - 103 Yaesu FT-1000D 0.0.6 Alpha -.br + 1001 Yaesu FT-847 0.5 Beta + 1003 Yaesu FT-1000D 0.0.6 Alpha \&. -.br \&. -.br \&. -.br - 2702 Rohde&Schwarz EB200 0.1 Untested -.br - 2801 Philips/Simoco PRM8060 0.1 Alpha -.br - 2901 ADAT www.adat.ch ADT-200A 1.36 Beta + 27002 Rohde&Schwarz EB200 0.1 Untested + 28001 Philips/Simoco PRM8060 0.1 Alpha + 29001 ADAT www.adat.ch ADT-200A 1.36 Beta .EE -.RE +.in . .PP The list is long so use \f(CWShift\-PageUp\fP/\f(CWShift\-PageDown\fP on @@ -264,7 +247,7 @@ window on Microsoft Windows) or the output can be piped to .BR more (1) or .BR less (1), -e.g. \(lq\f(CWrigctl -l | more\fP\(rq to scroll back up the list. +e.g., \(lq\f(CWrigctl -l | more\fP\(rq to scroll back up the list. . The list is sorted numerically by model number since Hamlib 1.2.15.1. . @@ -305,40 +288,39 @@ additional commands. . .PP In its most simple use as a -.I "command line" +.I command line program, rotctl is used to set azimuth position and (optionally) elevation by typing commands after any rotctl options: . -.sp -.RS 0.5i +.PP +.in +4n .EX -rotctl P 145.0 23.0 -.br -rotctl M 8 25 +.B rotctl P 145.0 23.0 +.B rotctl M 8 25 .EE -.RE +.in . .PP and then query those values: . -.sp -.RS 0.5i +.PP +.in +4n .EX -rotctl p +.B rotctl p .EE -.RE +.in . .PP Entering -.I "interactive mode" +.I interactive mode is a simple matter of not placing any commands after any rotctl options: . -.sp -.RS 0.5i +.PP +.in +4n .EX -rotctl +.B rotctl .EE -.RE +.in . .PP Entering interactive mode allows successive commands to be entered without @@ -354,40 +336,34 @@ library. .PP Interactive mode is indicated by the spartan prompt: . -.sp -.RS 0.5i +.PP +.in +4n .EX Rotator command: .EE -.RE +.in . .PP Commands are given at the prompt: . -.sp -.RS 0.5i +.PP +.in +4n .EX -Rotator command: M -.br -Direction: 16 -.br -Speed: 60 -.sp -Rotator command: p -.br +.RB "Rotator command: " M +.RB "Direction: " 16 +.RB "Speed: " 60 + +.RB "Rotator command: " p Azimuth: 11.352000 -.br Elevation: 0.000000 -.sp -Rotator command: p -.br + +.RB "Rotator command: " p Azimuth: 27.594000 -.br Elevation: 0.000000 -.sp + Rotator command: .EE -.RE +.in . .PP An additional prompt is printed when more information is required by the @@ -417,26 +393,24 @@ controller connected to the computer is necessary for debugging. .PP For example, to quickly set position for RotorEZ: . -.sp -.RS 0.5i +.PP +.in +4n .EX -rotctl -m 401 -r /dev/rotor P 100.0 0.0 +.B rotctl -m 401 -r /dev/rotor P 100.0 0.0 .EE -.RE +.in . .PP and to query the position: . -.sp -.RS 0.5i +.PP +.in +4n .EX -rotctl -m 401 -r /dev/rotor p -.br +.B rotctl -m 401 -r /dev/rotor p 100.000000 -.br 0.000000 .EE -.RE +.in . .PP The returned values do not have the prompt strings associated with interactive @@ -453,40 +427,29 @@ option takes the path to the port device on .SM POSIX or the device name on Microsoft Windows. . -.PP +.IP .BR Note : A complete list of supported rotator models may be seen by use of the .B -l option: . -.sp -.RS 0.5i +.PP +.in +4n .EX -rotctl -l -.br +.B rotctl -l Rot # Mfg Model Version Status -.br 1 Hamlib Dummy 0.5 Beta -.br 2 Hamlib NET rotctl 0.3 Beta -.br 201 Hamlib EasycommI 0.3 Beta -.br 202 Hamlib EasycommII 0.3 Beta -.br \&. -.br \&. -.br \&. -.br 1201 AMSAT IF-100 0.1 Untested -.br 1301 LA7LKA ts7400 0.1 Beta -.br 1401 Celestron NexStar 0.1 Untested .EE -.RE +.in . .PP The list is long so use \f(CWShift\-PageUp\fP/\f(CWShift\-PageDown\fP on @@ -511,6 +474,21 @@ The complete reference for rotctl can be found in the manual page. . . +.SH ampctl +. +The +.BR ampctl (1) +utility is a recent addition to the Hamlib utilities as a part of the 4.0 +development cycle. +. +It is intended to test the Hamlib implementation of amplifier control and is +similar in function to the utilities previously described. +. +See the +.BR ampctl (1) +manual page for the complete reference. +. +. .SH rigctld . The @@ -698,6 +676,22 @@ The complete reference for rotctld can be found in the manual page. . . +.SH ampctl +. +The +.BR ampctld (1) +utility is a recent addition to the Hamlib utilities as a part of the 4.0 +development cycle. +. +It provides network socket access for the Hamlib implementation of amplifier +control and is similar in function to the network utilities previously +described. +. +See the +.BR ampctld (1) +manual page for the complete reference. +. +. .SH rigmem . .B rigmem @@ -803,7 +797,7 @@ radio and rotator control functions for developers of software primarily of interest to radio amateurs and those interested in radio communications. . .PP -Copyright \(co 2001-2018 Hamlib Group (various contributors) +Copyright \(co 2001-2020 Hamlib Group (various contributors) . .PP This is free software; see the file COPYING for copying conditions. There is @@ -814,6 +808,8 @@ NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. . .BR less (1), .BR more (1), +.BR ampctl (1), +.BR ampctld (1), .BR rigctl (1), .BR rigctld (1), .BR rotctl (1), @@ -828,8 +824,8 @@ NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .SH COLOPHON . Links to the Hamlib Wiki, Git repository, release archives, and daily snapshot -archives: -.IP +archives are available via +. .UR http://www.hamlib.org hamlib.org .UE . diff --git a/doc/man7/hamlib.7 b/doc/man7/hamlib.7 index 58988ed8..f7c715cb 100644 --- a/doc/man7/hamlib.7 +++ b/doc/man7/hamlib.7 @@ -5,7 +5,7 @@ .\" .\" Please keep this file in sync with doc/nutshell.texi .\" -.TH HAMLIB "7" "2018-05-21" "Hamlib" "Hamlib Information Manual" +.TH HAMLIB "7" "2020-09-08" "Hamlib" "Hamlib Information Manual" . . .SH NAME @@ -153,20 +153,21 @@ in a few years. A major milestone was reached when Hamlib 1.2.0 was released in March 2004. . The API and Application Binary Interface (ABI) interfaces have remained stable -since that time up to the latest release of 3.2 in early 2018. +since that time up to the release of 3.3 in mid 2018. +. +Version 4.0 marks a major change to the ABI and certain changes to the API. . .PP Development continues through the major version number -.RI 3. x +.RI 4. x series and beyond. . -While some API tweaks are planned, ABI compatibility with the prior -.RI 1.2. x -releases remains a priority. +The 4.0 release marks a major change in the ABI with several changes for +additional modes and such that will require client programs that use the C ABI +to be recompiled/relinked, etc. . -Other goals include streamlining the build system (done), improving the SWIG -generated language bindings (done), improving the overall documentation (this -man page with more in progress), and other updates as warranted. +Other goals include improving the overall documentation (this man page with +more in progress), and other updates as warranted. . .PP The Project is hosted by @@ -255,28 +256,37 @@ atmosphere for development. Hamlib's source code is released under two licenses, the .B Lesser General Public License -(LGPL) for the library portion, and the +(LGPL) version 2.1 for the library portion, and the .B General Public License -(GPL) for the utility programs. +(GPL) version 2 for the utility programs. . .PP The LGPL allows the library to be used (linked) by programs regardless of their individual license. . -However, any contributions to the library source remain under copyleft which -means that the library source code may not be used in violation of the terms -of the LGPL. +However, any contributions to the library source remain under a copyleft +license which means that the library source code may not be used in violation +of the terms of the LGPL (see the file +.B COPYING.LIB +in the main source directory). +. +Concepts learned by studying these sources for the purpose of understanding +the Hamlib API is not covered nor prohibited by the LGPL, however, directly +copying LGPL sources into any work that is incompatible with the terms of the +LGPL is a violation of the terms of the license. . .PP The utility program source files are released under the GPL. . Any direct use of these sources must be in a form that complies with the terms -of the GPL. +of the GPL (see the file +.B COPYING +in the main source directory). . Concepts learned by studying these sources for the purpose of understanding the Hamlib API is not covered nor prohibited by the GPL, however, directly copying GPL sources into any work that is incompatible with the terms of the -GPL is prohibited. +GPL is a violation of the terms of the license. . . .SS Radios with a clone capability @@ -289,11 +299,11 @@ for cloning the memory contents from radio to another of the same model. . A related project, .UR http://chirp.danplanet.com -CHIRP +.B Chirp .UE , aims to support radios with such a clone capability. . -Please contact the CHIRP project for support of such radios. +Please contact the Chirp project for support of such radios. . . .SS Pronouncing Hamlib @@ -319,11 +329,12 @@ If you're French, the above does not apply! :-) .SH COPYING . This file is part of Hamlib, a project to develop a library that simplifies -radio and rotator control functions for developers of software primarily of -interest to radio amateurs and those interested in radio communications. +radio, rotator, and amplifier control functions for developers of software +primarily of interest to radio amateurs and those interested in radio +communications. . .PP -Copyright \(co 2001-2018 Hamlib Group (various contributors) +Copyright \(co 2001-2020 Hamlib Group (various contributors) . .PP This is free software; see the file COPYING for copying conditions. There is @@ -338,8 +349,8 @@ NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .SH COLOPHON . Links to the Hamlib Wiki, Git repository, release archives, and daily snapshot -archives: -.IP +archives are available via +. .UR http://www.hamlib.org hamlib.org .UE . commit 5e7b46eeeea9bbed648da059c0e428cc8c807a02 Author: Nate Bargmann <n0...@n0...> Date: Thu Sep 10 08:36:57 2020 -0500 Update utilities man pages for Hamlib 4.0 diff --git a/doc/man1/ampctl.1 b/doc/man1/ampctl.1 index e44ebcc8..01bcc00f 100644 --- a/doc/man1/ampctl.1 +++ b/doc/man1/ampctl.1 @@ -5,7 +5,7 @@ .\" .\" Note: Please keep this page in sync with the source, ampctl.c .\" -.TH AMPCTL "1" "2019-12-10" "Hamlib" "Hamlib Utilities" +.TH AMPCTL "1" "2020-09-08" "Hamlib" "Hamlib Utilities" . . .SH NAME @@ -249,12 +249,12 @@ typed in when in interactive mode or provided as argument(s) in command line interface mode. In interactive mode commands and their arguments may be entered on a single line: . -.sp -.RS 0.5i +.PP +.in +4n .EX -F 14250000 +.B F 14250000 .EE -.RE +.in . .PP Since most of the @@ -274,7 +274,7 @@ backslash, \(oq\\\(cq, to enter a long command name. Example: Use \(lq\\dump_caps\(rq to see what capabilities this amplifier and backend support. . -.PP +.IP .BR Note : The backend for the amplifier to be controlled, or the amplifier itself may not support some commands. In that case, the operation will fail with a @@ -283,22 +283,22 @@ error message. . . .PP -A simple example: +A simple example using commands saved to a file (typed text shown in bold): . -.sp -.RS 0.5i +.PP +.in +4n .EX -$ cat <<.EOF. >cmds.txt -> # File of commands -> F 14250000 -> f -> l PWRINPUT -> l PWRFORWARD -> l SWR -> \\dump_caps -> .EOF. +.RB $ " cat <<.EOF. >cmds.txt" +.RB > " # File of commands" +.RB > " F 14250000" +.RB > " f" +.RB > " l PWRINPUT" +.RB > " l PWRFORWARD" +.RB > " l SWR" +> \fB\\dump_caps\fP +.RB > " .EOF." -$ ampctl -m1 - <cmds.txt +.RB $ " ampctl -m1 - <cmds.txt" Amplifier command: # File of commands @@ -344,7 +344,7 @@ Amplifier command: $ .EE -.RE +.in . . .SS ampctl Commands @@ -573,19 +573,19 @@ if an error was returned by .BR Hamlib . . . -.SH EXAMPLE +.SH EXAMPLES . Start .B ampctl for am Elecraft KPA-1500 using a USB to serial adapter on Linux in interactive mode: . -.sp -.RS 0.5i +.PP +.in +4n .EX -$ ampctl -m 201 -r /dev/ttyUSB1 +.RB $ " ampctl -m 201 -r /dev/ttyUSB1" .EE -.RE +.in . .PP Start @@ -594,12 +594,12 @@ for an Elecraft KPA-1500 using COM1 on MS Windows while generating TRACE output to .IR stderr : . -.sp -.RS 0.5i +.PP +.in +4n .EX -> ampctl -m 201 -r COM1 -vvvvv +.RB > " ampctl -m 201 -r COM1 -vvvvv" .EE -.RE +.in . .PP Connect to a running @@ -607,12 +607,12 @@ Connect to a running with amplifier model 2 (\(lqNET ampctl\(rq) on the local host and specifying the TCP port, setting frequency and mode: . -.sp -.RS 0.5i +.PP +.in +4n .EX -$ ampctl -m 2 -r localhost:4531 F 7253500 +.RB $ " ampctl -m 2 -r localhost:4531 F 7253500" .EE -.RE +.in . . .SH BUGS @@ -640,7 +640,7 @@ Copyright \(co 2000-2011 Stephane Fillod .br Copyright \(co 2000-2018 the Hamlib Group (various contributors) .br -Copyright \(co 2010-2019 Nate Bargmann +Copyright \(co 2010-2020 Nate Bargmann . .PP This is free software; see the file COPYING for copying conditions. There is @@ -658,8 +658,8 @@ NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .SH COLOPHON . Links to the Hamlib Wiki, Git repository, release archives, and daily snapshot -archives: -.IP +archives are available via +. .UR http://www.hamlib.org hamlib.org .UE . diff --git a/doc/man1/ampctld.1 b/doc/man1/ampctld.1 index 5c66324a..31d97844 100644 --- a/doc/man1/ampctld.1 +++ b/doc/man1/ampctld.1 @@ -5,7 +5,7 @@ .\" .\" Note: Please keep this page in sync with the source, ampctld.c .\" -.TH AMPCTLD "1" "2019-12-10" "Hamlib" "Hamlib Utilities" +.TH AMPCTLD "1" "2020-09-09" "Hamlib" "Hamlib Utilities" . . .SH NAME @@ -402,16 +402,15 @@ needed values. In practice, reliable results are obtained by terminating each command string with a newline character, \(oq\\n\(cq. . .PP -Example set frequency and mode commands (Perl code): +Example set frequency and mode commands (Perl code (typed text shown in bold)): . -.sp -.RS 0.5i +.PP +.in +4n .EX -print $socket "F 14250000\\n"; -.br -print $socket "\\\\set_powerstat 1\\n"; # escape leading '\\' +\fBprint $socket "F 14250000\\n";\fP +\fBprint $socket "\\\\set_powerstat 1\\n";\fP # escape leading '\\' .EE -.RE +.in . .PP A one line response will be sent as a reply to @@ -434,14 +433,13 @@ is the Hamlib error code. .PP Example get frequency (Perl code): . -.sp -.RS 0.5i +.PP +.in +4n .EX -print $socket "f\\n"; -.br +\fBprint $socket "f\\n";\fP "14250000\\n" .EE -.RE +.in . .PP Most @@ -509,16 +507,14 @@ An example response to a .B set_frequency command sent from the shell prompt (note the prepended \(oq+\(cq): . -.sp -.RS 0.5i +.PP +.in +4n .EX -$ echo "+F 14250000" | nc -w 1 localhost 4531 -.br +$ \fBecho "+F 14250000" | nc -w 1 localhost 4531\fP set_freq: 14250000 -.br RPRT 0 .EE -.RE +.in . .PP In this case the long command name and values are returned on the first line @@ -530,18 +526,15 @@ An example response to a .B get_freq query: . -.sp -.RS 0.5i +.PP +.in +4n .EX -$ echo "+\\get_freq" | nc -w 1 localhost 4531 -.br +$ \fBecho "+\\get_freq" | nc -w 1 localhost 4531\fP get_freq: -.br Frequency(Hz): 14250000 -.br RPRT 0 .EE -.RE +.in . .IP .BR Note : @@ -600,34 +593,34 @@ For example, invoking a .B get_freq query with a leading \(oq;\(cq returns: . -.sp -.RS 0.5i +.PP +.in +4n .EX get_freq:;Frequency(Hz): 14250000;RPRT 0 .EE -.RE +.in . .PP Or, using the pipe character \(oq|\(cq returns: . -.sp -.RS 0.5i +.PP +.in +4n .EX get_freq:|Frequency(Hz): 14250000|RPRT 0 .EE -.RE +.in . .PP And a .B set_freq command prepended with a \(oq|\(cq returns: . -.sp -.RS 0.5i +.PP +.in +4n .EX set_freq: 14250000|RPRT 0 .EE -.RE +.in . .PP Such a format will allow reading a response as a single event using a preferred @@ -659,30 +652,30 @@ sent to and received from the amplifier which is very useful for amplifier backend library development and may be requested by the developers. . . -.SH EXAMPLE +.SH EXAMPLES . Start .B ampctld for an Elecraft KPA-1500 using a USB-to-serial adapter and backgrounding: . -.sp -.RS 0.5i +.PP +.in +4n .EX -$ ampctld -m 201 -r /dev/ttyUSB1 & +.RB $ " ampctld -m 201 -r /dev/ttyUSB1 &" .EE -.RE +.in . .PP Start .B ampctld for an Elecraft KPA-1500 using COM2 on MS Windows: . -.sp -.RS 0.5i +.PP +.in +4n .EX -$ ampctld -m 201 -r COM2 +.RB $ " ampctld -m 201 -r COM2" .EE -.RE +.in . .PP Connect to the already running @@ -690,12 +683,12 @@ Connect to the already running and set the frequency to 14.266 MHz with a 1 second read timeout using the default protocol from the shell prompt: . -.sp -.RS 0.5i +.PP +.in +4n .EX -$ echo "\\set_freq 14266000" | nc -w 1 localhost 4531 +$ \fBecho "\\set_freq 14266000" | nc -w 1 localhost 4531\fP .EE -.RE +.in . .PP Connect to a running @@ -704,12 +697,12 @@ with .B ampctl on the local host: . -.sp -.RS 0.5i +.PP +.in +4n .EX -$ ampctl -m2 +.RB $ " ampctl -m2" .EE -.RE +.in . . .SH SECURITY @@ -765,7 +758,7 @@ Copyright \(co 2000-2010 Stephane Fillod .br Copyright \(co 2000-2018 the Hamlib Group (various contributors) .br -Copyright \(co 2011-2019 Nate Bargmann +Copyright \(co 2011-2020 Nate Bargmann . .PP This is free software; see the file COPYING for copying conditions. There is @@ -783,8 +776,8 @@ NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .SH COLOPHON . Links to the Hamlib Wiki, Git repository, release archives, and daily snapshot -archives: -.IP +archives are available via +. .UR http://www.hamlib.org hamlib.org .UE . diff --git a/doc/man1/rigctl.1 b/doc/man1/rigctl.1 index c57eaf44..ff0b3c6b 100644 --- a/doc/man1/rigctl.1 +++ b/doc/man1/rigctl.1 @@ -5,7 +5,7 @@ .\" .\" Note: Please keep this page in sync with the source, rigctl.c .\" -.TH RIGCTL "1" "2019-12-10" "Hamlib" "Hamlib Utilities" +.TH RIGCTL "1" "2020-09-09" "Hamlib" "Hamlib Utilities" . . .SH NAME @@ -284,7 +284,7 @@ Set verbose mode, cumulative (see below). .TP .BR \-Y "," \-\-\ignore\-err -Ignores rig open errors +Ignores rig open errors . .TP .BR \-Z ", " \-\-debug\-time\-stamps @@ -337,12 +337,12 @@ typed in when in interactive mode or provided as argument(s) in command line interface mode. In interactive mode commands and their arguments may be entered on a single line: . -.sp -.RS 0.5i +.PP +.in +4n .EX -M LSB 2400 +.B M LSB 2400 .EE -.RE +.in . .PP Since most of the @@ -360,7 +360,7 @@ backslash, \(oq\\\(cq, to enter a long command name. Example: Use \(lq\\dump_caps\(rq to see what capabilities this radio and backend support. . -.PP +.IP .BR Note : The backend for the radio to be controlled, or the radio itself may not support some commands. In that case, the operation will fail with a @@ -383,19 +383,19 @@ up until the end of the current line including the \(oq#\(cq character is ignored. . .PP -A simple example: +A simple example (typed text is in bold): . -.sp -.RS 0.5i +.PP +.in +4n .EX -$ cat <<.EOF. >cmds.txt -> # File of commands -> v f m # query rig -> V VFOB F 14200000 M CW 500 # set rig -> v f m # query rig -> .EOF. +.RB $ " cat <<.EOF. >cmds.txt" +.RB > " # File of commands" +.RB > " v f m # query rig" +.RB > " V VFOB F 14200000 M CW 500 # set rig" +.RB > " v f m # query rig" +.RB > " .EOF." -$ rigctl -m1 - <cmds.txt +.RB $ " rigctl -m1 - <cmds.txt" v VFOA @@ -416,7 +416,7 @@ m CW $ .EE -.RE +.in . . .SS rigctl Commands @@ -498,17 +498,17 @@ In VFO mode (see .B \-\-vfo option above) only a single VFO parameter is required: . -.sp -.RS 1.0i +.IP +.in +4n .EX -$ rigctl -m 229 -r /dev/rig -o +.RB $ " rigctl -m 229 -r /dev/rig -o" Rig command: V VFO: VFOB Rig command: .EE -.RE +.in . .TP .BR v ", " get_vfo @@ -1119,7 +1119,7 @@ Get .RI \(aq Status \(aq .IP Returns Status as 1 if vfo option is on and 0 if vfo option is off. -This command reflects the -o switch for rigctl and ritctld and can be dynamically changed by +This command reflects the -o switch for rigctl and ritctld and can be dynamically changed by .B set_vfo_opt. . .TP @@ -1128,7 +1128,7 @@ Set .RI \(aq Status \(aq .IP Set vfo option Status 1=on or 0=off -This is the same as using the -o switch for rigctl and ritctld. +This is the same as using the -o switch for rigctl and ritctld. This can be dyamically changed while running. . .TP @@ -1252,18 +1252,18 @@ if an error was returned by .BR Hamlib . . . -.SH EXAMPLE +.SH EXAMPLES . Start .B rigctl for a Yaesu FT-920 using a USB to serial adapter on Linux in interactive mode: . -.sp -.RS 0.5i +.PP +.in +4n .EX -$ rigctl -m 114 -r /dev/ttyUSB1 +.RB $ " rigctl -m 1014 -r /dev/ttyUSB1" .EE -.RE +.in . .PP Start @@ -1271,12 +1271,12 @@ Start for a Yaesu FT-920 using COM1 on MS Windows while generating TRACE output to .IR stderr : . -.sp -.RS 0.5i +.PP +.in +4n .EX -> rigctl -m 114 -r COM1 -vvvvv +.RB > " rigctl -m 1014 -r COM1 -vvvvv" .EE -.RE +.in . .PP Start @@ -1284,12 +1284,12 @@ Start for a Yaesu FT-920 using a USB to serial adapter while setting baud rate and stop bits: . -.sp -.RS 0.5i +.PP +.in +4n .EX -$ rigctl -m 114 -r /dev/ttyUSB1 -s 4800 -C stop_bits=2 +.RB $ " rigctl -m 1014 -r /dev/ttyUSB1 -s 4800 -C stop_bits=2" .EE -.RE +.in . .PP Start @@ -1299,12 +1299,12 @@ terminator for the .B w command: . -.sp -.RS 0.5i +.PP +.in +4n .EX -$ rigctl -m 229 -r /dev/ttyUSB0 -t';' +.RB $ " rigctl -m 2029 -r /dev/ttyUSB0 -t';'" .EE -.RE +.in . .PP Connect to a running @@ -1312,12 +1312,12 @@ Connect to a running with radio model 2 (\(lqNET rigctl\(rq) on the local host and specifying the TCP port, setting frequency and mode: . -.sp -.RS 0.5i +.PP +.in +4n .EX -$ rigctl -m 2 -r localhost:4532 F 7253500 M LSB 0 +.RB $ " rigctl -m 2 -r localhost:4532 F 7253500 M LSB 0" .EE -.RE +.in . . .SH BUGS @@ -1348,7 +1348,7 @@ Copyright \(co 2000-2011 Stephane Fillod .br Copyright \(co 2000-2018 the Hamlib Group (various contributors) .br -Copyright \(co 2010-2019 Nate Bargmann +Copyright \(co 2010-2020 Nate Bargmann . .PP This is free software; see the file COPYING for copying conditions. There is @@ -1366,8 +1366,8 @@ NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .SH COLOPHON . Links to the Hamlib Wiki, Git repository, release archives, and daily snapshot -archives: -.IP +archives are available via +. .UR http://www.hamlib.org hamlib.org .UE . diff --git a/doc/man1/rigctlcom.1 b/doc/man1/rigctlcom.1 index 305ffdbf..7d63037d 100644 --- a/doc/man1/rigctlcom.1 +++ b/doc/man1/rigctlcom.1 @@ -5,7 +5,7 @@ .\" .\" Note: Please keep this page in sync with the source, rigctlcom.c .\" -.TH RIGCTLCOM "1" "2019-12-10" "Hamlib" "Hamlib Utilities" +.TH RIGCTLCOM "1" "2020-09-09" "Hamlib" "Hamlib Utilities" . . .SH NAME @@ -108,12 +108,12 @@ to the other com port of the virtual pair. Virtual serial ports on POSIX systems can be done with .BR socat (1): . -.sp -.RS 1.0i +.IP +.in +4n .EX -$ socat -d -d pty,raw,echo=0 pty,raw,echo=0 +.RB $ " socat -d -d pty,raw,echo=0 pty,raw,echo=0" .EE -.RE +.in . .IP See this @@ -342,23 +342,23 @@ attaching to COM10 and using the TS-2000 emulator attached to COM9 (assumes virtual serial/COM ports pipe has been created with the proper utility as described above): . -.sp -.RS 0.5i +.PP +.in +4n .EX -$ rigctlcom -m 4 -R COM9 -S 115200 +.RB $ " rigctlcom -m 4 -R COM9 -S 115200" .EE -.RE +.in . .PP The following diagram shows the communications flow that allows N1MM Logger+ to communicate with a radio connected to Flrig: . -.sp -.RS 0.5i +.PP +.in +4n .EX Flrig -><- rigctlcom -> COM9 <- virt_port_pipe -> COM10 <- N1MM .EE -.RE +.in . . .SH BUGS @@ -385,7 +385,7 @@ Copyright \(co 2000-2011 Stephane Fillod .br Copyright \(co 2000-2018 the Hamlib Group (various contributors) .br -Copyright \(co 2010-2019 Nate Bargmann +Copyright \(co 2010-2020 Nate Bargmann .br Copyright \(co 2019 Michael Black W9MDB . @@ -405,8 +405,8 @@ NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .SH COLOPHON . Links to the Hamlib Wiki, Git repository, release archives, and daily snapshot -archives: -.IP +archives are available via +. .UR http://www.hamlib.org hamlib.org .UE . diff --git a/doc/man1/rigctld.1 b/doc/man1/rigctld.1 index 5813636a..959b2425 100644 --- a/doc/man1/rigctld.1 +++ b/doc/man1/rigctld.1 @@ -5,7 +5,7 @@ .\" .\" Note: Please keep this page in sync with the source, rigctld.c .\" -.TH RIGCTLD "1" "2019-12-10" "Hamlib" "Hamlib Utilities" +.TH RIGCTLD "1" "2020-09-09" "Hamlib" "Hamlib Utilities" . . .SH NAME @@ -207,35 +207,58 @@ Use .I IPADDR as the listening IP address. .IP -The default is ANY. +The default is ANY (0.0.0.0). .IP -Can be run and connected to like this: +.B rigctld +can be run and connected to like this: +. .IP -.nf +.EX rigctld - rigctl -m 2 - rigctl -m 2 -r 127.0.0.1 - rigctl -m 2 -r localhost - rigctl -m 2 -r 192.168.1.1 (local IP address) - rigctl -m 2 -r ::1 (does not work on Linux as does not listen on IPV6 by default) -.BR +. +.in +4n +rigctl -m 2 +rigctl -m 2 -r 127.0.0.1 +rigctl -m 2 -r localhost +rigctl -m 2 -r 192.168.1.1 (local IP address) +rigctl -m 2 -r ::1 (on Linux rigctld doesn't listen on IPV6 by default) +.in +. +.IP rigctld -T 127.0.0.1 - rigctl -m 2 - rigctl -m 2 -r 127.0.0.1 - Exceptions: - rigctl -m 2 -r localhost (only works if localhost is IPV4 address) -.BR +.in +4n +rigctl -m 2 +rigctl -m 2 -r 127.0.0.1 +.EE +Exceptions: +.EX +rigctl -m 2 -r localhost (only works if localhost is IPV4 address) +.EE +.in +. +.IP +.EX rigctld -T localhost (will set up on IPV4 or IPV6 based on localhost) - rigctl -m 2 - rigctl -m 2 -r localhost - rigctl -m 2 ip6-localhost - Exceptions: - rigctl -m 2 -r 127.0.0.1 (only works if localhost is IPV4 address) - rigctl -m 2 -r ::1 (only works localhost is IPV6 address) -.BR -On Linux only where ip6-localhost fe00::0 +.in +4n +rigctl -m 2 +rigctl -m 2 -r localhost +rigctl -m 2 ip6-localhost +.EE +Exceptions: +.EX +rigctl -m 2 -r 127.0.0.1 (only works if localhost is IPV4 address) +rigctl -m 2 -r ::1 (only works localhost is IPV6 address) +.EE +.in +. +.IP +On Linux only where ip6-localhost is fe00::0: +.EX rigctld -T ip6-localhost - rigctl -m 2 -r ip6-localhost +.in +4n +rigctl -m 2 -r ip6-localhost +.in +.EE . .TP .BR \-t ", " \-\-port = \fInumber\fP @@ -460,8 +483,8 @@ In VFO mode (see .B \-\-vfo option above) only a single VFO parameter is required: . -.sp -.RS 1.0i +.IP +.in +4n .EX $ rigctl -m 229 -r /dev/rig -o @@ -470,7 +493,7 @@ VFO: VFOB Rig command: .EE -.RE +.in . .TP .BR v ", " get_vfo @@ -1049,7 +1072,7 @@ Set .RI \(aq Status \(aq .IP Set vfo option Status 1=on or 0=off -This is the same as using the -o switch for rigctl and ritctld. +This is the same as using the -o switch for rigctl and ritctld. This can be dyamically changed while running. . . @@ -1089,16 +1112,15 @@ needed values. In practice, reliable results are obtained by terminating each command string with a newline character, \(oq\\n\(cq. . .PP -Example set frequency and mode commands (Perl code): +Example set frequency and mode commands (Perl code (typed text shown in bold)): . -.sp -.RS 0.5i +.PP +.in +4n .EX -print $socket "F 14250000\\n"; -.br -print $socket "\\\\set_mode LSB 2400\\n"; # escape leading '\\' +\fBprint $socket "F 14250000\\n";\fP +\fBprint $socket "\\\\set_mode LSB 2400\\n";\fP # escape leading '\\' .EE -.RE +.in . .PP A one line response will be sent as a reply to @@ -1121,14 +1143,13 @@ is the Hamlib error... [truncated message content] |