summaryrefslogtreecommitdiffstats
path: root/host/lib/transport
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/transport')
-rw-r--r--host/lib/transport/CMakeLists.txt1
-rw-r--r--host/lib/transport/libusb1_control.cpp14
2 files changed, 8 insertions, 7 deletions
diff --git a/host/lib/transport/CMakeLists.txt b/host/lib/transport/CMakeLists.txt
index d6e1ff7ba..627d2d806 100644
--- a/host/lib/transport/CMakeLists.txt
+++ b/host/lib/transport/CMakeLists.txt
@@ -30,6 +30,7 @@ IF(LIBUSB_FOUND)
${CMAKE_SOURCE_DIR}/lib/transport/libusb1_control.cpp
${CMAKE_SOURCE_DIR}/lib/transport/libusb1_zero_copy.cpp
)
+ SET(HAVE_USB_SUPPORT TRUE)
ENDIF(LIBUSB_FOUND)
########################################################################
diff --git a/host/lib/transport/libusb1_control.cpp b/host/lib/transport/libusb1_control.cpp
index 2903d943d..c2f7060e8 100644
--- a/host/lib/transport/libusb1_control.cpp
+++ b/host/lib/transport/libusb1_control.cpp
@@ -16,10 +16,10 @@
//
#include <uhd/types/usb_descriptor.hpp>
-#include <uhd/utils/exception.hpp>
#include <uhd/transport/usb_control.hpp>
#include <libusb-1.0/libusb.h>
#include <boost/asio.hpp>
+#include <stdexcept>
#include <iostream>
using namespace uhd::transport;
@@ -61,15 +61,15 @@ libusb_control_impl::libusb_control_impl(uhd::usb_descriptor_t descriptor)
: _descriptor(descriptor), _ctx(NULL), _dev_handle(NULL)
{
if (libusb_init(&_ctx) < 0)
- UHD_THROW_SITE_INFO("USB: failed to initialize libusb");
+ throw std::runtime_error("USB: failed to initialize libusb");
libusb_set_debug(_ctx, libusb_debug_level);
if (!open_device())
- UHD_THROW_SITE_INFO("USB: failed to open device");
+ throw std::runtime_error("USB: failed to open device");
if (!open_interface())
- UHD_THROW_SITE_INFO("USB: failed to open device interface");
+ throw std::runtime_error("USB: failed to open device interface");
}
@@ -85,7 +85,7 @@ uhd::usb_descriptor_t libusb_control_impl::create_descriptor(libusb_device *dev)
libusb_device_descriptor desc;
if (libusb_get_device_descriptor(dev, &desc) < 0)
- UHD_THROW_SITE_INFO("USB: failed to get device descriptor");
+ throw std::runtime_error("USB: failed to get device descriptor");
uhd::usb_descriptor_t descriptor;
@@ -217,12 +217,12 @@ uhd::usb_descriptors_t usb_control::get_device_list()
uhd::usb_descriptors_t descriptors;
if (libusb_init(NULL) < 0)
- UHD_THROW_SITE_INFO("USB: failed to initialize libusb");
+ throw std::runtime_error("USB: failed to initialize libusb");
ssize_t cnt = libusb_get_device_list(NULL, &list);
if (cnt < 0)
- UHD_THROW_SITE_INFO("USB: failed to get device list");
+ throw std::runtime_error("USB: failed to get device list");
ssize_t i = 0;
for (i = 0; i < cnt; i++) {