11d96047eSMarkus Pfeiffer.\" 21d96047eSMarkus Pfeiffer.\" Copyright (c) 2009 Sylvestre Gallon 31d96047eSMarkus Pfeiffer.\" 41d96047eSMarkus Pfeiffer.\" All rights reserved. 51d96047eSMarkus Pfeiffer.\" 61d96047eSMarkus Pfeiffer.\" Redistribution and use in source and binary forms, with or without 71d96047eSMarkus Pfeiffer.\" modification, are permitted provided that the following conditions 81d96047eSMarkus Pfeiffer.\" are met: 91d96047eSMarkus Pfeiffer.\" 1. Redistributions of source code must retain the above copyright 101d96047eSMarkus Pfeiffer.\" notice, this list of conditions and the following disclaimer. 111d96047eSMarkus Pfeiffer.\" 2. Redistributions in binary form must reproduce the above copyright 121d96047eSMarkus Pfeiffer.\" notice, this list of conditions and the following disclaimer in the 131d96047eSMarkus Pfeiffer.\" documentation and/or other materials provided with the distribution. 141d96047eSMarkus Pfeiffer.\" 151d96047eSMarkus Pfeiffer.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 161d96047eSMarkus Pfeiffer.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 171d96047eSMarkus Pfeiffer.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 181d96047eSMarkus Pfeiffer.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 191d96047eSMarkus Pfeiffer.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 201d96047eSMarkus Pfeiffer.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 211d96047eSMarkus Pfeiffer.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 221d96047eSMarkus Pfeiffer.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 231d96047eSMarkus Pfeiffer.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 241d96047eSMarkus Pfeiffer.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 251d96047eSMarkus Pfeiffer.\" SUCH DAMAGE. 261d96047eSMarkus Pfeiffer.\" 27c5739aa6SSascha Wildner.\" $FreeBSD: head/lib/libusb/libusb.3 277165 2015-01-14 06:46:25Z hselasky $ 281d96047eSMarkus Pfeiffer.\" 29c4031fc1SImre Vadász.Dd June 22, 2016 301d96047eSMarkus Pfeiffer.Dt LIBUSB 3 311d96047eSMarkus Pfeiffer.Os 321d96047eSMarkus Pfeiffer.Sh NAME 331d96047eSMarkus Pfeiffer.Nm libusb 341d96047eSMarkus Pfeiffer.Nd "USB access library" 351d96047eSMarkus Pfeiffer.Sh LIBRARY 36a340784fSSascha Wildner.Lb libusb 371d96047eSMarkus Pfeiffer.Sh SYNOPSIS 381d96047eSMarkus Pfeiffer.In libusb.h 391d96047eSMarkus Pfeiffer.Sh DESCRIPTION 401d96047eSMarkus PfeifferThe 411d96047eSMarkus Pfeiffer.Nm 421d96047eSMarkus Pfeifferlibrary contains interfaces for directly managing a usb device. 431d96047eSMarkus PfeifferThe current implementation supports v1.0 of the libusb API. 44c5739aa6SSascha Wildner.Sh LIBRARY INITIALISATION AND DEINITIALISATION 451d96047eSMarkus Pfeiffer.Ft int 46c5739aa6SSascha Wildner.Fn libusb_init "libusb_context **ctx" 471d96047eSMarkus PfeifferThis function initialises libusb. 481d96047eSMarkus PfeifferIt must be called at the beginning 491d96047eSMarkus Pfeifferof the program, before other libusb routines are used. 501d96047eSMarkus PfeifferThis function returns 0 on success or LIBUSB_ERROR on 511d96047eSMarkus Pfeifferfailure. 521d96047eSMarkus Pfeiffer.Pp 531d96047eSMarkus Pfeiffer.Ft void 541d96047eSMarkus Pfeiffer.Fn libusb_exit "libusb_context *ctx" 551d96047eSMarkus PfeifferDeinitialise libusb. 561d96047eSMarkus PfeifferMust be called at the end of the application. 571d96047eSMarkus PfeifferOther libusb routines may not be called after this function. 581d96047eSMarkus Pfeiffer.Pp 591d96047eSMarkus Pfeiffer.Ft const char * 601d96047eSMarkus Pfeiffer.Fn libusb_strerror "int code" 611d96047eSMarkus PfeifferGet the ASCII representation of the error given by the 621d96047eSMarkus Pfeiffer.Fa code 631d96047eSMarkus Pfeifferargument. 641d96047eSMarkus PfeifferThis function does not return NULL. 651d96047eSMarkus Pfeiffer.Pp 661d96047eSMarkus Pfeiffer.Ft const char * 671d96047eSMarkus Pfeiffer.Fn libusb_error_name "int code" 681d96047eSMarkus PfeifferGet the ASCII representation of the error enum given by the 691d96047eSMarkus Pfeiffer.Fa code 701d96047eSMarkus Pfeifferargument. 711d96047eSMarkus PfeifferThis function does not return NULL. 721d96047eSMarkus Pfeiffer.Pp 731d96047eSMarkus Pfeiffer.Ft void 741d96047eSMarkus Pfeiffer.Fn libusb_set_debug "libusb_context *ctx" "int level" 751d96047eSMarkus PfeifferSet the debug level to 761d96047eSMarkus Pfeiffer.Fa level . 771d96047eSMarkus Pfeiffer.Pp 781d96047eSMarkus Pfeiffer.Ft ssize_t 791d96047eSMarkus Pfeiffer.Fn libusb_get_device_list "libusb_context *ctx" "libusb_device ***list" 801d96047eSMarkus PfeifferPopulate 811d96047eSMarkus Pfeiffer.Fa list 821d96047eSMarkus Pfeifferwith the list of usb devices available, adding a reference to each 831d96047eSMarkus Pfeifferdevice in the list. 841d96047eSMarkus PfeifferAll the list entries created by this 851d96047eSMarkus Pfeifferfunction must have their reference counter 861d96047eSMarkus Pfeifferdecremented when you are done with them, 871d96047eSMarkus Pfeifferand the list itself must be freed. 881d96047eSMarkus PfeifferThis 891d96047eSMarkus Pfeifferfunction returns the number of devices in the list or a LIBUSB_ERROR code. 901d96047eSMarkus Pfeiffer.Pp 911d96047eSMarkus Pfeiffer.Ft void 921d96047eSMarkus Pfeiffer.Fn libusb_free_device_list "libusb_device **list" "int unref_devices" 931d96047eSMarkus PfeifferFree the list of devices discovered by libusb_get_device_list. 941d96047eSMarkus PfeifferIf 951d96047eSMarkus Pfeiffer.Fa unref_device 961d96047eSMarkus Pfeifferis set to 1 all devices in the list have their reference 971d96047eSMarkus Pfeiffercounter decremented once. 981d96047eSMarkus Pfeiffer.Pp 991d96047eSMarkus Pfeiffer.Ft uint8_t 1001d96047eSMarkus Pfeiffer.Fn libusb_get_bus_number "libusb_device *dev" 1011d96047eSMarkus PfeifferReturns the number of the bus contained by the device 1021d96047eSMarkus Pfeiffer.Fa dev . 1031d96047eSMarkus Pfeiffer.Pp 1049b0c1abeSSascha Wildner.Ft int 1059b0c1abeSSascha Wildner.Fn libusb_get_port_numbers "libusb_device *dev" "uint8_t *buf" "uint8_t bufsize" 1069b0c1abeSSascha WildnerStores, in the buffer 1079b0c1abeSSascha Wildner.Fa buf 1089b0c1abeSSascha Wildnerof size 1099b0c1abeSSascha Wildner.Fa bufsize , 1109b0c1abeSSascha Wildnerthe list of all port numbers from root for the device 1119b0c1abeSSascha Wildner.Fa dev . 1129b0c1abeSSascha Wildner.Pp 1139b0c1abeSSascha Wildner.Ft int 1149b0c1abeSSascha Wildner.Fn libusb_get_port_path "libusb_context *ctx" "libusb_device *dev" "uint8_t *buf" "uint8_t bufsize" 1159b0c1abeSSascha WildnerDeprecated function equivalent to libusb_get_port_numbers. 1169b0c1abeSSascha Wildner.Pp 1171d96047eSMarkus Pfeiffer.Ft uint8_t 1181d96047eSMarkus Pfeiffer.Fn libusb_get_device_address "libusb_device *dev" 1191d96047eSMarkus PfeifferReturns the device_address contained by the device 1201d96047eSMarkus Pfeiffer.Fa dev . 1211d96047eSMarkus Pfeiffer.Pp 1221d96047eSMarkus Pfeiffer.Ft enum libusb_speed 1231d96047eSMarkus Pfeiffer.Fn libusb_get_device_speed "libusb_device *dev" 1241d96047eSMarkus PfeifferReturns the wire speed at which the device is connected. 1251d96047eSMarkus PfeifferSee the LIBUSB_SPEED_XXX enums for more information. 1261d96047eSMarkus PfeifferLIBUSB_SPEED_UNKNOWN is returned in case of unknown wire speed. 1271d96047eSMarkus Pfeiffer.Pp 1281d96047eSMarkus Pfeiffer.Ft int 1291d96047eSMarkus Pfeiffer.Fn libusb_get_max_packet_size "libusb_device *dev" "unsigned char endpoint" 1301d96047eSMarkus PfeifferReturns the wMaxPacketSize value on success, LIBUSB_ERROR_NOT_FOUND if the 1311d96047eSMarkus Pfeifferendpoint does not exist and LIBUSB_ERROR_OTHERS on other failure. 1321d96047eSMarkus Pfeiffer.Pp 133aa3e5c14SSascha Wildner.Ft int 134aa3e5c14SSascha Wildner.Fn libusb_get_max_iso_packet_size "libusb_device *dev" "unsigned char endpoint" 135aa3e5c14SSascha WildnerReturns the packet size multiplied by the packet multiplier on success, 136aa3e5c14SSascha WildnerLIBUSB_ERROR_NOT_FOUND if the endpoint does not exist and 137aa3e5c14SSascha WildnerLIBUSB_ERROR_OTHERS on other failure. 138aa3e5c14SSascha Wildner.Pp 1391d96047eSMarkus Pfeiffer.Ft libusb_device * 1401d96047eSMarkus Pfeiffer.Fn libusb_ref_device "libusb_device *dev" 1411d96047eSMarkus PfeifferIncrement the reference counter of the device 1421d96047eSMarkus Pfeiffer.Fa dev . 1431d96047eSMarkus Pfeiffer.Pp 1441d96047eSMarkus Pfeiffer.Ft void 1451d96047eSMarkus Pfeiffer.Fn libusb_unref_device "libusb_device *dev" 1461d96047eSMarkus PfeifferDecrement the reference counter of the device 1471d96047eSMarkus Pfeiffer.Fa dev . 1481d96047eSMarkus Pfeiffer.Pp 1491d96047eSMarkus Pfeiffer.Ft int 1501d96047eSMarkus Pfeiffer.Fn libusb_open "libusb_device *dev" "libusb_device_handle **devh" 1511d96047eSMarkus PfeifferOpen a device and obtain a device_handle. 1521d96047eSMarkus PfeifferReturns 0 on success, 1531d96047eSMarkus PfeifferLIBUSB_ERROR_NO_MEM on memory allocation problems, LIBUSB_ERROR_ACCESS 1541d96047eSMarkus Pfeifferon permissions problems, LIBUSB_ERROR_NO_DEVICE if the device has been 1551d96047eSMarkus Pfeifferdisconnected and a LIBUSB_ERROR code on other errors. 1561d96047eSMarkus Pfeiffer.Pp 1571d96047eSMarkus Pfeiffer.Ft libusb_device_handle * 1581d96047eSMarkus Pfeiffer.Fn libusb_open_device_with_vid_pid "libusb_context *ctx" "uint16_t vid" "uint16_t pid" 1591d96047eSMarkus PfeifferA convenience function to open a device by vendor and product IDs 1601d96047eSMarkus Pfeiffer.Fa vid 1611d96047eSMarkus Pfeifferand 1621d96047eSMarkus Pfeiffer.Fa pid . 1631d96047eSMarkus PfeifferReturns NULL on error. 1641d96047eSMarkus Pfeiffer.Pp 1651d96047eSMarkus Pfeiffer.Ft void 1661d96047eSMarkus Pfeiffer.Fn libusb_close "libusb_device_handle *devh" 1671d96047eSMarkus PfeifferClose a device handle. 1681d96047eSMarkus Pfeiffer.Pp 1691d96047eSMarkus Pfeiffer.Ft libusb_device * 1701d96047eSMarkus Pfeiffer.Fn libusb_get_device "libusb_device_handle *devh" 1711d96047eSMarkus PfeifferGet the device contained by devh. 1721d96047eSMarkus PfeifferReturns NULL on error. 1731d96047eSMarkus Pfeiffer.Pp 1741d96047eSMarkus Pfeiffer.Ft int 1751d96047eSMarkus Pfeiffer.Fn libusb_get_configuration "libusb_device_handle *devh" "int *config" 176aa3e5c14SSascha WildnerReturns the value of the current configuration. 1771d96047eSMarkus PfeifferReturns 0 1781d96047eSMarkus Pfeifferon success, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected 1791d96047eSMarkus Pfeifferand a LIBUSB_ERROR code on error. 1801d96047eSMarkus Pfeiffer.Pp 1811d96047eSMarkus Pfeiffer.Ft int 1821d96047eSMarkus Pfeiffer.Fn libusb_set_configuration "libusb_device_handle *devh" "int config" 1831d96047eSMarkus PfeifferSet the active configuration to 1841d96047eSMarkus Pfeiffer.Fa config 1851d96047eSMarkus Pfeifferfor the device contained by 1861d96047eSMarkus Pfeiffer.Fa devh . 1871d96047eSMarkus PfeifferThis function returns 0 on success, LIBUSB_ERROR_NOT_FOUND if the requested 1881d96047eSMarkus Pfeifferconfiguration does not exist, LIBUSB_ERROR_BUSY if the interfaces are currently 1891d96047eSMarkus Pfeifferclaimed, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and a 1901d96047eSMarkus PfeifferLIBUSB_ERROR code on failure. 1911d96047eSMarkus Pfeiffer.Pp 1921d96047eSMarkus Pfeiffer.Ft int 1931d96047eSMarkus Pfeiffer.Fn libusb_claim_interface "libusb_device_handle *devh" "int interface_number" 1941d96047eSMarkus PfeifferClaim an interface in a given libusb_handle 1951d96047eSMarkus Pfeiffer.Fa devh . 1961d96047eSMarkus PfeifferThis is a non-blocking function. 1971d96047eSMarkus PfeifferIt returns 0 on success, LIBUSB_ERROR_NOT_FOUND 1981d96047eSMarkus Pfeifferif the requested interface does not exist, LIBUSB_ERROR_BUSY if a program or 1991d96047eSMarkus Pfeifferdriver has claimed the interface, LIBUSB_ERROR_NO_DEVICE if the device has 2001d96047eSMarkus Pfeifferbeen disconnected and a LIBUSB_ERROR code on failure. 2011d96047eSMarkus Pfeiffer.Pp 2021d96047eSMarkus Pfeiffer.Ft int 2031d96047eSMarkus Pfeiffer.Fn libusb_release_interface "libusb_device_handle *devh" "int interface_number" 2041d96047eSMarkus PfeifferThis function releases an interface. 2051d96047eSMarkus PfeifferAll the claimed interfaces on a device must be released 2061d96047eSMarkus Pfeifferbefore closing the device. 2071d96047eSMarkus PfeifferReturns 0 on success, LIBUSB_ERROR_NOT_FOUND if the 2081d96047eSMarkus Pfeifferinterface was not claimed, LIBUSB_ERROR_NO_DEVICE if the device has been 2091d96047eSMarkus Pfeifferdisconnected and LIBUSB_ERROR on failure. 2101d96047eSMarkus Pfeiffer.Pp 2111d96047eSMarkus Pfeiffer.Ft int 2121d96047eSMarkus Pfeiffer.Fn libusb_set_interface_alt_setting "libusb_device_handle *dev" "int interface_number" "int alternate_setting" 2131d96047eSMarkus PfeifferActivate an alternate setting for an interface. 2141d96047eSMarkus PfeifferReturns 0 on success, 2151d96047eSMarkus PfeifferLIBUSB_ERROR_NOT_FOUND if the interface was not claimed or the requested 2161d96047eSMarkus Pfeiffersetting does not exist, LIBUSB_ERROR_NO_DEVICE if the device has been 2171d96047eSMarkus Pfeifferdisconnected and a LIBUSB_ERROR code on failure. 2181d96047eSMarkus Pfeiffer.Pp 2191d96047eSMarkus Pfeiffer.Ft int 2201d96047eSMarkus Pfeiffer.Fn libusb_clear_halt "libusb_device_handle *devh" "unsigned char endpoint" 221*52a88097SSascha WildnerClear an halt/stall for an endpoint. 2221d96047eSMarkus PfeifferReturns 0 on success, LIBUSB_ERROR_NOT_FOUND 2231d96047eSMarkus Pfeifferif the endpoint does not exist, LIBUSB_ERROR_NO_DEVICE if the device has been 2241d96047eSMarkus Pfeifferdisconnected and a LIBUSB_ERROR code on failure. 2251d96047eSMarkus Pfeiffer.Pp 2261d96047eSMarkus Pfeiffer.Ft int 2271d96047eSMarkus Pfeiffer.Fn libusb_reset_device "libusb_device_handle *devh" 2281d96047eSMarkus PfeifferPerform an USB port reset for an usb device. 2291d96047eSMarkus PfeifferReturns 0 on success, 2301d96047eSMarkus PfeifferLIBUSB_ERROR_NOT_FOUND if re-enumeration is required or if the device has 2311d96047eSMarkus Pfeifferbeen disconnected and a LIBUSB_ERROR code on failure. 2321d96047eSMarkus Pfeiffer.Pp 2331d96047eSMarkus Pfeiffer.Ft int 2341d96047eSMarkus Pfeiffer.Fn libusb_check_connected "libusb_device_handle *devh" 2351d96047eSMarkus PfeifferTest if the USB device is still connected. 2361d96047eSMarkus PfeifferReturns 0 on success, 2371d96047eSMarkus PfeifferLIBUSB_ERROR_NO_DEVICE if it has been disconnected and a LIBUSB_ERROR 2381d96047eSMarkus Pfeiffercode on failure. 2391d96047eSMarkus Pfeiffer.Pp 2401d96047eSMarkus Pfeiffer.Ft int 2411d96047eSMarkus Pfeiffer.Fn libusb_kernel_driver_active "libusb_device_handle *devh" "int interface" 242*52a88097SSascha WildnerDetermine if a driver is active on an interface. 2431d96047eSMarkus PfeifferReturns 0 if no kernel driver is active 2441d96047eSMarkus Pfeifferand 1 if a kernel driver is active, LIBUSB_ERROR_NO_DEVICE 2451d96047eSMarkus Pfeifferif the device has been disconnected and a LIBUSB_ERROR code on failure. 2461d96047eSMarkus Pfeiffer.Pp 2471d96047eSMarkus Pfeiffer.Ft int 2481d96047eSMarkus Pfeiffer.Fn libusb_get_driver "libusb_device_handle *devh" "int interface" "char *name" "int namelen" 2491d96047eSMarkus Pfeifferor 2501d96047eSMarkus Pfeiffer.Ft int 2511d96047eSMarkus Pfeiffer.Fn libusb_get_driver_np "libusb_device_handle *devh" "int interface" "char *name" "int namelen" 2521d96047eSMarkus PfeifferCopy the name of the driver attached to the given 2531d96047eSMarkus Pfeiffer.Fa device 2541d96047eSMarkus Pfeifferand 2551d96047eSMarkus Pfeiffer.Fa interface 2561d96047eSMarkus Pfeifferinto the buffer 2571d96047eSMarkus Pfeiffer.Fa name 2581d96047eSMarkus Pfeifferof length 2591d96047eSMarkus Pfeiffer.Fa namelen . 2601d96047eSMarkus PfeifferReturns 0 on success, LIBUSB_ERROR_NOT_FOUND if no kernel driver is attached 2611d96047eSMarkus Pfeifferto the given interface and LIBUSB_ERROR_INVALID_PARAM if the interface does 2621d96047eSMarkus Pfeiffernot exist. 2631d96047eSMarkus PfeifferThis function is non-portable. 2641d96047eSMarkus PfeifferThe buffer pointed to by 2651d96047eSMarkus Pfeiffer.Fa name 2661d96047eSMarkus Pfeifferis only zero terminated on success. 2671d96047eSMarkus Pfeiffer.Pp 2681d96047eSMarkus Pfeiffer.Ft int 2691d96047eSMarkus Pfeiffer.Fn libusb_detach_kernel_driver "libusb_device_handle *devh" "int interface" 2701d96047eSMarkus Pfeifferor 2711d96047eSMarkus Pfeiffer.Ft int 2721d96047eSMarkus Pfeiffer.Fn libusb_detach_kernel_driver_np "libusb_device_handle *devh" "int interface" 2731d96047eSMarkus PfeifferDetach a kernel driver from an interface. 2741d96047eSMarkus PfeifferThis is needed to claim an interface already claimed by a kernel driver. 2751d96047eSMarkus PfeifferReturns 0 on success, LIBUSB_ERROR_NOT_FOUND if no kernel driver was active, 2761d96047eSMarkus PfeifferLIBUSB_ERROR_INVALID_PARAM if the interface does not exist, 2771d96047eSMarkus PfeifferLIBUSB_ERROR_NO_DEVICE if the device has been disconnected 2781d96047eSMarkus Pfeifferand a LIBUSB_ERROR code on failure. 2791d96047eSMarkus PfeifferThis function is non-portable. 2801d96047eSMarkus Pfeiffer.Pp 2811d96047eSMarkus Pfeiffer.Ft int 2821d96047eSMarkus Pfeiffer.Fn libusb_attach_kernel_driver "libusb_device_handle *devh" "int interface" 2831d96047eSMarkus PfeifferRe-attach an interface kernel driver that was previously detached. 2841d96047eSMarkus PfeifferReturns 0 on success, 2851d96047eSMarkus PfeifferLIBUSB_ERROR_INVALID_PARAM if the interface does not exist, 2861d96047eSMarkus PfeifferLIBUSB_ERROR_NO_DEVICE 2871d96047eSMarkus Pfeifferif the device has been disconnected, LIBUSB_ERROR_BUSY if the driver cannot be 2881d96047eSMarkus Pfeifferattached because the interface is claimed by a program or driver and a 2891d96047eSMarkus PfeifferLIBUSB_ERROR code on failure. 2901d96047eSMarkus Pfeiffer.Sh USB DESCRIPTORS 2911d96047eSMarkus Pfeiffer.Ft int 2921d96047eSMarkus Pfeiffer.Fn libusb_get_device_descriptor "libusb_device *dev" "libusb_device_descriptor *desc" 2931d96047eSMarkus PfeifferGet the USB device descriptor for the device 2941d96047eSMarkus Pfeiffer.Fa dev . 2951d96047eSMarkus PfeifferThis is a non-blocking function. 2961d96047eSMarkus PfeifferReturns 0 on success and a LIBUSB_ERROR code on 2971d96047eSMarkus Pfeifferfailure. 2981d96047eSMarkus Pfeiffer.Pp 2991d96047eSMarkus Pfeiffer.Ft int 300aa3e5c14SSascha Wildner.Fn libusb_get_active_config_descriptor "libusb_device *dev" "struct libusb_config_descriptor **config" 3011d96047eSMarkus PfeifferGet the USB configuration descriptor for the active configuration. 3021d96047eSMarkus PfeifferReturns 0 on 3031d96047eSMarkus Pfeiffersuccess, LIBUSB_ERROR_NOT_FOUND if the device is in 3041d96047eSMarkus Pfeifferan unconfigured state 3051d96047eSMarkus Pfeifferand a LIBUSB_ERROR code on error. 3061d96047eSMarkus Pfeiffer.Pp 3071d96047eSMarkus Pfeiffer.Ft int 3081d96047eSMarkus Pfeiffer.Fn libusb_get_config_descriptor "libusb_device *dev" "uint8_t config_index" "libusb_config_descriptor **config" 3091d96047eSMarkus PfeifferGet a USB configuration descriptor based on its index 3101d96047eSMarkus Pfeiffer.Fa idx . 3111d96047eSMarkus PfeifferReturns 0 on success, LIBUSB_ERROR_NOT_FOUND if the configuration does not exist 3121d96047eSMarkus Pfeifferand a LIBUSB_ERROR code on error. 3131d96047eSMarkus Pfeiffer.Pp 3141d96047eSMarkus Pfeiffer.Ft int 3151d96047eSMarkus Pfeiffer.Fn libusb_get_config_descriptor_by_value "libusb_device *dev" "uint8 bConfigurationValue" "libusb_config_descriptor **config" 3161d96047eSMarkus PfeifferGet a USB configuration descriptor with a specific bConfigurationValue. 3171d96047eSMarkus PfeifferThis is 3181d96047eSMarkus Pfeiffera non-blocking function which does not send a request through the device. 3191d96047eSMarkus PfeifferReturns 0 3201d96047eSMarkus Pfeifferon success, LIBUSB_ERROR_NOT_FOUND if the configuration 3211d96047eSMarkus Pfeifferdoes not exist and a 3221d96047eSMarkus PfeifferLIBUSB_ERROR code on failure. 3231d96047eSMarkus Pfeiffer.Pp 3241d96047eSMarkus Pfeiffer.Ft void 3251d96047eSMarkus Pfeiffer.Fn libusb_free_config_descriptor "libusb_config_descriptor *config" 3261d96047eSMarkus PfeifferFree a configuration descriptor. 3271d96047eSMarkus Pfeiffer.Pp 3281d96047eSMarkus Pfeiffer.Ft int 329aa3e5c14SSascha Wildner.Fn libusb_get_string_descriptor "libusb_device_handle *devh" "uint8_t desc_idx" "uint16_t langid" "unsigned char *data" "int length" 330aa3e5c14SSascha WildnerRetrieve a string descriptor in raw format. 331aa3e5c14SSascha WildnerReturns the number of bytes actually transferred on success 332aa3e5c14SSascha Wildneror a negative LIBUSB_ERROR code on failure. 333aa3e5c14SSascha Wildner.Pp 334aa3e5c14SSascha Wildner.Ft int 3351d96047eSMarkus Pfeiffer.Fn libusb_get_string_descriptor_ascii "libusb_device_handle *devh" "uint8_t desc_idx" "unsigned char *data" "int length" 3361d96047eSMarkus PfeifferRetrieve a string descriptor in C style ASCII. 3371d96047eSMarkus PfeifferReturns the positive number of bytes in the resulting ASCII string 3381d96047eSMarkus Pfeifferon success and a LIBUSB_ERROR code on failure. 3391d96047eSMarkus Pfeiffer.Pp 3401d96047eSMarkus Pfeiffer.Ft int 3411d96047eSMarkus Pfeiffer.Fn libusb_parse_ss_endpoint_comp "const void *buf" "int len" "libusb_ss_endpoint_companion_descriptor **ep_comp" 3421d96047eSMarkus PfeifferThis function parses the USB 3.0 endpoint companion descriptor in host endian format pointed to by 3431d96047eSMarkus Pfeiffer.Fa buf 3441d96047eSMarkus Pfeifferand having a length of 3451d96047eSMarkus Pfeiffer.Fa len . 3461d96047eSMarkus PfeifferTypically these arguments are the extra and extra_length fields of the 3471d96047eSMarkus Pfeifferendpoint descriptor. 3481d96047eSMarkus PfeifferOn success the pointer to resulting descriptor is stored at the location given by 3491d96047eSMarkus Pfeiffer.Fa ep_comp . 3501d96047eSMarkus PfeifferReturns zero on success and a LIBUSB_ERROR code on failure. 3511d96047eSMarkus PfeifferOn success the parsed USB 3.0 endpoint companion descriptor must be 3521d96047eSMarkus Pfeifferfreed using the libusb_free_ss_endpoint_comp function. 3531d96047eSMarkus Pfeiffer.Pp 3541d96047eSMarkus Pfeiffer.Ft void 3551d96047eSMarkus Pfeiffer.Fn libusb_free_ss_endpoint_comp "libusb_ss_endpoint_companion_descriptor *ep_comp" 3561d96047eSMarkus PfeifferThis function is NULL safe and frees a parsed USB 3.0 endpoint companion descriptor. 3571d96047eSMarkus Pfeiffer.Pp 3581d96047eSMarkus Pfeiffer.Ft int 3591d96047eSMarkus Pfeiffer.Fn libusb_parse_bos_descriptor "const void *buf" "int len" "libusb_bos_descriptor **bos" 3601d96047eSMarkus PfeifferThis function parses a Binary Object Store, BOS, descriptor into host endian format pointed to by 3611d96047eSMarkus Pfeiffer.Fa buf 3621d96047eSMarkus Pfeifferand having a length of 3631d96047eSMarkus Pfeiffer.Fa len . 3641d96047eSMarkus PfeifferOn success the pointer to resulting descriptor is stored at the location given by 3651d96047eSMarkus Pfeiffer.Fa bos . 3661d96047eSMarkus PfeifferReturns zero on success and a LIBUSB_ERROR code on failure. 3671d96047eSMarkus PfeifferOn success the parsed BOS descriptor must be freed using the 3681d96047eSMarkus Pfeifferlibusb_free_bos_descriptor function. 3691d96047eSMarkus Pfeiffer.Pp 3701d96047eSMarkus Pfeiffer.Ft void 3711d96047eSMarkus Pfeiffer.Fn libusb_free_bos_descriptor "libusb_bos_descriptor *bos" 3721d96047eSMarkus PfeifferThis function is NULL safe and frees a parsed BOS descriptor. 3731d96047eSMarkus Pfeiffer.Sh USB ASYNCHRONOUS I/O 3741d96047eSMarkus Pfeiffer.Ft struct libusb_transfer * 3751d96047eSMarkus Pfeiffer.Fn libusb_alloc_transfer "int iso_packets" 3761d96047eSMarkus PfeifferAllocate a transfer with the number of isochronous packet descriptors 3771d96047eSMarkus Pfeifferspecified by 3781d96047eSMarkus Pfeiffer.Fa iso_packets . 3791d96047eSMarkus PfeifferReturns NULL on error. 3801d96047eSMarkus Pfeiffer.Pp 3811d96047eSMarkus Pfeiffer.Ft void 3821d96047eSMarkus Pfeiffer.Fn libusb_free_transfer "struct libusb_transfer *tr" 3831d96047eSMarkus PfeifferFree a transfer. 3841d96047eSMarkus Pfeiffer.Pp 3851d96047eSMarkus Pfeiffer.Ft int 3861d96047eSMarkus Pfeiffer.Fn libusb_submit_transfer "struct libusb_transfer *tr" 3871d96047eSMarkus PfeifferThis function will submit a transfer and returns immediately. 3881d96047eSMarkus PfeifferReturns 0 on success, LIBUSB_ERROR_NO_DEVICE if 3891d96047eSMarkus Pfeifferthe device has been disconnected and a 3901d96047eSMarkus PfeifferLIBUSB_ERROR code on other failure. 3911d96047eSMarkus Pfeiffer.Pp 3921d96047eSMarkus Pfeiffer.Ft int 3931d96047eSMarkus Pfeiffer.Fn libusb_cancel_transfer "struct libusb_transfer *tr" 3941d96047eSMarkus PfeifferThis function asynchronously cancels a transfer. 3951d96047eSMarkus PfeifferReturns 0 on success and a LIBUSB_ERROR code on failure. 3961d96047eSMarkus Pfeiffer.Sh USB SYNCHRONOUS I/O 3971d96047eSMarkus Pfeiffer.Ft int 3981d96047eSMarkus Pfeiffer.Fn libusb_control_transfer "libusb_device_handle *devh" "uint8_t bmRequestType" "uint8_t bRequest" "uint16_t wValue" "uint16_t wIndex" "unsigned char *data" "uint16_t wLength" "unsigned int timeout" 3991d96047eSMarkus PfeifferPerform a USB control transfer. 4001d96047eSMarkus PfeifferReturns the actual number of bytes 4011d96047eSMarkus Pfeiffertransferred on success, in the range from and including zero up to and 4021d96047eSMarkus Pfeifferincluding 4031d96047eSMarkus Pfeiffer.Fa wLength . 4041d96047eSMarkus PfeifferOn error a LIBUSB_ERROR code is returned, for example 4051d96047eSMarkus PfeifferLIBUSB_ERROR_TIMEOUT if the transfer timed out, LIBUSB_ERROR_PIPE if the 4061d96047eSMarkus Pfeiffercontrol request was not supported, LIBUSB_ERROR_NO_DEVICE if the 4071d96047eSMarkus Pfeifferdevice has been disconnected and another LIBUSB_ERROR code on other failures. 4081d96047eSMarkus PfeifferThe LIBUSB_ERROR codes are all negative. 4091d96047eSMarkus Pfeiffer.Pp 4101d96047eSMarkus Pfeiffer.Ft int 4111d96047eSMarkus Pfeiffer.Fn libusb_bulk_transfer "struct libusb_device_handle *devh" "unsigned char endpoint" "unsigned char *data" "int length" "int *transferred" "unsigned int timeout" 4121d96047eSMarkus PfeifferPerform an USB bulk transfer. 4131d96047eSMarkus PfeifferA timeout value of zero means no timeout. 4141d96047eSMarkus PfeifferThe timeout value is given in milliseconds. 4151d96047eSMarkus PfeifferReturns 0 on success, LIBUSB_ERROR_TIMEOUT 4161d96047eSMarkus Pfeifferif the transfer timed out, LIBUSB_ERROR_PIPE if the control request was not 4171d96047eSMarkus Pfeiffersupported, LIBUSB_ERROR_OVERFLOW if the device offered more data, 4181d96047eSMarkus PfeifferLIBUSB_ERROR_NO_DEVICE if the device has been disconnected and 4191d96047eSMarkus Pfeiffera LIBUSB_ERROR code on other failure. 4201d96047eSMarkus Pfeiffer.Pp 4211d96047eSMarkus Pfeiffer.Ft int 4221d96047eSMarkus Pfeiffer.Fn libusb_interrupt_transfer "struct libusb_device_handle *devh" "unsigned char endpoint" "unsigned char *data" "int length" "int *transferred" "unsigned int timeout" 4231d96047eSMarkus PfeifferPerform an USB Interrupt transfer. 4241d96047eSMarkus PfeifferA timeout value of zero means no timeout. 4251d96047eSMarkus PfeifferThe timeout value is given in milliseconds. 4261d96047eSMarkus PfeifferReturns 0 on success, LIBUSB_ERROR_TIMEOUT 4271d96047eSMarkus Pfeifferif the transfer timed out, LIBUSB_ERROR_PIPE if the control request was not 4281d96047eSMarkus Pfeiffersupported, LIBUSB_ERROR_OVERFLOW if the device offered more data, 4291d96047eSMarkus PfeifferLIBUSB_ERROR_NO_DEVICE if the device has been disconnected and 4301d96047eSMarkus Pfeiffera LIBUSB_ERROR code on other failure. 4311d96047eSMarkus Pfeiffer.Sh USB EVENTS 4321d96047eSMarkus Pfeiffer.Ft int 4331d96047eSMarkus Pfeiffer.Fn libusb_try_lock_events "libusb_context *ctx" 4341d96047eSMarkus PfeifferTry to acquire the event handling lock. 4351d96047eSMarkus PfeifferReturns 0 if the lock was obtained and 1 if not. 4361d96047eSMarkus Pfeiffer.Pp 4371d96047eSMarkus Pfeiffer.Ft void 4381d96047eSMarkus Pfeiffer.Fn libusb_lock_events "libusb_context *ctx" 4391d96047eSMarkus PfeifferAcquire the event handling lock. 4401d96047eSMarkus PfeifferThis function is blocking. 4411d96047eSMarkus Pfeiffer.Pp 4421d96047eSMarkus Pfeiffer.Ft void 4431d96047eSMarkus Pfeiffer.Fn libusb_unlock_events "libusb_context *ctx" 4441d96047eSMarkus PfeifferRelease the event handling lock. 4451d96047eSMarkus PfeifferThis will wake up any thread blocked 4461d96047eSMarkus Pfeifferon 447aa3e5c14SSascha Wildner.Fn libusb_wait_for_event . 4481d96047eSMarkus Pfeiffer.Pp 4491d96047eSMarkus Pfeiffer.Ft int 4501d96047eSMarkus Pfeiffer.Fn libusb_event_handling_ok "libusb_context *ctx" 4511d96047eSMarkus PfeifferDetermine if it still OK for this thread to be doing event handling. 4521d96047eSMarkus PfeifferReturns 1 4531d96047eSMarkus Pfeifferif event handling can start or continue. 4541d96047eSMarkus PfeifferReturns 0 if this thread must give up 4551d96047eSMarkus Pfeifferthe events lock. 4561d96047eSMarkus Pfeiffer.Pp 4571d96047eSMarkus Pfeiffer.Ft int 4581d96047eSMarkus Pfeiffer.Fn libusb_event_handler_active "libusb_context *ctx" 4591d96047eSMarkus PfeifferDetermine if an active thread is handling events. 4601d96047eSMarkus PfeifferReturns 1 if there is a thread handling events and 0 if there 4611d96047eSMarkus Pfeifferare no threads currently handling events. 4621d96047eSMarkus Pfeiffer.Pp 4631d96047eSMarkus Pfeiffer.Ft void 4641d96047eSMarkus Pfeiffer.Fn libusb_lock_event_waiters "libusb_context *ctx" 4651d96047eSMarkus PfeifferAcquire the event_waiters lock. 4661d96047eSMarkus PfeifferThis lock is designed to be obtained in the 4671d96047eSMarkus Pfeiffersituation where you want to be aware when events are completed, but some other 468d4155bf4SSascha Wildnerthread is event handling so calling 469d4155bf4SSascha Wildner.Fn libusb_handle_events 470d4155bf4SSascha Wildneris not allowed. 4711d96047eSMarkus Pfeiffer.Pp 4721d96047eSMarkus Pfeiffer.Ft void 4731d96047eSMarkus Pfeiffer.Fn libusb_unlock_event_waiters "libusb_context *ctx" 4741d96047eSMarkus PfeifferRelease the event_waiters lock. 4751d96047eSMarkus Pfeiffer.Pp 4761d96047eSMarkus Pfeiffer.Ft int 4771d96047eSMarkus Pfeiffer.Fn libusb_wait_for_event "libusb_context *ctx" "struct timeval *tv" 4781d96047eSMarkus PfeifferWait for another thread to signal completion of an event. 4791d96047eSMarkus PfeifferMust be called 480d4155bf4SSascha Wildnerwith the event waiters lock held, see 481d4155bf4SSascha Wildner.Fn libusb_lock_event_waiters . 4821d96047eSMarkus PfeifferThis will 4831d96047eSMarkus Pfeifferblock until the timeout expires or a transfer completes or a thread releases 484d4155bf4SSascha Wildnerthe event handling lock through 485d4155bf4SSascha Wildner.Fn libusb_unlock_events . 4861d96047eSMarkus PfeifferReturns 0 after a 4871d96047eSMarkus Pfeiffertransfer completes or another thread stops event handling, and 1 if the 4881d96047eSMarkus Pfeiffertimeout expired. 4891d96047eSMarkus Pfeiffer.Pp 4901d96047eSMarkus Pfeiffer.Ft int 4919b0c1abeSSascha Wildner.Fn libusb_handle_events_timeout_completed "libusb_context *ctx" "struct timeval *tv" "int *completed" 4929b0c1abeSSascha WildnerHandle any pending events by checking if timeouts have expired and by 4939b0c1abeSSascha Wildnerchecking the set of file descriptors for activity. 4949b0c1abeSSascha WildnerIf the 4959b0c1abeSSascha Wildner.Fa completed 4969b0c1abeSSascha Wildnerargument is not equal to NULL, this function will 4979b0c1abeSSascha Wildnerloop until a transfer completion callback sets the variable pointed to 4989b0c1abeSSascha Wildnerby the 4999b0c1abeSSascha Wildner.Fa completed 5009b0c1abeSSascha Wildnerargument to non-zero. 5019b0c1abeSSascha WildnerIf the 5029b0c1abeSSascha Wildner.Fa tv 5039b0c1abeSSascha Wildnerargument is not equal to NULL, this function will return 5049b0c1abeSSascha WildnerLIBUSB_ERROR_TIMEOUT after the given timeout. 5059b0c1abeSSascha WildnerReturns 0 on success, or a LIBUSB_ERROR code on failure or timeout. 5069b0c1abeSSascha Wildner.Pp 5079b0c1abeSSascha Wildner.Ft int 5089b0c1abeSSascha Wildner.Fn libusb_handle_events_completed "libusb_context *ctx" "int *completed" 5099b0c1abeSSascha WildnerHandle any pending events by checking the set of file descriptors for activity. 5109b0c1abeSSascha WildnerIf the 5119b0c1abeSSascha Wildner.Fa completed 5129b0c1abeSSascha Wildnerargument is not equal to NULL, this function will 5139b0c1abeSSascha Wildnerloop until a transfer completion callback sets the variable pointed to 5149b0c1abeSSascha Wildnerby the 5159b0c1abeSSascha Wildner.Fa completed 5169b0c1abeSSascha Wildnerargument to non-zero. 5179b0c1abeSSascha WildnerReturns 0 on success, or a LIBUSB_ERROR code on failure. 5189b0c1abeSSascha Wildner.Pp 5199b0c1abeSSascha Wildner.Ft int 5201d96047eSMarkus Pfeiffer.Fn libusb_handle_events_timeout "libusb_context *ctx" "struct timeval *tv" 5211d96047eSMarkus PfeifferHandle any pending events by checking if timeouts have expired and by 5221d96047eSMarkus Pfeifferchecking the set of file descriptors for activity. 5231d96047eSMarkus PfeifferReturns 0 on success, or a 5249b0c1abeSSascha WildnerLIBUSB_ERROR code on failure or timeout. 5251d96047eSMarkus Pfeiffer.Pp 5261d96047eSMarkus Pfeiffer.Ft int 5271d96047eSMarkus Pfeiffer.Fn libusb_handle_events "libusb_context *ctx" 5281d96047eSMarkus PfeifferHandle any pending events in blocking mode with a sensible timeout. 5291d96047eSMarkus PfeifferReturns 0 5301d96047eSMarkus Pfeifferon success and a LIBUSB_ERROR code on failure. 5311d96047eSMarkus Pfeiffer.Pp 5321d96047eSMarkus Pfeiffer.Ft int 5331d96047eSMarkus Pfeiffer.Fn libusb_handle_events_locked "libusb_context *ctx" "struct timeval *tv" 534aa3e5c14SSascha WildnerHandle any pending events by polling file descriptors, without checking if 5351d96047eSMarkus Pfeifferanother thread is already doing so. 5361d96047eSMarkus PfeifferMust be called with the event lock held. 5371d96047eSMarkus Pfeiffer.Pp 5381d96047eSMarkus Pfeiffer.Ft int 5391d96047eSMarkus Pfeiffer.Fn libusb_get_next_timeout "libusb_context *ctx" "struct timeval *tv" 5401d96047eSMarkus PfeifferDetermine the next internal timeout that libusb needs to handle. 5411d96047eSMarkus PfeifferReturns 0 5421d96047eSMarkus Pfeifferif there are no pending timeouts, 1 if a timeout was returned, or a LIBUSB_ERROR 5439b0c1abeSSascha Wildnercode on failure or timeout. 5441d96047eSMarkus Pfeiffer.Pp 5451d96047eSMarkus Pfeiffer.Ft void 5461d96047eSMarkus Pfeiffer.Fn libusb_set_pollfd_notifiers "libusb_context *ctx" "libusb_pollfd_added_cb added_cb" "libusb_pollfd_removed_cb remove_cb" "void *user_data" 5471d96047eSMarkus PfeifferRegister notification functions for file descriptor additions/removals. 5481d96047eSMarkus PfeifferThese functions will be invoked for every new or removed file descriptor 5491d96047eSMarkus Pfeifferthat libusb uses as an event source. 5501d96047eSMarkus Pfeiffer.Pp 5511d96047eSMarkus Pfeiffer.Ft const struct libusb_pollfd ** 5521d96047eSMarkus Pfeiffer.Fn libusb_get_pollfds "libusb_context *ctx" 55334bf0d2dSSascha WildnerRetrieve a list of file descriptors that should be polled by your main loop as 5541d96047eSMarkus Pfeifferlibusb event sources. 5551d96047eSMarkus PfeifferReturns a NULL-terminated list on success or NULL on failure. 556c4031fc1SImre Vadász.Pp 557c4031fc1SImre Vadász.Ft int 558c4031fc1SImre Vadász.Fn libusb_hotplug_register_callback "libusb_context *ctx" "libusb_hotplug_event events" "libusb_hotplug_flag flags" "int vendor_id" "int product_id" "int dev_class" "libusb_hotplug_callback_fn cb_fn" "void *user_data" "libusb_hotplug_callback_handle *handle" 559c4031fc1SImre VadászThis function registers a hotplug filter. 560c4031fc1SImre VadászThe 561c4031fc1SImre Vadász.Fa events 562c4031fc1SImre Vadászargument select which events makes the hotplug filter trigger. 563c4031fc1SImre VadászAvailable event values are LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED and LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT. 564c4031fc1SImre VadászOne or more events must be specified. 565c4031fc1SImre VadászThe 566c4031fc1SImre Vadász.Fa vendor_id , 567c4031fc1SImre Vadász.Fa product_id 568c4031fc1SImre Vadászand 569c4031fc1SImre Vadász.Fa dev_class 570c4031fc1SImre Vadászarguments can be set to LIBUSB_HOTPLUG_MATCH_ANY to match any value in the USB device descriptor. 571c4031fc1SImre VadászElse the specified value is used for matching. 572c4031fc1SImre VadászIf the 573c4031fc1SImre Vadász.Fa flags 574c4031fc1SImre Vadászargument is set to LIBUSB_HOTPLUG_ENUMERATE, all currently attached and matching USB devices will be passed to the hotplug filter, given by the 575c4031fc1SImre Vadász.Fa cb_fn 576c4031fc1SImre Vadászargument. 577c4031fc1SImre VadászElse the 578c4031fc1SImre Vadász.Fa flags 579c4031fc1SImre Vadászargument should be set to LIBUSB_HOTPLUG_NO_FLAGS. 580c4031fc1SImre VadászThis function returns 0 upon success or a LIBUSB_ERROR code on failure. 581c4031fc1SImre Vadász.Pp 582c4031fc1SImre Vadász.Ft int 583c4031fc1SImre Vadász.Fn libusb_hotplug_callback_fn "libusb_context *ctx" "libusb_device *device" "libusb_hotplug_event event" "void *user_data" 584c4031fc1SImre VadászThe hotplug filter function. 585c4031fc1SImre VadászIf this function returns non-zero, the filter is removed. 586c4031fc1SImre VadászElse the filter is kept and can receive more events. 587c4031fc1SImre VadászThe 588c4031fc1SImre Vadász.Fa user_data 589c4031fc1SImre Vadászargument is the same as given when the filter was registered. 590c4031fc1SImre VadászThe 591c4031fc1SImre Vadász.Fa event 592c4031fc1SImre Vadászargument can be either of LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED or LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT. 593c4031fc1SImre Vadász.Pp 594c4031fc1SImre Vadász.Ft void 595c4031fc1SImre Vadász.Fn libusb_hotplug_deregister_callback "libusb_context *ctx" "libusb_hotplug_callback_handle handle" 596c4031fc1SImre VadászThis function unregisters a hotplug filter. 5971d96047eSMarkus Pfeiffer.Sh LIBUSB VERSION 0.1 COMPATIBILITY 5981d96047eSMarkus PfeifferThe library is also compliant with LibUSB version 0.1.12. 5991d96047eSMarkus Pfeiffer.Pp 6001d96047eSMarkus Pfeiffer.Fn usb_open 6011d96047eSMarkus Pfeiffer.Fn usb_close 6021d96047eSMarkus Pfeiffer.Fn usb_get_string 6031d96047eSMarkus Pfeiffer.Fn usb_get_string_simple 6041d96047eSMarkus Pfeiffer.Fn usb_get_descriptor_by_endpoint 6051d96047eSMarkus Pfeiffer.Fn usb_get_descriptor 6061d96047eSMarkus Pfeiffer.Fn usb_parse_descriptor 6071d96047eSMarkus Pfeiffer.Fn usb_parse_configuration 6081d96047eSMarkus Pfeiffer.Fn usb_destroy_configuration 6091d96047eSMarkus Pfeiffer.Fn usb_fetch_and_parse_descriptors 6101d96047eSMarkus Pfeiffer.Fn usb_bulk_write 6111d96047eSMarkus Pfeiffer.Fn usb_bulk_read 6121d96047eSMarkus Pfeiffer.Fn usb_interrupt_write 6131d96047eSMarkus Pfeiffer.Fn usb_interrupt_read 6141d96047eSMarkus Pfeiffer.Fn usb_control_msg 6151d96047eSMarkus Pfeiffer.Fn usb_set_configuration 6161d96047eSMarkus Pfeiffer.Fn usb_claim_interface 6171d96047eSMarkus Pfeiffer.Fn usb_release_interface 6181d96047eSMarkus Pfeiffer.Fn usb_set_altinterface 6191d96047eSMarkus Pfeiffer.Fn usb_resetep 6201d96047eSMarkus Pfeiffer.Fn usb_clear_halt 6211d96047eSMarkus Pfeiffer.Fn usb_reset 6221d96047eSMarkus Pfeiffer.Fn usb_strerror 6231d96047eSMarkus Pfeiffer.Fn usb_init 6241d96047eSMarkus Pfeiffer.Fn usb_set_debug 6251d96047eSMarkus Pfeiffer.Fn usb_find_busses 6261d96047eSMarkus Pfeiffer.Fn usb_find_devices 6271d96047eSMarkus Pfeiffer.Fn usb_device 6281d96047eSMarkus Pfeiffer.Fn usb_get_busses 6291d96047eSMarkus Pfeiffer.Fn usb_check_connected 6301d96047eSMarkus Pfeiffer.Fn usb_get_driver_np 6311d96047eSMarkus Pfeiffer.Fn usb_detach_kernel_driver_np 6321d96047eSMarkus Pfeiffer.Sh SEE ALSO 6331d96047eSMarkus Pfeiffer.Xr libusb20 3 , 6341d96047eSMarkus Pfeiffer.Xr usb 4 , 6351d96047eSMarkus Pfeiffer.Xr usbconfig 8 , 6361d96047eSMarkus Pfeiffer.Xr usbdump 8 6371d96047eSMarkus Pfeiffer.Pp 6381d96047eSMarkus Pfeiffer.Pa http://libusb.sourceforge.net/ 6391d96047eSMarkus Pfeiffer.Sh HISTORY 6401d96047eSMarkus Pfeiffer.Nm 6411d96047eSMarkus Pfeiffersupport first appeared in 6421d96047eSMarkus Pfeiffer.Fx 8.0 . 643