Mailing Lists: Apple Mailing Lists

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

Re: How to match devices



On 1/20/03 7:47 PM, Matthew Lehrian wrote:

> I'm trying to use the asynchronous connection handling for my USB
> device.  I have the callback functions working and detect when the
> device is added and removed.
> 
> When a device is connected, I stash a reference away (io_service_t).
> When I get a device disconnected event, I can't figure out how to tell
> which device has been disconnected.  Please help!

Take a look a the following sample code:

Another sample that demonstrates how to use IOKitLib and IOUSBLib to set up
asynchronous  callbacks when a USB device is attached to or removed from the
system is located at:

http://developer.apple.com/samplecode/Sample_Code/Devices_and_Hardware/USB/U
SBPrivateDataSample.htm

It also shows how to associate arbitrary data with each device instance
(which can be used to distinguish between identical devices).  BTW, don't
use the io_service_t.  Use the location ID.

-- 
Fernando Urbina                            mailto:email@hidden
USB Technology Team                           work: 719.534.9387
Apple Computer, Inc.                           fax: 719.532.0981
_______________________________________________
usb mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/usb
Do not post admin requests to the list. They will be ignored.

References: 
 >How to match devices (From: Matthew Lehrian <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.