|
|
|
|
|
Description |
A database of USB identifiers.
Databases with vendor names and identifiers can be loaded from
string, file or directly from http://www.usb.org.
Example usage:
module Main where
import System.USB.IDDB
import Data.ByteString.Char8 (pack, unpack)
main :: IO ()
main = do -- Acquire the default database
db <- vdbDefault
-- Print the name of vendor 0x1D6B
putStrLn $ 'maybe "unknown ID!" unpack
$ vendorName db 0x1D6B
-- Print the ID of "The Linux Foundation"
putStrLn $ maybe "unknown name!" show
$ vendorID db (pack "The Linux Foundation")
EBNF grammar of the textual representation of a vendor database:
vendor database = {row};
row = vendor id, "|", vendor name;
vendor id = natural number;
vendor name = ASCII string;
natural number = positive digit, {digit}
positive digit = "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
digit = "0" | positive digit;
|
|
Synopsis |
|
|
|
|
Types
|
|
|
A numerical identifier for a vendor.
|
|
|
The name of a company/entity which has acquired an official ID
from the USB Implementors Forum.
|
|
|
A database of USB vendors. Associates numerical vendor ID's with
vendor names and vice versa.
|
|
Acquire database
|
|
|
Construct a vendor database from a string.
|
|
|
Load a vendor database from file. If the file can not be read for
some reason an error will be thrown.
|
|
|
Construct a vendor database from the list of companies available
at http://www.usb.org/developers/tools/comp_dump. The website
informs us that: "Remember this list changes almost daily, be
sure to get a fresh copy when you use the tools". However, the
list seems to be quite stable. Using this function more than once
a day is probably overkill.
|
|
|
Load a vendor database from a static file which is supplied with
the package.
|
|
Export database
|
|
|
Convert a vendor database to its textual representation.
|
|
|
Write a database to a file. If this file is not accessible an
error will be thrown.
|
|
Query database
|
|
|
Retrieve the name of a vendor given its ID.
|
|
|
Retrieve the ID of a vendor given its name.
|
|
Produced by Haddock version 2.4.2 |