diff options
Diffstat (limited to 'gr-uhd/lib/usrp_sink_impl.h')
-rw-r--r-- | gr-uhd/lib/usrp_sink_impl.h | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/gr-uhd/lib/usrp_sink_impl.h b/gr-uhd/lib/usrp_sink_impl.h index c714eb53eb..12a25658e3 100644 --- a/gr-uhd/lib/usrp_sink_impl.h +++ b/gr-uhd/lib/usrp_sink_impl.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2010-2013 Free Software Foundation, Inc. + * Copyright 2010-2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -26,6 +26,8 @@ static const pmt::pmt_t SOB_KEY = pmt::string_to_symbol("tx_sob"); static const pmt::pmt_t EOB_KEY = pmt::string_to_symbol("tx_eob"); static const pmt::pmt_t TIME_KEY = pmt::string_to_symbol("tx_time"); +static const pmt::pmt_t FREQ_KEY = pmt::string_to_symbol("tx_freq"); +static const pmt::pmt_t COMMAND_KEY = pmt::string_to_symbol("tx_command"); namespace gr { namespace uhd { @@ -53,7 +55,8 @@ namespace gr { { public: usrp_sink_impl(const ::uhd::device_addr_t &device_addr, - const ::uhd::stream_args_t &stream_args); + const ::uhd::stream_args_t &stream_args, + const std::string &length_tag_name); ~usrp_sink_impl(); void setup_rpc(); @@ -119,6 +122,15 @@ namespace gr { inline void tag_work(int &ninput_items); private: + //! Like set_center_freq(), but uses _curr_freq and _curr_lo_offset + ::uhd::tune_result_t _set_center_freq_from_internals(size_t chan); + //! Calls _set_center_freq_from_internals() on all channels + void _set_center_freq_from_internals_allchans(); + //! Receives commands and handles them + void msg_handler_command(pmt::pmt_t msg); + //! Receives queries and posts a response + void msg_handler_query(pmt::pmt_t msg); + ::uhd::usrp::multi_usrp::sptr _dev; const ::uhd::stream_args_t _stream_args; boost::shared_ptr< ::uhd::io_type_t > _type; @@ -135,6 +147,20 @@ namespace gr { //stream tags related stuff std::vector<tag_t> _tags; + const pmt::pmt_t _length_tag_key; + long _nitems_to_send; + + //! Stores 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!). + // We could theoretically ask the device, but during streaming, we want to minimize + // communication with the USRP. + std::vector<double> _curr_freq; + //! Stores the last value we told the USRP to have the LO offset for every channel. + std::vector<double> _curr_lo_offset; + //! Stores the last gain value we told the USRP to have for every channel. + std::vector<double> _curr_gain; + std::vector<bool> _chans_to_tune; + bool _call_tune; }; } /* namespace uhd */ |