From 7ed1039e55e5929e75baae2ff14b96e26c737541 Mon Sep 17 00:00:00 2001 From: Y-Nak Date: Wed, 3 Oct 2018 10:07:18 +0900 Subject: [PATCH] Add binding for libusb_clear_halt --- src/device_handle.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/device_handle.rs b/src/device_handle.rs index eb9c360..1b47f9b 100644 --- a/src/device_handle.rs +++ b/src/device_handle.rs @@ -65,6 +65,13 @@ impl<'a> DeviceHandle<'a> { Ok(()) } + + /// Clear stall/halt state of the endpoint + pub fn clear_halt(&self, endpoint: u8) -> ::Result<()> { + try_unsafe!(libusb_clear_halt(self.handle, endpoint as c_uchar)); + Ok(()) + } + /// Indicates whether the device has an attached kernel driver. /// /// This method is not supported on all platforms.