3

Ok i am working on a uController project (pointer device), i am trying to write a user space driver IOkit.framework.

using the idProduct and idVendor i can get the IOUSBInterfaceInterface300 obj

the problem is when i try

kr = (*intf)->USBInterfaceOpen(intf);

it fails with kIOReturnExclusiveAccess, most likely because the HID manager has opened the device already with exclusive access.

Here it says that a codeless kext can prevent the HID manager from taking over the device

Reading and writing to USB (HID) interrupt endpoints on Mac

I created a kext with the idVendor and idProduct and used kextload to load it. i get back "loaded successfully" from kextload

but somehow i still cant open the interface? am i doing something wrong?

I created the kext by creating a file name Info.plist (the content identical to that post with the idProduct and idVendor adjusted) and put it in a folder named MyUSBDeviceTest.kext

then change the owner to root:wheel then copy the kext to /System/Library/Extensions then

sudo kextload -vt /System/Library/Extensions/MyUSBDeviceTest.kext

i've tried restarting and reconnecting the device but i just cant take the interface from the HID system

Community
  • 1
  • 1
stewie
  • 37
  • 2
  • Loading a codeless kext doesn't really make any sense. You need to place it in SLE (with appropriate permissions) and connect the device (or reboot). If that doesn't work, the matching rules for your IOKitPersonality aren't right. Post those and the ioreg properties of the HID object that actually succeeds in matching if you need some help. – pmdj Jan 19 '13 at 17:42
  • never mind i found another way to do it with HID Manager, but thanks – stewie Jan 20 '13 at 08:02
  • 6
    Consider answering your own question with the HID manager solution, so the next person with the problem can use it too! – pmdj Jan 20 '13 at 17:49

0 Answers0