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



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST