From 5ebde1ca34e2b44b5b1c0d5e4a38ce091639b19e Mon Sep 17 00:00:00 2001 From: Mike Black W9MDB Date: Mon, 9 Jan 2023 22:53:01 -0600 Subject: [PATCH] Really fix CM108 ptt_bitnum usage https://github.com/Hamlib/Hamlib/issues/1203 --- NEWS | 3 +++ src/rig.c | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index b2909aaab..a8dd99d07 100644 --- a/NEWS +++ b/NEWS @@ -24,6 +24,9 @@ Version 4.6 * Add FLIR PTU-D48, E46, D100, D300 rotors * Fix FTDX3000 rig split +Version 4.5.5 + * Really fix CM108 ptt_bitnum usage + Version 4.5.4 * 2023-XX-XX * Fix CM108 ptt setting for non-default usage diff --git a/src/rig.c b/src/rig.c index d4cff0ae1..01e36480c 100644 --- a/src/rig.c +++ b/src/rig.c @@ -1114,8 +1114,12 @@ int HAMLIB_API rig_open(RIG *rig) rs->pttport.fd = cm108_open(&rs->pttport); strncpy(rs->rigport.pathname, DEFAULT_CM108_PORT, HAMLIB_FILPATHLEN); - rs->rigport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; - rs->pttport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; + + if (rs->rigport.parm.cm108.ptt_bitnum == 0) + { + rs->rigport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; + rs->pttport.parm.cm108.ptt_bitnum = DEFAULT_CM108_PTT_BITNUM; + } if (rs->pttport.fd < 0) { @@ -6019,6 +6023,7 @@ int HAMLIB_API rig_set_powerstat(RIG *rig, powerstat_t status) HAMLIB_TRACE; retcode = rig->caps->set_powerstat(rig, status); rig_flush(&rig->state.rigport); // if anything is queued up flush it + rig->state.auto_power_on = 1; // ensure we auto power on in the future RETURNFUNC(retcode); }