[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 851c499376915d9728cbe
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Michael B. <mdb...@us...> - 2021-08-24 04:20: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 851c499376915d9728cbec53618b7385378277b0 (commit) via 0965a4382c87739d46dbeb09df4ad8a064e6a7f6 (commit) via 547bd0fb555503cb30f5d2dad77d4de2b8e2c13a (commit) from b2acf0b6f5e34fcc9dd0a5d1f8ff3a3f45e35971 (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 851c499376915d9728cbec53618b7385378277b0 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Aug 23 23:19:12 2021 -0500 Fix lack of error for some bad rig numbers. e.g. rigctl -m 228 produced hash collision error instead of unknown rig https://github.com/Hamlib/Hamlib/issues/735 diff --git a/src/register.c b/src/register.c index ff4ef5e2..0d3895ac 100644 --- a/src/register.c +++ b/src/register.c @@ -284,6 +284,7 @@ int HAMLIB_API rig_check_backend(rig_model_t rig_model) const struct rig_caps *caps; int be_idx; int retval; + int i,n; /* already loaded ? */ caps = rig_get_caps(rig_model); @@ -293,6 +294,17 @@ int HAMLIB_API rig_check_backend(rig_model_t rig_model) return RIG_OK; } + // hmmm...no caps so did we already load the rigs? + for(n=0, i=0; i< RIGLSTHASHSZ; i++) + { + if (rig_hash_table[i]) ++n; + } + if (n > 1) + { + rig_debug(RIG_DEBUG_ERR, "%s: rig model %d not found and rig count=%d\n", __func__, rig_model, n); + return -RIG_ENAVAIL; + } + be_idx = rig_lookup_backend(rig_model); /* commit 0965a4382c87739d46dbeb09df4ad8a064e6a7f6 Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Aug 22 16:47:29 2021 -0500 Fix Kenwood rigs that turn split off during FR command by turning split back on if needed https://github.com/Hamlib/Hamlib/issues/746 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index f6681ee9..efe6ade9 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -1115,6 +1115,9 @@ int kenwood_set_vfo(RIG *rig, vfo_t vfo) } snprintf(cmdbuf, sizeof(cmdbuf), "FR%c", vfo_function); + // FR can turn off split on some Kenwood rigs + // So we'll turn it back on just in case + if (priv->split) strcat(cmdbuf,"FT1;"); if (RIG_IS_TS50 || RIG_IS_TS940) { @@ -1251,6 +1254,9 @@ int kenwood_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo) /* set RX VFO */ snprintf(cmdbuf, sizeof(cmdbuf), "FR%c", vfo_function); + // FR can turn off split on some Kenwood rigs + // So we'll turn it back on just in case + if (priv->split) strcat(cmdbuf,"FT1;"); retval = kenwood_transaction(rig, cmdbuf, NULL, 0); if (retval != RIG_OK) diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index f00b156f..17f64d54 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -28,7 +28,7 @@ #include "token.h" #include "misc.h" -#define BACKEND_VER "20210809" +#define BACKEND_VER "20210822" #define EOM_KEN ';' #define EOM_TH '\r' commit 547bd0fb555503cb30f5d2dad77d4de2b8e2c13a Author: Mike Black W9MDB <mdb...@ya...> Date: Sun Aug 22 16:40:48 2021 -0500 Fix ANT get/set for IC756Pro series https://github.com/Hamlib/Hamlib/issues/774 diff --git a/rigs/icom/ic756.c b/rigs/icom/ic756.c index bcdb0baa..64e8243f 100644 --- a/rigs/icom/ic756.c +++ b/rigs/icom/ic756.c @@ -127,7 +127,7 @@ static const struct icom_priv_caps ic756_priv_caps = 0, /* 731 mode */ 0, /* no XCHG */ ic756_ts_sc_list, - .antack_len = 2, + .antack_len = 3, .ant_count = 2, .r2i_mode = r2i_mode, .agc_levels_present = 1, @@ -291,7 +291,7 @@ static const struct icom_priv_caps ic756pro_priv_caps = 0, /* 731 mode */ 0, /* no XCHG */ ic756pro_ts_sc_list, - .antack_len = 2, + .antack_len = 3, .ant_count = 2, .agc_levels_present = 1, .agc_levels = { @@ -461,7 +461,7 @@ static const struct icom_priv_caps ic756pro2_priv_caps = 0, /* 731 mode */ 0, /* no XCHG */ ic756pro_ts_sc_list, - .antack_len = 2, + .antack_len = 3, .ant_count = 2, .agc_levels_present = 1, .agc_levels = { @@ -890,7 +890,7 @@ static const struct icom_priv_caps ic756pro3_priv_caps = 0, /* 731 mode */ 0, /* no XCHG */ ic756pro_ts_sc_list, - .antack_len = 2, + .antack_len = 3, .ant_count = 2, .agc_levels_present = 1, .agc_levels = { @@ -976,7 +976,7 @@ const struct rig_caps ic756pro3_caps = RIG_MODEL(RIG_MODEL_IC756PROIII), .model_name = "IC-756PROIII", .mfg_name = "Icom", - .version = BACKEND_VER ".0", + .version = BACKEND_VER ".1", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rig_type = RIG_TYPE_TRANSCEIVER, diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index e6120c3e..ba3607ce 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -7601,7 +7601,6 @@ int icom_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) RETURNFUNC(retval); } - antopt_len = 0; rig_debug(RIG_DEBUG_TRACE, "%s: antack_len=%d so antopt_len=%d, antopt=0x%02x\n", __func__, priv_caps->antack_len, antopt_len, antopt[0]); @@ -7729,13 +7728,14 @@ int icom_get_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t *option, rig_debug(RIG_DEBUG_ERR, "%s: ackbuf= 0x%02x 0x%02x 0x%02x\n", __func__, ackbuf[0], ackbuf[1], ackbuf[2]); - *ant_curr = rig_idx2setting(ackbuf[1]); + *ant_curr = *ant_tx = *ant_rx = rig_idx2setting(ackbuf[1]); // Note: with IC756/IC-756Pro/IC-7800 and more, ackbuf[2] deals with [RX ANT] // Hopefully any ack_len=3 can fit in the option field if (ack_len == 3) { option->i = ackbuf[2]; + *ant_rx = rig_idx2setting(ackbuf[2]); } RETURNFUNC(RIG_OK); diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 606e271c..c937844c 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -30,7 +30,7 @@ #include <sys/time.h> #endif -#define BACKEND_VER "20210812" +#define BACKEND_VER "20210822" #define ICOM_IS_SECONDARY_VFO(vfo) ((vfo) & (RIG_VFO_B | RIG_VFO_SUB | RIG_VFO_SUB_B | RIG_VFO_MAIN_B)) #define ICOM_GET_VFO_NUMBER(vfo) (ICOM_IS_SECONDARY_VFO(vfo) ? 0x01 : 0x00) diff --git a/tests/simicom.c b/tests/simicom.c index 509fc54b..7e7be713 100644 --- a/tests/simicom.c +++ b/tests/simicom.c @@ -27,6 +27,8 @@ mode_t modeA = RIG_MODE_CW; mode_t modeB = RIG_MODE_USB; pbwidth_t widthA = 0; pbwidth_t widthB = 1; +ant_t ant_curr = 0; +int ant_option = 0; void dumphex(unsigned char *buf, int n) { @@ -159,6 +161,25 @@ void frameParse(int fd, unsigned char *frame, int len) write(fd, frame, 6); break; + case 0x12: // we're simulating the 3-byte version -- not the 2-byte + if (frame[5] != 0xfd) + { + printf("Set ant %d\n", -1); + ant_curr = frame[5]; + ant_option = frame[6]; + dump_hex(frame,8); + } + else { + printf("Get ant\n"); + } + frame[5] = ant_curr; + frame[6] = ant_option; + frame[7]=0xfd; + printf("write 8 bytes\n"); + dump_hex(frame,8); + write(fd, frame, 8); + break; + case 0x1a: // miscellaneous things switch (frame[5]) { @@ -173,7 +194,7 @@ void frameParse(int fd, unsigned char *frame, int len) break; -#if 0 +#if 1 case 0x25: if (frame[6] == 0xfd) { ----------------------------------------------------------------------- Summary of changes: rigs/icom/ic756.c | 10 +++++----- rigs/icom/icom.c | 4 ++-- rigs/icom/icom.h | 2 +- rigs/kenwood/kenwood.c | 6 ++++++ rigs/kenwood/kenwood.h | 2 +- src/register.c | 12 ++++++++++++ tests/simicom.c | 23 ++++++++++++++++++++++- 7 files changed, 49 insertions(+), 10 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |