aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/io_impl.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-06-01 12:23:20 -0700
committerJosh Blum <josh@joshknows.com>2010-06-01 12:23:20 -0700
commitbb1eef8cade6e39532919918ce1168c3e62a54df (patch)
tree4b8b68cf6a4e464ad82e6cbfa1a48a4a841cd6cc /host/lib/usrp/usrp2/io_impl.cpp
parent8c0759df03520f010203fdeb3979f82fc41b72f7 (diff)
downloaduhd-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/io_impl.cpp')
-rw-r--r--host/lib/usrp/usrp2/io_impl.cpp14
1 files changed, 12 insertions, 2 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)
);
}