summaryrefslogtreecommitdiffstats
path: root/src/output/Soapy.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/Soapy.cpp
parentcf416ef85fb07da98e61d821ea1169acf57b45f6 (diff)
downloaddabmod-1035eb6574ac4062333e756a1ba4f47a4bfa9855.tar.gz
dabmod-1035eb6574ac4062333e756a1ba4f47a4bfa9855.tar.bz2
dabmod-1035eb6574ac4062333e756a1ba4f47a4bfa9855.zip
Add antenna selection to config
Diffstat (limited to 'src/output/Soapy.cpp')
-rw-r--r--src/output/Soapy.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/output/Soapy.cpp b/src/output/Soapy.cpp
index 44f8f58..8ee420e 100644
--- a/src/output/Soapy.cpp
+++ b/src/output/Soapy.cpp
@@ -71,23 +71,32 @@ Soapy::Soapy(SDRDeviceConfig& config) :
m_device->setMasterClockRate(m_conf.masterClockRate);
etiLog.level(info) << "SoapySDR master clock rate set to " <<
+ std::fixed << std::setprecision(4) <<
m_device->getMasterClockRate()/1000.0 << " kHz";
m_device->setSampleRate(SOAPY_SDR_TX, 0, m_conf.sampleRate);
etiLog.level(info) << "SoapySDR:Actual TX rate: " <<
+ std::fixed << std::setprecision(4) <<
m_device->getSampleRate(SOAPY_SDR_TX, 0) / 1000.0 <<
" ksps.";
tune(m_conf.lo_offset, m_conf.frequency);
m_conf.frequency = m_device->getFrequency(SOAPY_SDR_TX, 0);
etiLog.level(info) << "SoapySDR:Actual frequency: " <<
- m_conf.frequency / 1000.0 <<
- " kHz.";
+ std::fixed << std::setprecision(3) <<
+ m_conf.frequency / 1000.0 << " kHz.";
m_device->setGain(SOAPY_SDR_TX, 0, m_conf.txgain);
etiLog.level(info) << "SoapySDR:Actual tx gain: " <<
+ std::fixed << std::setprecision(2) <<
m_device->getGain(SOAPY_SDR_TX, 0);
+ if (not m_conf.tx_antenna.empty()) {
+ m_device->setAntenna(SOAPY_SDR_TX, 0, m_conf.tx_antenna);
+ }
+ etiLog.level(info) << "SoapySDR:Actual tx antenna: " <<
+ m_device->getAntenna(SOAPY_SDR_TX, 0);
+
const std::vector<size_t> channels({0});
m_tx_stream = m_device->setupStream(SOAPY_SDR_TX, "CF32", channels);
m_device->activateStream(m_tx_stream);