forked from karalabe/hid
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Feature/libusb c3deb6dd
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
troian
force-pushed
the
master
branch
5 times, most recently
from
April 6, 2021 11:44
3aa1dae
to
0c60ae8
Compare
Signed-off-by: Artur Troian <troian.ap@gmail.com>
Signed-off-by: Artur Troian <troian.ap@gmail.com>
feat: update hid package with latest libusb/libhid changes
Signed-off-by: Artur Troian <troian.ap@gmail.com>
Signed-off-by: Artur Troian <troian.ap@gmail.com>
SgtPooki
reviewed
Feb 16, 2022
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" | ||
*/ |
There was a problem hiding this comment.
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>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.