Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Tried to use IOUSBDeviceInterface, but I think that is too lo…
…w level and won't work for Bluetooth devices" So I looked into this more: - When you connect a device via BT, there is no related object of type IOUSBDevice in the registry (I think so at least) (If this is true then then razer-macos driver should not work with Bluetooth mice, since it uses the bluetooth specific kernel interface IOUSBDeviceInterface) - IOHIDDevice internally uses plugin interfaces to communicate with the kernel space device driver. You can also use these interfaces manually. See IOHIDDeviceCreate in IOHIDDevice.c for examples. - Here are the interfaces for HIDDevices that I found: IOHIDDeviceInterface IOHIDDeviceInterface121 IOHIDDeviceInterface122 IOHIDDeviceDeviceInterface IOHIDDeviceTimeStampedDeviceInterface IOHIDDeviceQueueInterface IOHIDDeviceTransactionInterface IOHIDQueueInterface - The IOHIDQueueInterface seems like it might be able to do what we want it to. (We want to read with a timeout and interrupt reading asynchronously) It has a getNextEvent() function with a timeout and there are functions to stop the queue (I think in IOHIDDeviceInterface?). But the problem is that the queue doesn't seem to deliver raw reports, but instead only parsed input elements or something. Also the docs say that the `timeoutMS` parameter is "UNSUPPORTED" and also the docs don't say what stopping the queue while waiting for an event actually does exactly. None of the other interfaces do what we need them to either. Well IOHIDDeviceInterface122 (and possibly others) can read reports with a timeout, but there's no way to interrupt reading anywhere. Based on this I think there is no elegant way to interrupt reading. I think you'd need create multiple threads when using them, to be able to interrupt reading. None of these interfaces provide any sigificant benefits over our current approach. The IOUSBDeviceInterface allows for elegant read interrupts, but I think it won't work for Bluetooth mice. So our current solution is the best we have. This reverts commit 4318472.
- Loading branch information