aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
Diffstat (limited to 'host')
-rw-r--r--host/lib/usrp/usrp2/usrp2_impl.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp b/host/lib/usrp/usrp2/usrp2_impl.cpp
index 45db0d081..9a8269e6f 100644
--- a/host/lib/usrp/usrp2/usrp2_impl.cpp
+++ b/host/lib/usrp/usrp2/usrp2_impl.cpp
@@ -86,11 +86,17 @@ static device_addrs_t usrp2_find(const device_addr_t &hint_){
return usrp2_addrs;
}
- //create a udp transport to communicate
- std::string ctrl_port = boost::lexical_cast<std::string>(USRP2_UDP_CTRL_PORT);
- udp_simple::sptr udp_transport = udp_simple::make_broadcast(
- hint["addr"], ctrl_port
- );
+ //Create a UDP transport to communicate:
+ //Some devices will cause a throw when opened for a broadcast address.
+ //We print and recover so the caller can loop through all bcast addrs.
+ udp_simple::sptr udp_transport;
+ try{
+ udp_transport = udp_simple::make_broadcast(hint["addr"], BOOST_STRINGIZE(USRP2_UDP_CTRL_PORT));
+ }
+ catch(const std::exception &e){
+ UHD_MSG(error) << boost::format("Cannot open UDP transport on %s\n%s") % hint["addr"] % e.what() << std::endl;
+ return usrp2_addrs; //dont throw, but return empty address so caller can insert
+ }
//send a hello control packet
usrp2_ctrl_data_t ctrl_data_out = usrp2_ctrl_data_t();
@@ -277,6 +283,12 @@ usrp2_impl::usrp2_impl(const device_addr_t &_device_addr){
device_addr["recv_buff_size"] = "50e6";
#endif
}
+ if (not device_addr.has_key("send_buff_size")){
+ #if defined(UHD_PLATFORM_WIN32)
+ //a large send buff is ok to have on windows
+ device_addr["send_buff_size"] = "50e6";
+ #endif
+ }
device_addrs_t device_args = separate_device_addr(device_addr);