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: IONotifications



Hello Ian,

On Apr 13, 2005, at 11:48 AM, Ian Keck wrote:

I'm using IOServiceAddMatchingNotification for both kIOPublishNotification and kIOTerminatedNotification to detect when devices are attached and removed.
I observed that the callback returns the same io_service_t on publish as on terminated, so I'm using the io_service_t to locate my device in my data structure
on the terminated call. It may be better to use the USB locationID for this purpose.

The recommended technique is to use IOServiceAddMatchingNotification to look for devices being attached. When a device appears that you're interested in, register for IOServiceAddInterestNotification for the specific device.


This is illustrated in the sample USBPrivateDataSample:

<http://developer.apple.com/samplecode/USBPrivateDataSample/ USBPrivateDataSample.html>.

Hope this helps,
--gc

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

References: 
 >IONotifications (From: Ian Keck <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.