31 #pragma warning(disable:4200)
33 #if !defined(__cplusplus)
34 #define inline __inline
37 #ifndef _SSIZE_T_DEFINED
38 #define _SSIZE_T_DEFINED
40 typedef SSIZE_T ssize_t;
46 #include <sys/types.h>
47 #if !defined(_MSC_VER)
52 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
53 #define LIBUSB_FLEXIBLE_ARRAY
55 #define LIBUSB_FLEXIBLE_ARRAY 0
63 #if defined(_WIN32) || defined(__CYGWIN__)
65 #if defined(interface)
68 #if !defined(__CYGWIN__)
73 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
74 #define LIBUSB_DEPRECATED_FOR(f) __attribute__ ((deprecated ("Use " #f " instead")))
75 #elif defined(__GNUC__) && (__GNUC__ >= 3)
76 #define LIBUSB_DEPRECATED_FOR(f) __attribute__ ((deprecated))
77 #elif defined(_MSC_VER)
78 #define LIBUSB_DEPRECATED_FOR(f) __declspec(deprecated("Use " #f " instead"))
80 #define LIBUSB_DEPRECATED_FOR(f)
84 #define LIBUSB_PACKED __attribute__ ((packed))
121 #if defined(_WIN32) || defined(__CYGWIN__)
122 #define LIBUSB_CALL WINAPI
123 #define LIBUSB_CALLV WINAPIV
171 #define LIBUSB_API_VERSION 0x0100010A
179 #define LIBUSBX_API_VERSION LIBUSB_API_VERSION
181 #if defined(__cplusplus)
199 _tmp.b8[1] = (uint8_t) (x >> 8);
200 _tmp.b8[0] = (uint8_t) (x & 0xff);
212 #define libusb_le16_to_cpu libusb_cpu_to_le16
239 LIBUSB_CLASS_PTP = 0x06,
329 #define LIBUSB_DT_DEVICE_SIZE 18
330 #define LIBUSB_DT_CONFIG_SIZE 9
331 #define LIBUSB_DT_INTERFACE_SIZE 9
332 #define LIBUSB_DT_ENDPOINT_SIZE 7
333 #define LIBUSB_DT_ENDPOINT_AUDIO_SIZE 9
334 #define LIBUSB_DT_HUB_NONVAR_SIZE 7
335 #define LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE 6
336 #define LIBUSB_DT_BOS_SIZE 5
337 #define LIBUSB_DT_DEVICE_CAPABILITY_SIZE 3
340 #define LIBUSB_BT_USB_2_0_EXTENSION_SIZE 7
341 #define LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE 10
342 #define LIBUSB_BT_CONTAINER_ID_SIZE 20
343 #define LIBUSB_BT_PLATFORM_DESCRIPTOR_MIN_SIZE 20
346 #define LIBUSB_DT_BOS_MAX_SIZE \
347 (LIBUSB_DT_BOS_SIZE + \
348 LIBUSB_BT_USB_2_0_EXTENSION_SIZE + \
349 LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE + \
350 LIBUSB_BT_CONTAINER_ID_SIZE)
352 #define LIBUSB_ENDPOINT_ADDRESS_MASK 0x0f
353 #define LIBUSB_ENDPOINT_DIR_MASK 0x80
367 #define LIBUSB_TRANSFER_TYPE_MASK 0x03
471 #define LIBUSB_ISO_SYNC_TYPE_MASK 0x0c
492 #define LIBUSB_ISO_USAGE_TYPE_MASK 0x30
1039 #if defined(_MSC_VER) || defined(__WATCOMC__)
1040 #pragma pack(push, 1)
1067 #if defined(_MSC_VER) || defined(__WATCOMC__)
1071 #define LIBUSB_CONTROL_SETUP_SIZE (sizeof(struct libusb_control_setup))
1228 #define LIBUSB_ERROR_COUNT 14
1532 #define LIBUSB_OPTION_WEAK_AUTHORITY LIBUSB_OPTION_NO_DEVICE_DISCOVERY
1545 LIBUSB_OPTION_MAX = 4
1647 unsigned char endpoint);
1649 unsigned char endpoint);
1651 int interface_number,
int alternate_setting,
unsigned char endpoint);
1668 int interface_number);
1670 int interface_number);
1676 int interface_number,
int alternate_setting);
1678 unsigned char endpoint);
1682 uint32_t num_streams,
unsigned char *endpoints,
int num_endpoints);
1684 unsigned char *endpoints,
int num_endpoints);
1689 unsigned char *buffer,
size_t length);
1692 int interface_number);
1694 int interface_number);
1696 int interface_number);
1717 return transfer->
buffer + LIBUSB_CONTROL_SETUP_SIZE;
1820 transfer->
buffer = buffer;
1822 transfer->
length = (int) (LIBUSB_CONTROL_SETUP_SIZE
1844 void *user_data,
unsigned int timeout)
1850 transfer->
buffer = buffer;
1851 transfer->
length = length;
1874 unsigned char endpoint, uint32_t stream_id,
1876 void *user_data,
unsigned int timeout)
1879 length, callback, user_data, timeout);
1899 unsigned char endpoint,
unsigned char *buffer,
int length,
1906 transfer->
buffer = buffer;
1907 transfer->
length = length;
1928 unsigned char *buffer,
int length,
int num_iso_packets,
1935 transfer->
buffer = buffer;
1936 transfer->
length = length;
1985 if (packet > INT_MAX)
1987 _packet = (int) packet;
1992 for (i = 0; i < _packet; i++)
1995 return transfer->
buffer + offset;
2025 if (packet > INT_MAX)
2027 _packet = (int) packet;
2039 unsigned char *data, uint16_t
wLength,
unsigned int timeout);
2042 unsigned char endpoint,
unsigned char *data,
int length,
2043 int *actual_length,
unsigned int timeout);
2046 unsigned char endpoint,
unsigned char *data,
int length,
2047 int *actual_length,
unsigned int timeout);
2062 uint8_t desc_type, uint8_t desc_index,
unsigned char *data,
int length)
2066 0, data, (uint16_t) length, 1000);
2084 uint8_t desc_index, uint16_t langid,
unsigned char *data,
int length)
2088 langid, data, (uint16_t) length, 1000);
2092 uint8_t desc_index,
unsigned char *data,
int length);
2107 struct timeval *tv);
2109 struct timeval *tv,
int *completed);
2113 struct timeval *tv);
2116 struct timeval *tv);
2204 #define LIBUSB_HOTPLUG_NO_FLAGS 0
2208 #define LIBUSB_HOTPLUG_MATCH_ANY -1
2272 int vendor_id,
int product_id,
int dev_class,
2304 #pragma warning(pop)
2307 #if defined(__cplusplus)
struct libusb_transfer * libusb_alloc_transfer(int iso_packets)
Allocate a libusb transfer with a specified number of isochronous packet descriptors.
Definition: io.c:1289
libusb_transfer_flags
libusb_transfer.flags values
Definition: libusb.h:1281
static void libusb_fill_iso_transfer(struct libusb_transfer *transfer, libusb_device_handle *dev_handle, unsigned char endpoint, unsigned char *buffer, int length, int num_iso_packets, libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout)
Helper function to populate the required libusb_transfer fields for an isochronous transfer.
Definition: libusb.h:1926
static void libusb_fill_control_transfer(struct libusb_transfer *transfer, libusb_device_handle *dev_handle, unsigned char *buffer, libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout)
Helper function to populate the required libusb_transfer fields for a control transfer.
Definition: libusb.h:1810
static unsigned char * libusb_get_iso_packet_buffer_simple(struct libusb_transfer *transfer, unsigned int packet)
Convenience function to locate the position of an isochronous packet within the buffer of an isochron...
Definition: libusb.h:2017
unsigned char * libusb_dev_mem_alloc(libusb_device_handle *dev_handle, size_t length)
Attempts to allocate a block of persistent DMA memory suitable for transfers against the given device...
Definition: core.c:2038
static void libusb_fill_control_setup(unsigned char *buffer, uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint16_t wLength)
Helper function to populate the setup packet (first 8 bytes of the data buffer) for a control transfe...
Definition: libusb.h:1761
uint32_t libusb_transfer_get_stream_id(struct libusb_transfer *transfer)
Get a transfers bulk stream id.
Definition: io.c:1667
int libusb_cancel_transfer(struct libusb_transfer *transfer)
Asynchronously cancel a previously submitted transfer.
Definition: io.c:1606
static struct libusb_control_setup * libusb_control_transfer_get_setup(struct libusb_transfer *transfer)
Get the control setup packet of a control transfer.
Definition: libusb.h:1732
void libusb_free_transfer(struct libusb_transfer *transfer)
Free a transfer structure.
Definition: io.c:1331
static unsigned char * libusb_get_iso_packet_buffer(struct libusb_transfer *transfer, unsigned int packet)
Convenience function to locate the position of an isochronous packet within the buffer of an isochron...
Definition: libusb.h:1975
static void libusb_fill_interrupt_transfer(struct libusb_transfer *transfer, libusb_device_handle *dev_handle, unsigned char endpoint, unsigned char *buffer, int length, libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout)
Helper function to populate the required libusb_transfer fields for an interrupt transfer.
Definition: libusb.h:1897
libusb_transfer_status
Transfer status codes.
Definition: libusb.h:1251
int libusb_free_streams(libusb_device_handle *dev_handle, unsigned char *endpoints, int num_endpoints)
Free usb bulk streams allocated with libusb_alloc_streams().
Definition: core.c:1995
int libusb_submit_transfer(struct libusb_transfer *transfer)
Submit a transfer.
Definition: io.c:1486
static void libusb_fill_bulk_stream_transfer(struct libusb_transfer *transfer, libusb_device_handle *dev_handle, unsigned char endpoint, uint32_t stream_id, unsigned char *buffer, int length, libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout)
Helper function to populate the required libusb_transfer fields for a bulk transfer using bulk stream...
Definition: libusb.h:1872
void(* libusb_transfer_cb_fn)(struct libusb_transfer *transfer)
Asynchronous transfer callback function type.
Definition: libusb.h:1348
libusb_transfer_type
Transfer type.
Definition: libusb.h:1232
static void libusb_set_iso_packet_lengths(struct libusb_transfer *transfer, unsigned int length)
Convenience function to set the length of all packets in an isochronous transfer, based on the num_is...
Definition: libusb.h:1950
static void libusb_fill_bulk_transfer(struct libusb_transfer *transfer, libusb_device_handle *dev_handle, unsigned char endpoint, unsigned char *buffer, int length, libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout)
Helper function to populate the required libusb_transfer fields for a bulk transfer.
Definition: libusb.h:1841
int libusb_dev_mem_free(libusb_device_handle *dev_handle, unsigned char *buffer, size_t length)
Free device memory allocated with libusb_dev_mem_alloc().
Definition: core.c:2058
int libusb_alloc_streams(libusb_device_handle *dev_handle, uint32_t num_streams, unsigned char *endpoints, int num_endpoints)
Allocate up to num_streams usb bulk streams on the specified endpoints.
Definition: core.c:1965
static unsigned char * libusb_control_transfer_get_data(struct libusb_transfer *transfer)
Get the data section of a control transfer.
Definition: libusb.h:1714
void libusb_transfer_set_stream_id(struct libusb_transfer *transfer, uint32_t stream_id)
Set a transfers bulk stream id.
Definition: io.c:1650
@ LIBUSB_TRANSFER_ADD_ZERO_PACKET
Terminate transfers that are a multiple of the endpoint's wMaxPacketSize with an extra zero length pa...
Definition: libusb.h:1321
@ LIBUSB_TRANSFER_FREE_TRANSFER
Automatically call libusb_free_transfer() after callback returns.
Definition: libusb.h:1295
@ LIBUSB_TRANSFER_SHORT_NOT_OK
Report short frames as errors.
Definition: libusb.h:1283
@ LIBUSB_TRANSFER_FREE_BUFFER
Automatically free() transfer buffer during libusb_free_transfer().
Definition: libusb.h:1289
@ LIBUSB_TRANSFER_STALL
For bulk/interrupt endpoints: halt condition detected (endpoint stalled).
Definition: libusb.h:1267
@ LIBUSB_TRANSFER_COMPLETED
Transfer completed without error.
Definition: libusb.h:1254
@ LIBUSB_TRANSFER_CANCELLED
Transfer was cancelled.
Definition: libusb.h:1263
@ LIBUSB_TRANSFER_ERROR
Transfer failed.
Definition: libusb.h:1257
@ LIBUSB_TRANSFER_OVERFLOW
Device sent more data than requested.
Definition: libusb.h:1273
@ LIBUSB_TRANSFER_NO_DEVICE
Device was disconnected.
Definition: libusb.h:1270
@ LIBUSB_TRANSFER_TIMED_OUT
Transfer timed out.
Definition: libusb.h:1260
@ LIBUSB_TRANSFER_TYPE_BULK_STREAM
Bulk stream transfer.
Definition: libusb.h:1246
@ LIBUSB_TRANSFER_TYPE_ISOCHRONOUS
Isochronous transfer.
Definition: libusb.h:1237
@ LIBUSB_TRANSFER_TYPE_CONTROL
Control transfer.
Definition: libusb.h:1234
@ LIBUSB_TRANSFER_TYPE_BULK
Bulk transfer.
Definition: libusb.h:1240
@ LIBUSB_TRANSFER_TYPE_INTERRUPT
Interrupt transfer.
Definition: libusb.h:1243
static int libusb_get_string_descriptor(libusb_device_handle *dev_handle, uint8_t desc_index, uint16_t langid, unsigned char *data, int length)
Retrieve a descriptor from a device.
Definition: libusb.h:2083
libusb_descriptor_type
Descriptor types as defined by the USB specification.
Definition: libusb.h:283
libusb_supported_speed
Supported speeds (wSpeedSupported) bitfield.
Definition: libusb.h:514
void libusb_free_config_descriptor(struct libusb_config_descriptor *config)
Free a configuration descriptor obtained from libusb_get_active_config_descriptor() or libusb_get_con...
Definition: descriptor.c:682
int libusb_get_string_descriptor_ascii(libusb_device_handle *dev_handle, uint8_t desc_index, unsigned char *data, int length)
Retrieve a string descriptor in C style ASCII.
Definition: descriptor.c:1149
void libusb_free_platform_descriptor(struct libusb_platform_descriptor *platform_descriptor)
Free a platform descriptor obtained from libusb_get_platform_descriptor().
Definition: descriptor.c:1131
int libusb_get_config_descriptor_by_value(libusb_device *dev, uint8_t bConfigurationValue, struct libusb_config_descriptor **config)
Get a USB configuration descriptor with a specific bConfigurationValue.
Definition: descriptor.c:642
int libusb_get_interface_association_descriptors(libusb_device *dev, uint8_t config_index, struct libusb_interface_association_descriptor_array **iad_array)
Get an array of interface association descriptors (IAD) for a given configuration.
Definition: descriptor.c:1305
int libusb_get_active_config_descriptor(libusb_device *dev, struct libusb_config_descriptor **config)
Get the USB configuration descriptor for the currently active configuration.
Definition: descriptor.c:555
void libusb_free_ss_endpoint_companion_descriptor(struct libusb_ss_endpoint_companion_descriptor *ep_comp)
Free a superspeed endpoint companion descriptor obtained from libusb_get_ss_endpoint_companion_descri...
Definition: descriptor.c:754
int libusb_get_device_descriptor(libusb_device *dev, struct libusb_device_descriptor *desc)
Get the USB device descriptor for a given device.
Definition: descriptor.c:531
void libusb_free_usb_2_0_extension_descriptor(struct libusb_usb_2_0_extension_descriptor *usb_2_0_extension)
Free a USB 2.0 Extension descriptor obtained from libusb_get_usb_2_0_extension_descriptor().
Definition: descriptor.c:957
int libusb_get_active_interface_association_descriptors(libusb_device *dev, struct libusb_interface_association_descriptor_array **iad_array)
Get an array of interface association descriptors (IAD) for the currently active configuration.
Definition: descriptor.c:1354
int libusb_get_bos_descriptor(libusb_device_handle *dev_handle, struct libusb_bos_descriptor **bos)
Get a Binary Object Store (BOS) descriptor This is a BLOCKING function, which will send requests to t...
Definition: descriptor.c:846
libusb_bos_type
USB capability types.
Definition: libusb.h:551
int libusb_get_container_id_descriptor(libusb_context *ctx, struct libusb_bos_dev_capability_descriptor *dev_cap, struct libusb_container_id_descriptor **container_id)
Get a Container ID descriptor.
Definition: descriptor.c:1032
libusb_endpoint_direction
Endpoint direction.
Definition: libusb.h:359
libusb_endpoint_transfer_type
Endpoint transfer type.
Definition: libusb.h:373
void libusb_free_ss_usb_device_capability_descriptor(struct libusb_ss_usb_device_capability_descriptor *ss_usb_device_cap)
Free a SuperSpeed USB Device Capability descriptor obtained from libusb_get_ss_usb_device_capability_...
Definition: descriptor.c:1013
static int libusb_get_descriptor(libusb_device_handle *dev_handle, uint8_t desc_type, uint8_t desc_index, unsigned char *data, int length)
Retrieve a descriptor from the default control pipe.
Definition: libusb.h:2061
libusb_iso_sync_type
Synchronization type for isochronous endpoints.
Definition: libusb.h:478
void libusb_free_interface_association_descriptors(struct libusb_interface_association_descriptor_array *iad_array)
Free an array of interface association descriptors (IADs) obtained from libusb_get_interface_associat...
Definition: descriptor.c:1390
int libusb_get_config_descriptor(libusb_device *dev, uint8_t config_index, struct libusb_config_descriptor **config)
Get a USB configuration descriptor based on its index.
Definition: descriptor.c:596
libusb_ss_usb_device_capability_attributes
Masks for the bits of the bmAttributes field field of the SuperSpeed USB Device Capability descriptor...
Definition: libusb.h:543
int libusb_get_ss_endpoint_companion_descriptor(libusb_context *ctx, const struct libusb_endpoint_descriptor *endpoint, struct libusb_ss_endpoint_companion_descriptor **ep_comp)
Get an endpoints superspeed endpoint companion descriptor (if any)
Definition: descriptor.c:705
libusb_iso_usage_type
Usage type for isochronous endpoints.
Definition: libusb.h:499
libusb_class_code
Device and/or Interface Class codes.
Definition: libusb.h:218
int libusb_get_ss_usb_device_capability_descriptor(libusb_context *ctx, struct libusb_bos_dev_capability_descriptor *dev_cap, struct libusb_ss_usb_device_capability_descriptor **ss_usb_device_cap)
Get a SuperSpeed USB Device Capability descriptor.
Definition: descriptor.c:976
int libusb_get_platform_descriptor(libusb_context *ctx, struct libusb_bos_dev_capability_descriptor *dev_cap, struct libusb_platform_descriptor **platform_descriptor)
Get a platform descriptor.
Definition: descriptor.c:1088
void libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos)
Free a BOS descriptor obtained from libusb_get_bos_descriptor().
Definition: descriptor.c:896
libusb_usb_2_0_extension_attributes
Masks for the bits of the bmAttributes field of the USB 2.0 Extension descriptor.
Definition: libusb.h:533
int libusb_get_usb_2_0_extension_descriptor(libusb_context *ctx, struct libusb_bos_dev_capability_descriptor *dev_cap, struct libusb_usb_2_0_extension_descriptor **usb_2_0_extension)
Get an USB 2.0 Extension descriptor.
Definition: descriptor.c:921
void libusb_free_container_id_descriptor(struct libusb_container_id_descriptor *container_id)
Free a Container ID descriptor obtained from libusb_get_container_id_descriptor().
Definition: descriptor.c:1067
@ LIBUSB_DT_HUB
Hub descriptor.
Definition: libusb.h:319
@ LIBUSB_DT_CONFIG
Configuration descriptor.
Definition: libusb.h:288
@ LIBUSB_DT_STRING
String descriptor.
Definition: libusb.h:291
@ LIBUSB_DT_HID
HID descriptor.
Definition: libusb.h:310
@ LIBUSB_DT_REPORT
HID report descriptor.
Definition: libusb.h:313
@ LIBUSB_DT_DEVICE
Device descriptor.
Definition: libusb.h:285
@ LIBUSB_DT_DEVICE_CAPABILITY
Device Capability descriptor.
Definition: libusb.h:307
@ LIBUSB_DT_SUPERSPEED_HUB
SuperSpeed Hub descriptor.
Definition: libusb.h:322
@ LIBUSB_DT_PHYSICAL
Physical descriptor.
Definition: libusb.h:316
@ LIBUSB_DT_INTERFACE
Interface descriptor.
Definition: libusb.h:294
@ LIBUSB_DT_ENDPOINT
Endpoint descriptor.
Definition: libusb.h:297
@ LIBUSB_DT_SS_ENDPOINT_COMPANION
SuperSpeed Endpoint Companion descriptor.
Definition: libusb.h:325
@ LIBUSB_DT_BOS
BOS descriptor.
Definition: libusb.h:304
@ LIBUSB_DT_INTERFACE_ASSOCIATION
Interface Association Descriptor.
Definition: libusb.h:301
@ LIBUSB_HIGH_SPEED_OPERATION
High speed operation supported (480MBit/s).
Definition: libusb.h:522
@ LIBUSB_LOW_SPEED_OPERATION
Low speed operation supported (1.5MBit/s).
Definition: libusb.h:516
@ LIBUSB_SUPER_SPEED_OPERATION
Superspeed operation supported (5000MBit/s).
Definition: libusb.h:525
@ LIBUSB_FULL_SPEED_OPERATION
Full speed operation supported (12MBit/s).
Definition: libusb.h:519
@ LIBUSB_BT_USB_2_0_EXTENSION
USB 2.0 extensions.
Definition: libusb.h:556
@ LIBUSB_BT_SS_USB_DEVICE_CAPABILITY
SuperSpeed USB device capability.
Definition: libusb.h:559
@ LIBUSB_BT_PLATFORM_DESCRIPTOR
Platform descriptor.
Definition: libusb.h:565
@ LIBUSB_BT_WIRELESS_USB_DEVICE_CAPABILITY
Wireless USB device capability.
Definition: libusb.h:553
@ LIBUSB_BT_CONTAINER_ID
Container ID type.
Definition: libusb.h:562
@ LIBUSB_ENDPOINT_IN
In: device-to-host.
Definition: libusb.h:364
@ LIBUSB_ENDPOINT_OUT
Out: host-to-device.
Definition: libusb.h:361
@ LIBUSB_ENDPOINT_TRANSFER_TYPE_INTERRUPT
Interrupt endpoint.
Definition: libusb.h:384
@ LIBUSB_ENDPOINT_TRANSFER_TYPE_ISOCHRONOUS
Isochronous endpoint.
Definition: libusb.h:378
@ LIBUSB_ENDPOINT_TRANSFER_TYPE_BULK
Bulk endpoint.
Definition: libusb.h:381
@ LIBUSB_ENDPOINT_TRANSFER_TYPE_CONTROL
Control endpoint.
Definition: libusb.h:375
@ LIBUSB_ISO_SYNC_TYPE_SYNC
Synchronous.
Definition: libusb.h:489
@ LIBUSB_ISO_SYNC_TYPE_NONE
No synchronization.
Definition: libusb.h:480
@ LIBUSB_ISO_SYNC_TYPE_ADAPTIVE
Adaptive.
Definition: libusb.h:486
@ LIBUSB_ISO_SYNC_TYPE_ASYNC
Asynchronous.
Definition: libusb.h:483
@ LIBUSB_BM_LTM_SUPPORT
Supports Latency Tolerance Messages (LTM)
Definition: libusb.h:545
@ LIBUSB_ISO_USAGE_TYPE_DATA
Data endpoint.
Definition: libusb.h:501
@ LIBUSB_ISO_USAGE_TYPE_FEEDBACK
Feedback endpoint.
Definition: libusb.h:504
@ LIBUSB_ISO_USAGE_TYPE_IMPLICIT
Implicit feedback Data endpoint.
Definition: libusb.h:507
@ LIBUSB_CLASS_AUDIO
Audio class.
Definition: libusb.h:226
@ LIBUSB_CLASS_HUB
Hub class.
Definition: libusb.h:248
@ LIBUSB_CLASS_MISCELLANEOUS
Miscellaneous class.
Definition: libusb.h:272
@ LIBUSB_CLASS_APPLICATION
Application class.
Definition: libusb.h:275
@ LIBUSB_CLASS_CONTENT_SECURITY
Content Security.
Definition: libusb.h:257
@ LIBUSB_CLASS_DIAGNOSTIC_DEVICE
Diagnostic Device.
Definition: libusb.h:266
@ LIBUSB_CLASS_PHYSICAL
Physical.
Definition: libusb.h:235
@ LIBUSB_CLASS_COMM
Communications class.
Definition: libusb.h:229
@ LIBUSB_CLASS_VIDEO
Video.
Definition: libusb.h:260
@ LIBUSB_CLASS_DATA
Data class.
Definition: libusb.h:251
@ LIBUSB_CLASS_WIRELESS
Wireless class.
Definition: libusb.h:269
@ LIBUSB_CLASS_PRINTER
Printer class.
Definition: libusb.h:242
@ LIBUSB_CLASS_PERSONAL_HEALTHCARE
Personal Healthcare.
Definition: libusb.h:263
@ LIBUSB_CLASS_PER_INTERFACE
In the context of a device descriptor, this bDeviceClass value indicates that each interface specifie...
Definition: libusb.h:223
@ LIBUSB_CLASS_MASS_STORAGE
Mass storage class.
Definition: libusb.h:245
@ LIBUSB_CLASS_HID
Human Interface Device class.
Definition: libusb.h:232
@ LIBUSB_CLASS_VENDOR_SPEC
Class is vendor-specific.
Definition: libusb.h:278
@ LIBUSB_CLASS_IMAGE
Image class.
Definition: libusb.h:238
@ LIBUSB_CLASS_SMART_CARD
Smart Card.
Definition: libusb.h:254
@ LIBUSB_BM_LPM_SUPPORT
Supports Link Power Management (LPM)
Definition: libusb.h:535
int libusb_get_max_alt_packet_size(libusb_device *dev, int interface_number, int alternate_setting, unsigned char endpoint)
Calculate the maximum packet size which a specific endpoint is capable of sending or receiving in the...
Definition: core.c:1239
libusb_device_handle * libusb_open_device_with_vid_pid(libusb_context *ctx, uint16_t vendor_id, uint16_t product_id)
Convenience function for finding a device with a particular idVendor/idProduct combination.
Definition: core.c:1460
uint8_t libusb_get_port_number(libusb_device *dev)
Get the number of the port that a device is connected to.
Definition: core.c:932
int libusb_kernel_driver_active(libusb_device_handle *dev_handle, int interface_number)
Determine if a kernel driver is active on an interface.
Definition: core.c:2084
libusb_speed
Speed codes.
Definition: libusb.h:1153
void libusb_unref_device(libusb_device *dev)
Decrement the reference count of a device.
Definition: core.c:1288
int libusb_open(libusb_device *dev, libusb_device_handle **dev_handle)
Open a device and obtain a device handle.
Definition: core.c:1405
int libusb_set_interface_alt_setting(libusb_device_handle *dev_handle, int interface_number, int alternate_setting)
Activate an alternate setting for an interface.
Definition: core.c:1862
int libusb_release_interface(libusb_device_handle *dev_handle, int interface_number)
Release an interface previously claimed with libusb_claim_interface().
Definition: core.c:1817
int libusb_get_device_speed(libusb_device *dev)
Get the negotiated connection speed for a device.
Definition: core.c:1015
int libusb_detach_kernel_driver(libusb_device_handle *dev_handle, int interface_number)
Detach a kernel driver from an interface.
Definition: core.c:2122
void libusb_close(libusb_device_handle *dev_handle)
Close a device handle.
Definition: core.c:1562
struct libusb_device libusb_device
Structure representing a USB device detected on the system.
Definition: libusb.h:1137
int libusb_set_configuration(libusb_device_handle *dev_handle, int configuration)
Set the active configuration for a device.
Definition: core.c:1736
struct libusb_device_handle libusb_device_handle
Structure representing a handle on a USB device.
Definition: libusb.h:1148
libusb_device * libusb_get_parent(libusb_device *dev)
Get the the parent from the specified device.
Definition: core.c:994
int libusb_wrap_sys_device(libusb_context *ctx, intptr_t sys_dev, libusb_device_handle **dev_handle)
Wrap a platform-specific system device handle and obtain a libusb device handle for the underlying de...
Definition: core.c:1350
int libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t *path, uint8_t path_length)
Definition: core.c:974
int libusb_get_port_numbers(libusb_device *dev, uint8_t *port_numbers, int port_numbers_len)
Get the list of all port numbers from root for the specified device.
Definition: core.c:948
libusb_device * libusb_ref_device(libusb_device *dev)
Increment the reference count of a device.
Definition: core.c:1273
uint8_t libusb_get_device_address(libusb_device *dev)
Get the address of the device on the bus it is connected to.
Definition: core.c:1004
int libusb_clear_halt(libusb_device_handle *dev_handle, unsigned char endpoint)
Clear the halt/stall condition for an endpoint.
Definition: core.c:1903
ssize_t libusb_get_device_list(libusb_context *ctx, libusb_device ***list)
Returns a list of USB devices currently attached to the system.
Definition: core.c:822
int libusb_set_auto_detach_kernel_driver(libusb_device_handle *dev_handle, int enable)
Enable/disable libusb's automatic kernel driver detachment.
Definition: core.c:2197
int libusb_get_max_packet_size(libusb_device *dev, unsigned char endpoint)
Convenience function to retrieve the wMaxPacketSize value for a particular endpoint in the active dev...
Definition: core.c:1061
void libusb_free_device_list(libusb_device **list, int unref_devices)
Frees a list of devices previously discovered using libusb_get_device_list().
Definition: core.c:892
int libusb_attach_kernel_driver(libusb_device_handle *dev_handle, int interface_number)
Re-attach an interface's kernel driver, which was previously detached using libusb_detach_kernel_driv...
Definition: core.c:2158
int libusb_get_configuration(libusb_device_handle *dev, int *config)
Determine the bConfigurationValue of the currently active configuration.
Definition: core.c:1649
int libusb_get_max_iso_packet_size(libusb_device *dev, unsigned char endpoint)
Calculate the maximum packet size which a specific endpoint is capable is sending or receiving in the...
Definition: core.c:1180
int libusb_claim_interface(libusb_device_handle *dev_handle, int interface_number)
Claim an interface on a given device handle.
Definition: core.c:1773
uint8_t libusb_get_bus_number(libusb_device *dev)
Get the number of the bus that a device is connected to.
Definition: core.c:913
libusb_device * libusb_get_device(libusb_device_handle *dev_handle)
Get the underlying device for a device handle.
Definition: core.c:1624
int libusb_reset_device(libusb_device_handle *dev_handle)
Perform a USB port reset to reinitialize a device.
Definition: core.c:1932
@ LIBUSB_SPEED_FULL
The device is operating at full speed (12MBit/s).
Definition: libusb.h:1161
@ LIBUSB_SPEED_HIGH
The device is operating at high speed (480MBit/s).
Definition: libusb.h:1164
@ LIBUSB_SPEED_LOW
The device is operating at low speed (1.5MBit/s).
Definition: libusb.h:1158
@ LIBUSB_SPEED_SUPER_PLUS
The device is operating at super speed plus (10000MBit/s).
Definition: libusb.h:1170
@ LIBUSB_SPEED_SUPER
The device is operating at super speed (5000MBit/s).
Definition: libusb.h:1167
@ LIBUSB_SPEED_UNKNOWN
The OS doesn't report or know the device speed.
Definition: libusb.h:1155
int(* libusb_hotplug_callback_fn)(libusb_context *ctx, libusb_device *device, libusb_hotplug_event event, void *user_data)
Hotplug callback function type.
Definition: libusb.h:2232
int libusb_hotplug_callback_handle
Callback handle.
Definition: libusb.h:2175
libusb_hotplug_event
Since version 1.0.16, LIBUSB_API_VERSION >= 0x01000102.
Definition: libusb.h:2182
int libusb_hotplug_register_callback(libusb_context *ctx, int events, int flags, int vendor_id, int product_id, int dev_class, libusb_hotplug_callback_fn cb_fn, void *user_data, libusb_hotplug_callback_handle *callback_handle)
Register a hotplug callback function.
Definition: hotplug.c:323
void libusb_hotplug_deregister_callback(libusb_context *ctx, libusb_hotplug_callback_handle callback_handle)
Deregisters a hotplug callback.
Definition: hotplug.c:408
libusb_hotplug_flag
Since version 1.0.16, LIBUSB_API_VERSION >= 0x01000102.
Definition: libusb.h:2197
void * libusb_hotplug_get_user_data(libusb_context *ctx, libusb_hotplug_callback_handle callback_handle)
Gets the user_data associated with a hotplug callback.
Definition: hotplug.c:446
@ LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED
A device has been plugged in and is ready to use.
Definition: libusb.h:2184
@ LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT
A device has left and is no longer available.
Definition: libusb.h:2189
@ LIBUSB_HOTPLUG_ENUMERATE
Arm the callback and fire it for all matching currently attached devices.
Definition: libusb.h:2199
libusb_option
Available option values for libusb_set_option() and libusb_init_context().
Definition: libusb.h:1478
int LIBUSB_CALLV libusb_set_option(libusb_context *ctx, enum libusb_option option,...)
Set an option in the library.
Definition: core.c:2291
libusb_log_cb_mode
Log callback mode.
Definition: libusb.h:1467
libusb_log_level
Log message levels.
Definition: libusb.h:1443
void libusb_set_log_cb(libusb_context *ctx, libusb_log_cb cb, int mode)
Set log handler.
Definition: core.c:2262
struct libusb_context libusb_context
Structure representing a libusb session.
Definition: libusb.h:1120
void libusb_set_debug(libusb_context *ctx, int level)
Deprecated.
Definition: core.c:2211
int libusb_init(libusb_context **ctx)
Deprecated initialization function.
Definition: core.c:2401
void(* libusb_log_cb)(libusb_context *ctx, enum libusb_log_level level, const char *str)
Callback function for handling log messages.
Definition: libusb.h:1559
int libusb_init_context(libusb_context **ctx, const struct libusb_init_option options[], int num_options)
Initialize libusb.
Definition: core.c:2424
void libusb_exit(libusb_context *ctx)
Deinitialize libusb.
Definition: core.c:2577
@ LIBUSB_OPTION_NO_DEVICE_DISCOVERY
Do not scan for devices.
Definition: libusb.h:1530
@ LIBUSB_OPTION_LOG_CB
Set the context log callback function.
Definition: libusb.h:1543
@ LIBUSB_OPTION_LOG_LEVEL
Set the log message verbosity.
Definition: libusb.h:1501
@ LIBUSB_OPTION_USE_USBDK
Use the UsbDk backend for a specific context, if available.
Definition: libusb.h:1510
@ LIBUSB_LOG_CB_GLOBAL
Callback function handling all log messages.
Definition: libusb.h:1469
@ LIBUSB_LOG_CB_CONTEXT
Callback function handling context related log messages.
Definition: libusb.h:1472
@ LIBUSB_LOG_LEVEL_WARNING
(2) : Warning and error messages are emitted
Definition: libusb.h:1451
@ LIBUSB_LOG_LEVEL_INFO
(3) : Informational, warning and error messages are emitted
Definition: libusb.h:1454
@ LIBUSB_LOG_LEVEL_ERROR
(1) : Error messages are emitted
Definition: libusb.h:1448
@ LIBUSB_LOG_LEVEL_NONE
(0) : No messages ever emitted by the library (default)
Definition: libusb.h:1445
@ LIBUSB_LOG_LEVEL_DEBUG
(4) : All messages are emitted
Definition: libusb.h:1457
libusb_request_type
Request type bits of the bmRequestType field in control transfers.
Definition: libusb.h:439
int libusb_setlocale(const char *locale)
Set the language, and only the language, not the encoding! used for translatable libusb messages.
Definition: strerror.c:178
libusb_request_recipient
Recipient bits of the bmRequestType field in control transfers.
Definition: libusb.h:457
#define libusb_le16_to_cpu
Convert a 16-bit value from little-endian to host-endian format.
Definition: libusb.h:212
libusb_standard_request
Standard requests, as defined in table 9-5 of the USB 3.0 specifications.
Definition: libusb.h:389
const struct libusb_version * libusb_get_version(void)
Returns a pointer to const struct libusb_version with the version (major, minor, micro,...
Definition: core.c:2924
int libusb_has_capability(uint32_t capability)
Check at runtime if the loaded library has a given capability.
Definition: core.c:2651
#define LIBUSB_CALL
libusb's Windows calling convention.
Definition: libusb.h:125
libusb_capability
Capabilities supported by an instance of libusb on the current running platform.
Definition: libusb.h:1422
libusb_error
Error codes.
Definition: libusb.h:1180
const char * libusb_error_name(int errcode)
Returns a constant NULL-terminated string with the ASCII name of a libusb error or transfer status co...
Definition: core.c:2869
const char * libusb_strerror(int errcode)
Returns a constant string with a short description of the given error code, this description is inten...
Definition: strerror.c:213
static uint16_t libusb_cpu_to_le16(const uint16_t x)
Convert a 16-bit value from host-endian to little-endian format.
Definition: libusb.h:193
@ LIBUSB_REQUEST_TYPE_VENDOR
Vendor.
Definition: libusb.h:447
@ LIBUSB_REQUEST_TYPE_STANDARD
Standard.
Definition: libusb.h:441
@ LIBUSB_REQUEST_TYPE_CLASS
Class.
Definition: libusb.h:444
@ LIBUSB_REQUEST_TYPE_RESERVED
Reserved.
Definition: libusb.h:450
@ LIBUSB_RECIPIENT_ENDPOINT
Endpoint.
Definition: libusb.h:465
@ LIBUSB_RECIPIENT_INTERFACE
Interface.
Definition: libusb.h:462
@ LIBUSB_RECIPIENT_OTHER
Other.
Definition: libusb.h:468
@ LIBUSB_RECIPIENT_DEVICE
Device.
Definition: libusb.h:459
@ LIBUSB_REQUEST_CLEAR_FEATURE
Clear or disable a specific feature.
Definition: libusb.h:394
@ LIBUSB_REQUEST_GET_INTERFACE
Return the selected alternate setting for the specified interface.
Definition: libusb.h:419
@ LIBUSB_REQUEST_GET_DESCRIPTOR
Get the specified descriptor.
Definition: libusb.h:407
@ LIBUSB_REQUEST_SET_DESCRIPTOR
Used to update existing descriptors or add new descriptors.
Definition: libusb.h:410
@ LIBUSB_REQUEST_GET_STATUS
Request status of the specific recipient.
Definition: libusb.h:391
@ LIBUSB_REQUEST_SET_FEATURE
Set or enable a specific feature.
Definition: libusb.h:399
@ LIBUSB_REQUEST_SET_INTERFACE
Select an alternate interface for the specified interface.
Definition: libusb.h:422
@ LIBUSB_REQUEST_SET_ADDRESS
Set device address for all future accesses.
Definition: libusb.h:404
@ LIBUSB_REQUEST_GET_CONFIGURATION
Get the current device configuration value.
Definition: libusb.h:413
@ LIBUSB_REQUEST_SET_SEL
Sets both the U1 and U2 Exit Latency.
Definition: libusb.h:428
@ LIBUSB_SET_ISOCH_DELAY
Delay from the time a host transmits a packet to the time it is received by the device.
Definition: libusb.h:432
@ LIBUSB_REQUEST_SYNCH_FRAME
Set then report an endpoint's synchronization frame.
Definition: libusb.h:425
@ LIBUSB_REQUEST_SET_CONFIGURATION
Set device configuration.
Definition: libusb.h:416
@ LIBUSB_CAP_HAS_CAPABILITY
The libusb_has_capability() API is available.
Definition: libusb.h:1424
@ LIBUSB_CAP_HAS_HOTPLUG
Hotplug support is available on this platform.
Definition: libusb.h:1427
@ LIBUSB_CAP_HAS_HID_ACCESS
The library can access HID devices without requiring user intervention.
Definition: libusb.h:1433
@ LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER
The library supports detaching of the default USB driver, using libusb_detach_kernel_driver(),...
Definition: libusb.h:1437
@ LIBUSB_ERROR_NOT_SUPPORTED
Operation not supported or unimplemented on this platform.
Definition: libusb.h:1218
@ LIBUSB_ERROR_ACCESS
Access denied (insufficient permissions)
Definition: libusb.h:1191
@ LIBUSB_ERROR_PIPE
Pipe error.
Definition: libusb.h:1209
@ LIBUSB_ERROR_NOT_FOUND
Entity not found.
Definition: libusb.h:1197
@ LIBUSB_ERROR_BUSY
Resource busy.
Definition: libusb.h:1200
@ LIBUSB_ERROR_INTERRUPTED
System call interrupted (perhaps due to signal)
Definition: libusb.h:1212
@ LIBUSB_SUCCESS
Success (no error)
Definition: libusb.h:1182
@ LIBUSB_ERROR_INVALID_PARAM
Invalid parameter.
Definition: libusb.h:1188
@ LIBUSB_ERROR_IO
Input/output error.
Definition: libusb.h:1185
@ LIBUSB_ERROR_OTHER
Other error.
Definition: libusb.h:1224
@ LIBUSB_ERROR_TIMEOUT
Operation timed out.
Definition: libusb.h:1203
@ LIBUSB_ERROR_OVERFLOW
Overflow.
Definition: libusb.h:1206
@ LIBUSB_ERROR_NO_DEVICE
No such device (it may have been disconnected)
Definition: libusb.h:1194
@ LIBUSB_ERROR_NO_MEM
Insufficient memory.
Definition: libusb.h:1215
int libusb_handle_events_completed(libusb_context *ctx, int *completed)
Handle any pending events in blocking mode.
Definition: io.c:2462
void libusb_lock_event_waiters(libusb_context *ctx)
Acquire the event waiters lock.
Definition: io.c:1983
void libusb_interrupt_event_handler(libusb_context *ctx)
Interrupt any active thread that is handling events.
Definition: io.c:1947
void libusb_set_pollfd_notifiers(libusb_context *ctx, libusb_pollfd_added_cb added_cb, libusb_pollfd_removed_cb removed_cb, void *user_data)
Register notification functions for file descriptor additions/removals.
Definition: io.c:2644
void(* libusb_pollfd_added_cb)(int fd, short events, void *user_data)
Callback function, invoked when a new file descriptor should be added to the set of file descriptors ...
Definition: libusb.h:2142
void(* libusb_pollfd_removed_cb)(int fd, void *user_data)
Callback function, invoked when a file descriptor should be removed from the set of file descriptors ...
Definition: libusb.h:2154
int libusb_event_handler_active(libusb_context *ctx)
Determine if an active thread is handling events (i.e.
Definition: io.c:1918
void libusb_unlock_event_waiters(libusb_context *ctx)
Release the event waiters lock.
Definition: io.c:1994
int libusb_handle_events_timeout_completed(libusb_context *ctx, struct timeval *tv, int *completed)
Handle any pending events.
Definition: io.c:2348
int libusb_handle_events(libusb_context *ctx)
Handle any pending events in blocking mode.
Definition: io.c:2440
const struct libusb_pollfd ** libusb_get_pollfds(libusb_context *ctx)
Retrieve a list of file descriptors that should be polled by your main loop as libusb event sources.
Definition: io.c:2752
int libusb_get_next_timeout(libusb_context *ctx, struct timeval *tv)
Determine the next internal timeout that libusb needs to handle.
Definition: io.c:2572
int libusb_event_handling_ok(libusb_context *ctx)
Determine if it is still OK for this thread to be doing event handling.
Definition: io.c:1889
int libusb_handle_events_timeout(libusb_context *ctx, struct timeval *tv)
Handle any pending events.
Definition: io.c:2420
int libusb_try_lock_events(libusb_context *ctx)
Attempt to acquire the event handling lock.
Definition: io.c:1796
int libusb_handle_events_locked(libusb_context *ctx, struct timeval *tv)
Handle any pending events by polling file descriptors, without checking if any other threads are alre...
Definition: io.c:2490
void libusb_lock_events(libusb_context *ctx)
Acquire the event handling lock, blocking until successful acquisition if it is contended.
Definition: io.c:1839
void libusb_unlock_events(libusb_context *ctx)
Release the lock previously acquired with libusb_try_lock_events() or libusb_lock_events().
Definition: io.c:1854
void libusb_free_pollfds(const struct libusb_pollfd **pollfds)
Free a list of libusb_pollfd structures.
Definition: io.c:2800
int libusb_wait_for_event(libusb_context *ctx, struct timeval *tv)
Wait for another thread to signal completion of an event.
Definition: io.c:2026
int libusb_pollfds_handle_timeouts(libusb_context *ctx)
Determines whether your application must apply special timing considerations when monitoring libusb's...
Definition: io.c:2538
int libusb_interrupt_transfer(libusb_device_handle *dev_handle, unsigned char endpoint, unsigned char *data, int length, int *actual_length, unsigned int timeout)
Perform a USB interrupt transfer.
Definition: sync.c:333
int libusb_bulk_transfer(libusb_device_handle *dev_handle, unsigned char endpoint, unsigned char *data, int length, int *actual_length, unsigned int timeout)
Perform a USB bulk transfer.
Definition: sync.c:279
int libusb_control_transfer(libusb_device_handle *dev_handle, uint8_t request_type, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, unsigned char *data, uint16_t wLength, unsigned int timeout)
Perform a USB control transfer.
Definition: sync.c:102
A structure representing the Binary Device Object Store (BOS) descriptor.
Definition: libusb.h:895
uint16_t wTotalLength
Length of this descriptor and all of its sub descriptors.
Definition: libusb.h:905
struct libusb_bos_dev_capability_descriptor * dev_capability[LIBUSB_FLEXIBLE_ARRAY]
bNumDeviceCap Device Capability Descriptors
Definition: libusb.h:912
uint8_t bNumDeviceCaps
The number of separate device capability descriptors in the BOS.
Definition: libusb.h:909
uint8_t bLength
Size of this descriptor (in bytes)
Definition: libusb.h:897
uint8_t bDescriptorType
Descriptor type.
Definition: libusb.h:902
A generic representation of a BOS Device Capability descriptor.
Definition: libusb.h:874
uint8_t bLength
Size of this descriptor (in bytes)
Definition: libusb.h:876
uint8_t bDescriptorType
Descriptor type.
Definition: libusb.h:881
uint8_t bDevCapabilityType
Device Capability type.
Definition: libusb.h:884
uint8_t dev_capability_data[LIBUSB_FLEXIBLE_ARRAY]
Device Capability data (bLength - 3 bytes)
Definition: libusb.h:887
A structure representing the standard USB configuration descriptor.
Definition: libusb.h:797
uint8_t bConfigurationValue
Identifier value for this configuration.
Definition: libusb.h:813
uint8_t iConfiguration
Index of string descriptor describing this configuration.
Definition: libusb.h:816
int extra_length
Length of the extra descriptors, in bytes.
Definition: libusb.h:836
uint8_t bLength
Size of this descriptor (in bytes)
Definition: libusb.h:799
uint8_t bNumInterfaces
Number of interfaces supported by this configuration.
Definition: libusb.h:810
uint8_t MaxPower
Maximum power consumption of the USB device from this bus in this configuration when the device is fu...
Definition: libusb.h:825
uint16_t wTotalLength
Total length of data returned for this configuration.
Definition: libusb.h:807
uint8_t bDescriptorType
Descriptor type.
Definition: libusb.h:804
const unsigned char * extra
Extra descriptors.
Definition: libusb.h:833
uint8_t bmAttributes
Configuration characteristics.
Definition: libusb.h:819
const struct libusb_interface * interface
Array of interfaces supported by this configuration.
Definition: libusb.h:829
A structure representing the Container ID descriptor.
Definition: libusb.h:988
uint8_t ContainerID[16]
128 bit UUID
Definition: libusb.h:1006
uint8_t bDescriptorType
Descriptor type.
Definition: libusb.h:995
uint8_t bDevCapabilityType
Capability type.
Definition: libusb.h:1000
uint8_t bLength
Size of this descriptor (in bytes)
Definition: libusb.h:990
uint8_t bReserved
Reserved field.
Definition: libusb.h:1003
Setup packet for control transfers.
Definition: libusb.h:1042
uint8_t bRequest
Request.
Definition: libusb.h:1055
uint8_t bmRequestType
Request type.
Definition: libusb.h:1048
uint16_t wLength
Number of bytes to transfer.
Definition: libusb.h:1065
uint16_t wIndex
Index.
Definition: libusb.h:1062
uint16_t wValue
Value.
Definition: libusb.h:1058
A structure representing the standard USB device descriptor.
Definition: libusb.h:573
uint8_t bNumConfigurations
Number of possible configurations.
Definition: libusb.h:619
uint8_t iProduct
Index of string descriptor describing product.
Definition: libusb.h:613
uint8_t iSerialNumber
Index of string descriptor containing device serial number.
Definition: libusb.h:616
uint8_t bMaxPacketSize0
Maximum packet size for endpoint 0.
Definition: libusb.h:598
uint8_t bDeviceProtocol
USB-IF protocol code for the device, qualified by the bDeviceClass and bDeviceSubClass values.
Definition: libusb.h:595
uint16_t idProduct
USB-IF product ID.
Definition: libusb.h:604
uint8_t bDescriptorType
Descriptor type.
Definition: libusb.h:580
uint8_t bDeviceSubClass
USB-IF subclass code for the device, qualified by the bDeviceClass value.
Definition: libusb.h:591
uint8_t bDeviceClass
USB-IF class code for the device.
Definition: libusb.h:587
uint8_t iManufacturer
Index of string descriptor describing manufacturer.
Definition: libusb.h:610
uint16_t idVendor
USB-IF vendor ID.
Definition: libusb.h:601
uint16_t bcdUSB
USB specification release number in binary-coded decimal.
Definition: libusb.h:584
uint16_t bcdDevice
Device release number in binary-coded decimal.
Definition: libusb.h:607
uint8_t bLength
Size of this descriptor (in bytes)
Definition: libusb.h:575
A structure representing the standard USB endpoint descriptor.
Definition: libusb.h:627
int extra_length
Length of the extra descriptors, in bytes.
Definition: libusb.h:667
uint8_t bEndpointAddress
The address of the endpoint described by this descriptor.
Definition: libusb.h:639
const unsigned char * extra
Extra descriptors.
Definition: libusb.h:664
uint8_t bInterval
Interval for polling endpoint for data transfers.
Definition: libusb.h:653
uint8_t bDescriptorType
Descriptor type.
Definition: libusb.h:634
uint8_t bRefresh
For audio devices only: the rate at which synchronization feedback is provided.
Definition: libusb.h:657
uint8_t bmAttributes
Attributes which apply to the endpoint when it is configured using the bConfigurationValue.
Definition: libusb.h:647
uint8_t bLength
Size of this descriptor (in bytes)
Definition: libusb.h:629
uint8_t bSynchAddress
For audio devices only: the address if the synch endpoint.
Definition: libusb.h:660
uint16_t wMaxPacketSize
Maximum packet size this endpoint is capable of sending/receiving.
Definition: libusb.h:650
Structure used for setting options through libusb_init_context.
Definition: libusb.h:1566
enum libusb_option option
Which option to set.
Definition: libusb.h:1568
union libusb_init_option::@0 value
An integer value used by the option (if applicable).
Structure containing an array of 0 or more interface association descriptors.
Definition: libusb.h:719
const struct libusb_interface_association_descriptor * iad
Array of interface association descriptors.
Definition: libusb.h:723
int length
Number of interface association descriptors contained.
Definition: libusb.h:726
A structure representing the standard USB interface association descriptor.
Definition: libusb.h:675
uint8_t bFunctionClass
USB-IF class code for this function.
Definition: libusb.h:697
uint8_t bDescriptorType
Descriptor type.
Definition: libusb.h:682
uint8_t bFunctionSubClass
USB-IF subclass code for this function.
Definition: libusb.h:703
uint8_t bFunctionProtocol
USB-IF protocol code for this function.
Definition: libusb.h:709
uint8_t bInterfaceCount
Number of contiguous interfaces that are associated with this function.
Definition: libusb.h:690
uint8_t iFunction
Index of string descriptor describing this function.
Definition: libusb.h:712
uint8_t bFirstInterface
Interface number of the first interface that is associated with this function.
Definition: libusb.h:686
uint8_t bLength
Size of this descriptor (in bytes)
Definition: libusb.h:677
A structure representing the standard USB interface descriptor.
Definition: libusb.h:734
uint8_t bInterfaceSubClass
USB-IF subclass code for this interface, qualified by the bInterfaceClass value.
Definition: libusb.h:758
uint8_t iInterface
Index of string descriptor describing this interface.
Definition: libusb.h:765
uint8_t bInterfaceClass
USB-IF class code for this interface.
Definition: libusb.h:754
uint8_t bAlternateSetting
Value used to select this alternate setting for this interface.
Definition: libusb.h:747
const struct libusb_endpoint_descriptor * endpoint
Array of endpoint descriptors.
Definition: libusb.h:769
uint8_t bNumEndpoints
Number of endpoints used by this interface (excluding the control endpoint).
Definition: libusb.h:751
uint8_t bInterfaceProtocol
USB-IF protocol code for this interface, qualified by the bInterfaceClass and bInterfaceSubClass valu...
Definition: libusb.h:762
uint8_t bLength
Size of this descriptor (in bytes)
Definition: libusb.h:736
uint8_t bInterfaceNumber
Number of this interface.
Definition: libusb.h:744
const unsigned char * extra
Extra descriptors.
Definition: libusb.h:773
int extra_length
Length of the extra descriptors, in bytes.
Definition: libusb.h:776
uint8_t bDescriptorType
Descriptor type.
Definition: libusb.h:741
A collection of alternate settings for a particular USB interface.
Definition: libusb.h:782
const struct libusb_interface_descriptor * altsetting
Array of interface descriptors.
Definition: libusb.h:785
int num_altsetting
The number of alternate settings that belong to this interface.
Definition: libusb.h:789
Isochronous packet descriptor.
Definition: libusb.h:1326
unsigned int actual_length
Amount of data that was actually transferred.
Definition: libusb.h:1331
unsigned int length
Length of data to request in this packet.
Definition: libusb.h:1328
enum libusb_transfer_status status
Status code for this packet.
Definition: libusb.h:1334
File descriptor for polling.
Definition: libusb.h:2121
short events
Event flags to poll for from <poll.h>.
Definition: libusb.h:2129
int fd
Numeric file descriptor.
Definition: libusb.h:2123
A structure representing the superspeed endpoint companion descriptor.
Definition: libusb.h:845
uint16_t wBytesPerInterval
The total number of bytes this EP will transfer every service interval.
Definition: libusb.h:866
uint8_t bLength
Size of this descriptor (in bytes)
Definition: libusb.h:847
uint8_t bDescriptorType
Descriptor type.
Definition: libusb.h:852
uint8_t bMaxBurst
The maximum number of packets the endpoint can send or receive as part of a burst.
Definition: libusb.h:856
uint8_t bmAttributes
In bulk EP: bits 4:0 represents the maximum number of streams the EP supports.
Definition: libusb.h:862
A structure representing the SuperSpeed USB Device Capability descriptor This descriptor is documente...
Definition: libusb.h:946
uint8_t bDevCapabilityType
Capability type.
Definition: libusb.h:958
uint16_t wSpeedSupported
Bitmap encoding of the speed supported by this device when operating in SuperSpeed mode.
Definition: libusb.h:968
uint8_t bFunctionalitySupport
The lowest speed at which all the functionality supported by the device is available to the user.
Definition: libusb.h:974
uint16_t bU2DevExitLat
U2 Device Exit Latency.
Definition: libusb.h:980
uint8_t bLength
Size of this descriptor (in bytes)
Definition: libusb.h:948
uint8_t bmAttributes
Bitmap encoding of supported device level features.
Definition: libusb.h:964
uint8_t bU1DevExitLat
U1 Device Exit Latency.
Definition: libusb.h:977
uint8_t bDescriptorType
Descriptor type.
Definition: libusb.h:953
The generic USB transfer structure.
Definition: libusb.h:1356
unsigned char endpoint
Address of the endpoint where this transfer will be sent.
Definition: libusb.h:1364
enum libusb_transfer_status status
The status of the transfer.
Definition: libusb.h:1380
int length
Length of the data buffer.
Definition: libusb.h:1383
libusb_transfer_cb_fn callback
Callback function.
Definition: libusb.h:1392
struct libusb_iso_packet_descriptor iso_packet_desc[LIBUSB_FLEXIBLE_ARRAY]
Isochronous packet descriptors, for isochronous transfers only.
Definition: libusb.h:1414
unsigned char type
Type of the transfer from libusb_transfer_type.
Definition: libusb.h:1367
int actual_length
Actual length of data that was transferred.
Definition: libusb.h:1388
unsigned char * buffer
Data buffer.
Definition: libusb.h:1407
int num_iso_packets
Number of isochronous packets.
Definition: libusb.h:1411
unsigned int timeout
Timeout for this transfer in milliseconds.
Definition: libusb.h:1371
void * user_data
User context data.
Definition: libusb.h:1404
libusb_device_handle * dev_handle
Handle of the device that this transfer will be submitted to.
Definition: libusb.h:1358
uint8_t flags
A bitwise OR combination of libusb_transfer_flags.
Definition: libusb.h:1361
A structure representing the USB 2.0 Extension descriptor This descriptor is documented in section 9....
Definition: libusb.h:920
uint8_t bLength
Size of this descriptor (in bytes)
Definition: libusb.h:922
uint8_t bDevCapabilityType
Capability type.
Definition: libusb.h:932
uint32_t bmAttributes
Bitmap encoding of supported device level features.
Definition: libusb.h:938
uint8_t bDescriptorType
Descriptor type.
Definition: libusb.h:927
Structure providing the version of the libusb runtime.
Definition: libusb.h:1082
const uint16_t micro
Library micro version.
Definition: libusb.h:1090
const uint16_t major
Library major version.
Definition: libusb.h:1084
const char * rc
Library release candidate suffix string, e.g.
Definition: libusb.h:1096
const uint16_t minor
Library minor version.
Definition: libusb.h:1087
const char * describe
For ABI compatibility only.
Definition: libusb.h:1099
const uint16_t nano
Library nano version.
Definition: libusb.h:1093