From a764d4b3bfd2165b34fb1bf46bc739587e479600 Mon Sep 17 00:00:00 2001 From: Michael West Date: Tue, 19 Nov 2013 15:21:52 -0800 Subject: More fixes for Win32 compatibility. --- host/utils/b2xx_fx3_utils.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'host/utils') diff --git a/host/utils/b2xx_fx3_utils.cpp b/host/utils/b2xx_fx3_utils.cpp index f958d1c9f..01e1ea793 100644 --- a/host/utils/b2xx_fx3_utils.cpp +++ b/host/utils/b2xx_fx3_utils.cpp @@ -153,11 +153,20 @@ b200_iface::sptr make_b200_iface(const uhd::transport::usb_device_handle::sptr & { b200_iface::sptr b200; - uhd::transport::usb_control::sptr usb_ctrl = uhd::transport::usb_control::make(handle, 0); - b200 = b200_iface::make(usb_ctrl); + try { + uhd::transport::usb_control::sptr usb_ctrl = uhd::transport::usb_control::make(handle, 0); + b200 = b200_iface::make(usb_ctrl); - if (!b200) - std::cerr << "Cannot create device interface" << std::endl; + if (!b200) + std::cerr << "Cannot create device interface" << std::endl; + } + catch(const std::exception &e) { + std::cerr << "Failed to communicate with the device!" << std::endl; + #ifdef UHD_PLATFORM_WIN32 + std::cerr << "The necessary drivers are not installed. Read the UHD Transport Application Notes for details." << std::endl; + #endif /* UHD_PLATFORM_WIN32 */ + b200.reset(); + } return b200; } -- cgit v1.2.3