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



Hi,

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.

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.