diff options
author | Niki <niki@aveer.io> | 2021-01-30 00:12:09 -0500 |
---|---|---|
committer | Martin Braun <martin@gnuradio.org> | 2021-02-01 21:04:53 +0100 |
commit | 53c7a3d195364c08d5ea6476009d76f9ae199bf7 (patch) | |
tree | b76e5692e2dbc1f1514f2a57c1568bb1f10c8ec2 | |
parent | b3cf9da3957962733d3b4ec7979dde97f32e090b (diff) |
uhd: Add direction to mtune
- such that mtune tx_command can tune either transmitter or receiver
Signed-off-by: Niki <niki@aveer.io>
-rw-r--r-- | gr-uhd/lib/usrp_block_impl.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gr-uhd/lib/usrp_block_impl.cc b/gr-uhd/lib/usrp_block_impl.cc index c8073ebd3c..675c466d55 100644 --- a/gr-uhd/lib/usrp_block_impl.cc +++ b/gr-uhd/lib/usrp_block_impl.cc @@ -833,8 +833,8 @@ void usrp_block_impl::_cmd_handler_tune(const pmt::pmt_t& tune, pmt::pmt_t direction = pmt::dict_ref(msg, cmd_direction_key(), - pmt::PMT_NIL // Anything except "TX" or "RX will default to the - // messaged block direction" + pmt::PMT_NIL // Anything except "TX" or "RX" will default to the + // messaged block direction ); double freq = pmt::to_double(pmt::car(tune)); @@ -847,6 +847,14 @@ void usrp_block_impl::_cmd_handler_mtune(const pmt::pmt_t& tune, int chan, const pmt::pmt_t& msg) { + // See if a direction was specified + pmt::pmt_t direction = + pmt::dict_ref(msg, + cmd_direction_key(), + pmt::PMT_NIL // Anything except "TX" or "RX" will default to the + // messaged block direction + ); + ::uhd::tune_request_t new_tune_request; if (pmt::dict_has_key(tune, pmt::mp("dsp_freq"))) { new_tune_request.dsp_freq = @@ -887,7 +895,7 @@ void usrp_block_impl::_cmd_handler_mtune(const pmt::pmt_t& tune, pmt::symbol_to_string(pmt::dict_ref(tune, pmt::mp("args"), pmt::mp("")))); } - _update_curr_tune_req(new_tune_request, chan); + _update_curr_tune_req(new_tune_request, chan, direction); } void usrp_block_impl::_cmd_handler_bw(const pmt::pmt_t& bw, |