From abed04b3c6d70c260d8725831b8aa6e944f52749 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Tue, 4 Oct 2011 09:56:11 -0700 Subject: uhd: restored super packet handler functionality --- host/include/uhd/device.hpp | 4 ++-- host/include/uhd/device_deprecated.ipp | 36 +++++++++++++++++----------------- host/include/uhd/streamer.hpp | 16 +++++++-------- 3 files changed, 28 insertions(+), 28 deletions(-) (limited to 'host/include') diff --git a/host/include/uhd/device.hpp b/host/include/uhd/device.hpp index 47afe7dc6..f76739907 100644 --- a/host/include/uhd/device.hpp +++ b/host/include/uhd/device.hpp @@ -77,10 +77,10 @@ public: static sptr make(const device_addr_t &hint, size_t which = 0); //! Make a new receive streamer given the list of channels - virtual recv_streamer::sptr get_recv_streamer(const std::vector &channels) = 0; + virtual rx_streamer::sptr get_rx_streamer(const std::vector &channels) = 0; //! Make a new transmit streamer given the list of channels - virtual send_streamer::sptr get_send_streamer(const std::vector &channels) = 0; + virtual tx_streamer::sptr get_tx_streamer(const std::vector &channels) = 0; /*! * Receive and asynchronous message from the device. diff --git a/host/include/uhd/device_deprecated.ipp b/host/include/uhd/device_deprecated.ipp index 4b8ec0037..ba0edb1bc 100644 --- a/host/include/uhd/device_deprecated.ipp +++ b/host/include/uhd/device_deprecated.ipp @@ -77,21 +77,21 @@ size_t send( send_mode_t send_mode, double timeout = 0.1 ){ - if (_send_streamer.get() == NULL or _send_streamer->get_num_channels() != buffs.size()){ + if (_tx_streamer.get() == NULL or _tx_streamer->get_num_channels() != buffs.size()){ std::vector chans(buffs.size()); for (size_t ch = 0; ch < chans.size(); ch++) chans[ch] = ch; - _send_streamer.reset(); //cleanup possible old one - _send_streamer = get_send_streamer(chans); + _tx_streamer.reset(); //cleanup possible old one + _tx_streamer = get_tx_streamer(chans); _send_tid = io_type_t::CUSTOM_TYPE; } if (io_type.tid != _send_tid){ _send_tid = io_type.tid; - _send_streamer->set_format((_send_tid == io_type_t::COMPLEX_FLOAT32)? "fc32" : "sc16", "sc16"); + _tx_streamer->set_format((_send_tid == io_type_t::COMPLEX_FLOAT32)? "fc32" : "sc16", "sc16"); } const size_t nsamps = (send_mode == SEND_MODE_ONE_PACKET)? std::min(nsamps_per_buff, get_max_send_samps_per_packet()) : nsamps_per_buff; - return _send_streamer->send(buffs, nsamps, metadata, timeout); + return _tx_streamer->send(buffs, nsamps, metadata, timeout); } /*! @@ -133,21 +133,21 @@ size_t recv( recv_mode_t recv_mode, double timeout = 0.1 ){ - if (_recv_streamer.get() == NULL or _recv_streamer->get_num_channels() != buffs.size()){ + if (_rx_streamer.get() == NULL or _rx_streamer->get_num_channels() != buffs.size()){ std::vector chans(buffs.size()); for (size_t ch = 0; ch < chans.size(); ch++) chans[ch] = ch; - _recv_streamer.reset(); //cleanup possible old one - _recv_streamer = get_recv_streamer(chans); + _rx_streamer.reset(); //cleanup possible old one + _rx_streamer = get_rx_streamer(chans); _recv_tid = io_type_t::CUSTOM_TYPE; } if (io_type.tid != _recv_tid){ _recv_tid = io_type.tid; - _recv_streamer->set_format((_recv_tid == io_type_t::COMPLEX_FLOAT32)? "fc32" : "sc16", "sc16"); + _rx_streamer->set_format((_recv_tid == io_type_t::COMPLEX_FLOAT32)? "fc32" : "sc16", "sc16"); } const size_t nsamps = (recv_mode == RECV_MODE_ONE_PACKET)? std::min(nsamps_per_buff, get_max_recv_samps_per_packet()) : nsamps_per_buff; - return _recv_streamer->recv(buffs, nsamps, metadata, timeout); + return _rx_streamer->recv(buffs, nsamps, metadata, timeout); } /*! @@ -155,11 +155,11 @@ size_t recv( * \return the number of samples */ size_t get_max_send_samps_per_packet(void){ - if (_send_streamer.get() == NULL){ + if (_tx_streamer.get() == NULL){ std::vector chans(1, 0); - _send_streamer = get_send_streamer(chans); + _tx_streamer = get_tx_streamer(chans); } - return _send_streamer->get_items_per_packet(); + return _tx_streamer->get_items_per_packet(); } /*! @@ -167,15 +167,15 @@ size_t get_max_send_samps_per_packet(void){ * \return the number of samples */ size_t get_max_recv_samps_per_packet(void){ - if (_recv_streamer.get() == NULL){ + if (_rx_streamer.get() == NULL){ std::vector chans(1, 0); - _recv_streamer = get_recv_streamer(chans); + _rx_streamer = get_rx_streamer(chans); } - return _recv_streamer->get_items_per_packet(); + return _rx_streamer->get_items_per_packet(); } private: - recv_streamer::sptr _recv_streamer; + rx_streamer::sptr _rx_streamer; io_type_t::tid_t _recv_tid; - send_streamer::sptr _send_streamer; + tx_streamer::sptr _tx_streamer; io_type_t::tid_t _send_tid; diff --git a/host/include/uhd/streamer.hpp b/host/include/uhd/streamer.hpp index dfbe15ec3..d96eeb2b7 100644 --- a/host/include/uhd/streamer.hpp +++ b/host/include/uhd/streamer.hpp @@ -90,12 +90,12 @@ public: }; //! A receive streamer to receive host samples -class UHD_API recv_streamer : public streamer{ +class UHD_API rx_streamer : public streamer{ public: - typedef boost::shared_ptr sptr; + typedef boost::shared_ptr sptr; //! Typedef for a pointer to a single, or a collection of recv buffers - typedef ref_vector recv_buffs_type; + typedef ref_vector buffs_type; /*! * Receive buffers containing samples described by the metadata. @@ -123,7 +123,7 @@ public: * \return the number of samples received or 0 on error */ virtual size_t recv( - const recv_buffs_type &buffs, + const buffs_type &buffs, size_t nsamps_per_buff, rx_metadata_t &metadata, double timeout = 0.1 @@ -131,12 +131,12 @@ public: }; //! A transmit streamer to send host samples -class UHD_API send_streamer : public streamer{ +class UHD_API tx_streamer : public streamer{ public: - typedef boost::shared_ptr sptr; + typedef boost::shared_ptr sptr; //! Typedef for a pointer to a single, or a collection of send buffers - typedef ref_vector send_buffs_type; + typedef ref_vector buffs_type; /*! * Send buffers containing samples described by the metadata. @@ -160,7 +160,7 @@ public: * \return the number of samples sent */ virtual size_t send( - const send_buffs_type &buffs, + const buffs_type &buffs, size_t nsamps_per_buff, const tx_metadata_t &metadata, double timeout = 0.1 -- cgit v1.2.3