hidapi_libusb.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*******************************************************
  2. HIDAPI - Multi-Platform library for
  3. communication with HID devices.
  4. libusb/hidapi Team
  5. Copyright 2021, All Rights Reserved.
  6. At the discretion of the user of this library,
  7. this software may be licensed under the terms of the
  8. GNU General Public License v3, a BSD-Style license, or the
  9. original HIDAPI license as outlined in the LICENSE.txt,
  10. LICENSE-gpl3.txt, LICENSE-bsd.txt, and LICENSE-orig.txt
  11. files located at the root of the source distribution.
  12. These files may also be found in the public source
  13. code repository located at:
  14. https://github.com/libusb/hidapi .
  15. ********************************************************/
  16. /** @file
  17. * @defgroup API hidapi API
  18. * Since version 0.11.0, @ref HID_API_VERSION >= HID_API_MAKE_VERSION(0, 11, 0).
  19. */
  20. #ifndef HIDAPI_LIBUSB_H__
  21. #define HIDAPI_LIBUSB_H__
  22. #include <stdint.h>
  23. #include "../hidapi/hidapi.h"
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /** @brief Open a HID device using libusb_wrap_sys_device.
  28. See https://libusb.sourceforge.io/api-1.0/group__libusb__dev.html#ga98f783e115ceff4eaf88a60e6439563c,
  29. for details on libusb_wrap_sys_device.
  30. @ingroup API
  31. @param sys_dev Platform-specific file descriptor that can be recognised by libusb.
  32. @param interface_num USB interface number of the device to be used as HID interface.
  33. Pass -1 to select first HID interface of the device.
  34. @returns
  35. This function returns a pointer to a #hid_device object on
  36. success or NULL on failure.
  37. */
  38. HID_API_EXPORT hid_device * HID_API_CALL hid_libusb_wrap_sys_device(intptr_t sys_dev, int interface_num);
  39. #ifdef __cplusplus
  40. }
  41. #endif
  42. #endif