Am Dienstag, 21.01.03 um 03:47 Uhr schrieb Matthew Lehrian:
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.
I had a similar problem and solved it by referencing the devices with
their location IDs.
This location IDs are supposed to be consistent even between reboots
and every connected device wil have its own one.
When you got the io_service_t, you can get the IOUSBDeviceInterface
with a 'CreateDeviceInterface()' call, then call 'GetLocationID()' in
the IOUSBDeviceInterface.
You can store the location ID and give it to the
kIOMessageServiceIsTerminated notification please have a look at
Apple's new sample code in the "Another USB Notification Example";
on your harddisk:
<file:///Developer/Examples/IOKit/usb/Another USB Notification
Example/USBNotificationTool.pbproj>
or search in Apple's download area.
hth,
Dirk Stegemann
_______________________________________________
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.