Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Wrapping my head around matching dictionaries.



Good-day Everyone:

I'm new to USB development on OS X, and have a bit of a dumb question to ask.

I have written a fairly extensive library in Java to synchronize PalmOS devices (ref: http://www.jsyncmanager.org), and I'm trying to write some JNI code to permit USB access on OS X (on most platforms we use the javax.usb API, but this isn't available on OS X yet. I own the SourceForge project to port javax.usb to OS X, but decided to start here as a quicker, easier into to IOKit and USB on OS X).

I've gone through the documentation and the examples from Apple, and have come up with a quick JNI-based plug-in which will detect when I plug my Tungsten C into its dock and press the synchronize button.

Unfortunately, I want to make this a bit more generic, so it will work with any PalmOS-based device. And the problem is that there are at least four different vendor ID's and at least 21 different device IDs for PalmOS-based devices.

In my current test code, I'm building a CFMutableDictionaryRef to handle the device matching, but from what I can see it is only possible to configure it to match vendor ID/device ID for one device. If I'm reading the documentation correctly, it's not possible through the default implementation to set multiple keys with the same values, correct?

I'm trying to think through the best way to accomplish my goal, and would like some advice. Is it better in this case to:

0) Just match against every USB device, and then read the vendor/ device IDs inside my run loop, ignoring anything I'm not looking for, or

1) Build my own dictionary which is smart enough to match against any valid combination of vendor/device IDs?

    Thanks in advance for any light anyone can shed on this issue!

Brad BARCLAY,
Lead Developer & Project Administrator,
The jSyncManager Project.

=-=-=-=-=-=-=-=-=-=
From the Mac OS X Desktop of Brad BARCLAY
E-Mail:  email@hidden     Web:  http://www.jsyncmanager.org


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



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.