macos: improve USB interface number retrival #534
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!534
Loading…
Reference in a new issue
No description provided.
Delete branch "macos-usb-interface"
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?
Fixes: #531
This is not working yet. But I think the approach is good and this is a good start.
click for the run log
Right. The idea is to detect and correctly report
-1, i.e. "something went wrong and the interface number is unknown".The solution appeared to be a bit different (and simpler) than I though.
We don't need to enumerate the actual USB devices (and its plugin interface) - reading the IO Registry is enough.
This is working fine now under fully up to date macOS Ventura 13.3.1. Tested on Mac Mini M1 (2020).
Full run log with some USB HID devices (Logitech USB receiver and a no-brand remote control) and some Bluetooth HID devices (Microsoft Bluetooth Mouse, Logitech K480 Keyboard).
BTW, it is a bit strange that there is no Manufacturer string printed for Logitech K480 bluetooth keyboard.
click for the full run log
I guess this is normal.
This PR is good to me now.
@dingsijie-nreal and @pengxianheng-nreal
Please give this PR a try to confirm it works for you. Thanks.
@dingsijie-nreal and @pengxianheng-nreal
Ping. Please help to try the PR. Thanks.
just tested and this PR works fine now on our device. Well done and thanks a lot!
Sorry for the late response.
BTW, May 1 is international Labour day and we have a nation wide 5-day holiday this year.
So, I was on my day off :)
@dingsijie-nreal
Thanks for the confirmation.
@Youw
Now this PR should be good to go.