aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoachim Steiger <jsteiger@sysmocom.de>2019-04-16 19:04:37 +0200
committerHarald Welte <laforge@gnumonks.org>2019-04-17 18:24:11 +0000
commitc785fb130a0ae4e5ae23ccc7817d03c551cf8fdc (patch)
treed783aa7f590cc24be7e89546f94331dff7693d4b
parent2875290d9556291182fb33d248ce1324057adf81 (diff)
lms: properly call close if set_antennas() fails, add some commentsHEADmaster
-rw-r--r--Transceiver52M/device/lms/LMSDevice.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp
index 34ad6e8..05904e8 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -222,6 +222,7 @@ int LMSDevice::open(const std::string &args, int ref, bool swap_channels)
goto out_close;
}
+ /* set samplerate */
if (LMS_GetSampleRateRange(m_lms_dev, LMS_CH_RX, &range_sr))
goto out_close;
print_range("Sample Rate", &range_sr);
@@ -237,9 +238,10 @@ int LMSDevice::open(const std::string &args, int ref, bool swap_channels)
/* FIXME: make this device/model dependent, like UHDDevice:dev_param_map! */
ts_offset = static_cast<TIMESTAMP>(8.9e-5 * GSMRATE * tx_sps); /* time * sample_rate */
+ /* configure antennas */
if (!set_antennas()) {
LOGC(DDEV, ALERT) << "LMS antenna setting failed";
- return -1;
+ goto out_close;
}
samplesRead = 0;
@@ -281,6 +283,7 @@ bool LMSDevice::start()
if (!do_calib(i))
return false;
+ /* configure Streams */
m_lms_stream_rx[i] = {};
m_lms_stream_rx[i].isTx = false;
m_lms_stream_rx[i].channel = i;