diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2023-08-15 10:05:09 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2023-08-15 10:05:09 +0200 |
commit | 738a1e859737458d3ee9c5a8e92655bdd107a07e (patch) | |
tree | a14f2d3d4800734b77e4fc530b0eef71f2738328 /src/output | |
parent | 0887d7e859605fad9617681695e70e3ef738a19c (diff) | |
download | dabmod-738a1e859737458d3ee9c5a8e92655bdd107a07e.tar.gz dabmod-738a1e859737458d3ee9c5a8e92655bdd107a07e.tar.bz2 dabmod-738a1e859737458d3ee9c5a8e92655bdd107a07e.zip |
Revert "DEXTER: Add pacontrol interface"
This reverts commit 150b75b244602c789934f1a5094f33aa7da3c09a.
Diffstat (limited to 'src/output')
-rw-r--r-- | src/output/Dexter.cpp | 71 | ||||
-rw-r--r-- | src/output/Dexter.h | 14 | ||||
-rw-r--r-- | src/output/SDRDevice.h | 4 |
3 files changed, 2 insertions, 87 deletions
diff --git a/src/output/Dexter.cpp b/src/output/Dexter.cpp index e52f774..14edace 100644 --- a/src/output/Dexter.cpp +++ b/src/output/Dexter.cpp @@ -66,35 +66,9 @@ static void fill_time(struct timespec *t) } } -static void pacontrol_set_targetpower(zmq::socket_t& sock, int targetpower_dBm) -{ - stringstream message_builder; - message_builder << "{'PA0' : {'TargetPower': "; - message_builder << targetpower_dBm; - message_builder << "}}"; - const auto message = message_builder.str(); - - try { - const auto r = sock.send(zmq::const_buffer{message.data(), message.size()}); - if (r.has_value()) { - etiLog.level(debug) << "Sent TargetPower=" << targetpower_dBm << " to pacontrol"; - } - else { - // zmq_send returned EAGAIN - etiLog.level(info) << "Send TargetPower=" << targetpower_dBm << " failed"; - } - } - catch (const zmq::error_t& err) { - etiLog.level(warn) << "Failed to send TargetPower=" << targetpower_dBm << ": " << err.what(); - } -} - - Dexter::Dexter(SDRDeviceConfig& config) : SDRDevice(), - m_conf(config), - m_zmq_context(1), - m_zmq_sock(m_zmq_context, ZMQ_PUSH) + m_conf(config) { etiLog.level(info) << "Dexter:Creating the device"; @@ -192,41 +166,6 @@ Dexter::Dexter(SDRDeviceConfig& config) : m_running = true; m_underflow_read_thread = std::thread(&Dexter::underflow_read_process, this); - - m_zmq_sock.setsockopt(ZMQ_SNDTIMEO, 0); - if (not m_conf.pacontrol_config_endpoint.empty()) { - etiLog.level(debug) << "Creating pacontrol connection to " << - m_conf.pacontrol_config_endpoint; - m_zmq_sock.connect(m_conf.pacontrol_config_endpoint.c_str()); - } - - if (m_conf.pacontrol_targetpower.has_value()) { - pacontrol_set_targetpower(m_zmq_sock, *m_conf.pacontrol_targetpower); - } - else { - etiLog.level(warn) << "Config does not define PA target power"; - } -} - -static void pacontrol_set_mute(zmq::socket_t& sock, bool mute) -{ - string message = "{'PA0' : {'Mute': "; - message += (mute ? "True" : "False"); - message += "}}"; - - try { - const auto r = sock.send(zmq::const_buffer{message.data(), message.size()}); - if (r.has_value()) { - etiLog.level(debug) << "Sent mute=" << mute << " to pacontrol"; - } - else { - // zmq_send returned EAGAIN - etiLog.level(info) << "Send mute=" << mute << " failed"; - } - } - catch (const zmq::error_t& err) { - etiLog.level(warn) << "Failed to send mute=" << mute << ": " << err.what(); - } } void Dexter::channel_up() @@ -239,10 +178,6 @@ void Dexter::channel_up() m_channel_is_up = true; etiLog.level(debug) << "DEXTER CHANNEL_UP"; - - if (m_zmq_sock.connected()) { - pacontrol_set_mute(m_zmq_sock, false); - } } void Dexter::channel_down() @@ -259,10 +194,6 @@ void Dexter::channel_down() m_channel_is_up = false; etiLog.level(debug) << "DEXTER CHANNEL_DOWN"; - - if (m_zmq_sock.connected()) { - pacontrol_set_mute(m_zmq_sock, true); - } } void Dexter::handle_hw_time() diff --git a/src/output/Dexter.h b/src/output/Dexter.h index 57b9798..d4f425f 100644 --- a/src/output/Dexter.h +++ b/src/output/Dexter.h @@ -34,14 +34,8 @@ DESCRIPTION: # include <config.h> #endif -#if defined(HAVE_DEXTER) - -#if !defined(HAVE_ZEROMQ) -#error "ZeroMQ is mandatory for DEXTER" -#endif - +#ifdef HAVE_DEXTER #include "iio.h" -#include "zmq.hpp" #include <string> #include <memory> @@ -126,12 +120,6 @@ class Dexter : public Output::SDRDevice size_t num_buffers_pushed = 0; - /* Communication with pacontrol */ - zmq::context_t m_zmq_context; - zmq::socket_t m_zmq_sock; - std::string m_pacontrol_endpoint; - - /* Clock State */ DexterClockState m_clock_state = DexterClockState::Startup; // Only valid when m_clock_state is not Startup diff --git a/src/output/SDRDevice.h b/src/output/SDRDevice.h index f728d8b..378829c 100644 --- a/src/output/SDRDevice.h +++ b/src/output/SDRDevice.h @@ -94,10 +94,6 @@ struct SDRDeviceConfig { // TCP port on which to serve TX and RX samples for the // digital pre distortion learning tool uint16_t dpdFeedbackServerPort = 0; - - // DEXTER-specific - std::string pacontrol_config_endpoint; - std::optional<int> pacontrol_targetpower; // dBm }; // Each frame contains one OFDM frame, and its |