Skip to content

Introduce HID_API_MAX_REPORT_DESCRIPTOR_SIZE (libusb#452)#1

Merged
fengjixuchui merged 14 commits intofengjixuchui:masterfrom
libusb:master
Sep 15, 2022
Merged

Introduce HID_API_MAX_REPORT_DESCRIPTOR_SIZE (libusb#452)#1
fengjixuchui merged 14 commits intofengjixuchui:masterfrom
libusb:master

Conversation

@fengjixuchui
Copy link
Owner

No description provided.

Julusian and others added 14 commits August 13, 2022 19:01
- new API function: `struct hid_device_info * hid_get_device_info(hid_device *dev);` to get `hid_device_info` after the device already opened;
- reused existing implementation on Windows and macOS from enumeration routines to have the implementation;
- refactored libusb implementation to have a shared routine for `hid_enumerate` and `hid_get_device_info`;
- refactored hidraw implementation to have a shared routine for `hid_enumerate` and `hid_get_device_info`;

Resolves: #431
Closes: #164
Closes: #163
Potential execution path may happen if kernel driver successfully detached,
but libusb failed to claim the requested interface.

Otherwise the device remains with detached kernel driver.
Avoid infinite reading from the device if the device doesn't send any interrupt reports.
Otherwise hidtest has to be stopped by Ctrl+C interruption, which doesn't give a chance to close the device properly,
as a result this has negative side-effects when using LIBUSB backed.
- pass the actual HID Report descriptor size (from HID descriptor);
- interface_num has to be wIndex, and not as part of wValue for LIBUSB_DT_REPORT request;
- not an independent build system, but a wrapper over CMake;
- may be used as a standalone Meson build or as a subproject;
NOTES, as described in #31:
- it is still hard to use HIDAPI on OpenBSD since it is hard to use LIBUSB with HID devices;
- there is a name colision with `hid_init` from `usbhid` OpenBSD library;
Check CMake build on:
- Alpine
- Archlinux
- Fedora/mingw64
- FreeBSD
- first step is to use HID_API_MAX_REPORT_DESCRIPTOR_SIZE internally;
- port a few improvements from get-descriptor branch early;

Resolves: #384
@fengjixuchui fengjixuchui merged commit 4301149 into fengjixuchui:master Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

Comments