From 5bd0e0e93dc18ce9c34db17762616e447af75a68 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sat, 30 Aug 2014 19:28:55 +0000 Subject: [PATCH] Allow Hamlib rig_get_ptt call to fail if function unavailable. The Hamlib backe end capabilities table is not reliable when the back end is the Hamlib Net one. This is because that back end claims all functions available but a call may fail on execution due to the actual remote back end target not supporting it. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4234 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- HamlibTransceiver.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/HamlibTransceiver.cpp b/HamlibTransceiver.cpp index bdc2b9626..034c82b97 100644 --- a/HamlibTransceiver.cpp +++ b/HamlibTransceiver.cpp @@ -709,13 +709,18 @@ void HamlibTransceiver::poll () if (RIG_PTT_NONE != rig_->state.pttport.type.ptt && rig_->caps->get_ptt) { ptt_t p; - error_check (rig_get_ptt (rig_.data (), RIG_VFO_CURR, &p), tr ("getting PTT state")); + auto rc = rig_get_ptt (rig_.data (), RIG_VFO_CURR, &p); + if (RIG_ENAVAIL != rc) // may fail if Net rig ctl and target + // doesn't support command + { + error_check (rc, tr ("getting PTT state")); #if WSJT_TRACE_CAT && WSJT_TRACE_CAT_POLLS - qDebug () << "HamlibTransceiver::state rig_get_ptt =" << p; + qDebug () << "HamlibTransceiver::state rig_get_ptt =" << p; #endif - update_PTT (!(RIG_PTT_OFF == p)); + update_PTT (!(RIG_PTT_OFF == p)); + } } #if !WSJT_TRACE_CAT_POLLS