summaryrefslogtreecommitdiffstats
path: root/src/output/SDR.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-11-04 08:36:03 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-11-04 08:36:03 +0100
commit4d8310ae0ffe1f78a2b8623d55f63ae504ff1aa8 (patch)
treeeb6a7ad2b63b2887725159f53904c7a471429269 /src/output/SDR.cpp
parent34afa3a0632817c30e4e5427ee67138d59c4ede3 (diff)
downloaddabmod-4d8310ae0ffe1f78a2b8623d55f63ae504ff1aa8.tar.gz
dabmod-4d8310ae0ffe1f78a2b8623d55f63ae504ff1aa8.tar.bz2
dabmod-4d8310ae0ffe1f78a2b8623d55f63ae504ff1aa8.zip
Make DPD Feedback server SDRDevice-agnostic
Diffstat (limited to 'src/output/SDR.cpp')
-rw-r--r--src/output/SDR.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/output/SDR.cpp b/src/output/SDR.cpp
index 2ad8e57..66e93e2 100644
--- a/src/output/SDR.cpp
+++ b/src/output/SDR.cpp
@@ -67,6 +67,13 @@ SDR::SDR(SDRDeviceConfig& config, std::shared_ptr<SDRDevice> device) :
m_config.muting = true;
m_device_thread = std::thread(&SDR::process_thread_entry, this);
+
+ if (m_config.dpdFeedbackServerPort != 0) {
+ m_dpd_feedback_server = make_shared<DPDFeedbackServer>(
+ m_device,
+ m_config.dpdFeedbackServerPort,
+ m_config.sampleRate);
+ }
}
SDR::~SDR()
@@ -108,10 +115,21 @@ int SDR::process(Buffer *dataIn)
if (frame.ts.fct == -1) {
etiLog.level(info) <<
- "OutputUHD: dropping one frame with invalid FCT";
+ "SDR output: dropping one frame with invalid FCT";
}
else {
- // TODO setup Feedback and set tx_frame
+ try {
+ m_dpd_feedback_server->set_tx_frame(frame.buf, frame.ts);
+ }
+ catch (const runtime_error& e) {
+ etiLog.level(warn) <<
+ "SDR output: Feedback server failed, restarting...";
+
+ m_dpd_feedback_server = std::make_shared<DPDFeedbackServer>(
+ m_device,
+ m_config.dpdFeedbackServerPort,
+ m_config.sampleRate);
+ }
size_t num_frames = m_queue.push_wait_if_full(frame,
FRAMES_MAX_SIZE);