diff options
author | Alexander Chemeris <Alexander.Chemeris@gmail.com> | 2015-05-17 23:25:57 -0400 |
---|---|---|
committer | Tom Tsou <tom.tsou@ettus.com> | 2015-07-30 14:25:17 -0700 |
commit | c4eab8795f79910c72f2153900d5af1e3feda813 (patch) | |
tree | 03b62eee54cd416a4b30ecb187772bc5815a90b0 | |
parent | cc6f79b1c01d317cb398ac0d9bf3fc12dfe60435 (diff) |
uhd: Output Rx/Tx gain limits to log to make it more transparent.
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
-rw-r--r-- | Transceiver52M/UHDDevice.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index b49b1be..2b258ef 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -472,18 +472,24 @@ void uhd_device::init_gains() tx_gain_min = range.start(); tx_gain_max = range.stop(); } + LOG(INFO) << "Supported Tx gain range [" << tx_gain_min << "; " << tx_gain_max << "]"; range = usrp_dev->get_rx_gain_range(); rx_gain_min = range.start(); rx_gain_max = range.stop(); + LOG(INFO) << "Supported Rx gain range [" << rx_gain_min << "; " << rx_gain_max << "]"; for (size_t i = 0; i < tx_gains.size(); i++) { - usrp_dev->set_tx_gain((tx_gain_min + tx_gain_max) / 2, i); + double gain = (tx_gain_min + tx_gain_max) / 2; + LOG(INFO) << "Default setting Tx gain for channel " << i << " to " << gain; + usrp_dev->set_tx_gain(gain, i); tx_gains[i] = usrp_dev->get_tx_gain(i); } for (size_t i = 0; i < rx_gains.size(); i++) { - usrp_dev->set_rx_gain((rx_gain_min + rx_gain_max) / 2, i); + double gain = (rx_gain_min + rx_gain_max) / 2; + LOG(INFO) << "Default setting Rx gain for channel " << i << " to " << gain; + usrp_dev->set_rx_gain(gain, i); rx_gains[i] = usrp_dev->get_rx_gain(i); } @@ -581,7 +587,7 @@ double uhd_device::setTxGain(double db, size_t chan) tx_gains[chan] = usrp_dev->get_tx_gain(chan); - LOG(INFO) << "Set TX gain to " << tx_gains[chan] << "dB"; + LOG(INFO) << "Set TX gain to " << tx_gains[chan] << "dB (asked for " << db << "dB)"; return tx_gains[chan]; } @@ -596,7 +602,7 @@ double uhd_device::setRxGain(double db, size_t chan) usrp_dev->set_rx_gain(db, chan); rx_gains[chan] = usrp_dev->get_rx_gain(chan); - LOG(INFO) << "Set RX gain to " << rx_gains[chan] << "dB"; + LOG(INFO) << "Set RX gain to " << rx_gains[chan] << "dB (asked for " << db << "dB)"; return rx_gains[chan]; } |