aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/UHD.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-05-07 11:46:45 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-05-07 11:46:45 +0200
commit04c3650d5f730891c33e45d2f07c052c6393c2e8 (patch)
treed95431a387598f88b4a05df7a1dd3d3c91f6126b /src/output/UHD.cpp
parentf6e3913f80ec15f2a554dc2ad1fe219cefd1f5d2 (diff)
parent3a7202306c6aca5be2dad604f62063d605fd0982 (diff)
downloaddabmod-04c3650d5f730891c33e45d2f07c052c6393c2e8.tar.gz
dabmod-04c3650d5f730891c33e45d2f07c052c6393c2e8.tar.bz2
dabmod-04c3650d5f730891c33e45d2f07c052c6393c2e8.zip
Merge branch 'next' into lime
Diffstat (limited to 'src/output/UHD.cpp')
-rw-r--r--src/output/UHD.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/output/UHD.cpp b/src/output/UHD.cpp
index c6c500b..3cf5aef 100644
--- a/src/output/UHD.cpp
+++ b/src/output/UHD.cpp
@@ -2,7 +2,7 @@
Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Her Majesty the
Queen in Right of Canada (Communications Research Center Canada)
- Copyright (C) 2018
+ Copyright (C) 2019
Matthias P. Braendli, matthias.braendli@mpb.li
http://opendigitalradio.org
@@ -193,6 +193,15 @@ UHD::UHD(SDRDeviceConfig& config) :
throw std::runtime_error("Cannot set USRP sample rate. Aborted.");
}
+ if (m_conf.bandwidth > 0) {
+ m_usrp->set_tx_bandwidth(m_conf.bandwidth);
+ m_usrp->set_rx_bandwidth(m_conf.bandwidth);
+
+ etiLog.level(info) << "OutputUHD:Actual TX bandwidth: " <<
+ std::fixed << std::setprecision(2) <<
+ m_usrp->get_tx_bandwidth();
+ }
+
tune(m_conf.lo_offset, m_conf.frequency);
m_conf.frequency = m_usrp->get_tx_freq();
@@ -294,6 +303,18 @@ double UHD::get_txgain(void) const
return m_usrp->get_tx_gain();
}
+void UHD::set_bandwidth(double bandwidth)
+{
+ m_usrp->set_tx_bandwidth(bandwidth);
+ m_usrp->set_rx_bandwidth(bandwidth);
+ m_conf.bandwidth = m_usrp->get_tx_bandwidth();
+}
+
+double UHD::get_bandwidth(void) const
+{
+ return m_usrp->get_tx_bandwidth();
+}
+
void UHD::transmit_frame(const struct FrameData& frame)
{
const double tx_timeout = 20.0;
@@ -338,8 +359,7 @@ void UHD::transmit_frame(const struct FrameData& frame)
num_acc_samps += num_tx_samps;
- md_tx.time_spec = md_tx.time_spec +
- uhd::time_spec_t(0, num_tx_samps/m_conf.sampleRate);
+ md_tx.time_spec += uhd::time_spec_t(0, num_tx_samps/m_conf.sampleRate);
if (num_tx_samps == 0) {
etiLog.log(warn,