diff options
author | Josh Blum <josh@joshknows.com> | 2010-04-29 06:29:54 +0000 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-04-29 06:29:54 +0000 |
commit | ef678a479cc4d4d60e16300e8654d19ebb6e43f0 (patch) | |
tree | da968df0580f1043b353d76ed550a56b35864974 /host/lib/usrp | |
parent | 4e97e9c4845814994e1e9d3deabb5abd4d177738 (diff) | |
parent | c7df3878779cf461cef01d910e6c52c7ac3e1105 (diff) | |
download | uhd-ef678a479cc4d4d60e16300e8654d19ebb6e43f0.tar.gz uhd-ef678a479cc4d4d60e16300e8654d19ebb6e43f0.tar.bz2 uhd-ef678a479cc4d4d60e16300e8654d19ebb6e43f0.zip |
Merge branch 'master' of git@ettus.sourcerepo.com:ettus/uhdpriv into usrp_e
Diffstat (limited to 'host/lib/usrp')
-rw-r--r-- | host/lib/usrp/usrp2/usrp2_impl.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp index 4079357f9..1dde8c054 100644 --- a/host/lib/usrp/usrp2/usrp2_impl.cpp +++ b/host/lib/usrp/usrp2/usrp2_impl.cpp @@ -24,6 +24,7 @@ #include <boost/assign/list_of.hpp> #include <boost/format.hpp> #include <boost/foreach.hpp> +#include <boost/lexical_cast.hpp> #include <boost/bind.hpp> #include <boost/asio.hpp> //htonl and ntohl #include <iostream> @@ -50,7 +51,7 @@ uhd::device_addrs_t usrp2::find(const device_addr_t &hint){ if (if_addrs.inet == asio::ip::address_v4::loopback().to_string()) continue; //create a new hint with this broadcast address - device_addr_t new_hint = hint; + device_addr_t new_hint; new_hint["addr"] = if_addrs.bcast; //call discover with the new hint and append results @@ -112,9 +113,21 @@ device::sptr usrp2::make(const device_addr_t &device_addr){ device_addr["addr"], num2str(USRP2_UDP_CTRL_PORT) ); + //extract the receive and send buffer sizes + size_t recv_buff_size = 0, send_buff_size= 0 ; + if (device_addr.has_key("recv_buff_size")){ + recv_buff_size = size_t(boost::lexical_cast<double>(device_addr["recv_buff_size"])); + } + if (device_addr.has_key("send_buff_size")){ + send_buff_size = size_t(boost::lexical_cast<double>(device_addr["send_buff_size"])); + } + //create a data transport udp_zero_copy::sptr data_transport = udp_zero_copy::make( - device_addr["addr"], num2str(USRP2_UDP_DATA_PORT) + device_addr["addr"], + num2str(USRP2_UDP_DATA_PORT), + recv_buff_size, + send_buff_size ); //create the usrp2 implementation guts |