summaryrefslogtreecommitdiff
path: root/gr-uhd/lib/usrp_source_impl.cc
diff options
context:
space:
mode:
authorJacob Gilbert <mrjacobagilbert@gmail.com>2017-09-12 13:36:34 -0700
committerJacob Gilbert <mrjacobagilbert@gmail.com>2017-09-12 13:36:34 -0700
commitcfb6e49e33d7f664268000e312367d091a60b9c3 (patch)
treeab10f5c49462e79fb2c6fc02fb26856dbe32d361 /gr-uhd/lib/usrp_source_impl.cc
parent811bee8c54bdca5c53c2ccbc6ef6d1bbca55eaae (diff)
gr-uhd: Added modification to UHD message-based tuning which will allow for timed tune command order to be ensured across TX/RX by enabling tuning of RX path from the sink block or TX path from source block. Doxygen also updated to reflect the new command.
Diffstat (limited to 'gr-uhd/lib/usrp_source_impl.cc')
-rw-r--r--gr-uhd/lib/usrp_source_impl.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/gr-uhd/lib/usrp_source_impl.cc b/gr-uhd/lib/usrp_source_impl.cc
index 23b94c684f..034e8207ba 100644
--- a/gr-uhd/lib/usrp_source_impl.cc
+++ b/gr-uhd/lib/usrp_source_impl.cc
@@ -149,7 +149,17 @@ namespace gr {
return res;
}
- SET_CENTER_FREQ_FROM_INTERNALS(usrp_source_impl, set_rx_freq);
+ ::uhd::tune_result_t
+ usrp_source_impl::_set_center_freq_from_internals(size_t chan, pmt::pmt_t direction)
+ {
+ _chans_to_tune.reset(chan);
+ if (pmt::eqv(direction, pmt::mp("TX"))) {
+ // TODO: what happens if the TX device is not instantiated? Catch error?
+ return _dev->set_tx_freq(_curr_tune_req[chan], _stream_args.channels[chan]);
+ } else {
+ return _dev->set_rx_freq(_curr_tune_req[chan], _stream_args.channels[chan]);
+ }
+ }
double
usrp_source_impl::get_center_freq(size_t chan)
@@ -534,7 +544,7 @@ namespace gr {
_rx_stream->recv(outputs, nbytes/bpi, _metadata, 0.0);
else
// no rx streamer -- nothing to flush
- break;
+ break;
#else
_dev->get_device()->recv
(outputs, nbytes/_type->size, _metadata, *_type,