aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport/libusb1_base.cpp
diff options
context:
space:
mode:
authorBalint Seeber <balint.seeber@ettus.com>2015-07-27 15:16:49 -0700
committerMartin Braun <martin.braun@ettus.com>2015-08-03 10:11:44 -0700
commit4ed2b26d512ed8c8e78fbbfcf25a3560fd8c7102 (patch)
tree940764e665d503f50a293ac8d50ca1fb0b605544 /host/lib/transport/libusb1_base.cpp
parente1672fa7eedb00a977c39b7e80bb18521493b524 (diff)
downloaduhd-4ed2b26d512ed8c8e78fbbfcf25a3560fd8c7102.tar.gz
uhd-4ed2b26d512ed8c8e78fbbfcf25a3560fd8c7102.tar.bz2
uhd-4ed2b26d512ed8c8e78fbbfcf25a3560fd8c7102.zip
b200: Change init sequence to catch bad USB states
- Fixes USB hang issues on OS X - Uses usb_errors
Diffstat (limited to 'host/lib/transport/libusb1_base.cpp')
-rw-r--r--host/lib/transport/libusb1_base.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/host/lib/transport/libusb1_base.cpp b/host/lib/transport/libusb1_base.cpp
index 0baf8dc76..9635d34b0 100644
--- a/host/lib/transport/libusb1_base.cpp
+++ b/host/lib/transport/libusb1_base.cpp
@@ -251,6 +251,21 @@ public:
_claimed.push_back(interface);
}
+ void clear_endpoints(unsigned char recv_endpoint, unsigned char send_endpoint)
+ {
+ int ret;
+ ret = libusb_clear_halt(this->get(), recv_endpoint | 0x80);
+ UHD_LOG << "usb device handle: recv endpoint clear: " << libusb_error_name(ret) << std::endl;
+ ret = libusb_clear_halt(this->get(), send_endpoint | 0x00);
+ UHD_LOG << "usb device handle: send endpoint clear: " << libusb_error_name(ret) << std::endl;
+ }
+
+ void reset_device(void)
+ {
+ int ret = libusb_reset_device(this->get());
+ UHD_LOG << "usb device handle: dev Reset: " << libusb_error_name(ret) << std::endl;
+ }
+
private:
libusb::device::sptr _dev; //always keep a reference to device
libusb_device_handle *_handle;