[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. eb8082b1f882706f589b2
Library to control radio transceivers and receivers
Brought to you by:
n0nb
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] |