usb-id-database-0.4.0.5: A database of USB identifiers

System.USB.IDDB

Contents

Description

A database of USB identifiers.

Databases with vendor names and identifiers can be loaded from string or file.

To get the most up-to-date database download the files directly from http://www.usb.org or http://linux-usb.org.

Each database's module contains an URL to the database file.

Example usage:

import System.USB.IDDB
import System.USB.IDDB.LinuxUsbIdRepo (staticDb)
import Text.Printf (printf)

main :: IO ()
main = do -- Load a snapshot from the linux-usb.org database.
          db <- staticDb
          -- Print the name of vendor 0x1d6b
          putStrLn $ maybe "unknown VID!" id
                   $ vendorName db 0x1d6b
          -- Print the ID of "Linux Foundation"
          putStrLn $ maybe "unknown vendor name!" (printf "0x%04x")
                   $ vendorId db "Linux Foundation"
          -- Print the name of the product with ID 0x0101 from the
          -- vendor with ID 0x1d6b.
          putStrLn $ maybe "unknown PID!" id
                   $ productName db 0x1d6b 0x0101
          -- Print the ID of the product with the name "Audio Gadget"
          -- from the vendor with ID 0x1d6b.
          putStrLn $ maybe "unknown product name!" (printf "0x%04x")
                   $ productId db 0x1d6b "Audio Gadget"

Synopsis

Types

data IDDB Source

A database of USB identifiers. Contains both vendor identifiers and product identifiers.

emptyDb :: IDDBSource

An empty database.

Query database

vendorNameSource

Arguments

:: IDDB

Database

-> Int

Vendor identifier

-> Maybe String 

vendorIdSource

Arguments

:: IDDB

Database

-> String

Vendor name

-> Maybe Int 

productNameSource

Arguments

:: IDDB

Database

-> Int

Vendor identifier

-> Int

Product identifier

-> Maybe String 

productIdSource

Arguments

:: IDDB

Database

-> Int

Vendor identifier

-> String

Product name

-> Maybe Int 

classNameSource

Arguments

:: IDDB

Database

-> Int

Class identifier

-> Maybe String 

subClassNameSource

Arguments

:: IDDB

Database

-> Int

Class identifier

-> Int

Sub class identifier

-> Maybe String 

protocolNameSource

Arguments

:: IDDB

Database

-> Int

Class identifier

-> Int

Sub class identifier

-> Int

Protocol identifier

-> Maybe String 

audioClassTerminalTypeNameSource

Arguments

:: IDDB

Database

-> Int

Audio class terminal type identifier

-> Maybe String 

videoClassTerminalTypeNameSource

Arguments

:: IDDB

Database

-> Int

Video class terminal type identifier

-> Maybe String 

hidDescTypeNameSource

Arguments

:: IDDB

Database

-> Int

HID descriptor type identifier

-> Maybe String 

hidDescItemNameSource

Arguments

:: IDDB

Database

-> Int

HID descriptor item identifier

-> Maybe String 

hidDescCountryCodeNameSource

Arguments

:: IDDB

Database

-> Int

HID descriptor country code identifier

-> Maybe String 

hidUsagePageNameSource

Arguments

:: IDDB

Database

-> Int

HID usage page identifier

-> Maybe String 

hidUsageNameSource

Arguments

:: IDDB

Database

-> Int

HID usage page identifier

-> Int

HID usage identifier

-> Maybe String 

physicalDescBiasNameSource

Arguments

:: IDDB

Database

-> Int

Physical descriptor bias identifier

-> Maybe String 

physicalDescItemNameSource

Arguments

:: IDDB

Database

-> Int

Physical descriptor item identifier

-> Maybe String 

langNameSource

Arguments

:: IDDB

Database

-> Int

Primary language identifier

-> Maybe String 

subLangNameSource

Arguments

:: IDDB

Database

-> Int

Primary language identifier

-> Int

Sub language identifier

-> Maybe String