From 834c33179d7407548c6b2345a7dde5f72a538b13 Mon Sep 17 00:00:00 2001 From: Derek Kozel Date: Thu, 25 Feb 2016 16:53:27 -0800 Subject: Enable multiple programs to use USB USRPs on Windows Window's WinUSB driver doesn't support multiple processes accessing a single USB device and libusb_open returns LIBUSB_ACCESS_ERROR when trying to access an already claimed USRP. One device access did not catch this exception and caused UHD to error during USRP discovery. --- host/lib/usrp/b200/b200_impl.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/host/lib/usrp/b200/b200_impl.cpp b/host/lib/usrp/b200/b200_impl.cpp index 38709bbb3..200d99aee 100644 --- a/host/lib/usrp/b200/b200_impl.cpp +++ b/host/lib/usrp/b200/b200_impl.cpp @@ -343,10 +343,12 @@ b200_impl::b200_impl(const uhd::device_addr_t& device_addr, usb_device_handle::s //locate the matching handle in the device list BOOST_FOREACH(usb_device_handle::sptr dev_handle, device_list) { - if (dev_handle->get_serial() == device_addr["serial"]){ - handle = dev_handle; - break; - } + try { + if (dev_handle->get_serial() == device_addr["serial"]){ + handle = dev_handle; + break; + } + } catch (const uhd::exception &e) { continue; } } UHD_ASSERT_THROW(handle.get() != NULL); //better be found -- cgit v1.2.3