aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/usrp2/usrp2_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp/usrp2/usrp2_impl.cpp')
-rw-r--r--host/lib/usrp/usrp2/usrp2_impl.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp
index a680708ad..afc69f703 100644
--- a/host/lib/usrp/usrp2/usrp2_impl.cpp
+++ b/host/lib/usrp/usrp2/usrp2_impl.cpp
@@ -17,7 +17,7 @@
#include "usrp2_impl.hpp"
#include <uhd/transport/if_addrs.hpp>
-#include <uhd/transport/udp_simple.hpp>
+#include <uhd/transport/udp_zero_copy.hpp>
#include <uhd/usrp/device_props.hpp>
#include <uhd/utils/assert.hpp>
#include <uhd/utils/static.hpp>
@@ -35,9 +35,6 @@ using namespace uhd::usrp;
using namespace uhd::transport;
namespace asio = boost::asio;
-//! wait this long for a control response when discovering devices
-static const size_t DISCOVERY_TIMEOUT_MS = 100;
-
/***********************************************************************
* Helper Functions
**********************************************************************/
@@ -99,7 +96,7 @@ static uhd::device_addrs_t usrp2_find(const device_addr_t &hint){
boost::uint8_t usrp2_ctrl_data_in_mem[udp_simple::mtu]; //allocate max bytes for recv
const usrp2_ctrl_data_t *ctrl_data_in = reinterpret_cast<const usrp2_ctrl_data_t *>(usrp2_ctrl_data_in_mem);
while(true){
- size_t len = udp_transport->recv(asio::buffer(usrp2_ctrl_data_in_mem), DISCOVERY_TIMEOUT_MS);
+ size_t len = udp_transport->recv(asio::buffer(usrp2_ctrl_data_in_mem));
//std::cout << len << "\n";
if (len > offsetof(usrp2_ctrl_data_t, data)){
//handle the received data
@@ -128,7 +125,7 @@ static device::sptr usrp2_make(const device_addr_t &device_addr){
//create a ctrl and data transport for each address
std::vector<udp_simple::sptr> ctrl_transports;
- std::vector<udp_zero_copy::sptr> data_transports;
+ std::vector<zero_copy_if::sptr> data_transports;
BOOST_FOREACH(const std::string &addr, std::split_string(device_addr["addr"])){
ctrl_transports.push_back(udp_simple::make_connected(
@@ -141,7 +138,7 @@ static device::sptr usrp2_make(const device_addr_t &device_addr){
//create the usrp2 implementation guts
return device::sptr(
- new usrp2_impl(ctrl_transports, data_transports)
+ new usrp2_impl(ctrl_transports, data_transports, device_addr)
);
}
@@ -154,7 +151,8 @@ UHD_STATIC_BLOCK(register_usrp2_device){
**********************************************************************/
usrp2_impl::usrp2_impl(
std::vector<udp_simple::sptr> ctrl_transports,
- std::vector<udp_zero_copy::sptr> data_transports
+ std::vector<zero_copy_if::sptr> data_transports,
+ const device_addr_t &flow_control_hints
):
_data_transports(data_transports)
{
@@ -173,7 +171,9 @@ usrp2_impl::usrp2_impl(
//create a new mboard handler for each control transport
for(size_t i = 0; i < ctrl_transports.size(); i++){
_mboards.push_back(usrp2_mboard_impl::sptr(new usrp2_mboard_impl(
- i, ctrl_transports[i], this->get_max_recv_samps_per_packet()
+ i, ctrl_transports[i], data_transports[i],
+ this->get_max_recv_samps_per_packet(),
+ flow_control_hints
)));
//use an empty name when there is only one mboard
std::string name = (ctrl_transports.size() > 1)? boost::lexical_cast<std::string>(i) : "";