[Hamlib-commits] Hamlib -- Ham radio control libraries branch master updated. v4.0rc1-84-ge459d4ed
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Michael B. <mdb...@us...> - 2020-09-01 14:57:52
|
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 e459d4edc2bd7ff91e38974244b4a6e778cde119 (commit) via 3ef3a73b799626a35823d46971ef4466a60f8252 (commit) via c8a36998614ef500031d01040c341a271e1fa17f (commit) via 1138feb576eaf44adde6cb2979820dc15ab6a770 (commit) via 29ae878fa7d88fa7033f9f8057ef7391568b8341 (commit) via 6f4a996a9aa32d2eee207fc59bd6d17a24cf9c6e (commit) via 8ba082c6622068fa19cd6f0ef09cc53fda055f2b (commit) from 5639d49e489bbbc0ccf044ae2d17f7ded9971288 (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 e459d4edc2bd7ff91e38974244b4a6e778cde119 Author: Michael Black W9MDB <mdb...@ya...> Date: Tue Sep 1 09:06:46 2020 -0500 astyle files diff --git a/rigs/alinco/dxsr8.c b/rigs/alinco/dxsr8.c index e4d5a56f..82eab0ea 100644 --- a/rigs/alinco/dxsr8.c +++ b/rigs/alinco/dxsr8.c @@ -471,7 +471,7 @@ int dxsr8_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width) return -RIG_EINVAL; } - filter=0; // avoid compiler warings of being possibly uninitialized + filter = 0; // avoid compiler warings of being possibly uninitialized retval = dxsr8_read_num(rig, AL "~RR_NAR" EOM, &filter); if (filter == 0) diff --git a/rigs/aor/aor.c b/rigs/aor/aor.c index 61c3cd25..9b3fb372 100644 --- a/rigs/aor/aor.c +++ b/rigs/aor/aor.c @@ -467,7 +467,7 @@ int aor_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (retval != RIG_OK) { return retval; } strncpy(mdbuf2, mdbuf + 4, 3); /* Extract first 'BW' part */ - mdbuf2[3]='\0'; // in case strnpy produces and un-terminated string + mdbuf2[3] = '\0'; // in case strnpy produces and un-terminated string mdbuf2_len = strlen(mdbuf2); retval = aor_transaction(rig, mdbuf2, mdbuf2_len, NULL, NULL); diff --git a/rigs/drake/drake.c b/rigs/drake/drake.c index c86fb152..1cc3c546 100644 --- a/rigs/drake/drake.c +++ b/rigs/drake/drake.c @@ -563,7 +563,7 @@ int drake_set_mem(RIG *rig, vfo_t vfo, int ch) len = sprintf(buf, "C%03d" EOM, ch); - ack_len=0; // fix compile-time warning "possibly uninitialized" + ack_len = 0; // fix compile-time warning "possibly uninitialized" retval = drake_transaction(rig, buf, len, ackbuf, &ack_len); if (ack_len != 2) @@ -853,7 +853,7 @@ int drake_get_chan(RIG *rig, channel_t *chan, int read_only) strncpy(chan->channel_desc, mdbuf + 25, 7); - chan->channel_desc[7]='\0'; // in case strncpy did not terminate the string + chan->channel_desc[7] = '\0'; // in case strncpy did not terminate the string //now put the radio back the way it was //we apparently can't do a read-only channel read diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 3af67ae9..846acdfd 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1314,6 +1314,7 @@ static int icom_set_it_new(RIG *rig, vfo_t vfo, shortfreq_t ts, int set_xit) } #if 0 // why is this here? We have another function to turn it on/off + if (ts == 0) // Turn off both RIT/XIT { if (rig->caps->has_get_func & RIG_FUNC_XIT) @@ -1339,6 +1340,7 @@ static int icom_set_it_new(RIG *rig, vfo_t vfo, shortfreq_t ts, int set_xit) retval = icom_set_func(rig, vfo, set_xit ? RIG_FUNC_XIT : RIG_FUNC_RIT, 1); } + #endif return retval; @@ -2065,7 +2067,7 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) case RIG_VFO_MAIN_A: // we need to select Main before setting VFO case RIG_VFO_MAIN_B: - rig_debug(RIG_DEBUG_VERBOSE, "%s: MainA/B logic\n", __func__); + rig_debug(RIG_DEBUG_VERBOSE, "%s: MainA/B logic\n", __func__); retval = icom_transaction(rig, C_SET_VFO, S_MAIN, NULL, 0, ackbuf, &ack_len); @@ -2087,7 +2089,7 @@ int icom_set_vfo(RIG *rig, vfo_t vfo) case RIG_VFO_SUB_A: // we need to select Sub before setting VFO case RIG_VFO_SUB_B: - rig_debug(RIG_DEBUG_VERBOSE, "%s: SubA/B logic\n", __func__); + rig_debug(RIG_DEBUG_VERBOSE, "%s: SubA/B logic\n", __func__); retval = icom_transaction(rig, C_SET_VFO, S_SUB, NULL, 0, ackbuf, &ack_len); diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 6e965a36..3ef057aa 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -1711,7 +1711,7 @@ int kenwood_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) if (priv->has_rit2) // if backend shows it has the Set 2 command { char cmd[15]; // length required to make Apple-gcc happy (unicode-proof). - snprintf(cmd, sizeof(cmd)-1, "R%c%05d", rit > 0 ? 'U' : 'D', abs((int)rit)); + snprintf(cmd, sizeof(cmd) - 1, "R%c%05d", rit > 0 ? 'U' : 'D', abs((int)rit)); retval = kenwood_transaction(rig, cmd, NULL, 0); } else diff --git a/tests/ampctld.c b/tests/ampctld.c index 6f99b525..440c2ce1 100644 --- a/tests/ampctld.c +++ b/tests/ampctld.c @@ -598,6 +598,7 @@ int main(int argc, char *argv[]) handle_socket(arg); #endif } + // cppcheck-suppress * while (retcode == 0); diff --git a/tests/rotctl_parse.c b/tests/rotctl_parse.c index b660ccc9..ef931405 100644 --- a/tests/rotctl_parse.c +++ b/tests/rotctl_parse.c @@ -306,7 +306,7 @@ void hash_sort_by_model_id() /* Delete hash */ void hash_delete_all() { - struct mod_lst *current_model, *tmp=NULL; + struct mod_lst *current_model, *tmp = NULL; HASH_ITER(hh, models, current_model, tmp) { diff --git a/tests/rotctld.c b/tests/rotctld.c index 065a6ea7..c7bfa5e4 100644 --- a/tests/rotctld.c +++ b/tests/rotctld.c @@ -611,6 +611,7 @@ int main(int argc, char *argv[]) handle_socket(arg); #endif } + // cppcheck-suppress * while (retcode == 0); commit 3ef3a73b799626a35823d46971ef4466a60f8252 Merge: 5639d49e c8a36998 Author: Michael Black <mdb...@ya...> Date: Tue Sep 1 09:04:13 2020 -0500 Merge pull request #361 from g0gjv/master Correct RIT for older Yaesu and Icom rigs commit c8a36998614ef500031d01040c341a271e1fa17f Merge: 1138feb5 5639d49e Author: Mike Goodey <mi...@go...> Date: Tue Sep 1 14:42:26 2020 +0100 Merge branch 'master' of https://github.com/Hamlib/Hamlib commit 1138feb576eaf44adde6cb2979820dc15ab6a770 Author: Mike Goodey <mi...@go...> Date: Tue Sep 1 14:41:45 2020 +0100 Remove icom_set_rit - it doesn't (and can't) work - see README.icom diff --git a/rigs/icom/README.icom b/rigs/icom/README.icom index 39f5323b..34c9379d 100644 --- a/rigs/icom/README.icom +++ b/rigs/icom/README.icom @@ -41,3 +41,18 @@ icr8600 3 2 icr9000 2 2 icr9500 3 2 +2020-09, G0GJV Attempting to support RIT. I asked ICOM technical support + +"I am doing some work on the Hamlib amateur radio control library, and in +particular looking at control of RIT via CI-V on the Icom IC-9100 Is my +reading of the manual correct - on this (and most older Icom rigs) - +there is no RIT/XIT control available?" + +and received the answer + +"Hi Mike, +Yes that's right +Thanks +Virgil" + +So I've removed the erroneous icom_set_rit function. \ No newline at end of file diff --git a/rigs/icom/ic7100.c b/rigs/icom/ic7100.c index d0d8f816..5320c55e 100644 --- a/rigs/icom/ic7100.c +++ b/rigs/icom/ic7100.c @@ -360,8 +360,6 @@ const struct rig_caps ic7100_caps = .set_ptt = icom_set_ptt, .get_ptt = icom_get_ptt, - .set_rit = icom_set_rit, - .set_rptr_shift = icom_set_rptr_shift, .get_rptr_shift = icom_get_rptr_shift, .set_rptr_offs = icom_set_rptr_offs, diff --git a/rigs/icom/ic7410.c b/rigs/icom/ic7410.c index b6513f78..443fbf5c 100644 --- a/rigs/icom/ic7410.c +++ b/rigs/icom/ic7410.c @@ -239,8 +239,6 @@ const struct rig_caps ic7410_caps = .set_ant = icom_set_ant, .get_ant = icom_get_ant, - .set_rit = icom_set_rit, - .decode_event = icom_decode_event, .set_level = ic7410_set_level, .get_level = ic7410_get_level, diff --git a/rigs/icom/ic9100.c b/rigs/icom/ic9100.c index 4ac8da14..61f36039 100644 --- a/rigs/icom/ic9100.c +++ b/rigs/icom/ic9100.c @@ -252,8 +252,6 @@ const struct rig_caps ic9100_caps = .set_ptt = icom_set_ptt, .get_ptt = icom_get_ptt, - .set_rit = icom_set_rit, - .set_rptr_shift = icom_set_rptr_shift, .get_rptr_shift = icom_get_rptr_shift, .set_rptr_offs = icom_set_rptr_offs, diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index 66a1eb6c..3af67ae9 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1256,37 +1256,6 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) return RIG_OK; } -int icom_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) -{ - unsigned char freqbuf[MAXFRAMELEN], ackbuf[MAXFRAMELEN]; - int freq_len, ack_len = sizeof(ackbuf), retval; - - - rig_debug(RIG_DEBUG_VERBOSE, "%s called\n", __func__); - freq_len = 2; - /* - * to_bcd requires nibble len - */ - to_bcd(freqbuf, rit, freq_len * 2); - - retval = icom_transaction(rig, C_SET_OFFS, -1, freqbuf, freq_len, - ackbuf, &ack_len); - - if (retval != RIG_OK) - { - return retval; - } - - if (ack_len != 1 || ackbuf[0] != ACK) - { - rig_debug(RIG_DEBUG_ERR, "%s: ack NG (%#.2x), len=%d\n", __func__, - ackbuf[0], ack_len); - return -RIG_ERJCTED; - } - - return RIG_OK; -} - int icom_get_rit_new(RIG *rig, vfo_t vfo, shortfreq_t *ts) { unsigned char tsbuf[MAXFRAMELEN]; diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 07e391a0..47a12f86 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -222,7 +222,6 @@ int icom_rig_close(RIG *rig); int icom_cleanup(RIG *rig); int icom_set_freq(RIG *rig, vfo_t vfo, freq_t freq); int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); -int icom_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit); int icom_get_rit_new(RIG *rig, vfo_t vfo, shortfreq_t *ts); int icom_set_rit_new(RIG *rig, vfo_t vfo, shortfreq_t ts); int icom_set_xit_new(RIG *rig, vfo_t vfo, shortfreq_t ts); diff --git a/rigs/icom/x108g.c b/rigs/icom/x108g.c index cd1fe8c7..cd2e6ade 100644 --- a/rigs/icom/x108g.c +++ b/rigs/icom/x108g.c @@ -271,8 +271,6 @@ const struct rig_caps x108g_caps = .set_ant = NULL, /*automatically set by rig depending band */ .get_ant = NULL, - .set_rit = icom_set_rit, - .decode_event = icom_decode_event, .set_level = icom_set_level, .get_level = icom_get_level, commit 29ae878fa7d88fa7033f9f8057ef7391568b8341 Author: Mike Goodey <mi...@go...> Date: Sat Aug 29 18:42:33 2020 +0100 Fixes to RIT code diff --git a/rigs/yaesu/ft450.h b/rigs/yaesu/ft450.h index 43f22d0f..e39cb291 100644 --- a/rigs/yaesu/ft450.h +++ b/rigs/yaesu/ft450.h @@ -67,8 +67,8 @@ #define FT450_FUNCS (RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_LOCK|\ RIG_FUNC_MON|RIG_FUNC_NB|RIG_FUNC_NR|RIG_FUNC_VOX|\ - RIG_FUNC_FBKIN|RIG_FUNC_MN|RIG_FUNC_TUNER - RIG_FUNC_RIT|RIG_FUNC_XIT|\ + RIG_FUNC_FBKIN|RIG_FUNC_MN|RIG_FUNC_TUNER|\ + RIG_FUNC_RIT|RIG_FUNC_XIT\ ) #define FT450_VFO_OPS (RIG_OP_TUNE|RIG_OP_CPY|RIG_OP_XCHG|\ commit 6f4a996a9aa32d2eee207fc59bd6d17a24cf9c6e Author: Mike Goodey <mi...@go...> Date: Fri Aug 28 19:04:13 2020 +0100 Changes for RIT/XIT on other newcat rigs diff --git a/rigs/yaesu/ft2000.h b/rigs/yaesu/ft2000.h index ac637401..09d1d1b1 100644 --- a/rigs/yaesu/ft2000.h +++ b/rigs/yaesu/ft2000.h @@ -73,6 +73,7 @@ #define FT2000_FUNCS (RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_LOCK|\ RIG_FUNC_MON|RIG_FUNC_NB|RIG_FUNC_NR|RIG_FUNC_VOX|\ RIG_FUNC_FBKIN|RIG_FUNC_COMP|RIG_FUNC_ANF|RIG_FUNC_MN|\ + RIG_FUNC_RIT|RIG_FUNC_XIT|\ RIG_FUNC_TUNER) /* TBC */ diff --git a/rigs/yaesu/ft450.h b/rigs/yaesu/ft450.h index cb4f0ac3..43f22d0f 100644 --- a/rigs/yaesu/ft450.h +++ b/rigs/yaesu/ft450.h @@ -67,7 +67,9 @@ #define FT450_FUNCS (RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_LOCK|\ RIG_FUNC_MON|RIG_FUNC_NB|RIG_FUNC_NR|RIG_FUNC_VOX|\ - RIG_FUNC_FBKIN|RIG_FUNC_MN|RIG_FUNC_TUNER) + RIG_FUNC_FBKIN|RIG_FUNC_MN|RIG_FUNC_TUNER + RIG_FUNC_RIT|RIG_FUNC_XIT|\ + ) #define FT450_VFO_OPS (RIG_OP_TUNE|RIG_OP_CPY|RIG_OP_XCHG|\ RIG_OP_UP|RIG_OP_DOWN|RIG_OP_BAND_UP|RIG_OP_BAND_DOWN|\ diff --git a/rigs/yaesu/ft5000.h b/rigs/yaesu/ft5000.h index 821fd86c..cf452a48 100644 --- a/rigs/yaesu/ft5000.h +++ b/rigs/yaesu/ft5000.h @@ -73,6 +73,7 @@ #define FTDX5000_FUNCS (RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_LOCK|\ RIG_FUNC_MON|RIG_FUNC_NB|RIG_FUNC_NR|RIG_FUNC_VOX|\ RIG_FUNC_FBKIN|RIG_FUNC_COMP|RIG_FUNC_ANF|RIG_FUNC_MN|\ + RIG_FUNC_RIT|RIG_FUNC_XIT|\ RIG_FUNC_TUNER) /* TBC */ diff --git a/rigs/yaesu/ft9000.h b/rigs/yaesu/ft9000.h index 56de9977..5cfc27d7 100644 --- a/rigs/yaesu/ft9000.h +++ b/rigs/yaesu/ft9000.h @@ -73,7 +73,9 @@ /* TBC */ #define FT9000_FUNCS (RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_LOCK|\ RIG_FUNC_MON|RIG_FUNC_NB|RIG_FUNC_NR|RIG_FUNC_VOX|\ - RIG_FUNC_FBKIN|RIG_FUNC_COMP|RIG_FUNC_ANF|RIG_FUNC_MN) + RIG_FUNC_FBKIN|RIG_FUNC_COMP|RIG_FUNC_ANF|RIG_FUNC_MN|\ + RIG_FUNC_RIT|RIG_FUNC_XIT\ + ) /* TBC */ #define FT9000_VFO_OPS (RIG_OP_TUNE|RIG_OP_CPY|RIG_OP_XCHG|\ diff --git a/rigs/yaesu/ft950.h b/rigs/yaesu/ft950.h index 15cab3e1..64c4961d 100644 --- a/rigs/yaesu/ft950.h +++ b/rigs/yaesu/ft950.h @@ -64,6 +64,7 @@ #define FT950_FUNCS (RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_LOCK|\ RIG_FUNC_MON|RIG_FUNC_NB|RIG_FUNC_NR|RIG_FUNC_VOX|\ RIG_FUNC_FBKIN|RIG_FUNC_COMP|RIG_FUNC_ANF|RIG_FUNC_MN|\ + RIG_FUNC_RIT|RIG_FUNC_XIT|\ RIG_FUNC_TUNER) #define FT950_VFO_OPS (RIG_OP_TUNE|RIG_OP_CPY|RIG_OP_XCHG|\ diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 60df9dae..21b98e8a 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -253,7 +253,7 @@ static const yaesu_newcat_commands_t valid_commands[] = {"VT", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE }, {"VV", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE }, {"VX", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE }, - {"XT", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE }, + {"XT", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE }, {"ZI", FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE }, }; int valid_commands_count = sizeof(valid_commands) / sizeof( commit 8ba082c6622068fa19cd6f0ef09cc53fda055f2b Author: Mike Goodey <mi...@go...> Date: Fri Aug 28 18:16:17 2020 +0100 Changes for FT991 RIT/XIT diff --git a/rigs/yaesu/ft991.h b/rigs/yaesu/ft991.h index e7dc988a..e7e9aa1b 100644 --- a/rigs/yaesu/ft991.h +++ b/rigs/yaesu/ft991.h @@ -65,6 +65,7 @@ #define FT991_FUNCS (RIG_FUNC_TONE|RIG_FUNC_TSQL|RIG_FUNC_LOCK|\ RIG_FUNC_MON|RIG_FUNC_NB|RIG_FUNC_NR|RIG_FUNC_VOX|\ RIG_FUNC_FBKIN|RIG_FUNC_COMP|RIG_FUNC_ANF|RIG_FUNC_MN|\ + RIG_FUNC_RIT|RIG_FUNC_XIT|\ RIG_FUNC_TUNER) #define FT991_VFO_OPS (RIG_OP_TUNE|RIG_OP_CPY|RIG_OP_XCHG|\ diff --git a/rigs/yaesu/newcat.c b/rigs/yaesu/newcat.c index 3b2b048e..60df9dae 100644 --- a/rigs/yaesu/newcat.c +++ b/rigs/yaesu/newcat.c @@ -97,8 +97,9 @@ typedef struct _yaesu_newcat_commands const cal_table_float_t yaesu_default_swr_cal = { 4, - { // first cut at generic Yaesu table, need more points probably - // based on testing by Adam M7OTP on FT-991 + { + // first cut at generic Yaesu table, need more points probably + // based on testing by Adam M7OTP on FT-991 {12, 1.0f}, {39, 1.35f}, {89, 2.0f}, @@ -1158,9 +1159,9 @@ int newcat_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt) *ptt = RIG_PTT_OFF; break; - case '1' : /* Just because, what the CAT Manual Shows */ - case '2' : /* FT-950 Radio: Mic, Dataport, CW "TX ON" */ - case '3' : /* FT-950 CAT port: Radio in "TX ON" mode [Not what the CAT Manual Shows] */ + case '1' : /* Just because, what the CAT Manual Shows */ + case '2' : /* FT-950 Radio: Mic, Dataport, CW "TX ON" */ + case '3' : /* FT-950 CAT port: Radio in "TX ON" mode [Not what the CAT Manual Shows] */ *ptt = RIG_PTT_ON; break; @@ -1575,9 +1576,9 @@ int newcat_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit) rit = - rig->caps->max_rit; /* - */ } - if (rit == 0) + if (rit == 0) // don't turn it off just because it is zero { - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RC%cRT0%c", cat_term, + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RC%c", cat_term); } else if (rit < 0) @@ -1599,7 +1600,7 @@ int newcat_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) { struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; char *retval; - char rit_on; + //char rit_on; int err; int offset = 0; @@ -1643,11 +1644,12 @@ int newcat_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit) } retval = priv->ret_data + offset; - rit_on = retval[5]; + //rit_on = retval[5]; retval[5] = '\0'; - if (rit_on == '1') + //if (rit_on == '1') { + // return the current offset even if turned off *rit = (shortfreq_t) atoi(retval); } @@ -1675,7 +1677,8 @@ int newcat_set_xit(RIG *rig, vfo_t vfo, shortfreq_t xit) if (xit == 0) { - snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RC%cXT0%c", cat_term, + // don't turn it off just because the offset is zero + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RC%c", cat_term); } else if (xit < 0) @@ -1697,7 +1700,7 @@ int newcat_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) { struct newcat_priv_data *priv = (struct newcat_priv_data *)rig->state.priv; char *retval; - char xit_on; + //char xit_on; int err; int offset = 0; @@ -1741,11 +1744,12 @@ int newcat_get_xit(RIG *rig, vfo_t vfo, shortfreq_t *xit) } retval = priv->ret_data + offset; - xit_on = retval[6]; + //xit_on = retval[6]; retval[5] = '\0'; - if (xit_on == '1') + //if (xit_on == '1') { + // return the offset even when turned off *xit = (shortfreq_t) atoi(retval); } @@ -3371,7 +3375,9 @@ int newcat_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val) { val->f = rig_raw2val_float(atoi(retlvl), &rig->caps->swr_cal); } + break; + case RIG_LEVEL_AF: case RIG_LEVEL_MICGAIN: case RIG_LEVEL_RF: @@ -3687,6 +3693,26 @@ int newcat_set_func(RIG *rig, vfo_t vfo, setting_t func, int status) cat_term); break; + case RIG_FUNC_RIT: + if (!newcat_valid_command(rig, "RT")) + { + return -RIG_ENAVAIL; + } + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RT%d%c", status ? 1 : 0, + cat_term); + break; + + case RIG_FUNC_XIT: + if (!newcat_valid_command(rig, "XT")) + { + return -RIG_ENAVAIL; + } + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "XT%d9%c", status ? 1 : 0, + cat_term); + break; + default: return -RIG_EINVAL; } @@ -3831,6 +3857,24 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) snprintf(priv->cmd_str, sizeof(priv->cmd_str), "AC%c", cat_term); break; + case RIG_FUNC_RIT: + if (!newcat_valid_command(rig, "RT")) + { + return -RIG_ENAVAIL; + } + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "RT%c", cat_term); + break; + + case RIG_FUNC_XIT: + if (!newcat_valid_command(rig, "XT")) + { + return -RIG_ENAVAIL; + } + + snprintf(priv->cmd_str, sizeof(priv->cmd_str), "XT%c", cat_term); + break; + default: return -RIG_EINVAL; } @@ -3876,6 +3920,14 @@ int newcat_get_func(RIG *rig, vfo_t vfo, setting_t func, int *status) *status = (retfunc[2] == '1') ? 1 : 0; break; + case RIG_FUNC_RIT: + *status = (retfunc[0] == '1') ? 1 : 0; + break; + + case RIG_FUNC_XIT: + *status = (retfunc[0] == '1') ? 1 : 0; + break; + default: return -RIG_EINVAL; } ----------------------------------------------------------------------- Summary of changes: rigs/alinco/dxsr8.c | 2 +- rigs/aor/aor.c | 2 +- rigs/drake/drake.c | 4 +-- rigs/icom/README.icom | 15 +++++++++ rigs/icom/ic7100.c | 2 -- rigs/icom/ic7410.c | 2 -- rigs/icom/ic9100.c | 2 -- rigs/icom/icom.c | 37 +++-------------------- rigs/icom/icom.h | 1 - rigs/icom/x108g.c | 2 -- rigs/kenwood/kenwood.c | 2 +- rigs/yaesu/ft2000.h | 1 + rigs/yaesu/ft450.h | 4 ++- rigs/yaesu/ft5000.h | 1 + rigs/yaesu/ft9000.h | 4 ++- rigs/yaesu/ft950.h | 1 + rigs/yaesu/ft991.h | 1 + rigs/yaesu/newcat.c | 82 +++++++++++++++++++++++++++++++++++++++++--------- tests/ampctld.c | 1 + tests/rotctl_parse.c | 2 +- tests/rotctld.c | 1 + 21 files changed, 104 insertions(+), 65 deletions(-) hooks/post-receive -- Hamlib -- Ham radio control libraries |