[Hamlib-commits] Hamlib -- Ham radio control libraries branch Hamlib-4.0 updated. af1a0828c327cff27
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Nate B. <n0...@us...> - 2020-12-13 18:39:40
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, Hamlib-4.0 has been updated via af1a0828c327cff27ddd281e6a050ca5d21939d7 (commit) via 6caeb35b55eb8c6acaf5b73c80b051a259bfe25f (commit) via 4ccc6cb72309481997cc70d51364ddf3f5ee12f1 (commit) via d0572c5ae650bfba5e382f62d0c1076bba509c89 (commit) via 66e154ffaf0609a69fc005c8d559f6160068823a (commit) via e2ce6027b5efc5f3d453498e0f829d7aa4b0edb4 (commit) via 62aa6eb4eafadf4d3b53a18d8878a5c3a832ebf4 (commit) via 99b862d0caf41fae6e0f33d36d54eff9207c5761 (commit) via 123e0e7d986bd1204b156e8d1597df91312f2552 (commit) via 6c5a7c205939b7932156a4ae6efc8a4220c39d3b (commit) via c202d9cdac47b4983dd8deef32a03fdf2a549864 (commit) via 1c389b97838dfb6862589631536699ed390ca6a8 (commit) via 178208714f13ea28786ddd9bfd32625bd09e12e4 (commit) via ada663f55e00f9a475412481a7669616116a89b5 (commit) via 5a3e50535d198f5c965eb4ebe2fd5f2b1bfd509c (commit) via 8217714ed31dcd3181abc2f00129aef3c9f7d4f7 (commit) via e88a8a863e5207babd4b6ed011a8c13d235d4997 (commit) from e0cbeb72df873076f10862ca88ae189505b3ae59 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit af1a0828c327cff27ddd281e6a050ca5d21939d7 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 13 10:20:02 2020 -0600 Fix debug statements in rig.c (cherry picked from commit 1e1f7529fab7302f7698a32607b97397cb8ed0e7) diff --git a/src/rig.c b/src/rig.c index c705ecfc..c7f48821 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1891,14 +1891,14 @@ int HAMLIB_API rig_get_mode(RIG *rig, if (retcode == RIG_OK && (vfo == RIG_VFO_CURR || vfo == rig->state.current_vfo)) { - rig_debug(RIG_DEBUG_TRACE, "%s(%d): debug", __func__, __LINE__); + rig_debug(RIG_DEBUG_TRACE, "%s(%d): debug\n", __func__, __LINE__); rig->state.current_mode = *mode; rig->state.current_width = *width; } if (*width == RIG_PASSBAND_NORMAL && *mode != RIG_MODE_NONE) { - rig_debug(RIG_DEBUG_TRACE, "%s(%d): debug", __func__, __LINE__); + rig_debug(RIG_DEBUG_TRACE, "%s(%d): debug\n", __func__, __LINE__); *width = rig_passband_normal(rig, *mode); } commit 6caeb35b55eb8c6acaf5b73c80b051a259bfe25f Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 13 10:00:37 2020 -0600 Fix debug statement in rig.c (cherry picked from commit 8c265a85f20b4318ba1b2cec9f3b6e1dac00baec) diff --git a/src/rig.c b/src/rig.c index 69a990dd..c705ecfc 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1862,7 +1862,7 @@ int HAMLIB_API rig_get_mode(RIG *rig, { int rc2; vfo_t curr_vfo; - rig_debug(RIG_DEBUG_TRACE, "%s(%d): debug", __func__, __LINE__); + rig_debug(RIG_DEBUG_TRACE, "%s(%d): debug\n", __func__, __LINE__); if (!caps->set_vfo) { commit 4ccc6cb72309481997cc70d51364ddf3f5ee12f1 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 13 09:40:52 2020 -0600 Change newcat.c to not abort when ?; is received FTDX3000 was giving ?; to FB; command!!! https://github.com/Hamlib/Hamlib/issues/464 (cherry picked from commit 4eef84ef47874e47f567d0d5c88fd093977b70dc) diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 08d98313..b15f6f68 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -9032,10 +9032,12 @@ int newcat_get_cmd(RIG *rig) * There are many more cases like these and they vary by rig model. * * So far, "rig busy" type situations with the ? response have not been observed for get commands. + * Followup 20201213 FTDX3000 FB; command returning ?; so do NOT abort + * see https://github.com/Hamlib/Hamlib/issues/464 */ rig_debug(RIG_DEBUG_ERR, "%s: Command rejected by the rig: '%s'\n", __func__, priv->cmd_str); - return -RIG_ERJCTED; + // return -RIG_ERJCTED; } continue; diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index 6b8e76e6..6b69bf15 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20201212" +#define NEWCAT_VER "20201213" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 commit d0572c5ae650bfba5e382f62d0c1076bba509c89 Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 13 08:55:50 2020 -0600 Added flrig LEVEL values STRENGTH, RF, AF, RFPOWER_METER, MICGAIN https://github.com/Hamlib/Hamlib/issues/460 (cherry picked from commit f54d0508fd1230c3bcd85143ba7b9349eda5a2aa) diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index caec2721..214174df 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -57,7 +57,7 @@ RIG_MODE_SSB | RIG_MODE_LSB | RIG_MODE_USB |\ RIG_MODE_FM | RIG_MODE_WFM | RIG_MODE_FMN |RIG_MODE_PKTFM ) -#define FLRIG_LEVELS (RIG_LEVEL_AF | RIG_LEVEL_RF | RIG_LEVEL_MICGAIN | RIG_LEVEL_STRENGTH) +#define FLRIG_LEVELS (RIG_LEVEL_AF | RIG_LEVEL_RF | RIG_LEVEL_MICGAIN | RIG_LEVEL_STRENGTH | RIG_LEVEL_RFPOWER_METER) #define streq(s1,s2) (strcmp(s1,s2)==0) @@ -1874,7 +1874,8 @@ static int flrig_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) } sprintf(cmd_arg, - "<params><param><value><double>%d</double></value></param></params>", (int)val.f); + "<params><param><value><double>%d</double></value></param></params>", + (int)val.f); switch (level) { @@ -1923,6 +1924,8 @@ static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) case RIG_LEVEL_STRENGTH: cmd = "rig.get_power"; break; + case RIG_LEVEL_RFPOWER_METER: cmd = "rig.get_pwrmeter"; break; + default: rig_debug(RIG_DEBUG_ERR, "%s: unknown level=%d\n", __func__, (int)level); return -RIG_EINVAL; @@ -1937,9 +1940,20 @@ static int flrig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return retval; } - val->f = atof(value); + // most levels are 0-100 -- may have to allow for different ranges + switch (level) + { + case RIG_LEVEL_STRENGTH: + case RIG_LEVEL_RFPOWER_METER: + val->i = atoi(value); + rig_debug(RIG_DEBUG_TRACE, "%s: val.i='%s'(%d)\n", __func__, value, val->i); + break; + + default: + val->f = atof(value) / 100; + rig_debug(RIG_DEBUG_TRACE, "%s: val.f='%s'(%f)\n", __func__, value, val->f); + } - rig_debug(RIG_DEBUG_TRACE, "%s: val='%s'(%f)\n", __func__, value, val->f); return RIG_OK; } diff --git a/rigs/dummy/flrig.h b/rigs/dummy/flrig.h index f49a1934..b231e02d 100644 --- a/rigs/dummy/flrig.h +++ b/rigs/dummy/flrig.h @@ -28,7 +28,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20201209" +#define BACKEND_VER "20201213" #define EOM "\r" #define TRUE 1 commit 66e154ffaf0609a69fc005c8d559f6160068823a Author: Michael Black W9MDB <mdb...@ya...> Date: Sun Dec 13 00:01:09 2020 -0600 Fix datamode set in icom.c to use 0x00 0x00 per the manual for 7300 and 9700 https://github.com/Hamlib/Hamlib/issues/448 (cherry picked from commit 9b98a264abf06b7e847ba45511494031f851a4f2) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 1248b87b..1c13b4a2 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1627,7 +1627,6 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, datamode[0] = 0x00; break; } - if (width != RIG_PASSBAND_NOCHANGE) { if (filter_byte) // then we need the width byte too @@ -1638,7 +1637,7 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, // since width_icom is 0-2 for rigs that need this here we have to make it 1-3 datamode[1] = datamode[0] ? width_icom : 0; retval = - icom_transaction(rig, C_CTL_MEM, dm_sub_cmd, datamode, width_icom == -1 ? 1 : 2, + icom_transaction(rig, C_CTL_MEM, dm_sub_cmd, datamode, 2, ackbuf, &ack_len); } commit e2ce6027b5efc5f3d453498e0f829d7aa4b0edb4 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 23:05:59 2020 -0600 icom.c passband nochange seems to be working https://github.com/Hamlib/Hamlib/issues/448 (cherry picked from commit 5883897656f7c8937d81af112ea7d9f7792e89f2) diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index ec5e20e3..e52950ad 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -404,7 +404,6 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, "%s: Failed to get width for passband nochange err=%s\n", __func__, rigerror(ret)); } - return RIG_OK; } switch (mode) @@ -491,15 +490,15 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, icmode_ext = PD_WIDE_3; /* default to Wide */ } } + *pd = icmode_ext; } else { // filter should already be set elsewhere - icmode_ext = priv_data->filter; + *pd = priv_data->filter; } *md = icmode; - *pd = icmode_ext; return RIG_OK; } diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index d4b66816..1248b87b 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1604,6 +1604,7 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, break; } + rig_debug(RIG_DEBUG_VERBOSE, "%s mode=%d, width=%d\n", __func__, (int)icom_mode, (int)width); retval = icom_set_mode(rig, vfo, icom_mode, width); if (RIG_OK == retval) @@ -1704,16 +1705,18 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { err = rig2icom_mode(rig, vfo, mode, width, &icmode, &icmode_ext); } + if (width == RIG_PASSBAND_NOCHANGE) icmode_ext = priv_data->filter; if (err < 0) { + rig_debug(RIG_DEBUG_ERR, "%s: Error on rig2icom err=%d\n", __func__, err); return err; } + rig_debug(RIG_DEBUG_VERBOSE, "%s: icmode=%d, icmode_ext=%d\n", __func__, icmode, icmode_ext); /* IC-731, IC-735, IC-7000 don't support passband data */ /* IC-726 & IC-475A/E also limited support - only on CW */ /* TODO: G4WJS CW wide/narrow are possible with above two radios */ - if (icmode_ext == -1) icmode_ext = priv_data->filter; if (priv->civ_731_mode || rig->caps->rig_model == RIG_MODEL_OS456 || rig->caps->rig_model == RIG_MODEL_IC726 || rig->caps->rig_model == RIG_MODEL_IC475 @@ -1722,6 +1725,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) icmode_ext = -1; } + rig_debug(RIG_DEBUG_VERBOSE, "%s: #2 icmode=%d, icmode_ext=%d\n", __func__, icmode, icmode_ext); retval = icom_transaction(rig, C_SET_MODE, icmode, (unsigned char *) &icmode_ext, (icmode_ext == -1 ? 0 : 1), ackbuf, &ack_len); @@ -1771,6 +1775,7 @@ int icom_get_mode_with_data(RIG *rig, vfo_t vfo, rmode_t *mode, rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); retval = icom_get_mode(rig, vfo, mode, width); + rig_debug(RIG_DEBUG_VERBOSE, "%s mode=%d\n", __func__, (int)*mode); if (retval != RIG_OK) { return retval; @@ -1816,6 +1821,7 @@ int icom_get_mode_with_data(RIG *rig, vfo_t vfo, rmode_t *mode, return -RIG_ERJCTED; } + rig_debug(RIG_DEBUG_VERBOSE, "%s databuf[2]=%d, mode=%d\n", __func__, (int)databuf[2], (int)*mode); if (databuf[2]) /* 0x01/0x02/0x03 -> data mode, 0x00 -> not data mode */ { switch (*mode) @@ -2045,8 +2051,6 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) return -RIG_EINVAL; } - rig_debug(RIG_DEBUG_TRACE, "%s: debug#1\n", __func__); - if (vfo != rig->state.current_vfo) { rig_debug(RIG_DEBUG_TRACE, "%s: VFO changing from %s to %s\n", __func__, commit 62aa6eb4eafadf4d3b53a18d8878a5c3a832ebf4 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 15:38:42 2020 -0600 move icom.c icmode_ext setting a bit earlier in the code https://github.com/Hamlib/Hamlib/issues/448 (cherry picked from commit cdeacfb7d1015850444d329a0ee9304e265a75f5) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 9555338d..d4b66816 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1713,6 +1713,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) /* IC-731, IC-735, IC-7000 don't support passband data */ /* IC-726 & IC-475A/E also limited support - only on CW */ /* TODO: G4WJS CW wide/narrow are possible with above two radios */ + if (icmode_ext == -1) icmode_ext = priv_data->filter; if (priv->civ_731_mode || rig->caps->rig_model == RIG_MODEL_OS456 || rig->caps->rig_model == RIG_MODEL_IC726 || rig->caps->rig_model == RIG_MODEL_IC475 @@ -1721,7 +1722,6 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) icmode_ext = -1; } - if (icmode_ext == -1) icmode_ext = priv_data->filter; retval = icom_transaction(rig, C_SET_MODE, icmode, (unsigned char *) &icmode_ext, (icmode_ext == -1 ? 0 : 1), ackbuf, &ack_len); commit 99b862d0caf41fae6e0f33d36d54eff9207c5761 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 15:33:38 2020 -0600 Set icom_set_mode to use existing filter for passband nochange https://github.com/Hamlib/Hamlib/issues/448 (cherry picked from commit ddb38db106519d801ff8f6a0d3bf25fedbd50b78) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 74ddda8e..9555338d 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1681,6 +1681,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { struct icom_priv_data *priv; const struct icom_priv_caps *priv_caps; + const struct icom_priv_data *priv_data; struct rig_state *rs; unsigned char ackbuf[MAXFRAMELEN]; unsigned char icmode; @@ -1693,6 +1694,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) priv = (struct icom_priv_data *) rs->priv; priv_caps = (const struct icom_priv_caps *) rig->caps->priv; + priv_data = (const struct icom_priv_data *) rig->state.priv; if (priv_caps->r2i_mode != NULL) /* call priv code if defined */ { @@ -1719,6 +1721,7 @@ int icom_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) icmode_ext = -1; } + if (icmode_ext == -1) icmode_ext = priv_data->filter; retval = icom_transaction(rig, C_SET_MODE, icmode, (unsigned char *) &icmode_ext, (icmode_ext == -1 ? 0 : 1), ackbuf, &ack_len); commit 123e0e7d986bd1204b156e8d1597df91312f2552 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 13:22:49 2020 -0600 Add filter memory to frame.c for no passband change https://github.com/Hamlib/Hamlib/issues/448 (cherry picked from commit 9bc98c9a2e45dbe2c47db488be5703dc2b0fc00d) diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index 5348dbca..ec5e20e3 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -389,6 +389,7 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, unsigned char icmode; signed char icmode_ext; pbwidth_t width_tmp = width; + struct icom_priv_data *priv_data = (struct icom_priv_data *) rig->state.priv; icmode_ext = -1; @@ -491,6 +492,11 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, } } } + else + { + // filter should already be set elsewhere + icmode_ext = priv_data->filter; + } *md = icmode; *pd = icmode_ext; commit 6c5a7c205939b7932156a4ae6efc8a4220c39d3b Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 13:00:26 2020 -0600 Fix passband nochange in icom frame.c https://github.com/Hamlib/Hamlib/issues/448 (cherry picked from commit 7cd09fdd84f70598fffb684e74ab4e24408da13b) diff --git a/rigs/icom/frame.c b/rigs/icom/frame.c index ca718a8d..5348dbca 100644 --- a/rigs/icom/frame.c +++ b/rigs/icom/frame.c @@ -388,6 +388,7 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, { unsigned char icmode; signed char icmode_ext; + pbwidth_t width_tmp = width; icmode_ext = -1; @@ -402,6 +403,7 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, "%s: Failed to get width for passband nochange err=%s\n", __func__, rigerror(ret)); } + return RIG_OK; } switch (mode) @@ -458,7 +460,7 @@ int rig2icom_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width, return -RIG_EINVAL; } - if (width != RIG_PASSBAND_NOCHANGE) + if (width_tmp != RIG_PASSBAND_NOCHANGE) { pbwidth_t medium_width = rig_passband_normal(rig, mode); commit c202d9cdac47b4983dd8deef32a03fdf2a549864 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 12:40:04 2020 -0600 Fix icom filter value, not ASCII!!! https://github.com/Hamlib/Hamlib/issues/448 (cherry picked from commit 3061a5f8b2354b14e226fc1cddcbaffce3bde159) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 0e32beca..74ddda8e 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1868,7 +1868,7 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) if (mode_len == 3) { - priv_data->filter = modebuf[2] - '0'; + priv_data->filter = modebuf[2]; rig_debug(RIG_DEBUG_TRACE, "%s: modebuf[0]=0x%02x, modebuf[1]=0x%02x, modebuf[2]=0x%02x, mode_len=%d, filter=%d\n", __func__, modebuf[0], diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 9120c364..b93aab6c 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -203,7 +203,7 @@ struct icom_priv_data int x25cmdfails; // This will get set if the 0x25 command fails so we try just once int x1cx03cmdfails; // This will get set if the 0x1c 0x03 command fails so we try just once int poweron; // to prevent powering on more than once - int filter; // Current filter selected + unsigned char filter; // Current filter selected }; extern const struct ts_sc_list r8500_ts_sc_list[]; commit 1c389b97838dfb6862589631536699ed390ca6a8 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 12:31:32 2020 -0600 Missed icom.h commit https://github.com/Hamlib/Hamlib/issues/448 (cherry picked from commit 0fa00cb14f12600c9863ab9369e5eb510108a252) diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index cb564ee5..9120c364 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -203,6 +203,7 @@ struct icom_priv_data int x25cmdfails; // This will get set if the 0x25 command fails so we try just once int x1cx03cmdfails; // This will get set if the 0x1c 0x03 command fails so we try just once int poweron; // to prevent powering on more than once + int filter; // Current filter selected }; extern const struct ts_sc_list r8500_ts_sc_list[]; commit 178208714f13ea28786ddd9bfd32625bd09e12e4 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 12:21:54 2020 -0600 Remember filter setting from icom_get_mode so we can refer to it later on set_mode https://github.com/Hamlib/Hamlib/issues/448 (cherry picked from commit 915666add2c857c2c74cf4623992c419c27812ad) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 19ad7460..0e32beca 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1857,16 +1857,29 @@ int icom_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) { unsigned char modebuf[MAXFRAMELEN]; const struct icom_priv_caps *priv_caps; + struct icom_priv_data *priv_data; int mode_len, retval; rig_debug(RIG_DEBUG_VERBOSE, "%s called vfo=%s\n", __func__, rig_strvfo(vfo)); priv_caps = (const struct icom_priv_caps *) rig->caps->priv; + priv_data = (struct icom_priv_data *) rig->state.priv; retval = icom_transaction(rig, C_RD_MODE, -1, NULL, 0, modebuf, &mode_len); - rig_debug(RIG_DEBUG_TRACE, - "%s: modebuf[0]=0x%02x, modebuf[1]=0x%02x, mode_len=%d\n", __func__, modebuf[0], - modebuf[1], mode_len); + if (mode_len == 3) + { + priv_data->filter = modebuf[2] - '0'; + rig_debug(RIG_DEBUG_TRACE, + "%s: modebuf[0]=0x%02x, modebuf[1]=0x%02x, modebuf[2]=0x%02x, mode_len=%d, filter=%d\n", + __func__, modebuf[0], + modebuf[1], modebuf[2], mode_len, priv_data->filter); + } + else + { + rig_debug(RIG_DEBUG_TRACE, + "%s: modebuf[0]=0x%02x, modebuf[1]=0x%02x, mode_len=%d\n", __func__, modebuf[0], + modebuf[1], mode_len); + } if (retval != RIG_OK) { commit ada663f55e00f9a475412481a7669616116a89b5 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 11:24:07 2020 -0600 Eliminate warning in icom.c for passband nochange https://github.com/Hamlib/Hamlib/issues/448 (cherry picked from commit e4e88b833d1877797e56726a749e3bf6cdb35a05) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index e3a7f133..19ad7460 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1651,6 +1651,7 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, else { rig_debug(RIG_DEBUG_TRACE, "%s RIG_PASSBAND_NOCHANGE\n", __func__); + return RIG_OK; } if (retval != RIG_OK) commit 5a3e50535d198f5c965eb4ebe2fd5f2b1bfd509c Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 10:07:03 2020 -0600 Update icom.h version (cherry picked from commit f22d4a6dbe7305b3a84546faa6e462e388a0d3ee) diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 8a404cc6..cb564ee5 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -30,7 +30,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20201103" +#define BACKEND_VER "20201212" /* * defines used by comp_cal_str in rig.c commit 8217714ed31dcd3181abc2f00129aef3c9f7d4f7 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 10:06:44 2020 -0600 astyle icom.c (cherry picked from commit c0743dfe6e6633151b87cdbc5c7321bd11ce9d1a) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 033801e5..e3a7f133 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1627,25 +1627,26 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, break; } - if (width != RIG_PASSBAND_NOCHANGE) { - if (filter_byte) // then we need the width byte too - { - unsigned char mode_icom; // not used as it will map to USB/LSB - signed char width_icom; - rig2icom_mode(rig, vfo, mode, width, &mode_icom, &width_icom); - // since width_icom is 0-2 for rigs that need this here we have to make it 1-3 - datamode[1] = datamode[0] ? width_icom : 0; - retval = - icom_transaction(rig, C_CTL_MEM, dm_sub_cmd, datamode, width_icom == -1 ? 1 : 2, - ackbuf, - &ack_len); - } - else + if (width != RIG_PASSBAND_NOCHANGE) { - retval = - icom_transaction(rig, C_CTL_MEM, dm_sub_cmd, datamode, 1, ackbuf, - &ack_len); - } + if (filter_byte) // then we need the width byte too + { + unsigned char mode_icom; // not used as it will map to USB/LSB + signed char width_icom; + rig2icom_mode(rig, vfo, mode, width, &mode_icom, &width_icom); + // since width_icom is 0-2 for rigs that need this here we have to make it 1-3 + datamode[1] = datamode[0] ? width_icom : 0; + retval = + icom_transaction(rig, C_CTL_MEM, dm_sub_cmd, datamode, width_icom == -1 ? 1 : 2, + ackbuf, + &ack_len); + } + else + { + retval = + icom_transaction(rig, C_CTL_MEM, dm_sub_cmd, datamode, 1, ackbuf, + &ack_len); + } } else { commit e88a8a863e5207babd4b6ed011a8c13d235d4997 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Dec 12 10:06:00 2020 -0600 icom now recognizes RIG_PASSBAND_NOCHANGE https://github.com/Hamlib/Hamlib/issues/448 (cherry picked from commit 2ff3fa0782377eed7b9b766caaf41d99c434cc22) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index acbc309f..033801e5 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1627,6 +1627,7 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, break; } + if (width != RIG_PASSBAND_NOCHANGE) { if (filter_byte) // then we need the width byte too { unsigned char mode_icom; // not used as it will map to USB/LSB @@ -1645,6 +1646,11 @@ int icom_set_mode_with_data(RIG *rig, vfo_t vfo, rmode_t mode, icom_transaction(rig, C_CTL_MEM, dm_sub_cmd, datamode, 1, ackbuf, &ack_len); } + } + else + { + rig_debug(RIG_DEBUG_TRACE, "%s RIG_PASSBAND_NOCHANGE\n", __func__); + } if (retval != RIG_OK) { ----------------------------------------------------------------------- Summary of changes: rigs/dummy/flrig.c | 22 ++++++++++++++---- rigs/dummy/flrig.h | 2 +- rigs/icom/frame.c | 11 +++++++-- rigs/icom/icom.c | 65 +++++++++++++++++++++++++++++++++++++---------------- rigs/icom/icom.h | 3 ++- rigs/yaesu/newcat.c | 4 +++- rigs/yaesu/newcat.h | 2 +- src/rig.c | 6 ++--- 8 files changed, 83 insertions(+), 32 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |