From f17a453de62681141641f1da414bdbed56a2e5a9 Mon Sep 17 00:00:00 2001
From: Niki <niki@aveer.io>
Date: Mon, 13 Jul 2020 21:37:02 -0400
Subject: 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>
---
 gr-uhd/python/uhd/bindings/usrp_block_python.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'gr-uhd/python/uhd/bindings/usrp_block_python.cc')

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))
 
 
-- 
cgit v1.2.3