Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update hid package with latest libusb/libhid changes #3

Closed
wants to merge 54 commits into from

Conversation

troian
Copy link

@troian troian commented Apr 4, 2021

No description provided.

neheb and others added 30 commits May 7, 2019 10:25
Fixes:

#warning redirecting incorrect #include <sys/poll.h> to <poll.h>

Under musl.
Add ability to perform a read with a specified timeout
Some USB devices require sending a feature report before they will
answer to read requests. Implement wrapper functions for the hidapi
hid_send_feature_report and hid_get_feature_report functions to support
doing so.
- libusb (https://github.com/libusb/libusb):
  da87201f7a5580db16565b1ecc7eefe0fcb5bb59
- hidapi (https://github.com/libusb/hidapi):
  24a822c80f95ae1b46a7a3c16008858dc4d8aec8
this is enabled when building with '-tags hidraw'
…IX for linux

libusb added another file, PLATFORM_POSIX need to be defined
bearsh and others added 8 commits November 26, 2020 13:01
This enables a workaround for `go mod vendor` which won't vendor
C files if there's no Go file in the same directory.

See this issue for reference: golang/go#26366
The original Read() method was a wrapper to C.hid_read.
C.hid_read checks for the device blocking field
to pass a timeout value to C.hid_read_timeout accordingly:
if blocking is enabled, -1, else 0.

The changed introduced in karalabe#22
and merged in this fork breaks that and incorrectly assumes that
a 0 timeout means a blocking read. This commit allows to maintain
the original use of Read() while also allowing a package user to
make use of ReadTimeout(b, t)
ReadTimeout() was previously missing from hid_disable.go
Re-establish original behaviour of Read() method
Signed-off-by: Artur Troian <troian.ap@gmail.com>
troian and others added 2 commits April 12, 2021 18:08
Signed-off-by: Artur Troian <troian.ap@gmail.com>
feat: update hid package with latest libusb/libhid changes
@jleni jleni added the P3-Low Low Priority label Jul 27, 2021
Signed-off-by: Artur Troian <troian.ap@gmail.com>
Signed-off-by: Artur Troian <troian.ap@gmail.com>
Comment on lines -676 to -680
/* hid_open_path()
*
* path must be a valid path to an IOHIDDevice in the IOService plane
* Example: "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/EHC1@1D,7/AppleUSBEHCI/PLAYSTATION(R)3 Controller@fd120000/IOUSBInterface@0/IOUSBHIDDriver"
*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this comment for the function that was moved down to line 805 be removed?

SgtPooki added a commit to SgtPooki/hid that referenced this pull request Feb 16, 2022
Replace kIOMasterPortDefault with kIOMainPortDefault.

Pulled in an update from https://github.com/Zondax/hid/blob/6f30845d880fbf88a7b5ee8f446ac5e8c10c760b/hidapi/mac/hid.c which belongs to Zondax#3 instead of trying to write something myself.

Caveat: I have not verified a successful build.

Fixes Zondax#4
Signed-off-by: Artur Troian <troian.ap@gmail.com>
Signed-off-by: Artur Troian <troian.ap@gmail.com>
Signed-off-by: Artur Troian <troian.ap@gmail.com>
Signed-off-by: Artur Troian <troian.ap@gmail.com>
Signed-off-by: Artur Troian <troian.ap@gmail.com>
@troian troian closed this Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3-Low Low Priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.