On Dec 23, 2007, at 5:52 PM, EricLee wrote:
Dear all,
I am new to Mac and IOKit. My sytem is Mac OSX 10.4, Xcode is 2.5
version.
I try to revise a sample code which exists in /Developer/Examples/
IOkit/usb to apply in my Mass storage device.
This sample code is "USBNotification Example" that access a usb device.
I have been success to execute USBDeviceOpen,
IOCreatePlugInInterfaceForService and QueryInterface functions.
But when I want to execute USBInterfaceOpen function, it is failed and
return kIOReturnNotOpen error code.
I'm confused -- are you getting kIOReturnNotOpen or
kIOReturnExclusiveAccess?
kIOReturnExclusiveAccess would mean that another process is using the
device -- i.e. it could be the kernel has gone ahead and matched a file
system driver to the device, just a guess. There are workarounds for
this -- search the archive for "codeless kext".
Because the USBDeviceOpen function can be success to be executed, I
think this is not Classic problem.
The interface seems to be opened by other application. Where can I to
check which application open this Interface?
If the interface is opened by other driver, how can I to access this
device?
Thanks very much~~
Best Regards.
PS. Another no-related quest:
I try to execute USBInterfaceOpenSeize function, but build occurs
error:'struct IOUSBInterfaceStruct' has no member function
USBInterfaceOpenSeize is available with IOUSBInterfaceInterface183 and
above, and IOUSBInterfaceInterface183 are available on Mac OS X version
10.1 and later.
So in my system, I should have the IOUSBInterfaceInterface183
definition.
How do I to revise this build error??
Just declare all your references as IOUSBInterfaceInterface183:
IOUSBInterfaceInterface** myInterface;
becomes:
IOUSBInterfaceInterface183** myInterface;
etc.
Hope that helps,
Joe K.