Main MRPT website > C++ reference for MRPT 1.5.6
xslibusb.cpp
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 #ifndef _WIN32 // patch for MRPT
10 
11 #include "xslibusb.h"
12 #include <xsens/xslibraryloader.h>
13 
14 /*! \class XsLibUsb
15  \brief Class for dynamic loading of winusb
16 */
18 {
20  initLibrary();
21 }
22 
24 {
25  delete m_libraryLoader;
26 }
27 
29 {
30  if (!m_libraryLoader->isLoaded())
31  m_libraryLoader->load("libusb-1.0.so");
32 
33  m_libUsb.init = NULL;
34  m_libUsb.exit = NULL;
35  m_libUsb.open = NULL;
36  m_libUsb.close = NULL;
40  m_libUsb.ref_device = NULL;
41  m_libUsb.unref_device = NULL;
46  m_libUsb.get_bus_number = NULL;
47  m_libUsb.get_device = NULL;
53  m_libUsb.bulk_transfer = NULL;
54  m_libUsb.set_debug = NULL;
55 
56  if (m_libraryLoader->isLoaded())
57  {
58  m_libUsb.init = (libUSB_init*)m_libraryLoader->resolve("libusb_init");
59  m_libUsb.exit = (libUSB_exit*)m_libraryLoader->resolve("libusb_exit");
60  m_libUsb.open = (libUSB_open*)m_libraryLoader->resolve("libusb_open");
61  m_libUsb.close = (libUSB_close*)m_libraryLoader->resolve("libusb_close");
62  m_libUsb.kernel_driver_active = (libUSB_kernel_driver_active*)m_libraryLoader->resolve("libusb_kernel_driver_active");
63  m_libUsb.attach_kernel_driver = (libUSB_attach_kernel_driver*)m_libraryLoader->resolve("libusb_attach_kernel_driver");
64  m_libUsb.detach_kernel_driver = (libUSB_detach_kernel_driver*)m_libraryLoader->resolve("libusb_detach_kernel_driver");
65  m_libUsb.ref_device = (libUSB_ref_device*)m_libraryLoader->resolve("libusb_ref_device");
66  m_libUsb.unref_device = (libUSB_unref_device*)m_libraryLoader->resolve("libusb_unref_device");
67  m_libUsb.claim_interface = (libUSB_claim_interface*)m_libraryLoader->resolve("libusb_claim_interface");
68  m_libUsb.release_interface = (libUSB_release_interface*)m_libraryLoader->resolve("libusb_release_interface");
69  m_libUsb.get_active_config_descriptor = (libUSB_get_active_config_descriptor*)m_libraryLoader->resolve("libusb_get_active_config_descriptor");
70  m_libUsb.free_config_descriptor = (libUSB_free_config_descriptor*)m_libraryLoader->resolve("libusb_free_config_descriptor");
71  m_libUsb.get_bus_number = (libUSB_get_bus_number*)m_libraryLoader->resolve("libusb_get_bus_number");
72  m_libUsb.get_device = (libUSB_get_device*)m_libraryLoader->resolve("libusb_get_device");
73  m_libUsb.get_device_address = (libUSB_get_device_address*)m_libraryLoader->resolve("libusb_get_device_address");
74  m_libUsb.get_device_descriptor = (libUSB_get_device_descriptor*)m_libraryLoader->resolve("libusb_get_device_descriptor");
75  m_libUsb.get_device_list = (libUSB_get_device_list*)m_libraryLoader->resolve("libusb_get_device_list");
76  m_libUsb.free_device_list = (libUSB_free_device_list*)m_libraryLoader->resolve("libusb_free_device_list");
77  m_libUsb.get_string_descriptor_ascii = (libUSB_get_string_descriptor_ascii*)m_libraryLoader->resolve("libusb_get_string_descriptor_ascii");
78  m_libUsb.bulk_transfer = (libUSB_bulk_transfer*)m_libraryLoader->resolve("libusb_bulk_transfer");
79  m_libUsb.set_debug = (libUSB_set_debug*)m_libraryLoader->resolve("libusb_set_debug");
80  }
81 }
82 
83 /*! \brief Initialize libusb. This function must be called before calling any other libusb function.
84 
85  If you do not provide an output location for a context pointer, a default
86  context will be created. If there was already a default context, it will
87  be reused (and nothing will be initialized/reinitialized).
88 
89  \param context Optional output location for context pointer.
90  Only valid on return code 0.
91  \returns 0 on success, or a LIBUSB_ERROR code on failure
92 */
93 int XsLibUsb::init(libusb_context **ctx)
94 {
95  if (m_libUsb.init)
96  return m_libUsb.init(ctx);
97  else
98  return LIBUSB_ERROR_NOT_SUPPORTED;
99 }
100 
101 /*! \brief Deinitialize libusb. Should be called after closing all open devices and before your application terminates.
102  \param ctx the context to deinitialize, or NULL for the default context
103 */
104 void XsLibUsb::exit(libusb_context *ctx)
105 {
106  if (m_libUsb.exit)
107  m_libUsb.exit(ctx);
108 }
109 
110 /*! \brief Open a device and obtain a device handle. A handle allows you to perform I/O on the device in question.
111 
112  Internally, this function adds a reference to the device and makes it available to you through libusb_get_device().
113  This reference is removed during libusb_close().
114 
115  This is a non-blocking function; no requests are sent over the bus.
116 
117  \param dev the device to open
118  \param handle output location for the returned device handle pointer. Only populated when the return code is 0.
119 
120  \returns 0 on success
121  \returns LIBUSB_ERROR_NO_MEM on memory allocation failure
122  \returns LIBUSB_ERROR_ACCESS if the user has insufficient permissions
123  \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
124  \returns another LIBUSB_ERROR code on other failure
125 */
126 int XsLibUsb::open(libusb_device *dev, libusb_device_handle **handle)
127 {
128  if (m_libUsb.open)
129  return m_libUsb.open(dev, handle);
130  else
131  return LIBUSB_ERROR_NOT_SUPPORTED;
132 }
133 
134 /*! \brief Close a device handle. Should be called on all open handles before your application exits.
135  Internally, this function destroys the reference that was added by libusb_open() on the given device.
136 
137  This is a non-blocking function; no requests are sent over the bus.
138  \param dev_handle the handle to close
139 */
140 void XsLibUsb::close(libusb_device_handle *dev_handle)
141 {
142  if (m_libUsb.close)
143  m_libUsb.close(dev_handle);
144 }
145 
146 /*! \brief Determine if a kernel driver is active on an interface.
147  If a kernel driver is active, you cannot claim the interface, and libusb will be unable to perform I/O.
148 
149  This functionality is not available on Windows.
150 
151  \param dev a device handle
152  \param interface_number the interface to check
153 
154  \returns 0 if no kernel driver is active
155  \returns 1 if a kernel driver is active
156  \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
157  \returns LIBUSB_ERROR_NOT_SUPPORTED on platforms where the functionality is not available
158  \returns another LIBUSB_ERROR code on other failure
159  \see libusb_detach_kernel_driver()
160 */
161 int XsLibUsb::kernel_driver_active(libusb_device_handle *dev,int interface_number)
162 {
164  return m_libUsb.kernel_driver_active(dev, interface_number);
165  else
166  return LIBUSB_ERROR_NOT_SUPPORTED;
167 }
168 
169 /** \brief Re-attach an interface's kernel driver, which was previously detached using libusb_detach_kernel_driver().
170  This call is only effective on Linux and returns LIBUSB_ERROR_NOT_SUPPORTED on all other platforms.
171 
172  This functionality is not available on Darwin or Windows.
173 
174  \param dev a device handle
175  \param interface_number the interface to attach the driver from
176 
177  \returns 0 on success
178  \returns LIBUSB_ERROR_NOT_FOUND if no kernel driver was active
179  \returns LIBUSB_ERROR_INVALID_PARAM if the interface does not exist
180  \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
181  \returns LIBUSB_ERROR_NOT_SUPPORTED on platforms where the functionality is not available
182  \returns LIBUSB_ERROR_BUSY if the driver cannot be attached because the interface is claimed by a program or driver
183  \returns another LIBUSB_ERROR code on other failure
184  \see libusb_kernel_driver_active()
185 */
186 int XsLibUsb::attach_kernel_driver(libusb_device_handle *dev,int interface_number)
187 {
189  return m_libUsb.attach_kernel_driver(dev, interface_number);
190  else
191  return LIBUSB_ERROR_NOT_SUPPORTED;
192 }
193 
194 /*! \brief Detach a kernel driver from an interface. If successful, you will then be able to claim the interface and perform I/O.
195 
196  This functionality is not available on Darwin or Windows.
197 
198  \param dev a device handle
199  \param interface_number the interface to detach the driver from
200 
201  \returns 0 on success
202  \returns LIBUSB_ERROR_NOT_FOUND if no kernel driver was active
203  \returns LIBUSB_ERROR_INVALID_PARAM if the interface does not exist
204  \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
205  \returns LIBUSB_ERROR_NOT_SUPPORTED on platforms where the functionality is not available
206  \returns another LIBUSB_ERROR code on other failure
207  \see libusb_kernel_driver_active()
208 */
209 int XsLibUsb::detach_kernel_driver(libusb_device_handle *dev,int interface_number)
210 {
212  return m_libUsb.detach_kernel_driver(dev, interface_number);
213  else
214  return LIBUSB_ERROR_NOT_SUPPORTED;
215 }
216 
217 /*! \brief Increment the reference count of a device.
218  \param dev the device to reference
219  \returns the same device
220 */
221 libusb_device * XsLibUsb::ref_device(libusb_device *dev)
222 {
223  if (m_libUsb.ref_device)
224  return m_libUsb.ref_device(dev);
225  else
226  return NULL;
227 }
228 
229 /*! \brief Decrement the reference count of a device.
230  If the decrement operation causes the reference count to reach zero, the device shall be destroyed.
231  \param dev the device to unreference
232 */
233 void XsLibUsb::unref_device(libusb_device *dev)
234 {
236  m_libUsb.unref_device(dev);
237 }
238 
239 /*! \brief Claim an interface on a given device handle.
240  You must claim the interface you wish to use before you can perform I/O on any of its endpoints.
241 
242  It is legal to attempt to claim an already-claimed interface, in which
243  case libusb just returns 0 without doing anything.
244 
245  Claiming of interfaces is a purely logical operation; it does not cause
246  any requests to be sent over the bus. Interface claiming is used to
247  instruct the underlying operating system that your application wishes
248  to take ownership of the interface.
249 
250  This is a non-blocking function.
251 
252  \param dev a device handle
253  \param interface_number the \a bInterfaceNumber of the interface you wish to claim
254  \returns 0 on success
255  \returns LIBUSB_ERROR_NOT_FOUND if the requested interface does not exist
256  \returns LIBUSB_ERROR_BUSY if another program or driver has claimed the interface
257  \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
258  \returns a LIBUSB_ERROR code on other failure
259 */
260 int XsLibUsb::claim_interface(libusb_device_handle *dev,int interface_number)
261 {
263  return m_libUsb.claim_interface(dev, interface_number);
264  else
265  return LIBUSB_ERROR_NOT_SUPPORTED;
266 }
267 
268 /*! \brief Release an interface previously claimed with libusb_claim_interface().
269  You should release all claimed interfaces before closing a device handle.
270 
271  This is a blocking function. A SET_INTERFACE control request will be sent
272  to the device, resetting interface state to the first alternate setting.
273 
274  \param dev a device handle
275  \param interface_number the \a bInterfaceNumber of the previously-claimed interface
276  \returns 0 on success
277  \returns LIBUSB_ERROR_NOT_FOUND if the interface was not claimed
278  \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
279  \returns another LIBUSB_ERROR code on other failure
280 */
281 int XsLibUsb::release_interface(libusb_device_handle *dev, int interface_number)
282 {
284  return m_libUsb.release_interface(dev, interface_number);
285  else
286  return LIBUSB_ERROR_NOT_SUPPORTED;
287 }
288 
289 /*! \brief Get the USB configuration descriptor for the currently active configuration.
290 
291  This is a non-blocking function which does not involve any requests being
292  sent to the device.
293 
294  \param dev a device
295  \param config output location for the USB configuration descriptor.
296  Only valid if 0 was returned. Must be freed with libusb_free_config_descriptor() after use.
297  \returns 0 on success
298  \returns LIBUSB_ERROR_NOT_FOUND if the device is in unconfigured state
299  \returns another LIBUSB_ERROR code on error
300  \see libusb_get_config_descriptor
301 */
302 int XsLibUsb::get_active_config_descriptor(libusb_device *dev, struct libusb_config_descriptor **config)
303 {
305  return m_libUsb.get_active_config_descriptor(dev, config);
306  else
307  return LIBUSB_ERROR_NOT_SUPPORTED;
308 }
309 
310 /*! \brief Free a configuration descriptor obtained from libusb_get_active_config_descriptor() or libusb_get_config_descriptor().
311 
312  It is safe to call this function with a NULL config parameter, in which case the function simply returns.
313 
314  \param config the configuration descriptor to free
315 */
316 void XsLibUsb::free_config_descriptor(struct libusb_config_descriptor *config)
317 {
320 }
321 
322 /*! \brief Get the number of the bus that a device is connected to.
323  \param dev a device
324  \returns the bus number
325 */
326 uint8_t XsLibUsb::get_bus_number(libusb_device *dev)
327 {
329  return m_libUsb.get_bus_number(dev);
330  else
331  return 0;
332 }
333 
334 /*! \brief Get the underlying device for a handle.
335 
336  This function does not modify the reference count of the returned device,
337  so do not feel compelled to unreference it when you are done.
338  \param dev_handle a device handle
339  \returns the underlying device
340 */
341 libusb_device * XsLibUsb::get_device(libusb_device_handle *dev_handle)
342 {
343  if (m_libUsb.get_device)
344  return m_libUsb.get_device(dev_handle);
345  else
346  return NULL;
347 }
348 
349 /*! \brief Get the address of the device on the bus it is connected to.
350  \param dev a device
351  \returns the device address
352 */
353 uint8_t XsLibUsb::get_device_address(libusb_device *dev)
354 {
356  return m_libUsb.get_device_address(dev);
357  else
358  return 0;
359 }
360 
361 /*! \brief Get the USB device descriptor for a given device.
362 
363  This is a non-blocking function; the device descriptor is cached in memory.
364 
365  \param dev the device
366  \param desc output location for the descriptor data
367  \returns 0 on success or a LIBUSB_ERROR code on failure
368 */
369 int XsLibUsb::get_device_descriptor(libusb_device *dev, struct libusb_device_descriptor *desc)
370 {
372  return m_libUsb.get_device_descriptor(dev, desc);
373  else
374  return LIBUSB_ERROR_NOT_SUPPORTED;
375 }
376 
377 /*! \brief Returns a list of USB devices currently attached to the system.
378  This is your entry point into finding a USB device to operate.
379 
380  You are expected to unreference all the devices when you are done with
381  them, and then free the list with libusb_free_device_list(). Note that
382  libusb_free_device_list() can unref all the devices for you. Be careful
383  not to unreference a device you are about to open until after you have
384  opened it.
385 
386  This return value of this function indicates the number of devices in
387  the resultant list. The list is actually one element larger, as it is
388  NULL-terminated.
389 
390  \param ctx the context to operate on, or NULL for the default context
391  \param list output location for a list of devices. Must be later freed with libusb_free_device_list().
392  \returns The number of devices in the outputted list, or any LIBUSB_ERROR code to errors encountered by the backend.
393 */
394 ssize_t XsLibUsb::get_device_list(libusb_context *ctx, libusb_device ***list)
395 {
397  return m_libUsb.get_device_list(ctx, list);
398  else
399  return LIBUSB_ERROR_NOT_SUPPORTED;
400 }
401 
402 /*! \brief Frees a list of devices previously discovered using libusb_get_device_list().
403  If the unref_devices parameter is set, the reference count of each device in the list is decremented by 1.
404  \param list the list to free
405  \param unref_devices whether to unref the devices in the list
406 */
407 void XsLibUsb::free_device_list(libusb_device **list, int unref_devices)
408 {
410  m_libUsb.free_device_list(list, unref_devices);
411 }
412 
413 /*! \brief Retrieve a string descriptor in C style ASCII.
414 
415  Wrapper around libusb_get_string_descriptor(). Uses the first language supported by the device.
416 
417  \param dev a device handle
418  \param desc_index the index of the descriptor to retrieve
419  \param data output buffer for ASCII string descriptor
420  \param length size of data buffer
421  \returns number of bytes returned in data, or LIBUSB_ERROR code on failure
422 */
423 int XsLibUsb::get_string_descriptor_ascii(libusb_device_handle *dev, uint8_t desc_index, unsigned char *data, int length)
424 {
426  return m_libUsb.get_string_descriptor_ascii(dev, desc_index, data, length);
427  else
428  return LIBUSB_ERROR_NOT_SUPPORTED;
429 }
430 
431 /*! \brief Perform a USB bulk transfer. The direction of the transfer is inferred from the direction bits of the endpoint address.
432 
433  For bulk reads, the \a length field indicates the maximum length of
434  data you are expecting to receive. If less data arrives than expected,
435  this function will return that data, so be sure to check the
436  \a transferred output parameter.
437 
438  You should also check the \a transferred parameter for bulk writes.
439  Not all of the data may have been written.
440 
441  Also check \a transferred when dealing with a timeout error code.
442  libusb may have to split your transfer into a number of chunks to satisfy
443  underlying O/S requirements, meaning that the timeout may expire after
444  the first few chunks have completed. libusb is careful not to lose any data
445  that may have been transferred; do not assume that timeout conditions
446  indicate a complete lack of I/O.
447 
448  \param dev_handle a handle for the device to communicate with
449  \param endpoint the address of a valid endpoint to communicate with
450  \param data a suitably-sized data buffer for either input or output (depending on endpoint)
451  \param length for bulk writes, the number of bytes from data to be sent. for bulk reads, the maximum number of bytes to receive into the data buffer.
452  \param transferred output location for the number of bytes actually transferred.
453  \param timeout timeout (in millseconds) that this function should wait before giving up due to no response being received. For an unlimited timeout, use value 0.
454 
455  \returns 0 on success (and populates \a transferred)
456  \returns LIBUSB_ERROR_TIMEOUT if the transfer timed out (and populates \a transferred)
457  \returns LIBUSB_ERROR_PIPE if the endpoint halted
458  \returns LIBUSB_ERROR_OVERFLOW if the device offered more data
459  \returns LIBUSB_ERROR_NO_DEVICE if the device has been disconnected
460  \returns another LIBUSB_ERROR code on other failures
461 */
462 int XsLibUsb::bulk_transfer(libusb_device_handle *dev_handle, unsigned char endpoint, unsigned char *data, int length, int *actual_length, unsigned int timeout)
463 {
465  return m_libUsb.bulk_transfer(dev_handle, endpoint, data, length, actual_length, timeout);
466  else
467  return LIBUSB_ERROR_NOT_SUPPORTED;
468 }
469 
470 /*! \brief Set message verbosity.
471  - Level 0: no messages ever printed by the library (default)
472  - Level 1: error messages are printed to stderr
473  - Level 2: warning and error messages are printed to stderr
474  - Level 3: informational messages are printed to stdout, warning and error messages are printed to stderr
475 
476  The default level is 0, which means no messages are ever printed. If you
477  choose to increase the message verbosity level, ensure that your
478  application does not close the stdout/stderr file descriptors.
479 
480  You are advised to set level 3. libusb is conservative with its message
481  logging and most of the time, will only log messages that explain error
482  conditions and other oddities. This will help you debug your software.
483 
484  If the LIBUSB_DEBUG environment variable was set when libusb was
485  initialized, this function does nothing: the message verbosity is fixed
486  to the value in the environment variable.
487 
488  If libusb was compiled without any message logging, this function does
489  nothing: you'll never get any messages.
490 
491  If libusb was compiled with verbose debug message logging, this function
492  does nothing: you'll always get messages from all levels.
493 
494  \param ctx the context to operate on, or NULL for the default context
495  \param level debug level to set
496 */
497 void XsLibUsb::set_debug(libusb_context *ctx, int level)
498 {
499  if (m_libUsb.set_debug)
500  m_libUsb.set_debug(ctx, level);
501 }
502 
503 #endif // patch for MRPT
XsLibraryLoader * m_libraryLoader
Definition: xslibusb.h:96
libUSB_attach_kernel_driver attach_kernel_driver
Definition: xslibusb.h:50
int libUSB_get_device_descriptor(libusb_device *dev, struct libusb_device_descriptor *desc)
Definition: xslibusb.h:32
libUSB_set_debug * set_debug
Definition: xslibusb.h:92
int libUSB_get_active_config_descriptor(libusb_device *dev, struct libusb_config_descriptor **config)
Definition: xslibusb.h:27
libUSB_close close
Definition: xslibusb.h:48
libUSB_unref_device unref_device
Definition: xslibusb.h:53
libUSB_get_bus_number * get_bus_number
Definition: xslibusb.h:84
libUSB_open open
Definition: xslibusb.h:47
XsLibUsb(void)
libUSB_unref_device * unref_device
Definition: xslibusb.h:79
int libUSB_claim_interface(libusb_device_handle *dev, int interface_number)
Definition: xslibusb.h:25
struct XsLibraryLoader XsLibraryLoader
libUSB_init init
Definition: xslibusb.h:45
libUSB_free_config_descriptor free_config_descriptor
Definition: xslibusb.h:57
libUSB_ref_device * ref_device
Definition: xslibusb.h:78
libUSB_init * init
Definition: xslibusb.h:71
void libUSB_set_debug(libusb_context *ctx, int level)
Definition: xslibusb.h:37
libUSB_get_active_config_descriptor * get_active_config_descriptor
Definition: xslibusb.h:82
void libUSB_close(libusb_device_handle *dev_handle)
Definition: xslibusb.h:19
libUSB_get_string_descriptor_ascii get_string_descriptor_ascii
Definition: xslibusb.h:64
unsigned char uint8_t
Definition: rptypes.h:43
libUSB_free_device_list free_device_list
Definition: xslibusb.h:63
libUSB_bulk_transfer * bulk_transfer
Definition: xslibusb.h:91
void libUSB_free_device_list(libusb_device **list, int unref_devices)
Definition: xslibusb.h:34
LIBUSB_API m_libUsb
Definition: xslibusb.h:95
libUSB_get_string_descriptor_ascii * get_string_descriptor_ascii
Definition: xslibusb.h:90
libUSB_claim_interface * claim_interface
Definition: xslibusb.h:80
libUSB_open * open
Definition: xslibusb.h:73
libUSB_get_device_list get_device_list
Definition: xslibusb.h:62
libUSB_close * close
Definition: xslibusb.h:74
ssize_t libUSB_get_device_list(libusb_context *ctx, libusb_device ***list)
Definition: xslibusb.h:33
libUSB_get_device_descriptor * get_device_descriptor
Definition: xslibusb.h:87
libUSB_claim_interface claim_interface
Definition: xslibusb.h:54
int libUSB_get_string_descriptor_ascii(libusb_device_handle *dev, uint8_t desc_index, unsigned char *data, int length)
Definition: xslibusb.h:35
void initLibrary()
libUSB_get_device_descriptor get_device_descriptor
Definition: xslibusb.h:61
libUSB_kernel_driver_active * kernel_driver_active
Definition: xslibusb.h:75
int libUSB_detach_kernel_driver(libusb_device_handle *dev, int interface_number)
Definition: xslibusb.h:22
libUSB_detach_kernel_driver * detach_kernel_driver
Definition: xslibusb.h:77
void libUSB_exit(libusb_context *ctx)
Definition: xslibusb.h:17
libUSB_set_debug set_debug
Definition: xslibusb.h:66
libUSB_get_device get_device
Definition: xslibusb.h:59
libUSB_attach_kernel_driver * attach_kernel_driver
Definition: xslibusb.h:76
libUSB_get_device_address * get_device_address
Definition: xslibusb.h:86
libUSB_kernel_driver_active kernel_driver_active
Definition: xslibusb.h:49
void libUSB_unref_device(libusb_device *dev)
Definition: xslibusb.h:24
libUSB_exit exit
Definition: xslibusb.h:46
uint8_t libUSB_get_device_address(libusb_device *dev)
Definition: xslibusb.h:31
void libUSB_free_config_descriptor(struct libusb_config_descriptor *config)
Definition: xslibusb.h:28
~XsLibUsb(void)
libUSB_detach_kernel_driver detach_kernel_driver
Definition: xslibusb.h:51
libUSB_get_device_list * get_device_list
Definition: xslibusb.h:88
libUSB_free_device_list * free_device_list
Definition: xslibusb.h:89
libUSB_exit * exit
Definition: xslibusb.h:72
int libUSB_kernel_driver_active(libusb_device_handle *dev, int interface_number)
Definition: xslibusb.h:20
GLuint GLsizei GLsizei * length
Definition: glext.h:3900
GLint level
Definition: glext.h:3545
libUSB_get_device * get_device
Definition: xslibusb.h:85
int libUSB_attach_kernel_driver(libusb_device_handle *dev, int interface_number)
Definition: xslibusb.h:21
libusb_device * libUSB_get_device(libusb_device_handle *dev_handle)
Definition: xslibusb.h:30
libUSB_get_device_address get_device_address
Definition: xslibusb.h:60
int libUSB_open(libusb_device *dev, libusb_device_handle **handle)
Definition: xslibusb.h:18
int libUSB_bulk_transfer(libusb_device_handle *dev_handle, unsigned char endpoint, unsigned char *data, int length, int *actual_length, unsigned int timeout)
Definition: xslibusb.h:36
libUSB_release_interface release_interface
Definition: xslibusb.h:55
libUSB_get_bus_number get_bus_number
Definition: xslibusb.h:58
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: glext.h:3520
libusb_device * libUSB_ref_device(libusb_device *dev)
Definition: xslibusb.h:23
libUSB_get_active_config_descriptor get_active_config_descriptor
Definition: xslibusb.h:56
libUSB_release_interface * release_interface
Definition: xslibusb.h:81
int libUSB_init(libusb_context **ctx)
Definition: xslibusb.h:16
libUSB_free_config_descriptor * free_config_descriptor
Definition: xslibusb.h:83
uint8_t libUSB_get_bus_number(libusb_device *dev)
Definition: xslibusb.h:29
int libUSB_release_interface(libusb_device_handle *dev, int interface_number)
Definition: xslibusb.h:26
libUSB_bulk_transfer bulk_transfer
Definition: xslibusb.h:65
libUSB_ref_device ref_device
Definition: xslibusb.h:52



Page generated by Doxygen 1.8.14 for MRPT 1.5.6 Git: 4c65e8431 Tue Apr 24 08:18:17 2018 +0200 at lun oct 28 01:35:26 CET 2019