diff options
author | Derek Kozel <derek.kozel@ettus.com> | 2016-02-25 16:53:27 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2016-02-29 11:40:03 -0800 |
commit | 834c33179d7407548c6b2345a7dde5f72a538b13 (patch) | |
tree | 859efd925f88c80ebb46d51292a18a2c3ae1fb31 | |
parent | ed4223d74cab604213b925da2eccb6055aa7aea2 (diff) | |
download | uhd-834c33179d7407548c6b2345a7dde5f72a538b13.tar.gz uhd-834c33179d7407548c6b2345a7dde5f72a538b13.tar.bz2 uhd-834c33179d7407548c6b2345a7dde5f72a538b13.zip |
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.
-rw-r--r-- | host/lib/usrp/b200/b200_impl.cpp | 10 |
1 files 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 |