Add Mac-specific API to get device location ID #378
No reviewers
Labels
No labels
3rdparty
Android
API
Author does not respond
bsd
bug
build system/CI
ci-virtual-device
CMake
Contributions Welcome
Core
dependencies
device-specific
documentation
don't_merge
duplicate
enhancement
Example
Haiku
hidraw
hotplug
info required
invalid
libusb
macOS
Misc
Not an issue
question
Release
Test
Test GUI
Windows
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libusb/hidapi!378
Loading…
Reference in a new issue
No description provided.
Delete branch "darwin-location-id"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
As discussed in https://github.com/libusb/hidapi/discussions/252#discussioncomment-2089707.
Not sure if there’s a simpler way to do this, but as I need the location ID during enumeration it seems I first need to create a
IOHIDDeviceReffrom the path in order to get the location ID.Thanks!
Just a few comments
revert
autotools are deprecated now
we don't want to develope/support new feature for it - that will be a good motivation to migrate to CMake for projects that are still using it autotools and are actively developed
@ -0,0 +1,50 @@/*******************************************************make it a:
int HID_API_EXPORT_CALL hid_darwin_get_location_id(hid_device *dev, uint32_t *location_id);returns
-1on failure - like all other functionand if someone wants to use it with
path: usehid_open_path->hid_darwin_get_location_id->hid_closeLooks like the AppVeyor build failed spuriously:
That is not an issue for us
I'm pretty sure that the
location_idis an unsigned int propertylets add a
get_uint_propertyfunction, to be strictly correctYes I also think it’s an unsigned property, and the return parameter is declared as such (
uint32_t *location_id).Since it’s the same bit size I don’t see any reason to add a separate getter. In fact
get_int_property()is already used inget_vendor_id()to return an unsigned property the same way. But I added a cast just to be explicit.