From afeb77e6d2f46709484202735840f796a17dc3f6 Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Sun, 31 May 2020 22:33:56 -0500 Subject: [PATCH 01/10] rigctld will now return either PTT_NONE or PTT_RIG_MICDATA to rigctl client https://github.com/Hamlib/Hamlib/issues/259 --- tests/rigctl_parse.c | 3 ++- tests/rigctld.c | 11 +++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index c4916f9f9..5b90a4681 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -4080,7 +4080,8 @@ declare_proto_rig(dump_state) // protocol 1 fields can be multi-line -- just write the thing to allow for it // backward compatible as new values will just generate warnings fprintf(fout, "vfo_ops=0x%x\n", rig->caps->vfo_ops); - fprintf(fout, "ptt_type=0x%x\n", rig->caps->ptt_type); + fprintf(fout, "ptt_type=0x%x\n", + rig->caps->ptt_type == RIG_PTT_NONE ? RIG_PTT_NONE : RIG_PTT_RIG_MICDATA); fprintf(fout, "done\n"); #if 0 // why isn't this implemented? Does anybody care? diff --git a/tests/rigctld.c b/tests/rigctld.c index e68b7a331..b5f09cbd6 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -571,6 +571,11 @@ int main(int argc, char *argv[]) /* * ex: RIG_PTT_PARALLEL and /dev/parport0 */ + if (ptt_type != RIG_PTT_NONE) + { + my_rig->state.pttport.type.ptt = ptt_type; + } + if (dcd_type != RIG_DCD_NONE) { my_rig->state.dcdport.type.dcd = dcd_type; @@ -625,12 +630,6 @@ int main(int argc, char *argv[]) exit(2); } - if (ptt_type != RIG_PTT_NONE) - { - my_rig->state.pttport.type.ptt = ptt_type; - my_rig->caps->ptt_type = ptt_type; - } - if (verbose > RIG_DEBUG_ERR) { printf("Opened rig model %u, '%s'\n", From 8c27ef12a077a2acf710a7b6e17b753d692f7530 Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Sun, 31 May 2020 23:21:51 -0500 Subject: [PATCH 02/10] Remove expected response for gs232b W command https://github.com/Hamlib/Hamlib/issues/272 --- rotators/gs232a/gs232b.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rotators/gs232a/gs232b.c b/rotators/gs232a/gs232b.c index 0582b840d..74b42bc68 100644 --- a/rotators/gs232a/gs232b.c +++ b/rotators/gs232a/gs232b.c @@ -186,12 +186,16 @@ gs232b_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) u_el = (unsigned) rint(el); sprintf(cmdstr, "W%03u %03u" EOM, u_az, u_el); +#if 0 // do any GS232B models need a reply to the W command? retval = gs232b_transaction(rot, cmdstr, buf, sizeof(buf), 0); +#else + retval = gs232b_transaction(rot, cmdstr, NULL, 0 , 0); if (retval != RIG_OK) { return retval; } +#endif return RIG_OK; } @@ -317,7 +321,7 @@ const struct rot_caps gs232b_rot_caps = ROT_MODEL(ROT_MODEL_GS232B), .model_name = "GS-232B", .mfg_name = "Yaesu", - .version = "20200517", + .version = "20200531", .copyright = "LGPL", .status = RIG_STATUS_STABLE, .rot_type = ROT_TYPE_OTHER, From d9ab62445cd790acdfaafdb54183421a063a655d Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Mon, 1 Jun 2020 12:21:48 +0100 Subject: [PATCH 03/10] Deal with remote PTT type at the client end Remote PTT must always be either RIG_PTT_RIG_MICDATA or RIG_PTT_NONE. Also take care not to override any locally set PTT type as it is feasible to use a local hardware PTT at the client end with remote CAT control. Maybe an odd arrangement but Hamlib does not preclude it. This is all done while preserving the accuracy of the ptt_type value in dump_state requests. --- dummy/netrigctl.c | 14 +++++++++++--- tests/rigctl_parse.c | 3 +-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/dummy/netrigctl.c b/dummy/netrigctl.c index 4acb59786..52df37c68 100644 --- a/dummy/netrigctl.c +++ b/dummy/netrigctl.c @@ -539,9 +539,17 @@ static int netrigctl_open(RIG *rig) } else if (strcmp(setting, "ptt_type") == 0) { - rig->caps->ptt_type = strtol(value, NULL, 0); - rig->state.pttport.type.ptt = rig->caps->ptt_type; - rig_debug(RIG_DEBUG_TRACE, "%s: %s set to %d\n", __func__, setting, rig->caps->ptt_type); + ptt_type_t temp = (ptt_type_t)strtol(value, NULL, 0); + if (RIG_PTT_RIG_MICDATA == rig->state.pttport.type.ptt && RIG_PTT_NONE == temp) + { + /* + * remote PTT must always be RIG_PTT_RIG_MICDATA + * if there is any PTT capability and we have not + * locally overridden it + */ + rig->state.pttport.type.ptt = temp; + rig_debug(RIG_DEBUG_TRACE, "%s: %s set to %d\n", __func__, setting, rig->state.pttport.type.ptt); + } } else { diff --git a/tests/rigctl_parse.c b/tests/rigctl_parse.c index 5b90a4681..d89985aa8 100644 --- a/tests/rigctl_parse.c +++ b/tests/rigctl_parse.c @@ -4080,8 +4080,7 @@ declare_proto_rig(dump_state) // protocol 1 fields can be multi-line -- just write the thing to allow for it // backward compatible as new values will just generate warnings fprintf(fout, "vfo_ops=0x%x\n", rig->caps->vfo_ops); - fprintf(fout, "ptt_type=0x%x\n", - rig->caps->ptt_type == RIG_PTT_NONE ? RIG_PTT_NONE : RIG_PTT_RIG_MICDATA); + fprintf(fout, "ptt_type=0x%x\n", rig->state.pttport.type.ptt); fprintf(fout, "done\n"); #if 0 // why isn't this implemented? Does anybody care? From 17109382b008a8ee79ad93d07eab6ddc31806d79 Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Mon, 1 Jun 2020 12:09:24 -0500 Subject: [PATCH 04/10] Fix kenwood setting of priv->tx_vfo based on IF response split indication When not transmitting tx_vfo is still VFO_B https://github.com/Hamlib/Hamlib/issues/272 --- rigs/kenwood/kenwood.c | 1 + rigs/kenwood/kenwood.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/rigs/kenwood/kenwood.c b/rigs/kenwood/kenwood.c index 6e0bcc8ec..39f1a6ffb 100644 --- a/rigs/kenwood/kenwood.c +++ b/rigs/kenwood/kenwood.c @@ -1375,6 +1375,7 @@ int kenwood_get_vfo_if(RIG *rig, vfo_t *vfo) { case '0': *vfo = priv->tx_vfo = split_and_transmitting ? RIG_VFO_B : RIG_VFO_A; + if (priv->info[32] == '1') priv->tx_vfo = RIG_VFO_B; break; case '1': diff --git a/rigs/kenwood/kenwood.h b/rigs/kenwood/kenwood.h index 5a91ed8be..bccf8ebb7 100644 --- a/rigs/kenwood/kenwood.h +++ b/rigs/kenwood/kenwood.h @@ -27,7 +27,7 @@ #include #include "token.h" -#define BACKEND_VER "20200528" +#define BACKEND_VER "20200601" #define EOM_KEN ';' #define EOM_TH '\r' From 207c50f36b7a42888097b5d972977e93ede1949c Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Mon, 1 Jun 2020 12:11:15 -0500 Subject: [PATCH 05/10] Fix rigctlcom split indication in IF generation Add some debug to see the cmd being requested by the client https://github.com/Hamlib/Hamlib/issues/272 --- tests/rigctlcom.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/rigctlcom.c b/tests/rigctlcom.c index 928ab2d64..93bd633ee 100644 --- a/tests/rigctlcom.c +++ b/tests/rigctlcom.c @@ -704,6 +704,7 @@ static int write_block2(void *func, */ static int handle_ts2000(void *arg) { + rig_debug(RIG_DEBUG_VERBOSE, "%s: cmd=%s\n", __func__, (char*)arg); // Handle all the queries if (strcmp(arg, "ID;") == 0) { @@ -752,15 +753,16 @@ static int handle_ts2000(void *arg) return retval; } - if (ptt) + // we need to know split status -- don't care about the vfo + retval = rig_get_split_vfo(my_rig, RIG_VFO_CURR, &split, &vfo); + + if (retval != RIG_OK) { - retval = rig_get_split_vfo(my_rig, RIG_VFO_CURR, &split, &vfo); - } - else - { - retval = rig_get_vfo(my_rig, &vfo); + return retval; } + retval = rig_get_vfo(my_rig, &vfo); + if (retval != RIG_OK) { return retval; From 79fdfe842505f238557bdd17deb9cde7f97d4ed0 Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Mon, 1 Jun 2020 12:53:07 -0500 Subject: [PATCH 06/10] Change vfo_fixup to just return when currVFO is requested https://github.com/Hamlib/Hamlib/issues/274 --- src/rig.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/rig.c b/src/rig.c index 620a97d7b..a6132d465 100644 --- a/src/rig.c +++ b/src/rig.c @@ -194,13 +194,12 @@ static vfo_t vfo_fixup(RIG *rig, vfo_t vfo) { rig_debug(RIG_DEBUG_TRACE, "%s: vfo=%s\n", __func__, rig_strvfo(vfo)); -#if 0 // Icoms require VFO_CURR -- 2020-05-30 -- if no other problems - // reported after WSJT-X is released delete this - if (vfo == RIG_VFO_CURR && rig->state.current_vfo == RIG_VFO_CURR) + if (vfo == RIG_VFO_CURR) { - vfo = RIG_VFO_A; + rig_debug(RIG_DEBUG_TRACE, "%s: Leaving currVFO alone\n", __func__); + return RIG_OK; // don't modify vfo for RIG_VFO_CURR } -#endif + if (vfo == RIG_VFO_RX) { vfo = RIG_VFO_A; From e49f1a9df9b04b0ab357d78425282e6999115142 Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Mon, 1 Jun 2020 14:08:45 -0500 Subject: [PATCH 07/10] Change rig.c to use some sensible defaults when rig_get_vfo fails https://github.com/Hamlib/Hamlib/issues/274 --- src/rig.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rig.c b/src/rig.c index a6132d465..d430ddb52 100644 --- a/src/rig.c +++ b/src/rig.c @@ -925,6 +925,11 @@ int HAMLIB_API rig_open(RIG *rig) { rs->tx_vfo = rs->current_vfo; } + else // vfo fails so set some sensible defaults + { + rs->current_vfo = RIG_VFO_CURR; + rs->tx_vfo = RIG_VFO_TX; + } // try to turn off the screensaver if possible // don't care about the return here...it's just a nice-to-have From 567cd7145e68193a4c23d1fd8828bc7179096f39 Mon Sep 17 00:00:00 2001 From: Michael Black Date: Mon, 1 Jun 2020 17:07:20 -0500 Subject: [PATCH 08/10] Fix VFO_CURR return from vfo_fixup https://github.com/Hamlib/Hamlib/issues/274 --- src/rig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rig.c b/src/rig.c index d430ddb52..5380969c5 100644 --- a/src/rig.c +++ b/src/rig.c @@ -197,7 +197,7 @@ static vfo_t vfo_fixup(RIG *rig, vfo_t vfo) if (vfo == RIG_VFO_CURR) { rig_debug(RIG_DEBUG_TRACE, "%s: Leaving currVFO alone\n", __func__); - return RIG_OK; // don't modify vfo for RIG_VFO_CURR + return vfo; // don't modify vfo for RIG_VFO_CURR } if (vfo == RIG_VFO_RX) From 00031994c6e704e8c547ee6e9811c5302ed0962e Mon Sep 17 00:00:00 2001 From: Michael Black Date: Mon, 1 Jun 2020 17:38:03 -0500 Subject: [PATCH 09/10] Remove block setting VFO_A -- does not work with rigs that don't have VFO_A https://github.com/Hamlib/Hamlib/issues/274 --- rigs/icom/icom.c | 2 ++ rigs/icom/icom.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/rigs/icom/icom.c b/rigs/icom/icom.c index a448db277..65ca20ee1 100644 --- a/rigs/icom/icom.c +++ b/rigs/icom/icom.c @@ -1128,6 +1128,7 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) } } +#if 0 // does not work with rigs without VFO_A if (vfo == RIG_VFO_CURR) { vfo = priv->curr_vfo; @@ -1135,6 +1136,7 @@ int icom_get_freq(RIG *rig, vfo_t vfo, freq_t *freq) rig_debug(RIG_DEBUG_VERBOSE, "%s: CurrVFO changed to %s\n", __func__, rig_strvfo(vfo)); } +#endif retval = set_vfo_curr(rig, vfo, priv->curr_vfo); diff --git a/rigs/icom/icom.h b/rigs/icom/icom.h index 4bdfef0c6..6c4dd84c8 100644 --- a/rigs/icom/icom.h +++ b/rigs/icom/icom.h @@ -31,7 +31,7 @@ #include #endif -#define BACKEND_VER "20200525" +#define BACKEND_VER "20200601" /* * defines used by comp_cal_str in rig.c From 783df7b57929b61e2140e43745465aaa44301d03 Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Mon, 1 Jun 2020 23:00:37 -0500 Subject: [PATCH 10/10] Remove unused var from gs232b.c --- rotators/gs232a/gs232b.c | 1 - 1 file changed, 1 deletion(-) diff --git a/rotators/gs232a/gs232b.c b/rotators/gs232a/gs232b.c index 74b42bc68..dc7822568 100644 --- a/rotators/gs232a/gs232b.c +++ b/rotators/gs232a/gs232b.c @@ -169,7 +169,6 @@ transaction_quit: static int gs232b_rot_set_position(ROT *rot, azimuth_t az, elevation_t el) { - char buf[32]; char cmdstr[64]; int retval; unsigned u_az, u_el;