diff options
authorPau Espin Pedrol <pespin@sysmocom.de>2018-11-01 18:30:12 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2018-11-19 11:47:37 +0100
commit1c4bbadda63e91fec4ae0a4134a22b299025a769 (patch)
parent08dfe237c83a37440da00cb75e2882f21feaf18f (diff)
UHDDevice: setRxGain on chan 0 when using multi-arfcn
When using multi-arfcn feature, several logical channels (arfcn) are multiplxed into one physical transceiver, as can be seen in uhd_device::set_channels. As a result, when multi-arfcn is enabled some properties are actually shared for those logical channels, and internally mapped to the first (only existing) channel, and per-channel internal array variables are allocated accordingly (size() == 1). When setting RxGain, we need to set the correct existing physical channel. Same check is done in getRxGain, and then we apply the RxGain correctly and we avoid outputing an error "Requested non-existent channel" immediatelly after. Change-Id: I5b02bb1ef6450dc48be7b8058d96a5691847d3cc
1 files changed, 3 insertions, 0 deletions
diff --git a/Transceiver52M/device/uhd/UHDDevice.cpp b/Transceiver52M/device/uhd/UHDDevice.cpp
index c30f3a7..3db09a8 100644
--- a/Transceiver52M/device/uhd/UHDDevice.cpp
+++ b/Transceiver52M/device/uhd/UHDDevice.cpp
@@ -486,6 +486,9 @@ double uhd_device::setTxGain(double db, size_t chan)
double uhd_device::setRxGain(double db, size_t chan)
+ if (iface == MULTI_ARFCN)
+ chan = 0;
if (chan >= rx_gains.size()) {
LOGC(DDEV, ALERT) << "Requested non-existent channel " << chan;
return 0.0f;