Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fetch the IOUSBDeviceInterface after releasing. How ??



Hi,
This mail is in continuation of my last query asked (see details below). How can I fetch the USB device again if I release it ??
 
I store the IOUSBDeviceInterface and IOUSBInterfaceInterface in a structure and
1. Open the device
2. Open the interface
3. Do Write and Read Pipe operations
4. Close the interface
5. Close the device
 
Now if I Releaes the interface after Step 5. using Release function, then how can I fetch the device agian next time before communicating with the device ??
_____________
Hi Stuart,
 
Below are my comments to the asked queries/solutions:
 
>>I assume that if you quit the first application, then run the second, you
>>can access the device from the second application? If not, you have some
>>weird bug.
Comments:
Yes, If I quit the first application and run the second, it works perfect. I can then easily access the device from the second application.

>>Perhaps your first application wasn't successful closing the interface and
>>device? Did it return any errors when closing?
Comments:
It returns success  while closing the interface. I am using "USBInterfaceClose" to close the interface.

>>I'm not sure if you copy/pasted the code below, but it doesn't look right.
Comments:
Yes, I mistakely copied pasted wrong in this query. I am using "USBInterfaceOpen" to open the interface.
 
>>What actual error results do you get from your open & close calls?
Comments:
When run with multiple apps, (running app1, then app2 again calling some function from app1) returns:
OpenDevice return success but
Opening the interface returns kIOReturnNoDevice (0x2c0) // no such device
 
and when i call the app2 it returns
Open Device returns kIOReturnExclusiveAccess (0x2c5) // exclusinve access and device already open.
The error meanins are written in IOReturn.h I took the meanings from there.
 
>>Have you tried Releasing the IOUSBDeviceInterface once you're done
>>communicating with the device? You'd need to fetch it again if you need to
>>communicate again, but it doesn't take long.
Comments:
No, I have not released the IOUSBDeviceInterface after communicating with the device. I have only released the same when the device is removed. Else I have not released the device interface. It may be the reason behind such issue.
 
Please tell :
1. When do I need to release the device Interface ? Each time I communicate with the key i.e after closing the device and interface, Do I NEED TO release the device interface ???
 
2. Do I need to release the IOUSBInterfaceInterface also ??

 
>>Why are you doing this at all, if your device is "USB BULK device" - do you
>>mean Mass Storage Bulk Only? If so, you don't need a driver, Mac OS X has
>>one.
Comments:
Its our own , vendor specific bulk device, and not a mass storage bulk.
 
All suggestions/comment are welcome.
 
Thanks and Regards,
rohitdhamija
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/usb/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.