From 0b1c7252a26e316361b34fd1baaf2f5980f827dd Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Mon, 16 Jun 2014 09:39:04 +0000 Subject: [PATCH] Ignore Hamlib error when using fake split without CAT split control. Fake split mode attempts to take the rig out of split mode on initialization and this caused an error when the rig doesn't support split control via CAT. This specfic error is now ignored to allow fake split mode to start cleanly. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4174 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- HamlibTransceiver.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/HamlibTransceiver.cpp b/HamlibTransceiver.cpp index 55f3d5087..13a65f898 100644 --- a/HamlibTransceiver.cpp +++ b/HamlibTransceiver.cpp @@ -533,7 +533,17 @@ void HamlibTransceiver::do_tx_frequency (Frequency tx, bool rationalise_mode) qDebug () << "HamlibTransceiver::do_tx_frequency rig_set_split_vfo"; #endif - error_check (rig_set_split_vfo (rig_.data (), RIG_VFO_CURR, tx ? RIG_SPLIT_ON : RIG_SPLIT_OFF, tx_vfo), tr ("seting split mode")); + auto rc = rig_set_split_vfo (rig_.data (), RIG_VFO_CURR, tx ? RIG_SPLIT_ON : RIG_SPLIT_OFF, tx_vfo); + if (tx || -RIG_ENAVAIL != rc) + { + // On rigs that can't have split controlled only throw an + // exception when an error other than command not accepted + // is returned when trying to leave split mode. This allows + // fake split mode and non-split mode to work without error + // on such rigs without having to know anything about the + // specific rig. + error_check (rc, tr ("setting/unsetting split mode")); + } } update_split (tx);