You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
macOS: Bluetooth HID devices have the same path #127
hidapi returns the same path IOService:/IOResources/IOBluetoothHCIController/AppleBroadcomBluetoothHostController/IOBluetoothDevice/IOBluetoothL2CAPChannel/IOBluetoothHIDDriver
For every Bluetooth HID device connected. Tested with:
Nintendo Switch JoyCon (L)
Nintendo Switch JoyCon (R)
Nintendo Switch ProController
Microsoft Bluetooth Mouse 5000
(all devices have unique product IDs and serial numbers)
As a result, hid_open(vendor_id, product_id, serial_number) does not open the correct device if there is more than one bluetooth device paired since it eventually calls hid_open_path, and all the paths are identical. It looks like it will always try to open the device that was paired first.
I can open the correct device if I store a copy of the IOHIDDeviceRef in hid_device_info and create an IOHIDDevice with the reference rather than looking up the IORegistry entry from the path.
This is on a MacBookPro11,1 running macOS 10.14.6.
It seems like patch by @flirc preserves backward compatibility and adds stability/reliability to hid_open_path on macOS, but before submitting it to master, I'd love to head some alternative opinions
Activity
Youw commentedon Dec 1, 2019
It looks like the same issue as signal11/hidapi#379
@erikmwerner try if you can apply flirc/hidapi@8d251c3 locally and check if it fixes your issue
It seems like patch by @flirc preserves backward compatibility and adds stability/reliability to
hid_open_pathon macOS, but before submitting it to master, I'd love to head some alternative opinionserikmwerner commentedon Dec 4, 2019
I can confirm that flirc/hidapi@8d251c3 fixes the issue for me. Thanks for pointing me in the right direction.
As an alternative, the solution that I described above also fixed the issue. I uploaded it at erikmwerner@1d65b88
Youw commentedon Dec 4, 2019
Thanks.
Yes, it seems like erikmwerner/hidapi@1d65b88 would fix your issue, but having same API for all 4 backends is more a bit more preferable to me.
@jdk do you think you could prepare a PR to master with flirc/hidapi@8d251c3 ?
fix 複数のjoyconを扱えるように
mcuee commentedon Jun 19, 2021
So #127 and #236 have the same fix in flirc/hidapi@8d251c3 but that fix needs some modification to be accepted, right?
Youw commentedon Jun 19, 2021
Right. flirc/hidapi@8d251c3 has a leak in the implementation, that's for sure, but the idea is fine.
macOS: use IORegistryEntryGetRegistryEntryID to resolve paths
macOS: use IORegistryEntryGetRegistryEntryID to resolve paths
macOS: use IORegistryEntryGetRegistryEntryID to resolve paths (#322)