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 6de67f32b1
commit 5bd0e0e93d
1 changed files with 8 additions and 3 deletions

View File

@ -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