summaryrefslogtreecommitdiff
path: root/libusb/core.c
diff options
context:
space:
mode:
authorDaniel Drake <dsd@gentoo.org>2008-05-04 13:46:41 +0100
committerDaniel Drake <dsd@gentoo.org>2008-05-04 13:46:41 +0100
commitc01f744ce07bbeccbe353e956479f0cc5a811a6f (patch)
treeac277becb6c434756403419d89b4fbf5efd63d50 /libusb/core.c
parent5878daa85e3364bb3885190425d4f9deaa2d8c36 (diff)
downloadlibusb-c01f744ce07bbeccbe353e956479f0cc5a811a6f.tar.gz
Add functionality to clear endpoint halt conditions
Diffstat (limited to 'libusb/core.c')
-rw-r--r--libusb/core.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/libusb/core.c b/libusb/core.c
index 59df43e..f5e0238 100644
--- a/libusb/core.c
+++ b/libusb/core.c
@@ -674,6 +674,26 @@ API_EXPORTED int libusb_set_interface_alt_setting(libusb_device_handle *dev,
alternate_setting);
}
+/** \ingroup dev
+ * Clear the halt/stall condition for an endpoint. Endpoints with halt status
+ * are unable to receive or transmit data until the halt condition is stalled.
+ *
+ * You should cancel all pending transfers before attempting to clear the halt
+ * condition.
+ *
+ * \param dev a device handle
+ * \param endpoint the endpoint to clear halt status
+ * \returns 0 on success
+ * \returns LIBUSB_ERROR_NOT_FOUND if the endpoint does not exist
+ * \returns another LIBUSB_ERROR code on other failure
+ */
+API_EXPORTED int libusb_clear_halt(libusb_device_handle *dev,
+ unsigned char endpoint)
+{
+ usbi_dbg("endpoint %x", endpoint);
+ return usbi_backend->clear_halt(dev, endpoint);
+}
+
/** \ingroup lib
* Initialize libusb. This function must be called before calling any other
* libusb function.