unbit / foohid

OSX IOKit driver for implementing virtual HID devices (joypads, keyboards, mices, ...) from userspace
MIT License
264 stars 35 forks source link

Allow clients to subscribe to setReport calls on devices #9

Closed btoews closed 7 years ago

btoews commented 7 years ago

This PR implements the setReport() method on the foohid device. This gets called when a report needs to be sent back to the device by whatever client is using it. To get these reports back into userland, this PR implements an external userclient method for subscribing to setReport calls for a given device. The subscribe method registers a callback function that gets called from the userclient when a device receives a setReport() call. This approach allows the userland HID implementation to receive setReport() calls without having to constantly poll the userclient.

I'm copying this approach from the SoftU2F driver I wrote. I'm hoping to include this change in foohid because Apple hasn't responded to my request for a kernel extension signing certificate.

I added a simple U2F example to this repository to demonstrate subscribing to setReport() calls.

Fixes #7

btoews commented 7 years ago

I submitted a request to Apple for a kext signing certificate for my SoftU2F library, but they rejected it after 4 weeks. My library contains a driver that does essentially the same thing as FooHID, but includes the setReport functionality. I could easily replace my driver with FooHID if it could handle setReport calls. I'd really like to ship my SoftU2FTool app, but can't really do so without a signed kext.

It would really help me out if this PR could get merged and a new release of the FooHID driver could be made. I understand though if you're busy. Sorry to pester you :smile:.

unbit commented 7 years ago

Sorry for the late, the patch is absolutely good (read: not invasive). But i could need a bit of time to issue a new release. (i fear i need to renew my apple development license before ;)

btoews commented 7 years ago

Thanks for merging this. If you would be renewing your developer program membership just to make a new release of this, I'd be happy to help with the cost. Let me know if that would be helpful.