summaryrefslogtreecommitdiff
path: root/gr-uhd/lib/usrp_block_impl.h
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/lib/usrp_block_impl.h
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/lib/usrp_block_impl.h')
-rw-r--r--gr-uhd/lib/usrp_block_impl.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/gr-uhd/lib/usrp_block_impl.h b/gr-uhd/lib/usrp_block_impl.h
index 51f06135e6..7c3ae56d3a 100644
--- a/gr-uhd/lib/usrp_block_impl.h
+++ b/gr-uhd/lib/usrp_block_impl.h
@@ -141,7 +141,9 @@ protected:
void _update_stream_args(const ::uhd::stream_args_t& stream_args_);
// should be const, doesn't work though 'cause missing operator=() for tune_request_t
- void _update_curr_tune_req(::uhd::tune_request_t& tune_req, int chan);
+ void _update_curr_tune_req(::uhd::tune_request_t& tune_req,
+ int chan,
+ pmt::pmt_t direction = pmt::PMT_NIL);
/*! \brief Wait until a timeout or a sensor returns 'locked'.
*
@@ -204,7 +206,7 @@ protected:
_set_center_freq_from_internals(size_t chan, pmt::pmt_t direction) = 0;
//! Calls _set_center_freq_from_internals() on all channels
- void _set_center_freq_from_internals_allchans(pmt::pmt_t direction);
+ void _set_center_freq_from_internals_allchans();
/**********************************************************************
* Members
@@ -224,8 +226,10 @@ protected:
std::vector<pmt::pmt_t> _pending_cmds;
//! Shadows the last value we told the USRP to tune to for every channel
// (this is not necessarily the true value the USRP is currently tuned to!).
- std::vector<::uhd::tune_request_t> _curr_tune_req;
- boost::dynamic_bitset<> _chans_to_tune;
+ std::vector<::uhd::tune_request_t> _curr_tx_tune_req;
+ std::vector<::uhd::tune_request_t> _curr_rx_tune_req;
+ boost::dynamic_bitset<> _tx_chans_to_tune;
+ boost::dynamic_bitset<> _rx_chans_to_tune;
//! Stores the individual command handlers
::uhd::dict<pmt::pmt_t, cmd_handler_t> _msg_cmd_handlers;