summaryrefslogtreecommitdiff
path: root/gr-uhd/python/uhd/bindings/usrp_block_python.cc
diff options
context:
space:
mode:
authorNiki <niki@aveer.io>2020-07-13 21:37:02 -0400
committerMartin Braun <martin@gnuradio.org>2021-01-24 10:57:00 -0800
commitf17a453de62681141641f1da414bdbed56a2e5a9 (patch)
tree24265e90ac1801b074f2bc73658773534038e3be /gr-uhd/python/uhd/bindings/usrp_block_python.cc
parentc40e82ae17a9dfefc95b15ab22eaf8dbf1a45d29 (diff)
uhd: Control of frequency and gain in both directions at the same moment
It implements the ability to control frequency and gain in both directions (Tx and Rx) with use of a single UHD source or sink - in the same moment. It is possible to do that in separate moments with current UHD blocks but this way it is not possible to change both Rx and Tx settings for the same burst. Now, a single message can do that. Note that there is a bit of an oddity here: The GNU Radio USRP blocks are either Rx or Tx (source or sink). However, they all encapsulate an underlying multi_usrp object. That means that under the hood, a USRP source or a USRP sink potentially has access to the "other" direction. This is made use in this patch. To use this feature, add a direction key to the message dictionary going to the block. Signed-off-by: Martin Braun <martin@gnuradio.org>
Diffstat (limited to 'gr-uhd/python/uhd/bindings/usrp_block_python.cc')
-rw-r--r--gr-uhd/python/uhd/bindings/usrp_block_python.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gr-uhd/python/uhd/bindings/usrp_block_python.cc b/gr-uhd/python/uhd/bindings/usrp_block_python.cc
index 09d164195e..2df8d931b4 100644
--- a/gr-uhd/python/uhd/bindings/usrp_block_python.cc
+++ b/gr-uhd/python/uhd/bindings/usrp_block_python.cc
@@ -90,9 +90,10 @@ void bind_usrp_block(py::module& m)
.def("set_gain",
- (void (usrp_block::*)(double, size_t)) & usrp_block::set_gain,
+ (void (usrp_block::*)(double, size_t, pmt::pmt_t)) & usrp_block::set_gain,
py::arg("gain"),
py::arg("chan") = 0,
+ py::arg("direction") = pmt::PMT_NIL,
D(usrp_block, set_gain, 0))