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