aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/UHD.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-01-18 02:13:29 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-01-18 02:13:29 +0100
commit1035eb6574ac4062333e756a1ba4f47a4bfa9855 (patch)
treed2e68e91521eb16197cd09929288d5fe9c97be7a /src/output/UHD.cpp
parentcf416ef85fb07da98e61d821ea1169acf57b45f6 (diff)
downloaddabmod-1035eb6574ac4062333e756a1ba4f47a4bfa9855.tar.gz
dabmod-1035eb6574ac4062333e756a1ba4f47a4bfa9855.tar.bz2
dabmod-1035eb6574ac4062333e756a1ba4f47a4bfa9855.zip
Add antenna selection to config
Diffstat (limited to 'src/output/UHD.cpp')
-rw-r--r--src/output/UHD.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/output/UHD.cpp b/src/output/UHD.cpp
index 8876b0e..2c571fd 100644
--- a/src/output/UHD.cpp
+++ b/src/output/UHD.cpp
@@ -159,10 +159,10 @@ UHD::UHD(SDRDeviceConfig& config) :
tune(m_conf.lo_offset, m_conf.frequency);
m_conf.frequency = m_usrp->get_tx_freq();
- etiLog.level(info) << std::fixed << std::setprecision(3) <<
+ etiLog.level(debug) << std::fixed << std::setprecision(3) <<
"OutputUHD:Actual TX frequency: " << m_conf.frequency;
- etiLog.level(info) << std::fixed << std::setprecision(3) <<
+ etiLog.level(debug) << std::fixed << std::setprecision(3) <<
"OutputUHD:Actual RX frequency: " << m_usrp->get_tx_freq();
m_usrp->set_tx_gain(m_conf.txgain);
@@ -175,18 +175,21 @@ UHD::UHD(SDRDeviceConfig& config) :
m_usrp->set_rx_rate(m_conf.sampleRate);
etiLog.log(debug, "OutputUHD:Actual RX Rate: %f sps.", m_usrp->get_rx_rate());
- m_usrp->set_rx_antenna("RX2");
- etiLog.log(debug, "OutputUHD:Set RX Antenna: %s",
+ if (not m_conf.rx_antenna.empty()) {
+ m_usrp->set_rx_antenna(m_conf.rx_antenna);
+ }
+ etiLog.log(debug, "OutputUHD:Actual RX Antenna: %s",
m_usrp->get_rx_antenna().c_str());
+ if (not m_conf.tx_antenna.empty()) {
+ m_usrp->set_tx_antenna(m_conf.tx_antenna);
+ }
+ etiLog.log(debug, "OutputUHD:Actual TX Antenna: %s",
+ m_usrp->get_tx_antenna().c_str());
+
m_usrp->set_rx_gain(m_conf.rxgain);
etiLog.log(debug, "OutputUHD:Actual RX Gain: %f", m_usrp->get_rx_gain());
- /* TODO
- uhdFeedback = std::make_shared<OutputUHDFeedback>(
- m_usrp, m_conf.dpdFeedbackServerPort, m_conf.sampleRate);
- */
-
const uhd::stream_args_t stream_args("fc32"); //complex floats
m_rx_stream = m_usrp->get_rx_stream(stream_args);
m_tx_stream = m_usrp->get_tx_stream(stream_args);