From bb00c359801b5518407297905a6e5a89a49f0fdd Mon Sep 17 00:00:00 2001 From: Michael Black W9MDB Date: Fri, 26 Feb 2021 11:35:53 -0600 Subject: [PATCH] In rig_set_ptt allow rig_get_ptt to fail and retry IC-9700 seems unable to query ptt right after setting it https://github.com/Hamlib/Hamlib/issues/571 --- src/rig.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/rig.c b/src/rig.c index b91b6723e..6ac883ff3 100644 --- a/src/rig.c +++ b/src/rig.c @@ -2491,7 +2491,14 @@ int HAMLIB_API rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt) { retcode = caps->set_ptt(rig, vfo, ptt); if (retcode != RIG_OK) RETURNFUNC(retcode); + tptt = -1; + // IC-9700 is failing on get_ptt right after set_ptt in split mode retcode = rig_get_ptt(rig, vfo, &tptt); + if (retcode != RIG_OK) + { + rig_debug(RIG_DEBUG_ERR, "%s: rig_get_ptt failed: %s\b", __func__, rigerror(retcode)); + retcode = RIG_OK; // fake the retcode so we retry + } if (tptt != ptt) rig_debug(RIG_DEBUG_WARN, "%s: failed, retry=%d\n", __func__, retry); } while(tptt != ptt && retry-- > 0 && retcode == RIG_OK); }