开发者

USBPrivateDataSample on Mac Snow Leopard

I need to create application that get notified each time I plug or unplug USB, and also can get access to it. For start, I tried to use USBPrivateDataSample application as example:

http://developer.apple.com/library/mac/#samplecode/USBPrivateDataSample/Listings/USBPrivateDataSample_c.html#//apple_ref/doc/uid/DTS10000456-USBPrivateDataSample_c-DontLinkElementID_4

In order to compile it I ch开发者_运维百科anged SDK to 10.6 since 10.4 is not supported on Snow Leopard. The program is compiled and runs successfully, however, I do not receive calls/events when the USB is plugged in. In other words, function DeviceAdded is never called.

Does this program supposed to work in Snow anyway? It looks old, maybe some calls are deprecated?

Can someone suggest other way to receive USB devices notifications?

Thanks!


The sample should work on 10.6, You may need to modify the matching dictionary to either match all devices by removing the kUSBProductID and kUSBVendorID matching dictionary entries, or set these to match your device, you can also use different matching criteria (see qa1076 for those).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜