USB readers use the bundle approach so that the reader can be loaded and unloaded upon automatic detection of the device. The bundle approach is simple: the actual library is just embedded in a directory so additional information can be gathered about the device.
A bundle looks like the following:
GenericReader.bundle/
Contents/
Info.plist - XML file describing the reader
MacOS/ - Driver directory for OS X
Solaris/ - Driver directory for Solaris
Linux/ - Driver directory for Linux
HPUX/ - Driver directory for HPUX
The Info.plist file describes the driver and gives the loader all the necessary information. The following must be contained in the Info.plist file:
The vendor ID of the USB device.
Example:
<key>ifdVendorID</key> <string>0x04E6</string>
You may have an OEM of this reader in which an additional <string> can be used like in the below example:
<key>ifdVendorID</key> <array> <string>0x04E6</string> <string>0x0973</string> </array>
If multiples exist all the other parameters must have a second value also. You may chose not to support this feature but it is useful when reader vendors OEM products so you only distribute one driver.
The CCID driver from Ludovic Rousseau1uses this feature since the same driver supports many different readers.
The product id of the USB device.
<key>ifdProductID</key> <string>0x3437</string>
Example:
<key>ifdFriendlyName</key> <string>SCM Microsystems USB Reader</string>
The executable name which exists in the particular platform's directory.
Example:
<key>CFBundleExecutable</key> <string>libccid.so.0.4.2</string>
List of capabilities supported by the driver. This is a bit field. Possible values are:
Complete sample file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.0.1d1</string>
<key>ifdCapabilities</key>
<string>0x00000000</string>
<key>ifdProtocolSupport</key>
<string>0x00000001</string>
<key>ifdVersionNumber</key>
<string>0x00000001</string>
<key>CFBundleExecutable</key>
<string>libfoobar.so.x.y</string>
<key>ifdManufacturerString</key>
<string>Foo bar inc.</string>
<key>ifdProductString</key>
<string>Driver for Foobar reader, version x.y</string>
<key>ifdVendorID</key>
<string>0x1234</string>
<key>ifdProductID</key>
<string>0x5678</string>
<key>ifdFriendlyName</key>
<string>Foobar USB reader</string>
</dict>
</plist>
As indicated in the XML file the DTD is available at http://www.apple.com/DTDs/PropertyList-1.0.dtd.
Ludovic Rousseau 2008-01-18