aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-04-28 21:41:07 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-05-25 17:14:43 +0200
commite0d2f507ea7bb6b367daac53e69e9dc2b3570840 (patch)
tree4e450d24eb3b23a81b33063a794c5d9469c6ad8a
parent7ca30375c96c04a0764d969a4ed355eff24720b7 (diff)
LMSDevice: Print sample rate range + actual sample rate after setting it
-rw-r--r--Transceiver52M/device/lms/LMSDevice.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp
index 0442e27..9301cf4 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -118,9 +118,18 @@ int LMSDevice::open(const std::string &args, int ref, bool swap_channels)
return -1;
}
+ lms_range_t range;
+ if (LMS_GetSampleRateRange(m_lms_dev, LMS_CH_RX, &range))
+ goto out_close;
+ LOG(DEBUG) << "Sample Rate: Min=" << range.min << " Max=" << range.max << " Step=" << range.step;
+
LOG(DEBUG) << "Setting sample rate to " << GSMRATE*sps << " " << sps;
if (LMS_SetSampleRate(m_lms_dev, GSMRATE*sps, 32) < 0)
goto out_close;
+ float_type sr_host, sr_rf;
+ if (LMS_GetSampleRate(m_lms_dev, LMS_CH_RX, 0, &sr_host, &sr_rf))
+ goto out_close;
+ LOG(DEBUG) << "Sample Rate: Host=" << sr_host << " RF=" << sr_rf;
/* FIXME: make this device/model dependent, like UHDDevice:dev_param_map! */
ts_offset = static_cast<TIMESTAMP>(8.9e-5 * GSMRATE);