 |
libusb 1.0.24
USBデバイスにアクセスするためのクロス・プラットフォームのユーザー・ライブラリ
|
30 #if !defined(__cplusplus)
31 #define inline __inline
35 typedef SSIZE_T ssize_t;
40 #include <sys/types.h>
41 #if !defined(_MSC_VER)
46 #if defined(__STDC_VERSION__) &&
(__STDC_VERSION__ >= 199901L)
47 #define ZERO_SIZED_ARRAY
49 #define ZERO_SIZED_ARRAY 0
57 #if defined(_WIN32) || defined(__CYGWIN__)
59 #if defined(interface)
62 #if !defined(__CYGWIN__)
67 #if defined(__GNUC__) && (__GNUC__ > 4 ||
(__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
68 #define LIBUSB_DEPRECATED_FOR(f) __attribute__
((deprecated ("Use " #f " instead")))
69 #elif defined(__GNUC__) && (__GNUC__ >=
3)
70 #define LIBUSB_DEPRECATED_FOR(f) __attribute__
((deprecated))
72 #define LIBUSB_DEPRECATED_FOR(f)
76 #define LIBUSB_PACKED __attribute__ ((packed))
113 #if defined(_WIN32) || defined(__CYGWIN__)
114 #define LIBUSB_CALL WINAPI
139 #define LIBUSB_API_VERSION
0x01000108
142 #define LIBUSBX_API_VERSION LIBUSB_API_VERSION
144 #if defined(__cplusplus)
162 _tmp.b8[1] =
(uint8_t) (x >> 8);
163 _tmp.b8[0] =
(uint8_t) (x & 0xff);
175 #define libusb_le16_to_cpu
libusb_cpu_to_le16
202 LIBUSB_CLASS_PTP
= 0x06,
288 #define LIBUSB_DT_DEVICE_SIZE 18
289 #define LIBUSB_DT_CONFIG_SIZE 9
290 #define LIBUSB_DT_INTERFACE_SIZE 9
291 #define LIBUSB_DT_ENDPOINT_SIZE 7
292 #define LIBUSB_DT_ENDPOINT_AUDIO_SIZE 9
293 #define LIBUSB_DT_HUB_NONVAR_SIZE 7
294 #define LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE 6
295 #define LIBUSB_DT_BOS_SIZE 5
296 #define LIBUSB_DT_DEVICE_CAPABILITY_SIZE 3
299 #define LIBUSB_BT_USB_2_0_EXTENSION_SIZE 7
300 #define LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE
10
301 #define LIBUSB_BT_CONTAINER_ID_SIZE 20
304 #define LIBUSB_DT_BOS_MAX_SIZE \
305 (LIBUSB_DT_BOS_SIZE + \
306 LIBUSB_BT_USB_2_0_EXTENSION_SIZE + \
307 LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE + \
308 LIBUSB_BT_CONTAINER_ID_SIZE)
310 #define LIBUSB_ENDPOINT_ADDRESS_MASK 0x0f
311 #define LIBUSB_ENDPOINT_DIR_MASK 0x80
325 #define LIBUSB_TRANSFER_TYPE_MASK 0x03
429 #define LIBUSB_ISO_SYNC_TYPE_MASK 0x0c
450 #define LIBUSB_ISO_USAGE_TYPE_MASK 0x30
907 #if defined(_MSC_VER) || defined(__WATCOMC__)
908 #pragma pack(push, 1)
935 #if defined(_MSC_VER) || defined(__WATCOMC__)
939 #define LIBUSB_CONTROL_SETUP_SIZE (sizeof(struct
libusb_control_setup))
1095 #define LIBUSB_ERROR_COUNT 14
1420 unsigned char
endpoint);
1422 unsigned char
endpoint);
1432 int interface_number);
1434 int interface_number);
1440 int interface_number,
int alternate_setting);
1442 unsigned char
endpoint);
1446 uint32_t
num_streams,
unsigned char *endpoints,
int num_endpoints);
1448 unsigned char
*endpoints,
int num_endpoints);
1453 unsigned char
*buffer,
size_t length);
1456 int interface_number);
1458 int interface_number);
1460 int interface_number);
1481 return transfer->
buffer
+ LIBUSB_CONTROL_SETUP_SIZE;
1584 transfer->
buffer
= buffer;
1586 transfer->
length
= (int) (LIBUSB_CONTROL_SETUP_SIZE
1608 void *user_data,
unsigned int
timeout)
1614 transfer->
buffer
= buffer;
1615 transfer->
length
= length;
1638 unsigned char
endpoint, uint32_t stream_id,
1640 void *user_data,
unsigned int
timeout)
1643 length,
callback, user_data, timeout);
1663 unsigned char
endpoint,
unsigned char *buffer,
int length,
1670 transfer->
buffer
= buffer;
1671 transfer->
length
= length;
1692 unsigned char
*buffer,
int length,
int num_iso_packets,
1699 transfer->
buffer
= buffer;
1700 transfer->
length
= length;
1749 if (packet > INT_MAX)
1751 _packet = (int)
packet;
1756 for (i = 0; i < _packet; i++)
1759 return transfer->
buffer
+ offset;
1789 if (packet > INT_MAX)
1791 _packet = (int)
packet;
1803 unsigned char
*data, uint16_t
wLength,
unsigned int timeout);
1806 unsigned char
endpoint,
unsigned char *data,
int
length,
1807 int *actual_length,
unsigned int
timeout);
1810 unsigned char
endpoint,
unsigned char *data,
int
length,
1811 int *actual_length,
unsigned int
timeout);
1826 uint8_t
desc_type, uint8_t desc_index,
unsigned
char *data,
int length)
1830 0, data,
(uint16_t) length, 1000);
1848 uint8_t
desc_index, uint16_t langid,
unsigned char *data,
int
length)
1852 langid, data,
(uint16_t) length, 1000);
1856 uint8_t
desc_index,
unsigned char *data,
int
length);
1871 struct timeval *tv);
1873 struct timeval *tv,
int *completed);
1877 struct timeval *tv);
1880 struct timeval *tv);
1968 #define
LIBUSB_HOTPLUG_NO_FLAGS 0
1972 #define
LIBUSB_HOTPLUG_MATCH_ANY -1
2036 int vendor_id,
int product_id,
int dev_class,
2114
LIBUSB_OPTION_MAX = 3
2119 #if defined(__cplusplus)
int libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t
*path, uint8_t path_length)
定義: core.c:964
libusb_endpoint_direction
定義: libusb.h:317
int libusb_init(libusb_context **ctx)
定義: core.c:2270
uint8_t bRequest
Request.
定義: libusb.h:923
@ LIBUSB_FULL_SPEED_OPERATION
Full speed operation supported (12MBit/s).
定義: libusb.h:477
@ LIBUSB_CLASS_DATA
Data class.
定義: libusb.h:214
int libusb_set_configuration(libusb_device_handle *dev_handle, int
configuration)
定義: core.c:1619
uint8_t bDeviceSubClass
USB-IF subclass code for the device, qualified by the bDeviceClass value.
定義: libusb.h:546
@ LIBUSB_SPEED_UNKNOWN
The OS doesn't report or know the device speed.
定義: libusb.h:1022
int num_altsetting
The number of alternate settings that belong to this interface.
定義: libusb.h:685
@ LIBUSB_BT_USB_2_0_EXTENSION
USB 2.0 extensions.
定義: libusb.h:514
libusb_capability
定義: libusb.h:1288
uint8_t bLength
Size of this descriptor (in bytes)
定義: libusb.h:743
uint16_t wBytesPerInterval
The total number of bytes this EP will transfer every service interval.
定義: libusb.h:762
@ LIBUSB_TRANSFER_CANCELLED
Transfer was cancelled.
定義: libusb.h:1130
uint8_t bDeviceProtocol
USB-IF protocol code for the device, qualified by the bDeviceClass and
bDeviceSubClass values.
定義: libusb.h:550
uint8_t bRefresh
For audio devices only: the rate at which synchronization feedback is
provided.
定義: libusb.h:612
const char * libusb_strerror(int errcode)
定義: strerror.c:213
@ LIBUSB_ENDPOINT_OUT
Out: host-to-device.
定義: libusb.h:319
void libusb_set_debug(libusb_context *ctx, int level)
定義: core.c:2095
@ LIBUSB_ERROR_NO_DEVICE
No such device (it may have been disconnected)
定義: libusb.h:1061
@ LIBUSB_REQUEST_SET_FEATURE
Set or enable a specific feature.
定義: libusb.h:357
libusb_request_recipient
定義: libusb.h:415
@ LIBUSB_ISO_SYNC_TYPE_ASYNC
Asynchronous.
定義: libusb.h:441
int libusb_clear_halt(libusb_device_handle *dev_handle, unsigned char
endpoint)
定義: core.c:1787
@ LIBUSB_LOG_LEVEL_NONE
(0) : No messages ever emitted by the library (default)
定義: libusb.h:1311
int libusb_bulk_transfer(libusb_device_handle *dev_handle, unsigned char
endpoint, unsigned char *data, int length, int *actual_length, unsigned int
timeout)
定義: sync.c:274
void libusb_free_container_id_descriptor(struct
libusb_container_id_descriptor *container_id)
定義: descriptor.c:1067
int libusb_get_device_descriptor(libusb_device *dev, struct
libusb_device_descriptor *desc)
定義: descriptor.c:531
@ LIBUSB_ERROR_OVERFLOW
Overflow.
定義: libusb.h:1073
@ LIBUSB_ISO_USAGE_TYPE_DATA
Data endpoint.
定義: libusb.h:459
uint8_t bSynchAddress
For audio devices only: the address if the synch endpoint.
定義: libusb.h:615
libusb_hotplug_event
定義: libusb.h:1946
uint8_t bmAttributes
In bulk EP: bits 4:0 represents the maximum number of streams the EP
supports.
定義: libusb.h:758
int libusb_wrap_sys_device(libusb_context *ctx, intptr_t sys_dev,
libusb_device_handle **dev_handle)
定義: core.c:1236
uint8_t bmAttributes
Attributes which apply to the endpoint when it is configured using the
bConfigurationValue.
定義: libusb.h:602
@ LIBUSB_LOG_CB_GLOBAL
Callback function handling all log messages.
定義: libusb.h:1335
@ LIBUSB_ISO_SYNC_TYPE_SYNC
Synchronous.
定義: libusb.h:447
static unsigned char * libusb_control_transfer_get_data(struct
libusb_transfer *transfer)
定義: libusb.h:1478
int libusb_event_handler_active(libusb_context *ctx)
定義: io.c:1887
void libusb_free_ss_usb_device_capability_descriptor(struct
libusb_ss_usb_device_capability_descriptor *ss_usb_device_cap)
定義: descriptor.c:1013
@ LIBUSB_ISO_SYNC_TYPE_NONE
No synchronization.
定義: libusb.h:438
@ LIBUSB_DT_CONFIG
Configuration descriptor.
定義: libusb.h:251
@ LIBUSB_OPTION_LOG_LEVEL
Set the log message verbosity.
定義: libusb.h:2090
struct libusb_context libusb_context
定義: libusb.h:987
@ LIBUSB_REQUEST_GET_STATUS
Request status of the specific recipient.
定義: libusb.h:349
int libusb_interrupt_transfer(libusb_device_handle *dev_handle, unsigned
char endpoint, unsigned char *data, int length, int *actual_length, unsigned
int timeout)
定義: sync.c:328
@ LIBUSB_TRANSFER_OVERFLOW
Device sent more data than requested.
定義: libusb.h:1140
uint8_t MaxPower
Maximum power consumption of the USB device from this bus in this
configuration when the device is fu...
定義: libusb.h:721
uint8_t bNumDeviceCaps
The number of separate device capability descriptors in the BOS.
定義: libusb.h:805
static unsigned char * libusb_get_iso_packet_buffer_simple(struct
libusb_transfer *transfer, unsigned int packet)
定義: libusb.h:1781
unsigned char type
Type of the transfer from libusb_transfer_type.
定義: libusb.h:1233
void(* libusb_log_cb)(libusb_context *ctx, enum libusb_log_level level,
const char *str)
定義: libusb.h:1352
int libusb_handle_events(libusb_context *ctx)
定義: io.c:2407
@ LIBUSB_TRANSFER_TYPE_CONTROL
Control transfer.
定義: libusb.h:1101
int libusb_cancel_transfer(struct libusb_transfer *transfer)
定義: io.c:1580
@ LIBUSB_CLASS_CONTENT_SECURITY
Content Security.
定義: libusb.h:220
uint16_t wTotalLength
Length of this descriptor and all of its sub descriptors.
定義: libusb.h:801
uint8_t bDescriptorType
Descriptor type.
定義: libusb.h:589
libusb_transfer_type
定義: libusb.h:1099
const char * describe
For ABI compatibility only.
定義: libusb.h:967
@ LIBUSB_CLASS_COMM
Communications class.
定義: libusb.h:192
libusb_transfer_status
定義: libusb.h:1118
@ LIBUSB_REQUEST_SET_INTERFACE
Select an alternate interface for the specified interface.
定義: libusb.h:380
@ LIBUSB_REQUEST_SET_ADDRESS
Set device address for all future accesses.
定義: libusb.h:362
uint8_t bInterval
Interval for polling endpoint for data transfers.
定義: libusb.h:608
uint8_t bDescriptorType
Descriptor type.
定義: libusb.h:748
uint8_t bDevCapabilityType
Capability type.
定義: libusb.h:896
@ LIBUSB_REQUEST_CLEAR_FEATURE
Clear or disable a specific feature.
定義: libusb.h:352
@ LIBUSB_ERROR_BUSY
Resource busy.
定義: libusb.h:1067
uint8_t bNumInterfaces
Number of interfaces supported by this configuration.
定義: libusb.h:706
void libusb_set_pollfd_notifiers(libusb_context *ctx, libusb_pollfd_added_cb
added_cb, libusb_pollfd_removed_cb removed_cb, void *user_data)
定義: io.c:2611
libusb_endpoint_transfer_type
定義: libusb.h:331
uint8_t bAlternateSetting
Value used to select this alternate setting for this interface.
定義: libusb.h:643
uint8_t iConfiguration
Index of string descriptor describing this configuration.
定義: libusb.h:712
@ LIBUSB_RECIPIENT_ENDPOINT
Endpoint.
定義: libusb.h:423
int extra_length
Length of the extra descriptors, in bytes.
定義: libusb.h:622
int libusb_detach_kernel_driver(libusb_device_handle *dev_handle, int
interface_number)
定義: core.c:2006
uint8_t bmAttributes
Configuration characteristics.
定義: libusb.h:715
unsigned int timeout
Timeout for this transfer in milliseconds.
定義: libusb.h:1237
@ LIBUSB_DT_HID
HID descriptor.
定義: libusb.h:269
@ LIBUSB_LOG_LEVEL_WARNING
(2) : Warning and error messages are emitted
定義: libusb.h:1317
uint8_t bFunctionalitySupport
The lowest speed at which all the functionality supported by the device is
available to the user.
定義: libusb.h:870
libusb_supported_speed
定義: libusb.h:472
uint8_t bLength
Size of this descriptor (in bytes)
定義: libusb.h:695
@ LIBUSB_ERROR_IO
Input/output error.
定義: libusb.h:1052
@ LIBUSB_CAP_HAS_CAPABILITY
The libusb_has_capability() API is available.
定義: libusb.h:1290
uint16_t wMaxPacketSize
Maximum packet size this endpoint is capable of sending/receiving.
定義: libusb.h:605
uint8_t bLength
Size of this descriptor (in bytes)
定義: libusb.h:632
@ LIBUSB_ERROR_NOT_FOUND
Entity not found.
定義: libusb.h:1064
uint8_t bDevCapabilityType
Capability type.
定義: libusb.h:854
@ LIBUSB_CLASS_DIAGNOSTIC_DEVICE
Diagnostic Device.
定義: libusb.h:229
const unsigned char * extra
Extra descriptors.
定義: libusb.h:669
@ LIBUSB_REQUEST_TYPE_STANDARD
Standard.
定義: libusb.h:399
int libusb_release_interface(libusb_device_handle *dev_handle, int
interface_number)
定義: core.c:1700
@ LIBUSB_TRANSFER_SHORT_NOT_OK
Report short frames as errors.
定義: libusb.h:1150
@ LIBUSB_RECIPIENT_OTHER
Other.
定義: libusb.h:426
@ LIBUSB_SPEED_FULL
The device is operating at full speed (12MBit/s).
定義: libusb.h:1028
struct libusb_bos_dev_capability_descriptor *
dev_capability[ZERO_SIZED_ARRAY]
bNumDeviceCap Device Capability Descriptors
定義: libusb.h:808
const unsigned char * extra
Extra descriptors.
定義: libusb.h:729
uint8_t iProduct
Index of string descriptor describing product.
定義: libusb.h:568
uint8_t bU1DevExitLat
U1 Device Exit Latency.
定義: libusb.h:873
libusb_device * libusb_ref_device(libusb_device *dev)
定義: core.c:1161
libusb_usb_2_0_extension_attributes
定義: libusb.h:491
int libusb_get_container_id_descriptor(libusb_context *ctx, struct
libusb_bos_dev_capability_descriptor *dev_cap, struct
libusb_container_id_descriptor **container_id)
定義: descriptor.c:1032
unsigned int actual_length
Amount of data that was actually transferred.
定義: libusb.h:1197
const char * libusb_error_name(int errcode)
定義: core.c:2670
int extra_length
Length of the extra descriptors, in bytes.
定義: libusb.h:732
uint8_t bDescriptorType
Descriptor type.
定義: libusb.h:777
@ LIBUSB_RECIPIENT_DEVICE
Device.
定義: libusb.h:417
@ LIBUSB_SPEED_SUPER
The device is operating at super speed (5000MBit/s).
定義: libusb.h:1034
void libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos)
定義: descriptor.c:896
const struct libusb_endpoint_descriptor * endpoint
Array of endpoint descriptors.
定義: libusb.h:665
@ LIBUSB_REQUEST_SET_SEL
Sets both the U1 and U2 Exit Latency.
定義: libusb.h:386
int libusb_get_max_packet_size(libusb_device *dev, unsigned char endpoint)
定義: core.c:1051
uint16_t bU2DevExitLat
U2 Device Exit Latency.
定義: libusb.h:876
#define libusb_le16_to_cpu
定義: libusb.h:175
@ LIBUSB_REQUEST_SET_DESCRIPTOR
Used to update existing descriptors or add new descriptors.
定義: libusb.h:368
struct libusb_iso_packet_descriptor iso_packet_desc[ZERO_SIZED_ARRAY]
Isochronous packet descriptors, for isochronous transfers only.
定義: libusb.h:1280
uint8_t bDescriptorType
Descriptor type.
定義: libusb.h:823
@ LIBUSB_CLASS_APPLICATION
Application class.
定義: libusb.h:238
ssize_t libusb_get_device_list(libusb_context *ctx, libusb_device ***list)
定義: core.c:812
void libusb_transfer_set_stream_id(struct libusb_transfer *transfer,
uint32_t stream_id)
定義: io.c:1624
unsigned char * buffer
Data buffer.
定義: libusb.h:1273
uint8_t bDevCapabilityType
Device Capability type.
定義: libusb.h:780
int libusb_get_configuration(libusb_device_handle *dev, int *config)
定義: core.c:1533
int libusb_set_auto_detach_kernel_driver(libusb_device_handle *dev_handle,
int enable)
定義: core.c:2081
uint8_t bReserved
Reserved field.
定義: libusb.h:899
@ LIBUSB_CAP_HAS_HOTPLUG
Hotplug support is available on this platform.
定義: libusb.h:1293
void libusb_exit(libusb_context *ctx)
定義: core.c:2385
#define LIBUSB_CALL
定義: libusb.h:116
uint8_t flags
A bitwise OR combination of libusb_transfer_flags.
定義: libusb.h:1227
static void libusb_fill_control_setup(unsigned char *buffer, uint8_t
bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, uint16_t
wLength)
定義: libusb.h:1525
const unsigned char * extra
Extra descriptors.
定義: libusb.h:619
uint16_t wTotalLength
Total length of data returned for this configuration.
定義: libusb.h:703
uint8_t bLength
Size of this descriptor (in bytes)
定義: libusb.h:844
struct libusb_device libusb_device
定義: libusb.h:1004
int libusb_dev_mem_free(libusb_device_handle *dev_handle, unsigned char
*buffer, size_t length)
定義: core.c:1942
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)
定義: libusb.h:1636
void libusb_unlock_events(libusb_context *ctx)
定義: io.c:1823
uint8_t bLength
Size of this descriptor (in bytes)
定義: libusb.h:584
uint8_t bmRequestType
Request type.
定義: libusb.h:916
@ LIBUSB_TRANSFER_COMPLETED
Transfer completed without error.
定義: libusb.h:1121
int libusb_reset_device(libusb_device_handle *dev_handle)
定義: core.c:1816
@ LIBUSB_ERROR_INVALID_PARAM
Invalid parameter.
定義: libusb.h:1055
int libusb_get_bos_descriptor(libusb_device_handle *dev_handle, struct
libusb_bos_descriptor **bos)
定義: descriptor.c:846
void libusb_free_transfer(struct libusb_transfer *transfer)
定義: io.c:1333
libusb_class_code
定義: libusb.h:181
@ LIBUSB_CLASS_IMAGE
Image class.
定義: libusb.h:201
struct libusb_transfer * libusb_alloc_transfer(int iso_packets)
定義: io.c:1285
@ LIBUSB_CLASS_PHYSICAL
Physical.
定義: libusb.h:198
uint8_t bLength
Size of this descriptor (in bytes)
定義: libusb.h:818
int libusb_setlocale(const char *locale)
定義: strerror.c:178
void(* libusb_pollfd_removed_cb)(int fd, void *user_data)
定義: libusb.h:1918
static int libusb_get_string_descriptor(libusb_device_handle *dev_handle,
uint8_t desc_index, uint16_t langid, unsigned char *data, int length)
定義: libusb.h:1847
int libusb_attach_kernel_driver(libusb_device_handle *dev_handle, int
interface_number)
定義: core.c:2042
@ LIBUSB_ERROR_OTHER
Other error.
定義: libusb.h:1091
@ LIBUSB_DT_STRING
String descriptor.
定義: libusb.h:254
uint32_t bmAttributes
Bitmap encoding of supported device level features.
定義: libusb.h:834
uint8_t iSerialNumber
Index of string descriptor containing device serial number.
定義: libusb.h:571
const struct libusb_pollfd ** libusb_get_pollfds(libusb_context *ctx)
定義: io.c:2719
libusb_option
定義: libusb.h:2068
@ LIBUSB_BT_WIRELESS_USB_DEVICE_CAPABILITY
Wireless USB device capability.
定義: libusb.h:511
@ LIBUSB_ERROR_PIPE
Pipe error.
定義: libusb.h:1076
@ LIBUSB_DT_DEVICE
Device descriptor.
定義: libusb.h:248
@ LIBUSB_TRANSFER_ERROR
Transfer failed.
定義: libusb.h:1124
@ LIBUSB_OPTION_USE_USBDK
Use the UsbDk backend for a specific context, if available.
定義: libusb.h:2099
@ LIBUSB_DT_ENDPOINT
Endpoint descriptor.
定義: libusb.h:260
int libusb_get_port_numbers(libusb_device *dev, uint8_t *port_numbers, int
port_numbers_len)
定義: core.c:938
void(* libusb_transfer_cb_fn)(struct libusb_transfer *transfer)
定義: libusb.h:1214
int libusb_handle_events_completed(libusb_context *ctx, int *completed)
定義: io.c:2429
uint16_t idProduct
USB-IF product ID.
定義: libusb.h:559
@ LIBUSB_HIGH_SPEED_OPERATION
High speed operation supported (480MBit/s).
定義: libusb.h:480
uint8_t bDescriptorType
Descriptor type.
定義: libusb.h:849
void libusb_free_usb_2_0_extension_descriptor(struct
libusb_usb_2_0_extension_descriptor *usb_2_0_extension)
定義: descriptor.c:957
uint16_t bcdDevice
Device release number in binary-coded decimal.
定義: libusb.h:562
uint8_t bmAttributes
Bitmap encoding of supported device level features.
定義: libusb.h:860
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)
定義: hotplug.c:320
uint8_t bLength
Size of this descriptor (in bytes)
定義: libusb.h:772
void libusb_unlock_event_waiters(libusb_context *ctx)
定義: io.c:1963
int libusb_hotplug_callback_handle
定義: libusb.h:1939
@ LIBUSB_ENDPOINT_TRANSFER_TYPE_INTERRUPT
Interrupt endpoint.
定義: libusb.h:342
uint8_t bEndpointAddress
The address of the endpoint described by this descriptor.
定義: libusb.h:594
libusb_device * libusb_get_parent(libusb_device *dev)
定義: core.c:984
libusb_ss_usb_device_capability_attributes
定義: libusb.h:501
@ LIBUSB_ENDPOINT_IN
In: device-to-host.
定義: libusb.h:322
@ LIBUSB_DT_SS_ENDPOINT_COMPANION
SuperSpeed Endpoint Companion descriptor.
定義: libusb.h:284
@ LIBUSB_TRANSFER_TYPE_BULK_STREAM
Bulk stream transfer.
定義: libusb.h:1113
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)
定義: descriptor.c:921
@ LIBUSB_ISO_SYNC_TYPE_ADAPTIVE
Adaptive.
定義: libusb.h:444
int libusb_get_next_timeout(libusb_context *ctx, struct timeval *tv)
定義: io.c:2539
@ LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT
A device has left and is no longer available.
定義: libusb.h:1953
libusb_descriptor_type
定義: libusb.h:246
const uint16_t major
Library major version.
定義: libusb.h:952
uint8_t bDevCapabilityType
Capability type.
定義: libusb.h:828
libusb_device_handle * dev_handle
Handle of the device that this transfer will be submitted to.
定義: libusb.h:1224
int libusb_set_option(libusb_context *ctx, enum libusb_option option,...)
定義: core.c:2175
@ LIBUSB_BT_CONTAINER_ID
Container ID type.
定義: libusb.h:520
uint8_t bInterfaceClass
USB-IF class code for this interface.
定義: libusb.h:650
uint8_t bDeviceClass
USB-IF class code for the device.
定義: libusb.h:542
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)
定義: libusb.h:1661
int libusb_submit_transfer(struct libusb_transfer *transfer)
定義: io.c:1489
@ LIBUSB_SPEED_HIGH
The device is operating at high speed (480MBit/s).
定義: libusb.h:1031
@ LIBUSB_TRANSFER_STALL
For bulk/interrupt endpoints: halt condition detected (endpoint stalled).
定義: libusb.h:1134
uint8_t libusb_get_device_address(libusb_device *dev)
定義: core.c:994
@ LIBUSB_DT_REPORT
HID report descriptor.
定義: libusb.h:272
void libusb_lock_event_waiters(libusb_context *ctx)
定義: io.c:1952
libusb_transfer_cb_fn callback
Callback function.
定義: libusb.h:1258
@ LIBUSB_CLASS_PER_INTERFACE
In the context of a device descriptor, this bDeviceClass value indicates
that each interface specifie...
定義: libusb.h:186
libusb_standard_request
定義: libusb.h:347
@ LIBUSB_ISO_USAGE_TYPE_IMPLICIT
Implicit feedback Data endpoint.
定義: libusb.h:465
uint8_t bNumEndpoints
Number of endpoints used by this interface (excluding the control endpoint).
定義: libusb.h:647
@ LIBUSB_REQUEST_GET_CONFIGURATION
Get the current device configuration value.
定義: libusb.h:371
const struct libusb_interface_descriptor * altsetting
Array of interface descriptors.
定義: libusb.h:681
@ LIBUSB_TRANSFER_FREE_BUFFER
Automatically free() transfer buffer during libusb_free_transfer().
定義: libusb.h:1156
@ LIBUSB_CLASS_MASS_STORAGE
Mass storage class.
定義: libusb.h:208
@ LIBUSB_CLASS_HUB
Hub class.
定義: libusb.h:211
@ LIBUSB_SPEED_LOW
The device is operating at low speed (1.5MBit/s).
定義: libusb.h:1025
int(* libusb_hotplug_callback_fn)(libusb_context *ctx, libusb_device
*device, libusb_hotplug_event event, void *user_data)
定義: libusb.h:1996
@ LIBUSB_SUCCESS
Success (no error)
定義: libusb.h:1049
@ LIBUSB_ENDPOINT_TRANSFER_TYPE_BULK
Bulk endpoint.
定義: libusb.h:339
uint8_t libusb_get_bus_number(libusb_device *dev)
定義: core.c:903
@ LIBUSB_TRANSFER_TYPE_ISOCHRONOUS
Isochronous transfer.
定義: libusb.h:1104
int libusb_alloc_streams(libusb_device_handle *dev_handle, uint32_t
num_streams, unsigned char *endpoints, int num_endpoints)
定義: core.c:1849
@ LIBUSB_DT_SUPERSPEED_HUB
SuperSpeed Hub descriptor.
定義: libusb.h:281
libusb_device_handle * libusb_open_device_with_vid_pid(libusb_context *ctx,
uint16_t vendor_id, uint16_t product_id)
定義: core.c:1346
@ LIBUSB_TRANSFER_FREE_TRANSFER
Automatically call libusb_free_transfer() after callback returns.
定義: libusb.h:1162
uint16_t idVendor
USB-IF vendor ID.
定義: libusb.h:556
void libusb_lock_events(libusb_context *ctx)
定義: io.c:1808
@ LIBUSB_ERROR_NOT_SUPPORTED
Operation not supported or unimplemented on this platform.
定義: libusb.h:1085
int libusb_get_max_iso_packet_size(libusb_device *dev, unsigned char
endpoint)
定義: core.c:1106
@ LIBUSB_RECIPIENT_INTERFACE
Interface.
定義: libusb.h:420
short events
Event flags to poll for from <poll.h>.
定義: libusb.h:1893
const uint16_t micro
Library micro version.
定義: libusb.h:958
@ LIBUSB_SUPER_SPEED_OPERATION
Superspeed operation supported (5000MBit/s).
定義: libusb.h:483
int libusb_open(libusb_device *dev, libusb_device_handle **dev_handle)
定義: core.c:1291
void libusb_free_ss_endpoint_companion_descriptor(struct
libusb_ss_endpoint_companion_descriptor *ep_comp)
定義: descriptor.c:754
int fd
Numeric file descriptor.
定義: libusb.h:1887
const uint16_t minor
Library minor version.
定義: libusb.h:955
uint8_t bLength
Size of this descriptor (in bytes)
定義: libusb.h:886
@ LIBUSB_CAP_SUPPORTS_DETACH_KERNEL_DRIVER
The library supports detaching of the default USB driver, using
libusb_detach_kernel_driver(),...
定義: libusb.h:1303
int libusb_kernel_driver_active(libusb_device_handle *dev_handle, int
interface_number)
定義: core.c:1968
uint16_t wLength
Number of bytes to transfer.
定義: libusb.h:933
int num_iso_packets
Number of isochronous packets.
定義: libusb.h:1277
uint8_t bInterfaceSubClass
USB-IF subclass code for this interface, qualified by the bInterfaceClass
value.
定義: libusb.h:654
static void libusb_set_iso_packet_lengths(struct libusb_transfer *transfer,
unsigned int length)
定義: libusb.h:1714
uint16_t wSpeedSupported
Bitmap encoding of the speed supported by this device when operating in
SuperSpeed mode.
定義: libusb.h:864
@ LIBUSB_ERROR_TIMEOUT
Operation timed out.
定義: libusb.h:1070
uint16_t wValue
Value.
定義: libusb.h:926
int libusb_set_interface_alt_setting(libusb_device_handle *dev_handle, int
interface_number, int alternate_setting)
定義: core.c:1745
int libusb_pollfds_handle_timeouts(libusb_context *ctx)
定義: io.c:2505
uint32_t libusb_transfer_get_stream_id(struct libusb_transfer *transfer)
定義: io.c:1641
@ LIBUSB_ISO_USAGE_TYPE_FEEDBACK
Feedback endpoint.
定義: libusb.h:462
@ LIBUSB_REQUEST_TYPE_RESERVED
Reserved.
定義: libusb.h:408
@ LIBUSB_BM_LTM_SUPPORT
Supports Latency Tolerance Messages (LTM)
定義: libusb.h:503
@ LIBUSB_TRANSFER_NO_DEVICE
Device was disconnected.
定義: libusb.h:1137
int libusb_event_handling_ok(libusb_context *ctx)
定義: io.c:1858
int libusb_handle_events_timeout(libusb_context *ctx, struct timeval *tv)
定義: io.c:2387
int libusb_has_capability(uint32_t capability)
定義: core.c:2454
libusb_error
定義: libusb.h:1047
@ LIBUSB_LOW_SPEED_OPERATION
Low speed operation supported (1.5MBit/s).
定義: libusb.h:474
libusb_log_cb_mode
定義: libusb.h:1333
uint8_t ContainerID[16]
128 bit UUID
定義: libusb.h:902
@ LIBUSB_ENDPOINT_TRANSFER_TYPE_CONTROL
Control endpoint.
定義: libusb.h:333
int libusb_wait_for_event(libusb_context *ctx, struct timeval *tv)
定義: io.c:1995
@ LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED
A device has been plugged in and is ready to use.
定義: libusb.h:1948
uint8_t bDescriptorType
Descriptor type.
定義: libusb.h:798
int libusb_get_ss_endpoint_companion_descriptor(libusb_context *ctx, const
struct libusb_endpoint_descriptor *endpoint, struct
libusb_ss_endpoint_companion_descriptor **ep_comp)
定義: descriptor.c:705
uint8_t bDescriptorType
Descriptor type.
定義: libusb.h:700
uint8_t bLength
Size of this descriptor (in bytes)
定義: libusb.h:530
unsigned char * libusb_dev_mem_alloc(libusb_device_handle *dev_handle,
size_t length)
定義: core.c:1922
void libusb_free_pollfds(const struct libusb_pollfd **pollfds)
定義: io.c:2767
uint8_t bLength
Size of this descriptor (in bytes)
定義: libusb.h:793
const uint16_t nano
Library nano version.
定義: libusb.h:961
@ LIBUSB_REQUEST_SYNCH_FRAME
Set then report an endpoint's synchronization frame.
定義: libusb.h:383
@ LIBUSB_DT_BOS
BOS descriptor.
定義: libusb.h:263
unsigned char endpoint
Address of the endpoint where this transfer will be sent.
定義: libusb.h:1230
uint8_t dev_capability_data[ZERO_SIZED_ARRAY]
Device Capability data (bLength - 3 bytes)
定義: libusb.h:783
uint16_t bcdUSB
USB specification release number in binary-coded decimal.
定義: libusb.h:539
@ LIBUSB_TRANSFER_TYPE_BULK
Bulk transfer.
定義: libusb.h:1107
@ LIBUSB_CLASS_MISCELLANEOUS
Miscellaneous class.
定義: libusb.h:235
@ LIBUSB_ERROR_NO_MEM
Insufficient memory.
定義: libusb.h:1082
int length
Length of the data buffer.
定義: libusb.h:1249
@ LIBUSB_CLASS_PRINTER
Printer class.
定義: libusb.h:205
uint8_t bDescriptorType
Descriptor type.
定義: libusb.h:637
@ LIBUSB_CLASS_WIRELESS
Wireless class.
定義: libusb.h:232
int libusb_get_config_descriptor_by_value(libusb_device *dev, uint8_t
bConfigurationValue, struct libusb_config_descriptor **config)
定義: descriptor.c:642
@ LIBUSB_BM_LPM_SUPPORT
Supports Link Power Management (LPM)
定義: libusb.h:493
void * user_data
User context data.
定義: libusb.h:1270
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)
定義: libusb.h:1690
@ LIBUSB_ENDPOINT_TRANSFER_TYPE_ISOCHRONOUS
Isochronous endpoint.
定義: libusb.h:336
uint16_t wIndex
Index.
定義: libusb.h:930
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)
定義: libusb.h:1605
int libusb_get_string_descriptor_ascii(libusb_device_handle *dev_handle,
uint8_t desc_index, unsigned char *data, int length)
定義: descriptor.c:1085
@ LIBUSB_TRANSFER_TIMED_OUT
Transfer timed out.
定義: libusb.h:1127
libusb_log_level
定義: libusb.h:1309
libusb_transfer_flags
定義: libusb.h:1148
@ LIBUSB_ERROR_ACCESS
Access denied (insufficient permissions)
定義: libusb.h:1058
libusb_iso_sync_type
定義: libusb.h:436
@ LIBUSB_CLASS_SMART_CARD
Smart Card.
定義: libusb.h:217
libusb_device * libusb_get_device(libusb_device_handle *dev_handle)
定義: core.c:1508
libusb_bos_type
定義: libusb.h:509
uint8_t bMaxPacketSize0
Maximum packet size for endpoint 0.
定義: libusb.h:553
@ LIBUSB_LOG_LEVEL_INFO
(3) : Informational, warning and error messages are emitted
定義: libusb.h:1320
const struct libusb_interface * interface
Array of interfaces supported by this configuration.
定義: libusb.h:725
uint8_t bConfigurationValue
Identifier value for this configuration.
定義: libusb.h:709
uint8_t bNumConfigurations
Number of possible configurations.
定義: libusb.h:574
int libusb_handle_events_locked(libusb_context *ctx, struct timeval *tv)
定義: io.c:2457
uint8_t bDescriptorType
Descriptor type.
定義: libusb.h:891
libusb_hotplug_flag
定義: libusb.h:1961
@ LIBUSB_REQUEST_TYPE_VENDOR
Vendor.
定義: libusb.h:405
const struct libusb_version * libusb_get_version(void)
定義: core.c:2725
int libusb_get_active_config_descriptor(libusb_device *dev, struct
libusb_config_descriptor **config)
定義: descriptor.c:555
@ LIBUSB_BT_SS_USB_DEVICE_CAPABILITY
SuperSpeed USB device capability.
定義: libusb.h:517
void libusb_free_config_descriptor(struct libusb_config_descriptor *config)
定義: descriptor.c:682
void * libusb_hotplug_get_user_data(libusb_context *ctx,
libusb_hotplug_callback_handle callback_handle)
定義: hotplug.c:442
uint8_t bInterfaceProtocol
USB-IF protocol code for this interface, qualified by the bInterfaceClass
and bInterfaceSubClass valu...
定義: libusb.h:658
libusb_request_type
定義: libusb.h:397
int extra_length
Length of the extra descriptors, in bytes.
定義: libusb.h:672
@ LIBUSB_LOG_CB_CONTEXT
Callback function handling context related log messages.
定義: libusb.h:1338
void libusb_set_log_cb(libusb_context *ctx, libusb_log_cb cb, int mode)
定義: core.c:2132
@ LIBUSB_CAP_HAS_HID_ACCESS
The library can access HID devices without requiring user intervention.
定義: libusb.h:1299
void libusb_hotplug_deregister_callback(libusb_context *ctx,
libusb_hotplug_callback_handle callback_handle)
定義: hotplug.c:404
void libusb_close(libusb_device_handle *dev_handle)
定義: core.c:1446
@ LIBUSB_REQUEST_SET_CONFIGURATION
Set device configuration.
定義: libusb.h:374
unsigned int length
Length of data to request in this packet.
定義: libusb.h:1194
int libusb_try_lock_events(libusb_context *ctx)
定義: io.c:1765
int actual_length
Actual length of data that was transferred.
定義: libusb.h:1254
enum libusb_transfer_status status
Status code for this packet.
定義: libusb.h:1200
static struct libusb_control_setup *
libusb_control_transfer_get_setup(struct libusb_transfer *transfer)
定義: libusb.h:1496
libusb_iso_usage_type
定義: libusb.h:457
void libusb_free_device_list(libusb_device **list, int unref_devices)
定義: core.c:882
@ LIBUSB_REQUEST_GET_DESCRIPTOR
Get the specified descriptor.
定義: libusb.h:365
@ LIBUSB_DT_DEVICE_CAPABILITY
Device Capability descriptor.
定義: libusb.h:266
uint8_t libusb_get_port_number(libusb_device *dev)
定義: core.c:922
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)
定義: sync.c:97
@ LIBUSB_SPEED_SUPER_PLUS
The device is operating at super speed plus (10000MBit/s).
定義: libusb.h:1037
int libusb_claim_interface(libusb_device_handle *dev_handle, int
interface_number)
定義: core.c:1656
void libusb_unref_device(libusb_device *dev)
定義: core.c:1176
@ LIBUSB_ERROR_INTERRUPTED
System call interrupted (perhaps due to signal)
定義: libusb.h:1079
uint8_t bMaxBurst
The maximum number of packets the endpoint can send or receive as part of a
burst.
定義: libusb.h:752
int libusb_get_device_speed(libusb_device *dev)
定義: core.c:1005
@ LIBUSB_DT_PHYSICAL
Physical descriptor.
定義: libusb.h:275
static int libusb_get_descriptor(libusb_device_handle *dev_handle, uint8_t
desc_type, uint8_t desc_index, unsigned char *data, int length)
定義: libusb.h:1825
@ LIBUSB_HOTPLUG_ENUMERATE
Arm the callback and fire it for all matching currently attached devices.
定義: libusb.h:1963
@ LIBUSB_SET_ISOCH_DELAY
Delay from the time a host transmits a packet to the time it is received by
the device.
定義: libusb.h:390
uint8_t iManufacturer
Index of string descriptor describing manufacturer.
定義: libusb.h:565
@ LIBUSB_REQUEST_TYPE_CLASS
Class.
定義: libusb.h:402
@ LIBUSB_TRANSFER_ADD_ZERO_PACKET
Terminate transfers that are a multiple of the endpoint's wMaxPacketSize
with an extra zero length pa...
定義: libusb.h:1187
static unsigned char * libusb_get_iso_packet_buffer(struct libusb_transfer
*transfer, unsigned int packet)
定義: libusb.h:1739
@ LIBUSB_CLASS_PERSONAL_HEALTHCARE
Personal Healthcare.
定義: libusb.h:226
void libusb_interrupt_event_handler(libusb_context *ctx)
定義: io.c:1916
int libusb_handle_events_timeout_completed(libusb_context *ctx, struct
timeval *tv, int *completed)
定義: io.c:2315
@ LIBUSB_CLASS_AUDIO
Audio class.
定義: libusb.h:189
uint8_t iInterface
Index of string descriptor describing this interface.
定義: libusb.h:661
@ LIBUSB_CLASS_HID
Human Interface Device class.
定義: libusb.h:195
uint8_t bDescriptorType
Descriptor type.
定義: libusb.h:535
@ LIBUSB_CLASS_VENDOR_SPEC
Class is vendor-specific.
定義: libusb.h:241
const char * rc
Library release candidate suffix string, e.g.
定義: libusb.h:964
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)
定義: descriptor.c:976
libusb_speed
定義: libusb.h:1020
@ LIBUSB_LOG_LEVEL_DEBUG
(4) : All messages are emitted
定義: libusb.h:1323
struct libusb_device_handle libusb_device_handle
定義: libusb.h:1015
void(* libusb_pollfd_added_cb)(int fd, short events, void *user_data)
定義: libusb.h:1906
@ LIBUSB_DT_HUB
Hub descriptor.
定義: libusb.h:278
uint8_t bInterfaceNumber
Number of this interface.
定義: libusb.h:640
@ LIBUSB_CLASS_VIDEO
Video.
定義: libusb.h:223
static uint16_t libusb_cpu_to_le16(const uint16_t x)
定義: libusb.h:156
int libusb_get_config_descriptor(libusb_device *dev, uint8_t config_index,
struct libusb_config_descriptor **config)
定義: descriptor.c:596
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)
定義: libusb.h:1574
enum libusb_transfer_status status
The status of the transfer.
定義: libusb.h:1246
@ LIBUSB_LOG_LEVEL_ERROR
(1) : Error messages are emitted
定義: libusb.h:1314
@ LIBUSB_TRANSFER_TYPE_INTERRUPT
Interrupt transfer.
定義: libusb.h:1110
@ LIBUSB_OPTION_WEAK_AUTHORITY
Flag that libusb has weak authority.
定義: libusb.h:2112
@ LIBUSB_DT_INTERFACE
Interface descriptor.
定義: libusb.h:257
int libusb_free_streams(libusb_device_handle *dev_handle, unsigned char
*endpoints, int num_endpoints)
定義: core.c:1879
@ LIBUSB_REQUEST_GET_INTERFACE
Return the selected alternate setting for the specified interface.
定義: libusb.h:377