-
Notifications
You must be signed in to change notification settings - Fork 278
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/expand getdeviceinfo #499
Conversation
Performance is identical, but buffers are simpler and often preferred
# Conflicts: # package.json # src/HID.cc
This reverts commit 0d96011.
I ended up getting compile warnings deep in the new code, so I reverted this PR. Apologies, I shouldn't have merged it without better testing. I'm looking into why The warnings I was seeing on macos and node v16.20.0:
|
OK, Ill take a look into that now. If you can hold off on doing a release until this is fixed and ideally #490 too that would be great. I think #490 could do with some additional changes, I shall open a new version of it for those |
Thanks. And apologies for being away from this for so long. The #490 one is tricky because of multi-arch builds. I'll leave this one for now and try testing it. |
Also, another issue with this PR (that's brought up elsewhere) is the need to update to |
Closes #132
This expands on #474 with some new functionality. I thought it better to do as a separate PR to avoid making #474 even larger.
Only the last couple of commits are relevant here, once #474 is merged the changes involved here will become a lot clearer.
This update hidapi to 0.13.1, and uses the new
hid_get_device_info
method to add more properties to thegetDeviceInfo
methods.getDeviceInfo
will now return the same content as is provided by a call toHID.devices()
.My usecase for this is that in https://github.com/Julusian/node-elgato-stream-deck I need to know what model of streamdeck a given path corresponds to. Until now I have achieved this by making a call to
HID.devices()
, and finding the entry with a matching path to find the productId and vendorId. This is unsurprisingly not at all efficient as it requires enumerating devices every time a new device is opened.Instead this will let me open the device, and retrieve the ids directly from it.
@todbot I vaguely remember reading something about concerns or things that need testing with updating hidapi. Do you know of anything that is particularly at risk of being an issue? On linux (hidraw) it was a drop in replacement that appears to work fine without additional changes.
Until this is merged it is possible to test with https://www.npmjs.com/package/@julusian/hid. You can either import it explicitly, or with
"node-hid": "npm:@julusian/hid@^3.0.0-0"
, to alias it to thenode-hid
name. This includes the changes from #474, #490 and #499.