aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/device/lms
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-01-13 16:00:04 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2020-01-13 16:13:28 +0100
commitb0e54265ad3407375f98999d7cdcebfc51320443 (patch)
tree2d1b8918dc52d5bc7b880f78dd5bc1cb51d59c03 /Transceiver52M/device/lms
parent62c92805903b992493f7e435823011f7b11dcc34 (diff)
lms: Change radioDevice constructor arg name to avoid masking instance attr
channel number mangling based on multi-arfcn feature being enabled was moved to generic radioDevice() to reuse code. Hence, the generic parent constructor sets this->chans to 1 if multi-arfcn feature is requested. However, LMSDevice constructor argument had same name as the class instance attribute, taking preference. As a result, if multi-arfcn is enabled in LMSDevice, the generic constructor first sets this->chans=1 but afterwards LMSDEvice constructor keeps calling .resize() with the argument value "chans" instead of using this->chans. Let's rename the argument in all radioDevice child class constructors to avoid potential future bugs in all of them. Change-Id: Id6c837e9133f22783dd92a81dfcc493e51bf2d21
Diffstat (limited to 'Transceiver52M/device/lms')
-rw-r--r--Transceiver52M/device/lms/LMSDevice.cpp4
-rw-r--r--Transceiver52M/device/lms/LMSDevice.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/Transceiver52M/device/lms/LMSDevice.cpp b/Transceiver52M/device/lms/LMSDevice.cpp
index 3a10983..cb0129a 100644
--- a/Transceiver52M/device/lms/LMSDevice.cpp
+++ b/Transceiver52M/device/lms/LMSDevice.cpp
@@ -44,10 +44,10 @@ using namespace std;
#define LMS_CALIBRATE_BW_HZ OSMO_MAX(GSM_CARRIER_BW, LMS_MIN_BW_SUPPORTED)
#define SAMPLE_BUF_SZ (1 << 20) /* Size of Rx timestamp based Ring buffer, in bytes */
-LMSDevice::LMSDevice(size_t tx_sps, size_t rx_sps, InterfaceType iface, size_t chans, double lo_offset,
+LMSDevice::LMSDevice(size_t tx_sps, size_t rx_sps, InterfaceType iface, size_t chan_num, double lo_offset,
const std::vector<std::string>& tx_paths,
const std::vector<std::string>& rx_paths):
- RadioDevice(tx_sps, rx_sps, iface, chans, lo_offset, tx_paths, rx_paths),
+ RadioDevice(tx_sps, rx_sps, iface, chan_num, lo_offset, tx_paths, rx_paths),
m_lms_dev(NULL), started(false)
{
LOGC(DDEV, INFO) << "creating LMS device...";
diff --git a/Transceiver52M/device/lms/LMSDevice.h b/Transceiver52M/device/lms/LMSDevice.h
index 003d064..cdba72c 100644
--- a/Transceiver52M/device/lms/LMSDevice.h
+++ b/Transceiver52M/device/lms/LMSDevice.h
@@ -72,7 +72,7 @@ private:
public:
/** Object constructor */
- LMSDevice(size_t tx_sps, size_t rx_sps, InterfaceType iface, size_t chans, double lo_offset,
+ LMSDevice(size_t tx_sps, size_t rx_sps, InterfaceType iface, size_t chan_num, double lo_offset,
const std::vector<std::string>& tx_paths,
const std::vector<std::string>& rx_paths);
~LMSDevice();