diff --git a/DXLabSuiteCommanderTransceiver.cpp b/DXLabSuiteCommanderTransceiver.cpp index 4961c2a69..5880abcdf 100644 --- a/DXLabSuiteCommanderTransceiver.cpp +++ b/DXLabSuiteCommanderTransceiver.cpp @@ -163,7 +163,7 @@ void DXLabSuiteCommanderTransceiver::do_frequency (Frequency f, MODE m, bool /*n { TRACE_CAT ("DXLabSuiteCommanderTransceiver", f << state ()); auto f_string = frequency_to_string (f); - if (UNK != m) + if (UNK != m && m != get_mode ()) { auto m_string = map_mode (m); auto params = ("" + f_string + "" + m_string + "Y").arg (f_string.size ()).arg (m_string.size ()); @@ -281,11 +281,16 @@ void DXLabSuiteCommanderTransceiver::poll () throw error {tr ("DX Lab Suite Commander didn't respond correctly polling split status")}; } - reply = command_with_reply ("CmdSendMode", quiet); + get_mode (quiet); +} + +auto DXLabSuiteCommanderTransceiver::get_mode (bool no_debug) -> MODE +{ + MODE m {UNK}; + auto reply = command_with_reply ("CmdSendMode", no_debug); if (0 == reply.indexOf ("') + 1); - MODE m {UNK}; if ("AM" == mode) { m = AM; @@ -338,6 +343,7 @@ void DXLabSuiteCommanderTransceiver::poll () TRACE_CAT_POLL ("DXLabSuiteCommanderTransceiver", "unexpected response"); throw error {tr ("DX Lab Suite Commander didn't respond correctly polling mode")}; } + return m; } void DXLabSuiteCommanderTransceiver::simple_command (QString const& cmd, bool no_debug) diff --git a/DXLabSuiteCommanderTransceiver.hpp b/DXLabSuiteCommanderTransceiver.hpp index 92d042c99..b02fbef12 100644 --- a/DXLabSuiteCommanderTransceiver.hpp +++ b/DXLabSuiteCommanderTransceiver.hpp @@ -42,6 +42,7 @@ protected: void poll () override; private: + MODE get_mode (bool no_debug = false); void simple_command (QString const&, bool no_debug = false); QString command_with_reply (QString const&, bool no_debug = false); bool write_to_port (QString const&);