libusb-1.0
libusb.h
1 /*
2  * Public libusb header file
3  * Copyright © 2001 Johannes Erdfelt <johannes@erdfelt.com>
4  * Copyright © 2007-2008 Daniel Drake <dsd@gentoo.org>
5  * Copyright © 2012 Pete Batard <pete@akeo.ie>
6  * Copyright © 2012-2018 Nathan Hjelm <hjelmn@cs.unm.edu>
7  * Copyright © 2014-2020 Chris Dickens <christopher.a.dickens@gmail.com>
8  * For more information, please visit: http://libusb.info
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  */
24 
25 #ifndef LIBUSB_H
26 #define LIBUSB_H
27 
28 #if defined(_MSC_VER)
29 /* on MS environments, the inline keyword is available in C++ only */
30 #if !defined(__cplusplus)
31 #define inline __inline
32 #endif
33 /* ssize_t is also not available */
34 #include <basetsd.h>
35 typedef SSIZE_T ssize_t;
36 #endif /* _MSC_VER */
37 
38 #include <limits.h>
39 #include <stdint.h>
40 #include <sys/types.h>
41 #if !defined(_MSC_VER)
42 #include <sys/time.h>
43 #endif
44 #include <time.h>
45 
46 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
47 #define ZERO_SIZED_ARRAY /* [] - valid C99 code */
48 #else
49 #define ZERO_SIZED_ARRAY 0 /* [0] - non-standard, but usually working code */
50 #endif /* __STDC_VERSION__ */
51 
52 /* 'interface' might be defined as a macro on Windows, so we need to
53  * undefine it so as not to break the current libusb API, because
54  * libusb_config_descriptor has an 'interface' member
55  * As this can be problematic if you include windows.h after libusb.h
56  * in your sources, we force windows.h to be included first. */
57 #if defined(_WIN32) || defined(__CYGWIN__)
58 #include <windows.h>
59 #if defined(interface)
60 #undef interface
61 #endif
62 #if !defined(__CYGWIN__)
63 #include <winsock.h>
64 #endif
65 #endif /* _WIN32 || __CYGWIN__ */
66 
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))
71 #else
72 #define LIBUSB_DEPRECATED_FOR(f)
73 #endif /* __GNUC__ */
74 
75 #if defined(__GNUC__)
76 #define LIBUSB_PACKED __attribute__ ((packed))
77 #else
78 #define LIBUSB_PACKED
79 #endif /* __GNUC__ */
80 
106 /* LIBUSB_CALL must be defined on both definition and declaration of libusb
107  * functions. You'd think that declaration would be enough, but cygwin will
108  * complain about conflicting types unless both are marked this way.
109  * The placement of this macro is important too; it must appear after the
110  * return type, before the function name. See internal documentation for
111  * API_EXPORTED.
112  */
113 #if defined(_WIN32) || defined(__CYGWIN__)
114 #define LIBUSB_CALL WINAPI
115 #else
116 #define LIBUSB_CALL
117 #endif /* _WIN32 || __CYGWIN__ */
118 
139 #define LIBUSB_API_VERSION 0x01000108
140 
141 /* The following is kept for compatibility, but will be deprecated in the future */
142 #define LIBUSBX_API_VERSION LIBUSB_API_VERSION
143 
144 #if defined(__cplusplus)
145 extern "C" {
146 #endif
147 
156 static inline uint16_t libusb_cpu_to_le16(const uint16_t x)
157 {
158  union {
159  uint8_t b8[2];
160  uint16_t b16;
161  } _tmp;
162  _tmp.b8[1] = (uint8_t) (x >> 8);
163  _tmp.b8[0] = (uint8_t) (x & 0xff);
164  return _tmp.b16;
165 }
166 
175 #define libusb_le16_to_cpu libusb_cpu_to_le16
176 
177 /* standard USB stuff */
178 
187 
190 
193 
196 
199 
202  LIBUSB_CLASS_PTP = 0x06, /* legacy name from libusb-0.1 usb.h */
203 
206 
209 
212 
215 
218 
221 
224 
227 
230 
233 
236 
239 };
240 
246 
249 
252 
255 
258 
261 
264 
267 
270 
273 
276 
279 
282 };
283 
284 /* Descriptor sizes per descriptor type */
285 #define LIBUSB_DT_DEVICE_SIZE 18
286 #define LIBUSB_DT_CONFIG_SIZE 9
287 #define LIBUSB_DT_INTERFACE_SIZE 9
288 #define LIBUSB_DT_ENDPOINT_SIZE 7
289 #define LIBUSB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */
290 #define LIBUSB_DT_HUB_NONVAR_SIZE 7
291 #define LIBUSB_DT_SS_ENDPOINT_COMPANION_SIZE 6
292 #define LIBUSB_DT_BOS_SIZE 5
293 #define LIBUSB_DT_DEVICE_CAPABILITY_SIZE 3
294 
295 /* BOS descriptor sizes */
296 #define LIBUSB_BT_USB_2_0_EXTENSION_SIZE 7
297 #define LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE 10
298 #define LIBUSB_BT_CONTAINER_ID_SIZE 20
299 
300 /* We unwrap the BOS => define its max size */
301 #define LIBUSB_DT_BOS_MAX_SIZE \
302  (LIBUSB_DT_BOS_SIZE + \
303  LIBUSB_BT_USB_2_0_EXTENSION_SIZE + \
304  LIBUSB_BT_SS_USB_DEVICE_CAPABILITY_SIZE + \
305  LIBUSB_BT_CONTAINER_ID_SIZE)
306 
307 #define LIBUSB_ENDPOINT_ADDRESS_MASK 0x0f /* in bEndpointAddress */
308 #define LIBUSB_ENDPOINT_DIR_MASK 0x80
309 
317 
320 };
321 
322 #define LIBUSB_TRANSFER_TYPE_MASK 0x03 /* in bmAttributes */
323 
331 
334 
337 
340 };
341 
347 
350 
351  /* 0x02 is reserved */
352 
355 
356  /* 0x04 is reserved */
357 
360 
363 
366 
369 
372 
375 
378 
381 
384 
388 };
389 
397 
400 
403 
406 };
407 
415 
418 
421 
424 };
425 
426 #define LIBUSB_ISO_SYNC_TYPE_MASK 0x0c
427 
436 
439 
442 
445 };
446 
447 #define LIBUSB_ISO_USAGE_TYPE_MASK 0x30
448 
457 
460 
463 };
464 
472 
475 
478 
481 };
482 
491 };
492 
501 };
502 
509 
512 
515 
518 };
519 
527  uint8_t bLength;
528 
533 
536  uint16_t bcdUSB;
537 
539  uint8_t bDeviceClass;
540 
544 
548 
551 
553  uint16_t idVendor;
554 
556  uint16_t idProduct;
557 
559  uint16_t bcdDevice;
560 
562  uint8_t iManufacturer;
563 
565  uint8_t iProduct;
566 
568  uint8_t iSerialNumber;
569 
572 };
573 
581  uint8_t bLength;
582 
587 
592 
599  uint8_t bmAttributes;
600 
602  uint16_t wMaxPacketSize;
603 
605  uint8_t bInterval;
606 
609  uint8_t bRefresh;
610 
612  uint8_t bSynchAddress;
613 
616  const unsigned char *extra;
617 
620 };
621 
629  uint8_t bLength;
630 
635 
638 
641 
644  uint8_t bNumEndpoints;
645 
648 
652 
656 
658  uint8_t iInterface;
659 
663 
666  const unsigned char *extra;
667 
670 };
671 
679 
683 };
684 
692  uint8_t bLength;
693 
698 
700  uint16_t wTotalLength;
701 
703  uint8_t bNumInterfaces;
704 
707 
709  uint8_t iConfiguration;
710 
712  uint8_t bmAttributes;
713 
718  uint8_t MaxPower;
719 
723 
726  const unsigned char *extra;
727 
730 };
731 
740  uint8_t bLength;
741 
746 
749  uint8_t bMaxBurst;
750 
755  uint8_t bmAttributes;
756 
760 };
761 
769  uint8_t bLength;
770 
775 
778 
780  uint8_t dev_capability_data[ZERO_SIZED_ARRAY];
781 };
782 
790  uint8_t bLength;
791 
796 
798  uint16_t wTotalLength;
799 
802  uint8_t bNumDeviceCaps;
803 
805  struct libusb_bos_dev_capability_descriptor *dev_capability[ZERO_SIZED_ARRAY];
806 };
807 
815  uint8_t bLength;
816 
821 
826 
831  uint32_t bmAttributes;
832 };
833 
841  uint8_t bLength;
842 
847 
852 
857  uint8_t bmAttributes;
858 
861  uint16_t wSpeedSupported;
862 
868 
870  uint8_t bU1DevExitLat;
871 
873  uint16_t bU2DevExitLat;
874 };
875 
883  uint8_t bLength;
884 
889 
894 
896  uint8_t bReserved;
897 
899  uint8_t ContainerID[16];
900 };
901 
904 #if defined(_MSC_VER)
905 #pragma pack(push, 1)
906 #endif
913  uint8_t bmRequestType;
914 
920  uint8_t bRequest;
921 
923  uint16_t wValue;
924 
927  uint16_t wIndex;
928 
930  uint16_t wLength;
931 } LIBUSB_PACKED;
932 #if defined(_MSC_VER)
933 #pragma pack(pop)
934 #endif
935 
936 #define LIBUSB_CONTROL_SETUP_SIZE (sizeof(struct libusb_control_setup))
937 
938 /* libusb */
939 
940 struct libusb_context;
941 struct libusb_device;
942 struct libusb_device_handle;
943 
949  const uint16_t major;
950 
952  const uint16_t minor;
953 
955  const uint16_t micro;
956 
958  const uint16_t nano;
959 
961  const char *rc;
962 
964  const char *describe;
965 };
966 
985 
1002 
1003 
1013 
1020 
1023 
1026 
1029 
1032 
1035 };
1036 
1047 
1050 
1053 
1056 
1059 
1062 
1065 
1068 
1071 
1074 
1077 
1080 
1083 
1084  /* NB: Remember to update LIBUSB_ERROR_COUNT below as well as the
1085  message strings in strerror.c when adding new error codes here. */
1086 
1089 };
1090 
1091 /* Total number of error codes in enum libusb_error */
1092 #define LIBUSB_ERROR_COUNT 14
1093 
1099 
1102 
1105 
1108 
1111 };
1112 
1119 
1122 
1125 
1128 
1132 
1135 
1138 
1139  /* NB! Remember to update libusb_error_name()
1140  when adding new status codes here. */
1141 };
1142 
1148 
1154 
1160 
1185 };
1186 
1191  unsigned int length;
1192 
1194  unsigned int actual_length;
1195 
1198 };
1199 
1200 struct libusb_transfer;
1201 
1211 typedef void (LIBUSB_CALL *libusb_transfer_cb_fn)(struct libusb_transfer *transfer);
1212 
1222 
1224  uint8_t flags;
1225 
1227  unsigned char endpoint;
1228 
1230  unsigned char type;
1231 
1234  unsigned int timeout;
1235 
1244 
1246  int length;
1247 
1252 
1255  libusb_transfer_cb_fn callback;
1256 
1267  void *user_data;
1268 
1270  unsigned char *buffer;
1271 
1275 
1277  struct libusb_iso_packet_descriptor iso_packet_desc[ZERO_SIZED_ARRAY];
1278 };
1279 
1288 
1291 
1297 
1301 };
1302 
1309 
1312 
1315 
1318 
1321 };
1322 
1330 
1333 };
1334 
1344  enum libusb_log_level level, const char *str);
1345 
1348 LIBUSB_DEPRECATED_FOR(libusb_set_option)
1349 void LIBUSB_CALL libusb_set_debug(libusb_context *ctx, int level);
1351 const struct libusb_version * LIBUSB_CALL libusb_get_version(void);
1352 int LIBUSB_CALL libusb_has_capability(uint32_t capability);
1353 const char * LIBUSB_CALL libusb_error_name(int errcode);
1354 int LIBUSB_CALL libusb_setlocale(const char *locale);
1355 const char * LIBUSB_CALL libusb_strerror(int errcode);
1356 
1358  libusb_device ***list);
1360  int unref_devices);
1363 
1365  int *config);
1367  struct libusb_device_descriptor *desc);
1369  struct libusb_config_descriptor **config);
1371  uint8_t config_index, struct libusb_config_descriptor **config);
1373  uint8_t bConfigurationValue, struct libusb_config_descriptor **config);
1375  struct libusb_config_descriptor *config);
1377  libusb_context *ctx,
1378  const struct libusb_endpoint_descriptor *endpoint,
1379  struct libusb_ss_endpoint_companion_descriptor **ep_comp);
1381  struct libusb_ss_endpoint_companion_descriptor *ep_comp);
1383  struct libusb_bos_descriptor **bos);
1386  libusb_context *ctx,
1387  struct libusb_bos_dev_capability_descriptor *dev_cap,
1388  struct libusb_usb_2_0_extension_descriptor **usb_2_0_extension);
1390  struct libusb_usb_2_0_extension_descriptor *usb_2_0_extension);
1392  libusb_context *ctx,
1393  struct libusb_bos_dev_capability_descriptor *dev_cap,
1394  struct libusb_ss_usb_device_capability_descriptor **ss_usb_device_cap);
1396  struct libusb_ss_usb_device_capability_descriptor *ss_usb_device_cap);
1398  struct libusb_bos_dev_capability_descriptor *dev_cap,
1399  struct libusb_container_id_descriptor **container_id);
1401  struct libusb_container_id_descriptor *container_id);
1404 int LIBUSB_CALL libusb_get_port_numbers(libusb_device *dev, uint8_t *port_numbers, int port_numbers_len);
1405 LIBUSB_DEPRECATED_FOR(libusb_get_port_numbers)
1406 int LIBUSB_CALL libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t *path, uint8_t path_length);
1411  unsigned char endpoint);
1413  unsigned char endpoint);
1414 
1415 int LIBUSB_CALL libusb_wrap_sys_device(libusb_context *ctx, intptr_t sys_dev, libusb_device_handle **dev_handle);
1419 
1421  int configuration);
1423  int interface_number);
1425  int interface_number);
1426 
1428  libusb_context *ctx, uint16_t vendor_id, uint16_t product_id);
1429 
1431  int interface_number, int alternate_setting);
1433  unsigned char endpoint);
1435 
1437  uint32_t num_streams, unsigned char *endpoints, int num_endpoints);
1439  unsigned char *endpoints, int num_endpoints);
1440 
1441 unsigned char * LIBUSB_CALL libusb_dev_mem_alloc(libusb_device_handle *dev_handle,
1442  size_t length);
1444  unsigned char *buffer, size_t length);
1445 
1447  int interface_number);
1449  int interface_number);
1451  int interface_number);
1453  libusb_device_handle *dev_handle, int enable);
1454 
1455 /* async I/O */
1456 
1469 static inline unsigned char *libusb_control_transfer_get_data(
1470  struct libusb_transfer *transfer)
1471 {
1472  return transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE;
1473 }
1474 
1487 static inline struct libusb_control_setup *libusb_control_transfer_get_setup(
1488  struct libusb_transfer *transfer)
1489 {
1490  return (struct libusb_control_setup *)(void *)transfer->buffer;
1491 }
1492 
1516 static inline void libusb_fill_control_setup(unsigned char *buffer,
1517  uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex,
1518  uint16_t wLength)
1519 {
1520  struct libusb_control_setup *setup = (struct libusb_control_setup *)(void *)buffer;
1521  setup->bmRequestType = bmRequestType;
1522  setup->bRequest = bRequest;
1523  setup->wValue = libusb_cpu_to_le16(wValue);
1524  setup->wIndex = libusb_cpu_to_le16(wIndex);
1525  setup->wLength = libusb_cpu_to_le16(wLength);
1526 }
1527 
1528 struct libusb_transfer * LIBUSB_CALL libusb_alloc_transfer(int iso_packets);
1529 int LIBUSB_CALL libusb_submit_transfer(struct libusb_transfer *transfer);
1530 int LIBUSB_CALL libusb_cancel_transfer(struct libusb_transfer *transfer);
1531 void LIBUSB_CALL libusb_free_transfer(struct libusb_transfer *transfer);
1533  struct libusb_transfer *transfer, uint32_t stream_id);
1535  struct libusb_transfer *transfer);
1536 
1565 static inline void libusb_fill_control_transfer(
1566  struct libusb_transfer *transfer, libusb_device_handle *dev_handle,
1567  unsigned char *buffer, libusb_transfer_cb_fn callback, void *user_data,
1568  unsigned int timeout)
1569 {
1570  struct libusb_control_setup *setup = (struct libusb_control_setup *)(void *)buffer;
1571  transfer->dev_handle = dev_handle;
1572  transfer->endpoint = 0;
1573  transfer->type = LIBUSB_TRANSFER_TYPE_CONTROL;
1574  transfer->timeout = timeout;
1575  transfer->buffer = buffer;
1576  if (setup)
1577  transfer->length = (int) (LIBUSB_CONTROL_SETUP_SIZE
1578  + libusb_le16_to_cpu(setup->wLength));
1579  transfer->user_data = user_data;
1580  transfer->callback = callback;
1581 }
1582 
1596 static inline void libusb_fill_bulk_transfer(struct libusb_transfer *transfer,
1597  libusb_device_handle *dev_handle, unsigned char endpoint,
1598  unsigned char *buffer, int length, libusb_transfer_cb_fn callback,
1599  void *user_data, unsigned int timeout)
1600 {
1601  transfer->dev_handle = dev_handle;
1602  transfer->endpoint = endpoint;
1603  transfer->type = LIBUSB_TRANSFER_TYPE_BULK;
1604  transfer->timeout = timeout;
1605  transfer->buffer = buffer;
1606  transfer->length = length;
1607  transfer->user_data = user_data;
1608  transfer->callback = callback;
1609 }
1610 
1627 static inline void libusb_fill_bulk_stream_transfer(
1628  struct libusb_transfer *transfer, libusb_device_handle *dev_handle,
1629  unsigned char endpoint, uint32_t stream_id,
1630  unsigned char *buffer, int length, libusb_transfer_cb_fn callback,
1631  void *user_data, unsigned int timeout)
1632 {
1633  libusb_fill_bulk_transfer(transfer, dev_handle, endpoint, buffer,
1634  length, callback, user_data, timeout);
1636  libusb_transfer_set_stream_id(transfer, stream_id);
1637 }
1638 
1652 static inline void libusb_fill_interrupt_transfer(
1653  struct libusb_transfer *transfer, libusb_device_handle *dev_handle,
1654  unsigned char endpoint, unsigned char *buffer, int length,
1655  libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout)
1656 {
1657  transfer->dev_handle = dev_handle;
1658  transfer->endpoint = endpoint;
1660  transfer->timeout = timeout;
1661  transfer->buffer = buffer;
1662  transfer->length = length;
1663  transfer->user_data = user_data;
1664  transfer->callback = callback;
1665 }
1666 
1681 static inline void libusb_fill_iso_transfer(struct libusb_transfer *transfer,
1682  libusb_device_handle *dev_handle, unsigned char endpoint,
1683  unsigned char *buffer, int length, int num_iso_packets,
1684  libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout)
1685 {
1686  transfer->dev_handle = dev_handle;
1687  transfer->endpoint = endpoint;
1689  transfer->timeout = timeout;
1690  transfer->buffer = buffer;
1691  transfer->length = length;
1692  transfer->num_iso_packets = num_iso_packets;
1693  transfer->user_data = user_data;
1694  transfer->callback = callback;
1695 }
1696 
1705 static inline void libusb_set_iso_packet_lengths(
1706  struct libusb_transfer *transfer, unsigned int length)
1707 {
1708  int i;
1709 
1710  for (i = 0; i < transfer->num_iso_packets; i++)
1711  transfer->iso_packet_desc[i].length = length;
1712 }
1713 
1730 static inline unsigned char *libusb_get_iso_packet_buffer(
1731  struct libusb_transfer *transfer, unsigned int packet)
1732 {
1733  int i;
1734  size_t offset = 0;
1735  int _packet;
1736 
1737  /* oops..slight bug in the API. packet is an unsigned int, but we use
1738  * signed integers almost everywhere else. range-check and convert to
1739  * signed to avoid compiler warnings. FIXME for libusb-2. */
1740  if (packet > INT_MAX)
1741  return NULL;
1742  _packet = (int) packet;
1743 
1744  if (_packet >= transfer->num_iso_packets)
1745  return NULL;
1746 
1747  for (i = 0; i < _packet; i++)
1748  offset += transfer->iso_packet_desc[i].length;
1749 
1750  return transfer->buffer + offset;
1751 }
1752 
1772 static inline unsigned char *libusb_get_iso_packet_buffer_simple(
1773  struct libusb_transfer *transfer, unsigned int packet)
1774 {
1775  int _packet;
1776 
1777  /* oops..slight bug in the API. packet is an unsigned int, but we use
1778  * signed integers almost everywhere else. range-check and convert to
1779  * signed to avoid compiler warnings. FIXME for libusb-2. */
1780  if (packet > INT_MAX)
1781  return NULL;
1782  _packet = (int) packet;
1783 
1784  if (_packet >= transfer->num_iso_packets)
1785  return NULL;
1786 
1787  return transfer->buffer + ((int) transfer->iso_packet_desc[0].length * _packet);
1788 }
1789 
1790 /* sync I/O */
1791 
1793  uint8_t request_type, uint8_t bRequest, uint16_t wValue, uint16_t wIndex,
1794  unsigned char *data, uint16_t wLength, unsigned int timeout);
1795 
1797  unsigned char endpoint, unsigned char *data, int length,
1798  int *actual_length, unsigned int timeout);
1799 
1801  unsigned char endpoint, unsigned char *data, int length,
1802  int *actual_length, unsigned int timeout);
1803 
1816 static inline int libusb_get_descriptor(libusb_device_handle *dev_handle,
1817  uint8_t desc_type, uint8_t desc_index, unsigned char *data, int length)
1818 {
1819  return libusb_control_transfer(dev_handle, LIBUSB_ENDPOINT_IN,
1820  LIBUSB_REQUEST_GET_DESCRIPTOR, (uint16_t) ((desc_type << 8) | desc_index),
1821  0, data, (uint16_t) length, 1000);
1822 }
1823 
1838 static inline int libusb_get_string_descriptor(libusb_device_handle *dev_handle,
1839  uint8_t desc_index, uint16_t langid, unsigned char *data, int length)
1840 {
1841  return libusb_control_transfer(dev_handle, LIBUSB_ENDPOINT_IN,
1842  LIBUSB_REQUEST_GET_DESCRIPTOR, (uint16_t)((LIBUSB_DT_STRING << 8) | desc_index),
1843  langid, data, (uint16_t) length, 1000);
1844 }
1845 
1847  uint8_t desc_index, unsigned char *data, int length);
1848 
1849 /* polling and timeouts */
1850 
1859 int LIBUSB_CALL libusb_wait_for_event(libusb_context *ctx, struct timeval *tv);
1860 
1862  struct timeval *tv);
1864  struct timeval *tv, int *completed);
1868  struct timeval *tv);
1871  struct timeval *tv);
1872 
1878  int fd;
1879 
1884  short events;
1885 };
1886 
1897 typedef void (LIBUSB_CALL *libusb_pollfd_added_cb)(int fd, short events,
1898  void *user_data);
1899 
1909 typedef void (LIBUSB_CALL *libusb_pollfd_removed_cb)(int fd, void *user_data);
1910 
1912  libusb_context *ctx);
1913 void LIBUSB_CALL libusb_free_pollfds(const struct libusb_pollfd **pollfds);
1915  libusb_pollfd_added_cb added_cb, libusb_pollfd_removed_cb removed_cb,
1916  void *user_data);
1917 
1931 
1937 typedef enum {
1940 
1946 
1952 typedef enum {
1956 
1959 #define LIBUSB_HOTPLUG_NO_FLAGS 0
1960 
1963 #define LIBUSB_HOTPLUG_MATCH_ANY -1
1964 
1988  libusb_device *device, libusb_hotplug_event event, void *user_data);
1989 
2026  int events, int flags,
2027  int vendor_id, int product_id, int dev_class,
2028  libusb_hotplug_callback_fn cb_fn, void *user_data,
2029  libusb_hotplug_callback_handle *callback_handle);
2030 
2043  libusb_hotplug_callback_handle callback_handle);
2044 
2054  libusb_hotplug_callback_handle callback_handle);
2055 
2082 
2091 };
2092 
2094 
2095 #if defined(__cplusplus)
2096 }
2097 #endif
2098 
2099 #endif
const char * describe
Definition: libusb.h:964
uint16_t bU2DevExitLat
Definition: libusb.h:873
Definition: libusb.h:414
uint8_t bFunctionalitySupport
Definition: libusb.h:867
Definition: libusb.h:281
uint8_t bInterfaceNumber
Definition: libusb.h:637
Definition: libusb.h:438
uint8_t bSynchAddress
Definition: libusb.h:612
Definition: libusb.h:1308
Definition: libusb.h:1022
void LIBUSB_CALL libusb_set_debug(libusb_context *ctx, int level)
Definition: core.c:2117
Definition: libusb.h:1046
Definition: libusb.h:1134
int LIBUSB_CALL libusb_get_max_iso_packet_size(libusb_device *dev, unsigned char endpoint)
Definition: core.c:1124
Definition: libusb.h:263
uint8_t bmAttributes
Definition: libusb.h:599
Definition: libusb.h:1019
Definition: libusb.h:675
Definition: libusb.h:266
int LIBUSB_CALL libusb_has_capability(uint32_t capability)
Definition: core.c:2473
int LIBUSB_CALL libusb_get_string_descriptor_ascii(libusb_device_handle *dev_handle, uint8_t desc_index, unsigned char *data, int length)
Definition: descriptor.c:1103
uint8_t bReserved
Definition: libusb.h:896
uint8_t bNumConfigurations
Definition: libusb.h:571
Definition: libusb.h:189
uint8_t bRequest
Definition: libusb.h:920
Definition: libusb.h:1082
int LIBUSB_CALL libusb_handle_events_locked(libusb_context *ctx, struct timeval *tv)
Definition: io.c:2464
Definition: libusbi.h:301
void LIBUSB_CALL libusb_free_usb_2_0_extension_descriptor(struct libusb_usb_2_0_extension_descriptor *usb_2_0_extension)
Definition: descriptor.c:975
Definition: libusb.h:198
Definition: libusb.h:423
const uint16_t nano
Definition: libusb.h:958
uint8_t bDevCapabilityType
Definition: libusb.h:893
Definition: libusb.h:1104
Definition: libusb.h:490
uint8_t bLength
Definition: libusb.h:769
void LIBUSB_CALL libusb_hotplug_deregister_callback(libusb_context *ctx, libusb_hotplug_callback_handle callback_handle)
Definition: hotplug.c:319
uint8_t bDeviceSubClass
Definition: libusb.h:543
ssize_t LIBUSB_CALL libusb_get_device_list(libusb_context *ctx, libusb_device ***list)
Definition: core.c:830
libusb_class_code
Definition: libusb.h:181
#define libusb_le16_to_cpu
Definition: libusb.h:175
int LIBUSB_CALL 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)
Definition: descriptor.c:994
uint8_t bDescriptorType
Definition: libusb.h:774
Definition: libusb.h:211
int LIBUSB_CALL libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t *path, uint8_t path_length)
Definition: core.c:982
Definition: libusb.h:690
Definition: libusb.h:767
uint8_t bInterval
Definition: libusb.h:605
uint8_t bLength
Definition: libusb.h:527
int LIBUSB_CALL libusb_set_interface_alt_setting(libusb_device_handle *dev_handle, int interface_number, int alternate_setting)
Definition: core.c:1766
libusb_endpoint_direction
Definition: libusb.h:314
uint8_t bDeviceClass
Definition: libusb.h:539
Definition: libusb.h:254
Definition: libusb.h:1070
libusb_ss_usb_device_capability_attributes
Definition: libusb.h:498
short events
Definition: libusb.h:1884
Definition: libusb.h:517
int extra_length
Definition: libusb.h:619
uint8_t flags
Definition: libusb.h:1224
Definition: libusb.h:459
Definition: libusb.h:456
Definition: libusb.h:405
int LIBUSB_CALL libusb_get_bos_descriptor(libusb_device_handle *dev_handle, struct libusb_bos_descriptor **bos)
Definition: descriptor.c:864
Definition: libusb.h:1332
Definition: libusb.h:1954
uint8_t bmAttributes
Definition: libusb.h:755
int LIBUSB_CALL libusb_try_lock_events(libusb_context *ctx)
Definition: io.c:1778
Definition: libusb.h:1296
uint8_t bDescriptorType
Definition: libusb.h:586
Definition: libusb.h:238
Definition: libusb.h:1184
uint8_t iSerialNumber
Definition: libusb.h:568
libusb_option
Definition: libusb.h:2059
Definition: libusb.h:383
int LIBUSB_CALL libusb_get_max_packet_size(libusb_device *dev, unsigned char endpoint)
Definition: core.c:1069
Definition: libusb.h:1101
uint8_t bLength
Definition: libusb.h:629
int LIBUSB_CALL libusb_detach_kernel_driver(libusb_device_handle *dev_handle, int interface_number)
Definition: core.c:2027
int LIBUSB_CALL libusb_get_device_speed(libusb_device *dev)
Definition: core.c:1023
Definition: libusb.h:1052
int LIBUSB_CALL libusb_wrap_sys_device(libusb_context *ctx, intptr_t sys_dev, libusb_device_handle **dev_handle)
Definition: core.c:1249
Definition: libusb.h:1876
Definition: libusb.h:500
uint8_t bNumInterfaces
Definition: libusb.h:703
libusb_speed
Definition: libusb.h:1017
Definition: libusb.h:1944
Definition: libusb.h:1076
int LIBUSB_CALL libusb_free_streams(libusb_device_handle *dev_handle, unsigned char *endpoints, int num_endpoints)
Definition: core.c:1900
libusb_iso_sync_type
Definition: libusb.h:433
uint8_t bmAttributes
Definition: libusb.h:857
libusb_device *LIBUSB_CALL libusb_get_device(libusb_device_handle *dev_handle)
Definition: core.c:1529
Definition: libusb.h:1311
int LIBUSB_CALL 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)
Definition: sync.c:97
uint16_t bcdDevice
Definition: libusb.h:559
int LIBUSB_CALL libusb_reset_device(libusb_device_handle *dev_handle)
Definition: core.c:1837
unsigned char * buffer
Definition: libusb.h:1270
Definition: libusb.h:471
uint8_t bDeviceProtocol
Definition: libusb.h:547
Definition: libusb.h:1939
Definition: libusb.h:1320
Definition: libusb.h:1055
Definition: libusb.h:1061
int LIBUSB_CALL libusb_attach_kernel_driver(libusb_device_handle *dev_handle, int interface_number)
Definition: core.c:2064
Definition: libusb.h:1049
Definition: libusb.h:1287
uint16_t wMaxPacketSize
Definition: libusb.h:602
Definition: libusb.h:229
uint8_t bDevCapabilityType
Definition: libusb.h:851
const unsigned char * extra
Definition: libusb.h:616
libusb_standard_request
Definition: libusb.h:344
Definition: libusb.h:1025
Definition: libusb.h:359
int fd
Definition: libusb.h:1878
int LIBUSB_CALL libusb_get_next_timeout(libusb_context *ctx, struct timeval *tv)
Definition: io.c:2542
Definition: libusb.h:881
uint8_t iManufacturer
Definition: libusb.h:562
Definition: libusb.h:511
Definition: libusb.h:1034
uint8_t iInterface
Definition: libusb.h:658
Definition: libusb.h:1219
Definition: libusb.h:1159
int LIBUSB_CALL libusb_pollfds_handle_timeouts(libusb_context *ctx)
Definition: io.c:2508
libusb_descriptor_type
Definition: libusb.h:243
Definition: libusb.h:420
Definition: libusb.h:1028
unsigned int timeout
Definition: libusb.h:1234
Definition: libusb.h:365
Definition: libusb.h:217
int LIBUSB_CALL libusb_get_configuration(libusb_device_handle *dev, int *config)
Definition: core.c:1554
void LIBUSB_CALL libusb_free_ss_usb_device_capability_descriptor(struct libusb_ss_usb_device_capability_descriptor *ss_usb_device_cap)
Definition: descriptor.c:1031
libusb_bos_type
Definition: libusb.h:506
uint8_t bDevCapabilityType
Definition: libusb.h:777
int LIBUSB_CALL libusb_claim_interface(libusb_device_handle *dev_handle, int interface_number)
Definition: core.c:1677
libusb_transfer_cb_fn callback
Definition: libusb.h:1255
Definition: libusb.h:627
const uint16_t minor
Definition: libusb.h:952
const unsigned char * extra
Definition: libusb.h:726
Definition: libusb.h:316
Definition: libusb.h:525
int LIBUSB_CALL libusb_setlocale(const char *locale)
Definition: strerror.c:178
int LIBUSB_CALL libusb_set_auto_detach_kernel_driver(libusb_device_handle *dev_handle, int enable)
Definition: core.c:2103
void LIBUSB_CALL libusb_unlock_events(libusb_context *ctx)
Definition: io.c:1836
const char *LIBUSB_CALL libusb_strerror(int errcode)
Definition: strerror.c:213
Definition: libusb.h:1079
uint8_t bmRequestType
Definition: libusb.h:913
void LIBUSB_CALL libusb_close(libusb_device_handle *dev_handle)
Definition: core.c:1467
libusb_transfer_type
Definition: libusb.h:1096
uint8_t bLength
Definition: libusb.h:581
Definition: libusb.h:195
Definition: libusb.h:208
uint8_t bEndpointAddress
Definition: libusb.h:591
Definition: libusb.h:368
Definition: libusb.h:205
void LIBUSB_CALL libusb_unlock_event_waiters(libusb_context *ctx)
Definition: io.c:1976
Definition: libusb.h:1064
Definition: getopt.h:94
Definition: libusb.h:362
unsigned char *LIBUSB_CALL libusb_dev_mem_alloc(libusb_device_handle *dev_handle, size_t length)
Definition: core.c:1943
Definition: libusb.h:220
Definition: libusb.h:1088
void LIBUSB_CALL libusb_lock_event_waiters(libusb_context *ctx)
Definition: io.c:1965
const struct libusb_interface * interface
Definition: libusb.h:722
libusb_request_recipient
Definition: libusb.h:412
uint8_t bLength
Definition: libusb.h:740
uint8_t bDescriptorType
Definition: libusb.h:634
libusb_error
Definition: libusb.h:1044
Definition: libusb.h:278
int extra_length
Definition: libusb.h:669
const struct libusb_interface_descriptor * altsetting
Definition: libusb.h:678
struct libusb_iso_packet_descriptor iso_packet_desc[ZERO_SIZED_ARRAY]
Definition: libusb.h:1277
libusb_hotplug_event
Definition: libusb.h:1937
Definition: libusbi.h:460
Definition: libusb.h:2090
libusb_supported_speed
Definition: libusb.h:469
libusb_hotplug_flag
Definition: libusb.h:1952
uint32_t LIBUSB_CALL libusb_transfer_get_stream_id(struct libusb_transfer *transfer)
Definition: io.c:1654
const uint16_t major
Definition: libusb.h:949
uint8_t bU1DevExitLat
Definition: libusb.h:870
int LIBUSB_CALL libusb_handle_events(libusb_context *ctx)
Definition: io.c:2416
Definition: libusb.h:788
Definition: libusb.h:214
libusb_transfer_status
Definition: libusb.h:1115
struct libusb_transfer *LIBUSB_CALL libusb_alloc_transfer(int iso_packets)
Definition: io.c:1296
Definition: libusb.h:417
int LIBUSB_CALL libusb_submit_transfer(struct libusb_transfer *transfer)
Definition: io.c:1502
int LIBUSB_CALL libusb_clear_halt(libusb_device_handle *dev_handle, unsigned char endpoint)
Definition: core.c:1808
Definition: libusb.h:1098
const uint16_t micro
Definition: libusb.h:955
unsigned int actual_length
Definition: libusb.h:1194
int num_altsetting
Definition: libusb.h:682
Definition: libusb.h:1317
libusb_request_type
Definition: libusb.h:394
int libusb_hotplug_callback_handle
Definition: libusb.h:1930
uint8_t bLength
Definition: libusb.h:815
uint8_t bInterfaceClass
Definition: libusb.h:647
int LIBUSB_CALL libusb_event_handler_active(libusb_context *ctx)
Definition: io.c:1900
Definition: libusb.h:1314
void LIBUSB_CALL libusb_free_pollfds(const struct libusb_pollfd **pollfds)
Definition: io.c:2775
void LIBUSB_CALL libusb_exit(libusb_context *ctx)
Definition: core.c:2377
libusb_device *LIBUSB_CALL libusb_ref_device(libusb_device *dev)
Definition: core.c:1179
libusb_log_cb_mode
Definition: libusb.h:1327
Definition: libusb.h:1124
Definition: libusb.h:1067
Definition: libusb.h:441
libusb_iso_usage_type
Definition: libusb.h:454
uint16_t wValue
Definition: libusb.h:923
int LIBUSB_CALL libusb_get_active_config_descriptor(libusb_device *dev, struct libusb_config_descriptor **config)
Definition: descriptor.c:573
const char *LIBUSB_CALL libusb_error_name(int errcode)
Definition: core.c:2702
libusb_device *LIBUSB_CALL libusb_get_parent(libusb_device *dev)
Definition: core.c:1002
void LIBUSB_CALL libusb_unref_device(libusb_device *dev)
Definition: core.c:1192
int LIBUSB_CALL libusb_alloc_streams(libusb_device_handle *dev_handle, uint32_t num_streams, unsigned char *endpoints, int num_endpoints)
Definition: core.c:1870
Definition: libusb.h:396
Definition: libusb.h:272
Definition: libusb.h:477
int LIBUSB_CALL libusb_init(libusb_context **ctx)
Definition: core.c:2266
Definition: libusb.h:474
uint8_t bmAttributes
Definition: libusb.h:712
int LIBUSB_CALL libusb_get_config_descriptor(libusb_device *dev, uint8_t config_index, struct libusb_config_descriptor **config)
Definition: descriptor.c:614
int LIBUSB_CALL libusb_set_configuration(libusb_device_handle *dev_handle, int configuration)
Definition: core.c:1640
uint8_t bDescriptorType
Definition: libusb.h:697
int length
Definition: libusb.h:1246
Definition: libusb.h:1147
void * user_data
Definition: libusb.h:1267
Definition: libusb.h:435
uint8_t bNumEndpoints
Definition: libusb.h:644
uint16_t wIndex
Definition: libusb.h:927
int LIBUSB_CALL libusb_open(libusb_device *dev, libusb_device_handle **dev_handle)
Definition: core.c:1308
int LIBUSB_CALL libusb_get_port_numbers(libusb_device *dev, uint8_t *port_numbers, int port_numbers_len)
Definition: core.c:956
Definition: libusb.h:260
Definition: libusb.h:1118
Definition: libusb.h:275
Definition: libusb.h:232
Definition: libusb.h:813
uint8_t bDevCapabilityType
Definition: libusb.h:825
Definition: libusb.h:251
Definition: libusb.h:444
typedef void(LIBUSB_CALL *libusb_transfer_cb_fn)(struct libusb_transfer *transfer)
uint8_t bDescriptorType
Definition: libusb.h:846
uint8_t bLength
Definition: libusb.h:790
int(LIBUSB_CALL * libusb_hotplug_callback_fn)(libusb_context *ctx, libusb_device *device, libusb_hotplug_event event, void *user_data)
Definition: libusb.h:1987
Definition: libusb.h:201
Definition: libusb.h:907
Definition: libusbi.h:439
Definition: libusb.h:1031
void LIBUSB_CALL libusb_free_container_id_descriptor(struct libusb_container_id_descriptor *container_id)
Definition: descriptor.c:1085
Definition: libusb.h:1121
int LIBUSB_CALL libusb_cancel_transfer(struct libusb_transfer *transfer)
Definition: io.c:1593
uint8_t bDescriptorType
Definition: libusb.h:888
libusb_device_handle * dev_handle
Definition: libusb.h:1221
uint8_t bDescriptorType
Definition: libusb.h:820
uint8_t bNumDeviceCaps
Definition: libusb.h:802
uint16_t wTotalLength
Definition: libusb.h:700
uint16_t idProduct
Definition: libusb.h:556
Definition: libusb.h:248
uint16_t wTotalLength
Definition: libusb.h:798
Definition: libusb.h:374
int LIBUSB_CALL libusb_get_config_descriptor_by_value(libusb_device *dev, uint8_t bConfigurationValue, struct libusb_config_descriptor **config)
Definition: descriptor.c:660
int LIBUSB_CALL libusb_get_ss_endpoint_companion_descriptor(libusb_context *ctx, const struct libusb_endpoint_descriptor *endpoint, struct libusb_ss_endpoint_companion_descriptor **ep_comp)
Definition: descriptor.c:723
int LIBUSB_CALL libusb_set_option(libusb_context *ctx, enum libusb_option option,...)
Definition: core.c:2195
Definition: libusb.h:257
Definition: libusb.h:399
Definition: libusb.h:349
void LIBUSB_CALL libusb_free_transfer(struct libusb_transfer *transfer)
Definition: io.c:1344
void LIBUSB_CALL libusb_set_pollfd_notifiers(libusb_context *ctx, libusb_pollfd_added_cb added_cb, libusb_pollfd_removed_cb removed_cb, void *user_data)
Definition: io.c:2619
uint16_t wLength
Definition: libusb.h:930
Definition: libusb.h:336
Definition: libusb.h:223
uint16_t idVendor
Definition: libusb.h:553
uint8_t bInterfaceSubClass
Definition: libusb.h:651
int LIBUSB_CALL libusb_handle_events_timeout(libusb_context *ctx, struct timeval *tv)
Definition: io.c:2396
Definition: libusb.h:579
uint8_t bLength
Definition: libusb.h:841
uint8_t bConfigurationValue
Definition: libusb.h:706
int LIBUSB_CALL libusb_bulk_transfer(libusb_device_handle *dev_handle, unsigned char endpoint, unsigned char *data, int length, int *actual_length, unsigned int timeout)
Definition: sync.c:274
Definition: libusb.h:1058
int num_iso_packets
Definition: libusb.h:1274
libusb_transfer_flags
Definition: libusb.h:1145
void(LIBUSB_CALL * libusb_log_cb)(libusb_context *ctx, enum libusb_log_level level, const char *str)
Definition: libusb.h:1343
Definition: libusb.h:1107
Definition: sunos_usb.h:37
int actual_length
Definition: libusb.h:1251
uint8_t bDescriptorType
Definition: libusb.h:532
Definition: libusb.h:319
Definition: libusb.h:235
Definition: libusb.h:480
int LIBUSB_CALL 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)
Definition: descriptor.c:939
uint8_t bLength
Definition: libusb.h:692
int LIBUSB_CALL libusb_handle_events_completed(libusb_context *ctx, int *completed)
Definition: io.c:2438
void LIBUSB_CALL libusb_lock_events(libusb_context *ctx)
Definition: io.c:1821
libusb_endpoint_transfer_type
Definition: libusb.h:328
void(LIBUSB_CALL * libusb_pollfd_added_cb)(int fd, short events, void *user_data)
Definition: libusb.h:1897
Definition: libusb.h:1127
Definition: libusb.h:1131
uint8_t bMaxPacketSize0
Definition: libusb.h:550
Definition: libusb.h:226
int LIBUSB_CALL libusb_interrupt_transfer(libusb_device_handle *dev_handle, unsigned char endpoint, unsigned char *data, int length, int *actual_length, unsigned int timeout)
Definition: sync.c:328
uint8_t iProduct
Definition: libusb.h:565
Definition: libusb.h:387
Definition: libusb.h:2081
void LIBUSB_CALL libusb_interrupt_event_handler(libusb_context *ctx)
Definition: io.c:1929
void(LIBUSB_CALL * libusb_pollfd_removed_cb)(int fd, void *user_data)
Definition: libusb.h:1909
uint8_t bLength
Definition: libusb.h:883
int LIBUSB_CALL libusb_handle_events_timeout_completed(libusb_context *ctx, struct timeval *tv, int *completed)
Definition: io.c:2327
uint8_t bDescriptorType
Definition: libusb.h:795
libusb_capability
Definition: libusb.h:1285
Definition: libusb.h:1110
Definition: libusb.h:377
int extra_length
Definition: libusb.h:729
int LIBUSB_CALL libusb_get_device_descriptor(libusb_device *dev, struct libusb_device_descriptor *desc)
Definition: descriptor.c:549
uint32_t bmAttributes
Definition: libusb.h:831
uint16_t wBytesPerInterval
Definition: libusb.h:759
uint8_t iConfiguration
Definition: libusb.h:709
void LIBUSB_CALL libusb_free_device_list(libusb_device **list, int unref_devices)
Definition: core.c:900
unsigned int length
Definition: libusb.h:1191
void LIBUSB_CALL libusb_free_ss_endpoint_companion_descriptor(struct libusb_ss_endpoint_companion_descriptor *ep_comp)
Definition: descriptor.c:772
const unsigned char * extra
Definition: libusb.h:666
uint8_t bAlternateSetting
Definition: libusb.h:640
Definition: libusb.h:462
libusb_log_level
Definition: libusb.h:1306
Definition: libusb.h:1137
Definition: libusb.h:1073
Definition: libusb.h:346
Definition: libusb.h:402
Definition: libusb.h:192
int LIBUSB_CALL libusb_kernel_driver_active(libusb_device_handle *dev_handle, int interface_number)
Definition: core.c:1989
unsigned char endpoint
Definition: libusb.h:1227
const struct libusb_version *LIBUSB_CALL libusb_get_version(void)
Definition: core.c:2757
int LIBUSB_CALL 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)
Definition: hotplug.c:231
uint8_t bInterfaceProtocol
Definition: libusb.h:655
const struct libusb_pollfd **LIBUSB_CALL libusb_get_pollfds(libusb_context *ctx)
Definition: io.c:2727
Definition: libusb.h:1153
uint16_t bcdUSB
Definition: libusb.h:536
int LIBUSB_CALL libusb_release_interface(libusb_device_handle *dev_handle, int interface_number)
Definition: core.c:1721
Definition: libusb.h:947
Definition: libusb.h:245
uint8_t bMaxBurst
Definition: libusb.h:749
uint16_t wSpeedSupported
Definition: libusb.h:861
Definition: libusb.h:354
int LIBUSB_CALL libusb_dev_mem_free(libusb_device_handle *dev_handle, unsigned char *buffer, size_t length)
Definition: core.c:1963
Definition: libusb.h:371
const struct libusb_endpoint_descriptor * endpoint
Definition: libusb.h:662
int LIBUSB_CALL libusb_event_handling_ok(libusb_context *ctx)
Definition: io.c:1871
void *LIBUSB_CALL libusb_hotplug_get_user_data(libusb_context *ctx, libusb_hotplug_callback_handle callback_handle)
Definition: hotplug.c:357
void LIBUSB_CALL libusb_free_bos_descriptor(struct libusb_bos_descriptor *bos)
Definition: descriptor.c:914
#define LIBUSB_CALL
Definition: libusb.h:116
uint8_t LIBUSB_CALL libusb_get_device_address(libusb_device *dev)
Definition: core.c:1012
Definition: libusb.h:1189
uint8_t LIBUSB_CALL libusb_get_bus_number(libusb_device *dev)
Definition: core.c:921
void LIBUSB_CALL libusb_transfer_set_stream_id(struct libusb_transfer *transfer, uint32_t stream_id)
Definition: io.c:1637
uint8_t bDescriptorType
Definition: libusb.h:745
const char * rc
Definition: libusb.h:961
Definition: libusb.h:380
void LIBUSB_CALL libusb_set_log_cb(libusb_context *ctx, libusb_log_cb cb, int mode)
Definition: core.c:2152
Definition: libusb.h:1290
Definition: libusb.h:514
uint8_t LIBUSB_CALL libusb_get_port_number(libusb_device *dev)
Definition: core.c:940
int LIBUSB_CALL libusb_wait_for_event(libusb_context *ctx, struct timeval *tv)
Definition: io.c:2007
uint8_t MaxPower
Definition: libusb.h:718
int LIBUSB_CALL libusb_get_container_id_descriptor(libusb_context *ctx, struct libusb_bos_dev_capability_descriptor *dev_cap, struct libusb_container_id_descriptor **container_id)
Definition: descriptor.c:1050
Definition: libusb.h:269
unsigned char type
Definition: libusb.h:1230
void LIBUSB_CALL libusb_free_config_descriptor(struct libusb_config_descriptor *config)
Definition: descriptor.c:700
Definition: libusb.h:1329
uint8_t bRefresh
Definition: libusb.h:609
libusb_usb_2_0_extension_attributes
Definition: libusb.h:488
Definition: libusb.h:186
libusb_device_handle *LIBUSB_CALL libusb_open_device_with_vid_pid(libusb_context *ctx, uint16_t vendor_id, uint16_t product_id)
Definition: core.c:1367