[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. d361a111e2ce371e97db2
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Michael B. <mdb...@us...> - 2020-07-04 16:24:19
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Hamlib -- Ham radio control libraries". The branch, master has been updated via d361a111e2ce371e97db29da89b5939688172737 (commit) via 3d852c433e9a7d911ad60e48384be430de7ecdf0 (commit) via 06d130371c3a8f89ccfac16d58eb2d9b64ecb72f (commit) from 699927b3e7d7424c9e18e504689f24ebe61f6aca (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 d361a111e2ce371e97db29da89b5939688172737 Merge: 699927b3 3d852c43 Author: Michael Black W9MDB <mdb...@ya...> Date: Sat Jul 4 11:23:49 2020 -0500 Merge branch 'th7d-updates' of git://git.code.sf.net/u/bsomervi/hamlib commit 3d852c433e9a7d911ad60e48384be430de7ecdf0 Author: Bill Somerville <bi...@cl...> Date: Sat Jul 4 15:27:07 2020 +0100 Less ambiguous variable name and repair merge issue in prior commit diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index d37f7421..001c5f3b 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -232,7 +232,7 @@ int kenwood_transaction(RIG *rig, const char *cmdstr, char *data, char buffer[KENWOOD_MAX_BUF_LEN]; /* use our own buffer since verification may need a longer buffer than the user supplied one */ - char cmdtrm[2]; /* Default Command/Reply termination char */ + char cmdtrm_str[2]; /* Default Command/Reply termination char */ int retval; char *cmd; int len; @@ -282,8 +282,8 @@ int kenwood_transaction(RIG *rig, const char *cmdstr, char *data, priv->cache_start.tv_sec = 0; } - cmdtrm[0] = caps->cmdtrm; - cmdtrm[1] = '\0'; + cmdtrm_str[0] = caps->cmdtrm; + cmdtrm_str[1] = '\0'; transaction_write: @@ -306,7 +306,7 @@ transaction_write: /* XXX the if is temporary, until all invocations are fixed */ if (cmdstr[len - 1] != ';' && cmdstr[len - 1] != '\r') { - cmd[len] = caps->cmdtrm[0]; + cmd[len] = caps->cmdtrm; len++; } @@ -341,7 +341,7 @@ transaction_read: /* allow room for most any response */ len = min(datasize ? datasize + 1 : strlen(priv->verify_cmd) + 32, KENWOOD_MAX_BUF_LEN); - retval = read_string(&rs->rigport, buffer, len, cmdtrm, strlen(cmdtrm)); + retval = read_string(&rs->rigport, buffer, len, cmdtrm_str, strlen(cmdtrm_str)); rig_debug(RIG_DEBUG_TRACE, "%s: read_string(len=%d)='%s'\n", __func__, (int)strlen(buffer), buffer); @@ -368,7 +368,7 @@ transaction_read: } /* Check that command termination is correct */ - if (strchr(cmdtrm, buffer[strlen(buffer) - 1]) == NULL) + if (strchr(cmdtrm_str, buffer[strlen(buffer) - 1]) == NULL) { rig_debug(RIG_DEBUG_ERR, "%s: Command is not correctly terminated '%s'\n", __func__, buffer); @@ -664,14 +664,14 @@ int kenwood_init(RIG *rig) memset(priv, 0x00, sizeof(struct kenwood_priv_data)); if (RIG_IS_XG3) { - priv->verify_cmd[0] = caps->cmdtrm[0]; + priv->verify_cmd[0] = caps->cmdtrm; priv->verify_cmd[1] ='\0'; } else { priv->verify_cmd[0] ='I'; priv->verify_cmd[1] ='D'; - priv->verify_cmd[2] = caps->cmdtrm[0]; + priv->verify_cmd[2] = caps->cmdtrm; priv->verify_cmd[3] ='\0'; } priv->split = RIG_SPLIT_OFF; @@ -811,10 +811,10 @@ int kenwood_open(RIG *rig) /* here we know there is something that responds to FA but not to ID so use FA as the command verification command */ - priv->verify_cmd[0] = F'; - priv->verify_cmd[1] = A'; - priv->verify_cmd[2] = caps->cmdtrm ; - priv->verify_cmd[3] = \0; + priv->verify_cmd[0] = 'F'; + priv->verify_cmd[1] = 'A'; + priv->verify_cmd[2] = caps->cmdtrm; + priv->verify_cmd[3] = '\0'; strcpy(id, "ID019"); /* fake a TS-2000 */ } else commit 06d130371c3a8f89ccfac16d58eb2d9b64ecb72f Author: Bill Somerville <bi...@cl...> Date: Sat Jul 4 13:00:31 2020 +0100 Updates to the TH-D7A/E back end Allow for these rigs echo of successful set commands, no command verification is requires nor necessary with TH style rigs. Change rig_open to not use teh IF command with TH style rigs as it is not supported and breaks communications for the next command. Send the correct command to disable auto-information mode on TH style rigs. Ensure the correct command terminator is sent with all commands to TH style rigs. Fix an issue with MEM mode selection in the TH-D7. Use the correct DCD detection command for the TH-D7. diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 3d113757..d37f7421 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -306,7 +306,7 @@ transaction_write: /* XXX the if is temporary, until all invocations are fixed */ if (cmdstr[len - 1] != ';' && cmdstr[len - 1] != '\r') { - cmd[len] = caps->cmdtrm; + cmd[len] = caps->cmdtrm[0]; len++; } @@ -662,7 +662,18 @@ int kenwood_init(RIG *rig) priv = rig->state.priv; memset(priv, 0x00, sizeof(struct kenwood_priv_data)); - strcpy(priv->verify_cmd, RIG_IS_XG3 ? ";" : "ID;"); + if (RIG_IS_XG3) + { + priv->verify_cmd[0] = caps->cmdtrm[0]; + priv->verify_cmd[1] ='\0'; + } + else + { + priv->verify_cmd[0] ='I'; + priv->verify_cmd[1] ='D'; + priv->verify_cmd[2] = caps->cmdtrm[0]; + priv->verify_cmd[3] ='\0'; + } priv->split = RIG_SPLIT_OFF; priv->trn_state = -1; priv->curr_mode = 0; @@ -697,6 +708,7 @@ int kenwood_cleanup(RIG *rig) int kenwood_open(RIG *rig) { struct kenwood_priv_data *priv = rig->state.priv; + struct kenwood_priv_caps *caps = kenwood_caps(rig); int err, i; char *idptr; char id[KENWOOD_MAX_BUF_LEN]; @@ -799,7 +811,10 @@ int kenwood_open(RIG *rig) /* here we know there is something that responds to FA but not to ID so use FA as the command verification command */ - strcpy(priv->verify_cmd, "FA;"); + priv->verify_cmd[0] = F'; + priv->verify_cmd[1] = A'; + priv->verify_cmd[2] = caps->cmdtrm ; + priv->verify_cmd[3] = \0; strcpy(id, "ID019"); /* fake a TS-2000 */ } else @@ -862,19 +877,25 @@ int kenwood_open(RIG *rig) kenwood_get_trn(rig, &priv->trn_state); /* ignore errors */ /* Currently we cannot cope with AI mode so turn it off in case last client left it on */ - kenwood_set_trn(rig, RIG_TRN_OFF); /* ignore status in case - it's not supported */ - // call get_split to fill in current split and tx_vfo status - retval = kenwood_get_split_vfo_if(rig, RIG_VFO_A, &split, &tx_vfo); + if (priv->trn_state != RIG_TRN_OFF) + { + kenwood_set_trn(rig, RIG_TRN_OFF); /* ignore status in case + it's not supported */ + } - if (retval != RIG_OK) + if (!RIG_IS_THD74 && !RIG_IS_THD7A) { - rig_debug(RIG_DEBUG_ERR, "%s: %s\n", __func__, rigerror(retval)); + // call get_split to fill in current split and tx_vfo status + retval = kenwood_get_split_vfo_if(rig, RIG_VFO_A, &split, &tx_vfo); + if (retval != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: %s\n", __func__, rigerror(retval)); + } + priv->tx_vfo = tx_vfo; + rig_debug(RIG_DEBUG_VERBOSE, "%s: priv->tx_vfo=%s\n", __func__, + rig_strvfo(priv->tx_vfo)); } - priv->tx_vfo = tx_vfo; - rig_debug(RIG_DEBUG_VERBOSE, "%s: priv->tx_vfo=%s\n", __func__, - rig_strvfo(priv->tx_vfo)); return RIG_OK; } @@ -3402,6 +3423,7 @@ int kenwood_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) */ int kenwood_set_trn(RIG *rig, int trn) { + char buf[5]; rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); switch (rig->caps->rig_model) @@ -3410,9 +3432,9 @@ int kenwood_set_trn(RIG *rig, int trn) return kenwood_transaction(rig, (trn == RIG_TRN_RIG) ? "AI2" : "AI0", NULL, 0); break; + case RIG_MODEL_THD7A: case RIG_MODEL_THD74: - return kenwood_transaction(rig, (trn == RIG_TRN_RIG) ? "AI 1" : "AI 0", NULL, - 4); + return kenwood_transaction(rig, (trn == RIG_TRN_RIG) ? "AI 1" : "AI 0", buf, sizeof buf); break; default: @@ -3443,7 +3465,7 @@ int kenwood_get_trn(RIG *rig, int *trn) return -RIG_ENAVAIL; } - if (RIG_IS_THD74) + if (RIG_IS_THD74 || RIG_IS_THD7A) { retval = kenwood_safe_transaction(rig, "AI", trnbuf, 6, 4); } @@ -3457,7 +3479,7 @@ int kenwood_get_trn(RIG *rig, int *trn) return retval; } - if (RIG_IS_THD74) + if (RIG_IS_THD74 || RIG_IS_THD7A) { *trn = trnbuf[3] != '0' ? RIG_TRN_RIG : RIG_TRN_OFF; } diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index ec48b6ab..8030f9de 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -80,6 +80,7 @@ extern const struct confparams kenwood_cfg_params[]; #define RIG_IS_HPSDR (rig->caps->rig_model == RIG_MODEL_HPSDR) #define RIG_IS_K2 (rig->caps->rig_model == RIG_MODEL_K2) #define RIG_IS_K3 (rig->caps->rig_model == RIG_MODEL_K3) +#define RIG_IS_THD7A (rig->caps->rig_model == RIG_MODEL_THD7A) #define RIG_IS_THD74 (rig->caps->rig_model == RIG_MODEL_THD74) #define RIG_IS_TS2000 (rig->caps->rig_model == RIG_MODEL_TS2000) #define RIG_IS_TS50 (rig->caps->rig_model == RIG_MODEL_TS50) diff --git a/rigs/kenwood/th.c b/rigs/kenwood/th.c index a6e6e1ac..a7750adb 100644 --- a/rigs/kenwood/th.c +++ b/rigs/kenwood/th.c @@ -245,7 +245,7 @@ th_set_freq(RIG *rig, vfo_t vfo, freq_t freq) // cppcheck-suppress * sprintf(buf, "FQ %011"PRIll",%X", (int64_t) freq_sent, step); - return kenwood_transaction(rig, buf, NULL, 0); + return kenwood_transaction(rig, buf, buf, sizeof buf); } /* @@ -293,7 +293,6 @@ int th_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) { char kmode, mdbuf[8]; - int retval; const struct kenwood_priv_caps *priv = (const struct kenwood_priv_caps *) rig->caps->priv; @@ -338,14 +337,7 @@ th_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) sprintf(mdbuf, "MD %c", kmode); - retval = kenwood_transaction(rig, mdbuf, NULL, 0); - - if (retval != RIG_OK) - { - return retval; - } - - return RIG_OK; + return kenwood_transaction(rig, mdbuf, mdbuf, sizeof mdbuf); } /* @@ -422,7 +414,8 @@ th_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) int th_set_vfo(RIG *rig, vfo_t vfo) { - const char *cmd; + int retval; + char cmd[8]; rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__); @@ -437,31 +430,24 @@ th_set_vfo(RIG *rig, vfo_t vfo) /* set band */ if (vfo != RIG_VFO_MEM) { - int retval; - switch (vfo) { case RIG_VFO_A: case RIG_VFO_VFO: case RIG_VFO_MAIN: - cmd = "BC 0"; + strncpy (cmd, "BC 0", sizeof cmd); break; case RIG_VFO_B: case RIG_VFO_SUB: - cmd = "BC 1"; + strncpy (cmd, "BC 1", sizeof cmd); break; default: return kenwood_wrong_vfo(__func__, vfo); } - retval = kenwood_simple_transaction(rig, cmd, 5); - - if (retval != RIG_OK) - { - return retval; - } + return kenwood_transaction(rig, cmd, cmd, sizeof cmd); } /* No "VMC" cmd on THD72A/THD74 */ @@ -477,23 +463,29 @@ th_set_vfo(RIG *rig, vfo_t vfo) case RIG_VFO_A: case RIG_VFO_VFO: case RIG_VFO_MAIN: - cmd = "VMC 0,0"; + strncpy (cmd, "VMC 0,0", sizeof cmd); break; case RIG_VFO_B: case RIG_VFO_SUB: - cmd = "VMC 1,0"; + strncpy (cmd, "VMC 1,0", sizeof cmd); break; case RIG_VFO_MEM: + strncpy (cmd, "BC", sizeof cmd); + retval = kenwood_transaction (rig, cmd, cmd, sizeof cmd); + if (retval != RIG_OK) + { + return retval; + } if (rig->caps->rig_model == RIG_MODEL_THF7E || rig->caps->rig_model == RIG_MODEL_THF6A) { - cmd = "VMC 0,1"; + snprintf (cmd, sizeof cmd, "VMC %c,1", cmd[3]); } else { - cmd = "VMC 0,2"; + snprintf (cmd, sizeof cmd, "VMC %c,2", cmd[3]); } break; @@ -502,7 +494,7 @@ th_set_vfo(RIG *rig, vfo_t vfo) return kenwood_wrong_vfo(__func__, vfo); } - return kenwood_transaction(rig, cmd, NULL, 0); + return kenwood_transaction(rig, cmd, cmd, sizeof cmd); } int @@ -636,7 +628,7 @@ th_get_vfo(RIG *rig, vfo_t *vfo) int tm_set_vfo_bc2(RIG *rig, vfo_t vfo) { struct kenwood_priv_data *priv = rig->state.priv; - char vfobuf[16], ackbuf[16]; + char cmd[16]; int vfonum, txvfonum, vfomode = 0; int retval; @@ -661,15 +653,15 @@ int tm_set_vfo_bc2(RIG *rig, vfo_t vfo) case RIG_VFO_MEM: /* get current band */ - sprintf(vfobuf, "BC"); - retval = kenwood_transaction(rig, vfobuf, ackbuf, sizeof(ackbuf)); + snprintf(cmd, sizeof cmd, "BC"); + retval = kenwood_transaction(rig, cmd, cmd, sizeof cmd); if (retval != RIG_OK) { return retval; } - txvfonum = vfonum = ackbuf[3] - '0'; + txvfonum = vfonum = cmd[3] - '0'; vfomode = 2; break; @@ -678,8 +670,8 @@ int tm_set_vfo_bc2(RIG *rig, vfo_t vfo) return -RIG_EVFO; } - sprintf(vfobuf, "VMC %d,%d", vfonum, vfomode); - retval = kenwood_transaction(rig, vfobuf, NULL, 0); + snprintf(cmd, sizeof cmd, "VMC %d,%d", vfonum, vfomode); + retval = kenwood_transaction(rig, cmd, cmd, sizeof cmd); if (retval != RIG_OK) { @@ -691,15 +683,8 @@ int tm_set_vfo_bc2(RIG *rig, vfo_t vfo) return RIG_OK; } - sprintf(vfobuf, "BC %d,%d", vfonum, txvfonum); - retval = kenwood_transaction(rig, vfobuf, NULL, 0); - - if (retval != RIG_OK) - { - return retval; - } - - return RIG_OK; + snprintf(cmd, sizeof cmd, "BC %d,%d", vfonum, txvfonum); + return kenwood_transaction(rig, cmd, cmd, sizeof cmd); } @@ -752,15 +737,15 @@ int th_set_split_vfo(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo) } /* Set VFO mode. To be done for TX vfo also? */ - sprintf(vfobuf, "VMC %d,0", vfonum); - retval = kenwood_transaction(rig, vfobuf, NULL, 0); + snprintf (vfobuf, sizeof vfobuf, "VMC %d,0", vfonum); + retval = kenwood_transaction(rig, vfobuf, vfobuf, sizeof vfobuf); if (retval != RIG_OK) { return retval; } - sprintf(vfobuf, "BC %d,%d", vfonum, txvfonum); + snprintf (vfobuf, sizeof vfobuf, "BC %d,%d", vfonum, txvfonum); retval = kenwood_transaction(rig, vfobuf, NULL, 0); if (retval != RIG_OK) @@ -818,8 +803,9 @@ int th_get_split_vfo(RIG *rig, vfo_t vfo, split_t *split, vfo_t *txvfo) int th_set_trn(RIG *rig, int trn) { - return kenwood_transaction(rig, (trn == RIG_TRN_RIG) ? "AI 1" : "AI 0", NULL, - 0); + char buf[5]; + snprintf (buf, sizeof buf, "AI %c", RIG_TRN_RIG == trn ? '1' : '0'); + return kenwood_transaction (rig, buf, buf, sizeof buf); } /* @@ -1411,7 +1397,7 @@ th_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone) { const struct rig_caps *caps; char tonebuf[16]; - int i, retval; + int i; rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__); @@ -1431,15 +1417,8 @@ th_set_ctcss_tone(RIG *rig, vfo_t vfo, tone_t tone) } i += (i == 0) ? 1 : 2; /* Correct for TH-D7A index anomally */ - sprintf(tonebuf, "TN %02d", i); - retval = kenwood_transaction(rig, tonebuf, NULL, 0); - - if (retval != RIG_OK) - { - return retval; - } - - return RIG_OK; + snprintf (tonebuf, sizeof tonebuf, "TN %02d", i); + return kenwood_transaction (rig, tonebuf, tonebuf, sizeof tonebuf); } /* @@ -1496,7 +1475,7 @@ th_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone) { const struct rig_caps *caps; char tonebuf[16]; - int i, retval; + int i; rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__); @@ -1516,15 +1495,8 @@ th_set_ctcss_sql(RIG *rig, vfo_t vfo, tone_t tone) } i += (i == 0) ? 1 : 2; /* Correct for TH-D7A index anomally */ - sprintf(tonebuf, "CTN %02d", i); - retval = kenwood_transaction(rig, tonebuf, NULL, 0); - - if (retval != RIG_OK) - { - return retval; - } - - return RIG_OK; + snprintf (tonebuf, sizeof tonebuf, "CTN %02d", i); + return kenwood_transaction (rig, tonebuf, tonebuf, sizeof tonebuf); } /* @@ -1593,7 +1565,8 @@ th_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code) if (code == 0) { - return kenwood_transaction(rig, "DCS 0", NULL, 0); + snprintf (codebuf, sizeof codebuf, "DCS 0"); + return kenwood_transaction(rig, codebuf, codebuf, sizeof codebuf); } for (i = 0; caps->dcs_list[i] != 0; i++) @@ -1609,22 +1582,14 @@ th_set_dcs_sql(RIG *rig, vfo_t vfo, tone_t code) return -RIG_EINVAL; } - retval = kenwood_transaction(rig, "DCS 1", NULL, 0); - - if (retval != RIG_OK) - { - return retval; - } - - sprintf(codebuf, "DCSN %04d", (i + 1) * 10); - retval = kenwood_transaction(rig, codebuf, NULL, 0); - - if (retval != RIG_OK) + snprintf (codebuf, sizeof codebuf, "DCS 1"); + if ((retval = kenwood_transaction(rig, codebuf, codebuf, sizeof codebuf)) != RIG_OK) { return retval; } - return RIG_OK; + snprintf(codebuf, sizeof codebuf, "DCSN %04d", (i + 1) * 10); + return kenwood_transaction (rig, codebuf, codebuf, sizeof codebuf); } /* @@ -1730,7 +1695,7 @@ int th_set_mem(RIG *rig, vfo_t vfo, int ch) { unsigned char vsel; - char membuf[10], ackbuf[10]; + char membuf[10]; int retval; vfo_t tvfo; @@ -1754,23 +1719,13 @@ th_set_mem(RIG *rig, vfo_t vfo, int ch) return kenwood_wrong_vfo(__func__, vfo); } - retval = rig_set_vfo(rig, RIG_VFO_MEM); - - if (retval != RIG_OK) + if ((retval = rig_set_vfo(rig, RIG_VFO_MEM)) != RIG_OK) { return retval; } - sprintf(membuf, "MC %c,%03i", vsel, ch); - - retval = kenwood_safe_transaction(rig, membuf, ackbuf, 10, 8); - - if (retval != RIG_OK) - { - return retval; - } - - return RIG_OK; + snprintf (membuf, sizeof membuf, "MC %c,%03i", vsel, ch); + return kenwood_transaction (rig, membuf, membuf, sizeof membuf); } /* Get mem works only when the display is @@ -1844,9 +1799,9 @@ th_get_mem(RIG *rig, vfo_t vfo, int *ch) int th_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) { + char buf[3]; rig_debug(RIG_DEBUG_TRACE, "%s: called\n", __func__); - - return kenwood_transaction(rig, (ptt == RIG_PTT_ON) ? "TX" : "RX", NULL, 0); + return kenwood_transaction(rig, (ptt == RIG_PTT_ON) ? "TX" : "RX", buf, sizeof buf); } int th_get_dcd(RIG *rig, vfo_t vfo, dcd_t *dcd) @@ -2482,7 +2437,7 @@ int th_set_channel(RIG *rig, const channel_t *chan) ); } - retval = kenwood_transaction(rig, membuf, NULL, 0); + retval = kenwood_transaction(rig, membuf, membuf, sizeof membuf); if (retval != RIG_OK) { @@ -2498,7 +2453,7 @@ int th_set_channel(RIG *rig, const channel_t *chan) req[3 + strlen(mr_extra)] = '1'; sprintf(membuf, "%s,%011"PRIll",%X", req, (int64_t)chan->tx_freq, step); - retval = kenwood_transaction(rig, membuf, NULL, 0); + retval = kenwood_transaction(rig, membuf, membuf, sizeof membuf); if (retval != RIG_OK) { @@ -2519,7 +2474,7 @@ int th_set_channel(RIG *rig, const channel_t *chan) sprintf(membuf, "MNA %s%03d,%s", mr_extra, channel_num, channel_desc); } - retval = kenwood_transaction(rig, membuf, NULL, 0); + retval = kenwood_transaction(rig, membuf, membuf, sizeof membuf); if (retval != RIG_OK) { @@ -2535,29 +2490,29 @@ int th_set_channel(RIG *rig, const channel_t *chan) */ int th_set_ant(RIG *rig, vfo_t vfo, ant_t ant, value_t option) { - const char *cmd; + char cmd[6]; rig_debug(RIG_DEBUG_TRACE, "%s: ant = %d\n", __func__, ant); switch (ant) { case RIG_ANT_1: - cmd = "ANT 0"; + strncpy (cmd, "ANT 0", sizeof cmd); break; case RIG_ANT_2: - cmd = "ANT 1"; + strncpy (cmd, "ANT 1", sizeof cmd); break; case RIG_ANT_3: - cmd = "ANT 2"; + strncpy (cmd, "ANT 2", sizeof cmd); break; default: return -RIG_EINVAL; } - return kenwood_transaction(rig, cmd, NULL, 0); + return kenwood_transaction(rig, cmd, cmd, sizeof cmd); } diff --git a/rigs/kenwood/th.h b/rigs/kenwood/th.h index a8346cf1..62161ac7 100644 --- a/rigs/kenwood/th.h +++ b/rigs/kenwood/th.h @@ -23,7 +23,7 @@ #include "idx_builtin.h" -#define TH_VER "20200212" +#define TH_VER "20200701" extern int th_transaction (RIG *rig, const char *cmdstr, char *data, size_t datasize); extern int th_get_vfo_char(RIG *rig, vfo_t *vfo, char *vfoch); diff --git a/rigs/kenwood/thd7.c b/rigs/kenwood/thd7.c index 7305aba7..205afe27 100644 --- a/rigs/kenwood/thd7.c +++ b/rigs/kenwood/thd7.c @@ -88,7 +88,7 @@ const struct rig_caps thd7a_caps = .mfg_name = "Kenwood", .version = TH_VER ".0", .copyright = "LGPL", - .status = RIG_STATUS_ALPHA, + .status = RIG_STATUS_BETA, .rig_type = RIG_TYPE_HANDHELD | RIG_FLAG_APRS | RIG_FLAG_TNC | RIG_FLAG_DXCLUSTER, .ptt_type = RIG_PTT_RIG, .dcd_type = RIG_DCD_RIG, @@ -195,7 +195,7 @@ const struct rig_caps thd7a_caps = .get_parm = th_get_parm, .get_info = th_get_info, - .get_dcd = kenwood_get_dcd, + .get_dcd = th_get_dcd, .decode_event = th_decode_event, }; ----------------------------------------------------------------------- Summary of changes: rigs/kenwood/kenwood.c | 62 +++++++++++++------ rigs/kenwood/kenwood.h | 1 + rigs/kenwood/th.c | 161 ++++++++++++++++++------------------------------- rigs/kenwood/th.h | 2 +- rigs/kenwood/thd7.c | 4 +- 5 files changed, 104 insertions(+), 126 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |