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
This commit is contained in:
Bill Somerville 2014-08-30 19:28:55 +00:00
parent 05b7c4680b
commit 124c0ac70c

View File

@ -709,7 +709,11 @@ 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;
@ -717,6 +721,7 @@ void HamlibTransceiver::poll ()
update_PTT (!(RIG_PTT_OFF == p));
}
}
#if !WSJT_TRACE_CAT_POLLS
#if WSJT_HAMLIB_TRACE