From 94e8859a6f0725994435b414e1cae402a3c9bce4 Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Sun, 31 May 2020 15:52:38 -0500 Subject: [PATCH 1/2] Fix ptt_type to be consistent across open/close calls https://github.com/Hamlib/Hamlib/issues/270 --- dummy/netrigctl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dummy/netrigctl.c b/dummy/netrigctl.c index 8b0eadf9f..4acb59786 100644 --- a/dummy/netrigctl.c +++ b/dummy/netrigctl.c @@ -534,13 +534,14 @@ static int netrigctl_open(RIG *rig) { if (strcmp(setting, "vfo_ops") == 0) { - rig_debug(RIG_DEBUG_TRACE, "%s: %s set to %s\n", __func__, setting, value); rig->caps->vfo_ops = strtol(value, NULL, 0); + rig_debug(RIG_DEBUG_TRACE, "%s: %s set to %d\n", __func__, setting, rig->caps->vfo_ops); } else if (strcmp(setting, "ptt_type") == 0) { - rig_debug(RIG_DEBUG_TRACE, "%s: %s set to %s\n", __func__, setting, value); 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); } else { From 1dc461966df5e3a5d6719d448ae62fa3abc5e678 Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Sun, 31 May 2020 16:42:56 -0500 Subject: [PATCH 2/2] Fix rigctld ptt_type to correctly reflect DTR/RTS Might need to do this with some other values too github.com/Hamlib/Hamlib/issues/270 --- tests/rigctld.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/rigctld.c b/tests/rigctld.c index b5f09cbd6..e68b7a331 100644 --- a/tests/rigctld.c +++ b/tests/rigctld.c @@ -571,11 +571,6 @@ 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; @@ -630,6 +625,12 @@ 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",