aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/device/uhd/UHDDevice.cpp
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-09-13 17:05:02 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2019-09-13 17:34:46 +0200
commit2ab921812e8cb89b8dbce6aab97bca60e632cf31 (patch)
treeee9003d28fdf28b6d8d7a86f5e5e188c8c52348d /Transceiver52M/device/uhd/UHDDevice.cpp
parent752055c7c1c5aedbcab9666e84aa7dd5024544b6 (diff)
radioDevice: Introduce getTxGain() API
It will be used in later commits by radioInterfaceMulti. Change-Id: Ie3caca8971ed1e5370dfed6fb60716a24e7d82a5
Diffstat (limited to 'Transceiver52M/device/uhd/UHDDevice.cpp')
-rw-r--r--Transceiver52M/device/uhd/UHDDevice.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/Transceiver52M/device/uhd/UHDDevice.cpp b/Transceiver52M/device/uhd/UHDDevice.cpp
index 5b38df4..3b59291 100644
--- a/Transceiver52M/device/uhd/UHDDevice.cpp
+++ b/Transceiver52M/device/uhd/UHDDevice.cpp
@@ -310,6 +310,19 @@ double uhd_device::getRxGain(size_t chan)
return rx_gains[chan];
}
+double uhd_device::getTxGain(size_t chan)
+{
+ if (iface == MULTI_ARFCN)
+ chan = 0;
+
+ if (chan >= tx_gains.size()) {
+ LOGC(DDEV, ALERT) << "Requested non-existent channel " << chan;
+ return 0.0f;
+ }
+
+ return tx_gains[chan];
+}
+
/*
Parse the UHD device tree and mboard name to find out what device we're
dealing with. We need the window type so that the transceiver knows how to