diff options
author | Josh Blum <josh@joshknows.com> | 2010-06-01 12:23:20 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-06-01 12:23:20 -0700 |
commit | bb1eef8cade6e39532919918ce1168c3e62a54df (patch) | |
tree | 4b8b68cf6a4e464ad82e6cbfa1a48a4a841cd6cc /host/lib/usrp/usrp2 | |
parent | 8c0759df03520f010203fdeb3979f82fc41b72f7 (diff) | |
download | uhd-bb1eef8cade6e39532919918ce1168c3e62a54df.tar.gz uhd-bb1eef8cade6e39532919918ce1168c3e62a54df.tar.bz2 uhd-bb1eef8cade6e39532919918ce1168c3e62a54df.zip |
Moved the packet handler state stuff into a separate header (so we dont pull in all the includes).
Use callback for getting buffers rather than zc interface pointer so its more modular.
Diffstat (limited to 'host/lib/usrp/usrp2')
-rw-r--r-- | host/lib/usrp/usrp2/io_impl.cpp | 14 | ||||
-rw-r--r-- | host/lib/usrp/usrp2/usrp2_impl.hpp | 2 |
2 files changed, 13 insertions, 3 deletions
diff --git a/host/lib/usrp/usrp2/io_impl.cpp b/host/lib/usrp/usrp2/io_impl.cpp index 79b18fb63..5a082bf13 100644 --- a/host/lib/usrp/usrp2/io_impl.cpp +++ b/host/lib/usrp/usrp2/io_impl.cpp @@ -15,11 +15,13 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. // +#include "../../transport/vrt_packet_handler.hpp" #include "usrp2_impl.hpp" #include "usrp2_regs.hpp" #include <uhd/transport/convert_types.hpp> #include <boost/format.hpp> #include <boost/asio.hpp> //htonl and ntohl +#include <boost/bind.hpp> #include <iostream> using namespace uhd; @@ -65,6 +67,10 @@ void usrp2_impl::io_init(void){ /*********************************************************************** * Send Data **********************************************************************/ +static inline managed_send_buffer::sptr get_send_buff(zero_copy_if::sptr zc_if){ + return zc_if->get_send_buff(); +} + size_t usrp2_impl::send( const asio::const_buffer &buff, const tx_metadata_t &metadata, @@ -76,7 +82,7 @@ size_t usrp2_impl::send( buff, metadata, send_mode, //buffer to empty and samples metadata io_type, _tx_otw_type, //input and output types to convert get_master_clock_freq(), //master clock tick rate - _data_transport, //zero copy interface + boost::bind(get_send_buff, _data_transport), get_max_send_samps_per_packet() ); } @@ -84,6 +90,10 @@ size_t usrp2_impl::send( /*********************************************************************** * Receive Data **********************************************************************/ +static inline managed_recv_buffer::sptr get_recv_buff(zero_copy_if::sptr zc_if){ + return zc_if->get_recv_buff(); +} + size_t usrp2_impl::recv( const asio::mutable_buffer &buff, rx_metadata_t &metadata, @@ -95,6 +105,6 @@ size_t usrp2_impl::recv( buff, metadata, recv_mode, //buffer to fill and samples metadata io_type, _rx_otw_type, //input and output types to convert get_master_clock_freq(), //master clock tick rate - _data_transport //zero copy interface + boost::bind(get_recv_buff, _data_transport) ); } diff --git a/host/lib/usrp/usrp2/usrp2_impl.hpp b/host/lib/usrp/usrp2/usrp2_impl.hpp index 7948a2069..6a2a09349 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.hpp +++ b/host/lib/usrp/usrp2/usrp2_impl.hpp @@ -33,7 +33,7 @@ #include <uhd/transport/vrt.hpp> #include <uhd/transport/udp_zero_copy.hpp> #include <uhd/usrp/dboard_manager.hpp> -#include "../../transport/vrt_packet_handler.hpp" +#include "../../transport/vrt_packet_handler_state.hpp" /*! * Make a usrp2 dboard interface. |