usb-1.2.0.1: Communicate with USB devices

Copyright(c) 2009–2012 Bas van Dijk
LicenseBSD3 (see the file LICENSE)
MaintainerBas van Dijk <v.dijk.bas@gmail.com>
Safe HaskellTrustworthy
LanguageHaskell98

System.USB.Enumeration

Description

This module provides functionality for enumerating the USB devices currently attached to the system.

Synopsis

Documentation

data Device Source

Abstract type representing a USB device detected on the system.

You can only obtain a USB device from the getDevices function.

Certain operations can be performed on a device, but in order to do any I/O you will have to first obtain a DeviceHandle using openDevice.

Just because you have a reference to a device does not mean it is necessarily usable. The device may have been unplugged, you may not have permission to operate such device or another process or driver may be using the device.

To get additional information about a device you can retrieve its descriptor using getDeviceDesc.

Instances

Eq Device 
Show Device

Devices are shown as: Bus <busNumber> Device <deviceAddress>

Typeable * Device 

getDevices :: Ctx -> IO (Vector Device) Source

Returns a vector of USB devices currently attached to the system.

This is your entry point into finding a USB device.

Exceptions:

busNumber :: Device -> Word8 Source

The number of the bus that a device is connected to.

deviceAddress :: Device -> Word8 Source

The address of the device on the bus it is connected to.