usb-1.1: Communicate with USB devices

MaintainerBas van Dijk <v.dijk.bas@gmail.com>

System.USB.IO.StandardDeviceRequests

Description

This module provides functions for performing standard device requests. The functions are primarily used for testing USB devices.

To avoid name clashes with functions from System.USB it is advised to use an explicit import list or a qualified import.

Synopsis

Documentation

setHalt :: DeviceHandle -> EndpointAddress -> Timeout -> IO ()Source

See: USB 2.0 Spec. section 9.4.9

setConfig :: DeviceHandle -> Maybe ConfigValue -> Timeout -> IO ()Source

See: USB 2.0 Spec. section 9.4.7

This function is for testing purposes only!

You should normally use System.USB.DeviceHandling.setConfig because that function notifies the underlying operating system about the changed configuration.

getConfig :: DeviceHandle -> Timeout -> IO (Maybe ConfigValue)Source

See: USB 2.0 Spec. section 9.4.2

This function is for testing purposes only!

You should normally use System.USB.DeviceHandling.getConfig because that functon may exploit operating system caches (no I/O involved).

clearRemoteWakeup :: DeviceHandle -> Timeout -> IO ()Source

See: USB 2.0 Spec. section 9.4.1

setRemoteWakeup :: DeviceHandle -> Timeout -> IO ()Source

See: USB 2.0 Spec. section 9.4.9

setStandardTestMode :: DeviceHandle -> TestMode -> Timeout -> IO ()Source

See: USB 2.0 Spec. section 9.4.9 TODO: What about vendor-specific test modes?

getDeviceStatus :: DeviceHandle -> Timeout -> IO DeviceStatusSource

See: USB 2.0 Spec. section 9.4.5

getEndpointStatus :: DeviceHandle -> EndpointAddress -> Timeout -> IO BoolSource

See: USB 2.0 Spec. section 9.4.5

setDeviceAddress :: DeviceHandle -> Word16 -> Timeout -> IO ()Source

See: USB 2.0 Spec. section 9.4.6

synchFrame :: DeviceHandle -> EndpointAddress -> Timeout -> IO FrameNumberSource

This request is used to set and then report an endpoint's synchronization frame.

When an endpoint supports isochronous transfers, the endpoint may also require per-frame transfers to vary in size according to a specific pattern. The host and the endpoint must agree on which frame the repeating pattern begins. The number of the frame in which the pattern began is returned to the host.

If a high-speed device supports the Synch Frame request, it must internally synchronize itself to the zeroth microframe and have a time notion of classic frame. Only the frame number is used to synchronize and reported by the device endpoint (i.e., no microframe number). The endpoint must synchronize to the zeroth microframe.

This value is only used for isochronous data transfers using implicit pattern synchronization. If the specified endpoint does not support this request, then the device will respond with a Request Error.

See: USB 2.0 Spec. section 9.4.11