[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. 4b77f9b6b67afc4bf26e4
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: n0nb <n0...@us...> - 2024-11-22 22:03:30
|
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 4b77f9b6b67afc4bf26e4aeaa4774cb842d48d8b (commit) via 11acef5d3bc4645ad70881759b2aeaf0de443cfe (commit) via c080ba7b829e0d1427edd066ff39a1a4f88b8fb5 (commit) via 238344b0ce3db6d50b8647c54de7d56355a37f64 (commit) via d640511b206b466892ce37085b2e0bd35ef59b71 (commit) via 3f526117097b08d075134309cb94e76c8cfdba5f (commit) via 48aa284152ff5c6e031eecff261bbe9b3d809c01 (commit) from d444fe43c61477ea823009ab5de24c69cf4de817 (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 4b77f9b6b67afc4bf26e4aeaa4774cb842d48d8b Merge: d640511b2 11acef5d3 Author: Michael Black <mdb...@ya...> Date: Fri Nov 22 15:07:51 2024 -0600 Merge pull request #1630 from GeoBaltz/fix23 Fix23 commit 11acef5d3bc4645ad70881759b2aeaf0de443cfe Author: George Baltz N3GB <Geo...@gm...> Date: Thu Nov 21 19:21:41 2024 -0500 MACROize new code. diff --git a/rigs/dummy/flrig.c b/rigs/dummy/flrig.c index 58b6e8692..bfabc388b 100644 --- a/rigs/dummy/flrig.c +++ b/rigs/dummy/flrig.c @@ -853,7 +853,7 @@ static int flrig_open(RIG *rig) char model_name[256]; snprintf(model_name,sizeof(model_name), "%.248s(%s)", value, "FLRig"); rig->caps->model_name = strdup(model_name); - rig->state.model_name = strdup(model_name); + STATE(rig)->model_name = strdup(model_name); /* see if get_pwrmeter_scale is available */ retval = flrig_transaction(rig, "rig.get_pwrmeter_scale", NULL, value, diff --git a/rigs/yaesu/ft1000mp.c b/rigs/yaesu/ft1000mp.c index 9a6db6b78..d134c2b3a 100644 --- a/rigs/yaesu/ft1000mp.c +++ b/rigs/yaesu/ft1000mp.c @@ -945,7 +945,7 @@ static int ft1000mp_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) RETURNFUNC(retval); } - priv = (struct ft1000mp_priv_data *)rig->state.priv; + priv = (struct ft1000mp_priv_data *)STATE(rig)->priv; if (vfo == RIG_VFO_B) { diff --git a/rigs/yaesu/ft817.c b/rigs/yaesu/ft817.c index 68a28bf73..301e0e44f 100644 --- a/rigs/yaesu/ft817.c +++ b/rigs/yaesu/ft817.c @@ -1711,7 +1711,7 @@ static int ft817_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) // check if we're already in the mode and return if so // the memory check was failing when in FM mode -- still showing digmode - if (rig->state.current_mode == mode) + if (STATE(rig)->current_mode == mode) { if (digmode[0] == 0x00 && mode == RIG_MODE_RTTY) { return RIG_OK; } else if (digmode[0] == 0x01 && mode == RIG_MODE_PSKR) { return RIG_OK; } diff --git a/src/rig.c b/src/rig.c index a6cd5f2f3..bf233f360 100644 --- a/src/rig.c +++ b/src/rig.c @@ -7979,7 +7979,7 @@ int HAMLIB_API rig_get_rig_info(RIG *rig, char *response, int max_response_len) "VFO=%s Freq=%.0f Mode=%s Width=%d RX=%d TX=%d\nVFO=%s Freq=%.0f Mode=%s Width=%d RX=%d TX=%d\nSplit=%d SatMode=%d\nRig=%s\nApp=%s\nVersion=20241103 1.1.0\nModel=%u\n", rig_strvfo(vfoA), freqA, modeAstr, (int)widthA, rxa, txa, rig_strvfo(vfoB), freqB, modeBstr, (int)widthB, rxb, txb, split, satmode, rig->caps->model_name, - rig->state.client_version, rig->caps->rig_model); + STATE(rig)->client_version, rig->caps->rig_model); unsigned long crc = CRC32_function((unsigned char *)response, strlen(response)); char tmpstr[32]; SNPRINTF(tmpstr, sizeof(tmpstr), "CRC=0x%08lx\n", crc); commit c080ba7b829e0d1427edd066ff39a1a4f88b8fb5 Author: George Baltz N3GB <Geo...@gm...> Date: Wed Nov 20 16:35:15 2024 -0500 Factor out TS-890S and TS-990S from kenwood_get_split_vfo_if() Fix TS-890S to return correct VFO More of issue #1380 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 9d37c46ff..e0bad2505 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -1675,7 +1675,7 @@ int kenwood_set_split(RIG *rig, vfo_t vfo, split_t split, vfo_t txvfo) } -/* IF TB +/* IF * Gets split VFO status from kenwood_get_if() * */ @@ -1694,30 +1694,6 @@ int kenwood_get_split_vfo_if(RIG *rig, vfo_t rxvfo, split_t *split, RETURNFUNC(-RIG_EINVAL); } - if (RIG_IS_TS990S || RIG_IS_TS890S) - { - char buf[4]; - - if (RIG_OK == (retval = kenwood_safe_transaction(rig, "TB", buf, sizeof(buf), - 3))) - { - if ('1' == buf[2]) - { - *split = RIG_SPLIT_ON; - *txvfo = RIG_VFO_SUB; - priv->tx_vfo = rs->tx_vfo = *txvfo; - } - else - { - *split = RIG_SPLIT_OFF; - *txvfo = RIG_VFO_MAIN; - priv->tx_vfo = rs->tx_vfo = *txvfo; - } - } - - RETURNFUNC(retval); - } - retval = kenwood_get_if(rig); if (retval != RIG_OK) diff --git a/rigs/kenwood/ts890s.c b/rigs/kenwood/ts890s.c index ec71d0a9f..c5906f6dc 100644 --- a/rigs/kenwood/ts890s.c +++ b/rigs/kenwood/ts890s.c @@ -466,6 +466,50 @@ static int ts890_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) return RIG_OK; } +/* + * Gets split VFO status + * + */ +static int ts890s_get_split_vfo(RIG *rig, vfo_t rxvfo, split_t *split, + vfo_t *txvfo) +{ + char buf[4]; + int retval; + vfo_t tvfo; + struct rig_state *rs = STATE(rig); + struct kenwood_priv_data *priv = rs->priv; + + if (RIG_OK == (retval = kenwood_safe_transaction(rig, "FT", buf, sizeof(buf), + 3))) + { + if ('0' == buf[2]) + { + tvfo = RIG_VFO_A; + } + else if ('1' == buf[2]) + { + tvfo = RIG_VFO_B; + } + else if ('3' == buf[2]) + { + tvfo = RIG_VFO_MEM; + } + else + { + rig_debug(RIG_DEBUG_ERR, "%s: Unknown VFO - %s\n", __func__, buf); + return -RIG_EPROTO; + } + + *txvfo = priv->tx_vfo = rs->tx_vfo = tvfo; + // Now get split status + retval = kenwood_safe_transaction(rig, "TB", buf, sizeof buf, 3); + if (RIG_OK != retval) {return retval;} + *split = priv->split = buf[2] == '1'; + } + + return retval; +} + static struct kenwood_priv_caps ts890s_priv_caps = { @@ -626,7 +670,7 @@ struct rig_caps ts890s_caps = .set_vfo = kenwood_set_vfo, .get_vfo = kenwood_get_vfo_if, .set_split_vfo = kenwood_set_split_vfo, - .get_split_vfo = kenwood_get_split_vfo_if, + .get_split_vfo = ts890s_get_split_vfo, .set_ctcss_tone = kenwood_set_ctcss_tone_tn, .get_ctcss_tone = kenwood_get_ctcss_tone, .set_ctcss_sql = kenwood_set_ctcss_sql, diff --git a/rigs/kenwood/ts990s.c b/rigs/kenwood/ts990s.c index 4c8d97a2e..0deda6bed 100644 --- a/rigs/kenwood/ts990s.c +++ b/rigs/kenwood/ts990s.c @@ -88,6 +88,7 @@ /* prototypes */ static int ts990s_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); +static int ts990s_get_split_vfo(RIG *rig, vfo_t rxvfo, split_t *split, vfo_t *txvfo); static rmode_t ts990s_mode_table[KENWOOD_MODE_TABLE_MAX] = { @@ -352,7 +353,7 @@ struct rig_caps ts990s_caps = .set_vfo = kenwood_set_vfo_main_sub, .get_vfo = kenwood_get_vfo_main_sub, .set_split_vfo = kenwood_set_split_vfo, - .get_split_vfo = kenwood_get_split_vfo_if, + .get_split_vfo = ts990s_get_split_vfo, .set_ctcss_tone = kenwood_set_ctcss_tone_tn, .get_ctcss_tone = kenwood_get_ctcss_tone, .set_ctcss_sql = kenwood_set_ctcss_sql, @@ -761,3 +762,34 @@ int ts990s_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) return retval; } + +/* + * Gets split VFO status + * + */ +static int ts990s_get_split_vfo(RIG *rig, vfo_t rxvfo, split_t *split, + vfo_t *txvfo) +{ + char buf[4]; + int retval; + struct rig_state *rs = STATE(rig); + struct kenwood_priv_data *priv = rs->priv; + + if (RIG_OK == (retval = kenwood_safe_transaction(rig, "TB", buf, sizeof(buf), + 3))) + { + if ('1' == buf[2]) + { + *split = RIG_SPLIT_ON; + *txvfo = RIG_VFO_SUB; + } + else + { + *split = RIG_SPLIT_OFF; + *txvfo = RIG_VFO_MAIN; + } + priv->tx_vfo = rs->tx_vfo = *txvfo; + } + + return retval; +} commit 238344b0ce3db6d50b8647c54de7d56355a37f64 Author: George Baltz N3GB <Geo...@gm...> Date: Wed Nov 6 16:47:19 2024 -0500 Update TS-890S and TS-990S RIT/XIT handling Use dedicated commands that make setting much simpler. Replaces usage of deprecated IF command. See issue #1380 diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 7fd811422..9d37c46ff 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -1885,7 +1885,6 @@ int kenwood_get_vfo_if(RIG *rig, vfo_t *vfo) RETURNFUNC(RIG_OK); } - /* * kenwood_set_freq */ @@ -2156,6 +2155,29 @@ int kenwood_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) RETURNFUNC(RIG_OK); } +/* RF + * kenwood_get_rit_new (also usable as kenwood_get_xit_new) + * Gets the RIT or XIT value using dedicated command + * and without using IF. + */ +int kenwood_get_rit_new(RIG *rig, vfo_t vfo, shortfreq_t *rit) +{ + int retval, tempf; + char rfbuf[10]; + + ENTERFUNC; + if (!rit) { RETURNFUNC(-RIG_EINVAL); } + retval = kenwood_safe_transaction(rig, "RF", rfbuf, sizeof rfbuf, 7); + if (retval != RIG_OK) {RETURNFUNC(retval); } + tempf = atoi(rfbuf + 3); + if (rfbuf[2] == '1') + { + tempf = -tempf; + } + *rit = tempf; + RETURNFUNC(RIG_OK); +} + /* * rit can only move up/down by 10 Hz, so we use a loop... */ @@ -2252,6 +2274,30 @@ int kenwood_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) RETURNFUNC2(retval); } +/* RU/RD + * Set the RIT/XIT frequency offset + * using dedicated commands (not IF) + */ +int kenwood_set_rit_new(RIG *rig, vfo_t vfo, shortfreq_t rit) +{ + int retval, diff; + shortfreq_t oldrit; + char rdbuf[10]; + + ENTERFUNC; + if (abs(rit) > 9999) { RETURNFUNC(-RIG_EINVAL); } + retval = kenwood_get_rit_new(rig, vfo, &oldrit); + if (retval != RIG_OK) { RETURNFUNC(retval); } + if (rit == oldrit) // if the new value is the same + { + RETURNFUNC(RIG_OK); // Nothing to do + } + diff = rit - oldrit; + SNPRINTF(rdbuf, sizeof rdbuf, "R%c%05d;", diff < 0 ? 'D' : 'U', abs(diff)); + retval = kenwood_transaction(rig, rdbuf, NULL, 0); + RETURNFUNC(retval); +} + /* * rit and xit are the same */ diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 0989f722f..4e363d533 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -223,9 +223,11 @@ int kenwood_set_freq(RIG *rig, vfo_t vfo, freq_t freq); int kenwood_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); int kenwood_get_freq_if(RIG *rig, vfo_t vfo, freq_t *freq); int kenwood_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit); +int kenwood_set_rit_new(RIG *rig, vfo_t vfo, shortfreq_t rit); // Also use this for xit int kenwood_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit); -int kenwood_set_xit(RIG *rig, vfo_t vfo, shortfreq_t rit); -int kenwood_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *rit); +int kenwood_get_rit_new(RIG *rig, vfo_t vfo, shortfreq_t *rit); // Also use this for xit +int kenwood_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit); +int kenwood_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit); int kenwood_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); int kenwood_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); int kenwood_get_mode_if(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); diff --git a/rigs/kenwood/ts890s.c b/rigs/kenwood/ts890s.c index 5ae39970d..ec71d0a9f 100644 --- a/rigs/kenwood/ts890s.c +++ b/rigs/kenwood/ts890s.c @@ -617,10 +617,10 @@ struct rig_caps ts890s_caps = .rig_cleanup = kenwood_cleanup, .set_freq = kenwood_set_freq, .get_freq = kenwood_get_freq, - .set_rit = kenwood_set_rit, - .get_rit = kenwood_get_rit, - .set_xit = kenwood_set_xit, - .get_xit = kenwood_get_xit, + .set_rit = kenwood_set_rit_new, + .get_rit = kenwood_get_rit_new, + .set_xit = kenwood_set_rit_new, // Same routines as for RIT + .get_xit = kenwood_get_rit_new, // Same .set_mode = kenwood_set_mode, .get_mode = kenwood_get_mode, .set_vfo = kenwood_set_vfo, diff --git a/rigs/kenwood/ts990s.c b/rigs/kenwood/ts990s.c index 6933581be..4c8d97a2e 100644 --- a/rigs/kenwood/ts990s.c +++ b/rigs/kenwood/ts990s.c @@ -343,10 +343,10 @@ struct rig_caps ts990s_caps = .rig_cleanup = kenwood_cleanup, .set_freq = kenwood_set_freq, .get_freq = kenwood_get_freq, - .set_rit = kenwood_set_rit, - .get_rit = kenwood_get_rit, - .set_xit = kenwood_set_xit, - .get_xit = kenwood_get_xit, + .set_rit = kenwood_set_rit_new, + .get_rit = kenwood_get_rit_new, + .set_xit = kenwood_set_rit_new, // Use same routines as for rit + .get_xit = kenwood_get_rit_new, // Same .set_mode = kenwood_set_mode, .get_mode = kenwood_get_mode, .set_vfo = kenwood_set_vfo_main_sub, commit d640511b206b466892ce37085b2e0bd35ef59b71 Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Nov 21 11:06:52 2024 -0600 astyle icom.c diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index e17c15707..00929c528 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -4547,6 +4547,7 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->f = rig_raw2val_float(icom_val, &rig->caps->rfpower_meter_cal) * 0.01; } + if (RIG_IS_IC9700 && CACHE(rig)->freqMainA >= 1e9) { val->f /= 10; // power scale is different for 10GHz @@ -9134,8 +9135,9 @@ int icom_is_async_frame(RIG *rig, size_t frame_length, /* Spectrum scope data is not CI-V transceive data, but handled the same way as it is pushed by the rig */ // IC-7100 sends 0xe1 for broadcast frame? - return frame[2] == BCASTID || frame[2] == C_SND_MODE || (frame[2] == CTRLID && frame[4] == C_CTL_SCP - && frame[5] == S_SCP_DAT); + return frame[2] == BCASTID || frame[2] == C_SND_MODE || (frame[2] == CTRLID + && frame[4] == C_CTL_SCP + && frame[5] == S_SCP_DAT); } int icom_process_async_frame(RIG *rig, size_t frame_length, @@ -9159,8 +9161,9 @@ int icom_process_async_frame(RIG *rig, size_t frame_length, if (frame[2] != 0x00 || frame[2] == 0x01) { // just ignoring 0x01 for now - // fe fe 01 94 1c 03 00 80 07 07 00 fd - rig_debug(RIG_DEBUG_VERBOSE, "%s: 3rd byte not 0x00 or is 0x01...not async\n", __func__); + // fe fe 01 94 1c 03 00 80 07 07 00 fd + rig_debug(RIG_DEBUG_VERBOSE, "%s: 3rd byte not 0x00 or is 0x01...not async\n", + __func__); RETURNFUNC(RIG_OK); } commit 3f526117097b08d075134309cb94e76c8cfdba5f Author: Mike Black W9MDB <mdb...@ya...> Date: Thu Nov 21 11:06:21 2024 -0600 Fix IC9700 WATTS measurement when freq > 1GHz diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 91771ca81..e17c15707 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -4547,6 +4547,10 @@ int icom_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) val->f = rig_raw2val_float(icom_val, &rig->caps->rfpower_meter_cal) * 0.01; } + if (RIG_IS_IC9700 && CACHE(rig)->freqMainA >= 1e9) + { + val->f /= 10; // power scale is different for 10GHz + } break; commit 48aa284152ff5c6e031eecff261bbe9b3d809c01 Author: Mike Black W9MDB <mdb...@ya...> Date: Mon Nov 18 17:26:10 2024 -0600 Ensure tuner is off for FTDX101D/MP for 70cm band -- bug in firmware leaves it on which can cause damage diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 94c306065..8044f532f 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -1011,6 +1011,13 @@ int newcat_set_freq(RIG *rig, vfo_t vfo, freq_t freq) RETURNFUNC(RIG_OK); /* make it look like we changed */ } + if ((is_ftdx101d || is_ftdx101mp) && (freq >= 70000000 && freq <= 70499999)) + { + // ensure the tuner is off for 70cm -- can cause damage to the rig + newcat_set_func(rig, RIG_VFO_A, RIG_FUNC_TUNER, 0); + hl_usleep(100 * 1000); // give it a chance to turn off + } + switch (vfo) { case RIG_VFO_A: diff --git a/rigs/yaesu/newcat.h b/rigs/yaesu/newcat.h index dc1e4669d..b41ffe2cd 100644 --- a/rigs/yaesu/newcat.h +++ b/rigs/yaesu/newcat.h @@ -50,7 +50,7 @@ typedef char ncboolean; /* shared function version */ -#define NEWCAT_VER "20240922" +#define NEWCAT_VER "20241118" /* Hopefully large enough for future use, 128 chars plus '\0' */ #define NEWCAT_DATA_LEN 129 ----------------------------------------------------------------------- Summary of changes: rigs/dummy/flrig.c | 2 +- rigs/icom/icom.c | 15 +++++++--- rigs/kenwood/kenwood.c | 74 ++++++++++++++++++++++++++++++++------------------ rigs/kenwood/kenwood.h | 6 ++-- rigs/kenwood/ts890s.c | 54 ++++++++++++++++++++++++++++++++---- rigs/kenwood/ts990s.c | 42 ++++++++++++++++++++++++---- rigs/yaesu/ft1000mp.c | 2 +- rigs/yaesu/ft817.c | 2 +- rigs/yaesu/newcat.c | 7 +++++ rigs/yaesu/newcat.h | 2 +- src/rig.c | 2 +- 11 files changed, 161 insertions(+), 47 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |