diff options
author | Josh Blum <josh@joshknows.com> | 2011-10-06 09:26:40 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-11-07 18:56:27 -0800 |
commit | 5b0ae93c8f319bbc367254172719d40f11a0f55b (patch) | |
tree | 3e6decdae54ee512bdce605090e858623813c62b /gr-uhd/include | |
parent | 24d572bc56f265f99b1994cd031df6bd15607ff3 (diff) |
uhd: backwards compat work which support streamer API
Diffstat (limited to 'gr-uhd/include')
-rw-r--r-- | gr-uhd/include/gr_uhd_usrp_sink.h | 45 | ||||
-rw-r--r-- | gr-uhd/include/gr_uhd_usrp_source.h | 43 |
2 files changed, 87 insertions, 1 deletions
diff --git a/gr-uhd/include/gr_uhd_usrp_sink.h b/gr-uhd/include/gr_uhd_usrp_sink.h index f11d00063b..e3d21226a6 100644 --- a/gr-uhd/include/gr_uhd_usrp_sink.h +++ b/gr-uhd/include/gr_uhd_usrp_sink.h @@ -26,6 +26,20 @@ #include <gr_sync_block.h> #include <uhd/usrp/multi_usrp.hpp> +#ifndef INCLUDED_UHD_STREAM_HPP +namespace uhd{ + struct GR_UHD_API stream_args_t{ + std::string cpu_format; + std::string otw_format; + std::string args; + std::vector<size_t> channels; + }; +} +# define INCLUDED_UHD_STREAM_HPP +#else +# define GR_UHD_USE_STREAM_API +#endif + class uhd_usrp_sink; /*! @@ -62,6 +76,37 @@ GR_UHD_API boost::shared_ptr<uhd_usrp_sink> uhd_make_usrp_sink( size_t num_channels ); +/*! + * \brief Make a new USRP sink block. + * + * The USRP sink block reads a stream and transmits the samples. + * The sink block also provides API calls for transmitter settings. + * + * TX Stream tagging: + * + * The following tag keys will be consumed by the work function: + * - pmt::pmt_string_to_symbol("tx_sob") + * - pmt::pmt_string_to_symbol("tx_eob") + * - pmt::pmt_string_to_symbol("tx_time") + * + * The sob and eob (start and end of burst) tag values are pmt booleans. + * When present, burst tags should be set to true (pmt::PMT_T). + * + * The timstamp tag value is a pmt tuple of the following: + * (uint64 seconds, and double fractional seconds). + * + * See the UHD manual for more detailed documentation: + * http://code.ettus.com/redmine/ettus/projects/uhd/wiki + * + * \param device_addr the address to identify the hardware + * \param stream_args the IO format and channel specification + * \return a new USRP sink block object + */ +GR_UHD_API boost::shared_ptr<uhd_usrp_sink> uhd_make_usrp_sink( + const uhd::device_addr_t &device_addr, + const uhd::stream_args_t &stream_args +); + class GR_UHD_API uhd_usrp_sink : virtual public gr_sync_block{ public: diff --git a/gr-uhd/include/gr_uhd_usrp_source.h b/gr-uhd/include/gr_uhd_usrp_source.h index fecc6e94d3..b194ba4a31 100644 --- a/gr-uhd/include/gr_uhd_usrp_source.h +++ b/gr-uhd/include/gr_uhd_usrp_source.h @@ -26,6 +26,20 @@ #include <gr_sync_block.h> #include <uhd/usrp/multi_usrp.hpp> +#ifndef INCLUDED_UHD_STREAM_HPP +namespace uhd{ + struct GR_UHD_API stream_args_t{ + std::string cpu_format; + std::string otw_format; + std::string args; + std::vector<size_t> channels; + }; +} +# define INCLUDED_UHD_STREAM_HPP +#else +# define GR_UHD_USE_STREAM_API +#endif + class uhd_usrp_source; /*! @@ -55,7 +69,34 @@ class uhd_usrp_source; GR_UHD_API boost::shared_ptr<uhd_usrp_source> uhd_make_usrp_source( const uhd::device_addr_t &device_addr, const uhd::io_type_t &io_type, - size_t num_channels + size_t num_channels = 1 +); + +/*! + * \brief Make a new USRP source block. + * + * The USRP source block receives samples and writes to a stream. + * The source block also provides API calls for receiver settings. + * + * RX Stream tagging: + * + * The following tag keys will be produced by the work function: + * - pmt::pmt_string_to_symbol("rx_time") + * + * The timstamp tag value is a pmt tuple of the following: + * (uint64 seconds, and double fractional seconds). + * A timestamp tag is produced at start() and after overflows. + * + * See the UHD manual for more detailed documentation: + * http://code.ettus.com/redmine/ettus/projects/uhd/wiki + * + * \param device_addr the address to identify the hardware + * \param stream_args the IO format and channel specification + * \return a new USRP source block object + */ +GR_UHD_API boost::shared_ptr<uhd_usrp_source> uhd_make_usrp_source( + const uhd::device_addr_t &device_addr, + const uhd::stream_args_t &stream_args ); class GR_UHD_API uhd_usrp_source : virtual public gr_sync_block{ |