aע"      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !  Safe-Inferred" NoneM# bits s e b extract bit s to e (including) from b.$ between n b e tests if n is between the given bounds b and e (including).%A generalized & that works on any ' type.(A generalized ) that returns any ' type.*mapPeekArray f n a applies the monadic function f to each of the n elements of the array a# and returns the results in a list.+;Write the elements of a storable vector to the given array.,Monadic if...then...else... #$%(*-+.,/ #$%(*-+.,/ #$%(*-+.,/  Safe-Inferred012  Safe-Inferred333 Unsafe+0FM3Type of USB exceptions.Other exception.Operation not supported or unimplemented on this platform. If possible, it's recommended the check if a certain operation is supported by using the  API.Insufficient memory.0System call interrupted (perhaps due to signal).Pipe exception.+If the device offered to much data. See  9http://libusb.sourceforge.net/api-1.0/packetoverflow.htmlPackets and overflows in the libusb documentation.Operation timed out.Resource busy. Entity not found. /No such device (it may have been disconnected). Access denied (insufficient permissions). It may help to run your program with elevated privileges or change the permissions of your device using something like udev. Invalid parameter. Input/output exception.An isochronous write transfer.An isochronous read transfer.#A bulk or interrupt write transfer."A bulk or interrupt read transfer.Type of  or  which can either be bulk or  interrupt.CNote that isochronous transfers are handled differently using the  or  types.1A control transfer which writes data to a device.2A control transfer which reads data from a device./A control transfer which doesn't transfer data.4KFunction to wait on the termination of a transfer. Note that this is just 5 partially applied to a 6.7The " is stored so that its associated  and , can be kept alive during the lifetime of a 8.9A 8Q should not be performed concurrently which is why we sequentialize it using an :.67A lock is in one of two states: "locked" or "unlocked".;&Endpoint transfer type. Can be any of:<=>?@Handy type synonym for the libusb transfer functions.VA potential additional parameter for the request. Usually used as an index or offset. (Host-endian)1A potential additional parameter for the request. (Host-endian)The actual request code.tA common request can be directed to different recipients and based on the recipient perform different functions. A  GetStatus #j request for example, can be directed at the device, interface or endpoint. When directed to a device it returns flags indicating the status of remote wakeup and if the device is self powered. However if the same request is directed at the interface it always returns zero, or should it be directed at an endpoint will return the halt flag for the endpoint.FDirected to something other than the device, interface or endpoint.Directed to the endpoint.Directed to the interface.Directed to the device. The type of control requests.!These are requests which the USB device designer (you?) can assign. These are normally different from device to device, but this is all up to your implementation and imagination."-Class requests are common to classes of drivers. For example, all device's conforming to the HID class will have a common set of class specific requests. These will differ to a device conforming to the communications class and differ again to that of a device conforming to the mass storage class.#1Standard requests are common to all USB device's.$Setup for control transfers.&The type of request.'The recipient of the request.(The numeric request.) The value.* The index.+ Status of a terminated transfer.,=Not all bytes were transferred within the maximum allowed . period.-9All bytes were transferred within the maximum allowed . period..A timeout in milliseconds. A timeout defines how long a transfer should wait before giving up due to no response being received. Use  for no timeout./Number of bytes transferred.0XHandy type synonym for write transfers that must exactly write all the given bytes. An ! is thrown otherwise.1'Handy type synonym for write transfers.A  WriteAction is a function which takes a A to write and a .. The function returns an Bc action which, when exectued, returns the number of bytes that were actually written paired with a ++ flag which indicates whether the transfer - or ,.2`Handy type synonym for read transfers that must exactly read the specified number of bytes. An   is thrown otherwise.3&Handy type synonym for read transfers.A  ReadAction is a function which takes a /, which defines how many bytes to read and a .. The function returns an BG action which, when executed, performs the actual read and returns the A that was read paired with a ++ flag which indicates whether the transfer - or ,.4%Type of indici of string descriptors.-Can be retrieved by all the *StrIx functions.5The sublanguage identifier.6 The primary language identifier.7mThe language ID consists of the primary language identifier and the sublanguage identififier as described in: 2http://www.usb.org/developers/docs/USB_LANGIDs.pdf0For a mapping between IDs and languages see the  2http://hackage.haskell.org/package/usb-id-databaseusb-id-database package. To see which 7 s are supported by a device see .8>Number of additional transaction oppurtunities per microframe.,See table 9-13 of the USB 2.0 specification.92 additional (3 per microframe):1 additional (2 per microframe);#None (1 transaction per microframe)<Maximum packet size.@2See section 5.12.4.2 of the USB 2.0 specification.D2See section 5.12.4.1 of the USB 2.0 specification.ESynchronized to the USB s SOF (Start Of Frame)FCSynchronized using feedback or feedforward data rate informationG=Unsynchronized, although sinks provide data rate feedback.HNo Synchonisation.I>Describes what types of transfers are allowed on the endpoint.JrInterrupt transfers are typically non-periodic, small device "initiated" communication requiring bounded latency.K1Bulk transfers can be used for large bursty data.L:Isochronous transfers occur continuously and periodically.MHControl transfers are typically used for command and status operations.NkThe USB 2.0 specification specifies that the endpoint attributes only describe the endpoint transfer type.O4The direction of data transfer relative to the host.P;In transfer direction (device -> host) used for reading.Q<Out transfer direction (host -> device) used for writing.RThe address of an endpoint.TMust be >= 0 and <= 15UEThe direction of data transfer relative to the host of this endpoint.V>A structure representing the standard USB endpoint descriptor.LThis descriptor is documented in section 9.6.3 of the USB 2.0 specification.)This structure can be retrieved by using g.X8The address of the endpoint described by the descriptor.YHAttributes which apply to the endpoint when it is configured using the q.ZAMaximum packet size the endpoint is capable of sending/receiving.[Interval for polling endpoint for data transfers. Expressed in frames or microframes depending on the device operating speed (i.e., either 1 millisecond or 125 s units).\For audio devices only:9 the rate at which synchronization feedback is provided.]For audio devices only:# the address of the synch endpoint.^Extra descriptors. If libusbb encounters unknown endpoint descriptors, it will store them here, should you wish to parse them._?A structure representing the standard USB interface descriptor.LThis descriptor is documented in section 9.6.5 of the USB 2.0 specification.&This structure can be retrieved using u.aNumber of the interface.b=Value used to select the alternate setting for the interface.c$USB-IF class code for the interface.d:USB-IF subclass code for the interface, qualified by the c value.e:USB-IF protocol code for the interface, qualified by the c and d values.f=Optional index of string descriptor describing the interface.g/Vector of endpoints supported by the interface.hExtra descriptors. If libusbc encounters unknown interface descriptors, it will store them here, should you wish to parse them.iHAn interface is represented as a vector of alternate interface settings.jThe status of a USB device.lThe Remote Wakeup field indicates whether the device is currently enabled to request remote wakeup. The default mode for devices that support remote wakeup is disabled.mPThe Self Powered field indicates whether the device is currently self-poweredngThe USB 2.0 specification specifies that the configuration attributes only describe the device status.oCA structure representing the standard USB configuration descriptor.LThis descriptor is documented in section 9.6.3 of the USB 2.0 specification.#This structure can be retrieved by .q'Identifier value for the configuration.rAOptional index of string descriptor describing the configuration.sConfiguration characteristics.tMaximum power consumption of the USB device from the bus in the configuration when the device is fully operational. Expressed in 2 mA units (i.e., 50 = 100 mA).u4Vector of interfaces supported by the configuration.vExtra descriptors. If libusbg encounters unknown configuration descriptors, it will store them here, should you wish to parse them.wQA 16-bit number used to identify a USB device. Each company which is assigned a x3 can assign a product ID to its USB-based products.xA 16-bit number used to identify a USB device. Each vendor ID is assigned by the USB Implementers Forum to a specific company.y;Release / version number of the USB specification / device.z<A structure representing the standard USB device descriptor.LThis descriptor is documented in section 9.6.1 of the USB 2.0 specification.#This structure can be retrieved by .|!USB specification release number.}!USB-IF class code for the device.~6USB-IF subclass code for the device, qualified by the } value.6USB-IF protocol code for the device, qualified by the } and ~ values.#Maximum packet size for endpoint 0.USB-IF vendor ID.USB-IF product ID.Device release number.<Optional index of string descriptor describing manufacturer.7Optional index of string descriptor describing product.DOptional index of string descriptor containing device serial number."Number of possible configurations.,Identifier for interface alternate settings.Can be retrieved by b.Identifier for interfaces.Can be retrieved by a.Identifier for configurations.Can be retrieved by  or by q.4Abstract type representing a handle of a USB device.You can acquire a handle from .A device handle is used to perform I/O and other operations. When finished with a device handle you should close it by applying  to it. Retrieve the  from the .BSpeed codes. Indicates the speed at which the device is operating.4The device is operating at super speed (5000MBit/s).2The device is operating at high speed (480MBit/s).1The device is operating at full speed (12MBit/s).1The device is operating at low speed (1.5MBit/s).Callback handle.#Callbacks handles are generated by K and can be used to deregister callbacks. Callback handles are unique per  and it is safe to call # on an already deregisted callback.Returned from a A to indicate whether the callback is finished processing events."The callback will be deregistered. The callback remains registered.'Hotplug callback function type used in .libusb1 will call this function, once registered using ;, when a matching event has happened on a matching device.:This callback may be called by an internal event thread and as such it is recommended the callback do minimal processing before returning. In fact, it has been observed that doing any I/O with the device from inside the callback results in dead-lock! See the example below on the correct use of this callback.It is safe to call either  or ! from within a callback function.Should return a Q which indicates whether this callback is finished processing events. Returning . will cause this callback to be deregistered.iIf you need to wait on the arrival of a device after which you need to do something with it, it's recommended to write the device to a concurrent channel like a MVar / TChan / TMVar / TChan / etc. then read the channel outside the callback. This way the processing of the device takes place in a different thread. See the following for one correct use-case: waitForMyDevice :: Ctx -> Maybe VendorId -> Maybe ProductId -> Maybe Word8 -> IO Device waitForMyDevice ctx mbVendorId mbProductId mbDevClass = do mv <- newEmptyMVar -- We mask asynchronous exceptions to ensure that the callback -- gets properly deregistered when an asynchronous exception is -- thrown during the interruptible takeMVar operation. mask_ $ do h <- registerHotplugCallback ctx deviceArrived enumerate mbVendorId mbProductId mbDevClass (dev event -> tryPutMVar mv (dev, event) $> DeregisterThisCallback) (dev, _event) <- takeMVar mv `onException` deregisterHotplugCallback h return dev Set of configuration flags for .6The set of hotplug events to trigger the callback in .?Abstract type representing a USB device detected on the system.*You can only obtain a USB device from the  function.lCertain operations can be performed on a device, but in order to do any I/O you will have to first obtain a  using .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.STo get additional information about a device you can retrieve its descriptor using .CThis reference to the E is needed so that it won't gets garbage collected. The finalizer  libusb_exit' is run only when all references to Devices are gone.)Capabilities supported by an instance of libusb" on the current running platform.Test if the loaded libusb1 library supports a given capability by calling .AThe library supports detaching of the default USB driver, using !, if one is set by the OS kernel.HThe library can access HID devices without requiring user intervention.eNote that before being able to actually access an HID device, you may still have to call additional libusb functions such as ..Hotplug support is available on this platform.The  API is available.'Structure providing the version of the libusb runtime.Library major version.Library minor version.Library micro version.Library nano version..Library release candidate suffix string, e.g. "-rc4".Message verbosity3Debug and informational messages are printed to stdout, warnings and errors to stderr.&Informational messages are printed to stdout/, warning and error messages are printed to stderr.*Warning and error messages are printed to stderr.Error messages are printed to stderr.,No messages are ever printed by the library.5?A function to wait for the termination of a submitted transfer.)Abstract type representing a USB session.The concept of individual sessions allows your program to use multiple threads that can independently use this library without interfering with eachother.(Sessions are created and initialized by > and are automatically closed when they are garbage collected."The only functions that receive a Ctx are ,  and .D,Internal function used to initialize libusb.FThis function must be called before calling any other libusb function.(Create and initialize a new USB context.This function may throw s.Note that the internal libusbo event handling can return errors. These errors occur in the thread that is executing the event handling loop.  will print these errors to Em. If you need to handle the errors yourself (for example log them in an application specific way) please use .Like X but enables you to specify the way errors should be handled that occur while handling libusb events.F/Checks if the system supports asynchronous I/O.GV means asynchronous I/O is not supported so synchronous I/O should be used instead.H wait/ means that asynchronous I/O is supported. The wait7 function can be used to wait for submitted transfers.ILike FE but throws an error if the system doesn't support asynchronous I/O.Set message verbosity.The default level is . This means no messages are ever printed. If you choose to increase the message verbosity level you must ensure that your application does not close the stdout/stderr file descriptors.*You are advised to set the debug level to . Libusb is conservative with its message logging. Most of the time it will only log messages that explain error conditions and other oddities. This will help you debug your software.The LIBUSB_DEBUG environment variable overrules the debug level set by this function. The message verbosity is fixed to the value in the environment variable if it is defined.If libusbe was compiled without any message logging, this function does nothing: you'll never get any messages.If libusby was compiled with verbose debug message logging, this function does nothing: you'll always get messages from all levels.FReturns the version (major, minor, micro, nano and rc) of the loaded libusb library. Convert a  to a J for easy comparison.Check at runtime if the loaded libusb library has a given capability.$This call should be performed after c, to ensure the backend has updated its capability set. For this reason you need to apply it to a .AReturns a vector of USB devices currently attached to the system.3This is your entry point into finding a USB device. Exceptions: on a memory allocation failure.1A device has been plugged in and is ready to use.-A device has left and is no longer available.(It is the user's responsibility to call J on any handle associated with a disconnected device. It is safe to call  on a device that has left.*Determine if the set of events contains a  event.*Determine if the set of events contains a  event.8Fire events for all matching currently attached devices.WARNING: see the note on ( for the danger of using this function!Register a hotplug callback function with the context. The callback will fire when a matching event occurs on a matching device. The callback is armed until either it is deregistered with # or the supplied callback returns / to indicate it is finished processing events.If the 4 flag is passed the callback will be called with a ? for all devices already plugged into the machine. Note that libusba modifies its internal device list from a separate thread, while calling hotplug callbacks from libusb_handle_events(), so it is possible for a device to already be present on, or removed from, its internal device list, while the hotplug callbacks still need to be dispatched. This means that when using the X flag, your callback may be called twice for the arrival of the same device, once from  and once from libusb_handle_events()k; and/or your callback may be called for the removal of a device for which an arrived call was never made.Deregisters a hotplug callback.Deregister a callback from a @. This function is safe to call from within a hotplug callback.4The number of the bus that a device is connected to.XGet the number of the port that a is device connected to. Unless the OS does something funky, or you are hot-plugging USB extension cards, the port number returned by this call is usually guaranteed to be uniquely tied to a physical port, meaning that different devices plugged on the same physical port should return the same port number.But outside of this, there is no guarantee that the port number returned by this call will remain the same, or even match the order in which ports have been numbered by the HUB/HCD manufacturer.DGet the list of all port numbers from root for the specified device.8The address of the device on the bus it is connected to.1Get the negotiated connection speed for a device.GS means that the OS doesn't know or doesn't support returning the negotiated speed.K Operate the L pointer inside the .The $ that the handle references and the v in which it was created are kept alive at least during the whole action, even if they are not used directly inside.)Open a device and obtain a device handle.=A handle allows you to perform I/O on the device in question.CThis is a non-blocking function; no requests are sent over the bus.It is advisable to use L because it automatically closes the device when the computation terminates. Exceptions:) if there is a memory allocation failure. * if the user has insufficient permissions. % if the device has been disconnected.Another .Close a device handle.CShould be called on all open handles before your application exits.CThis is a non-blocking function; no requests are sent over the bus.withDeviceHandle dev act opens the  dev4 and passes the resulting handle to the computation act). The handle will be closed on exit from withDeviceHandle: whether by normal termination or by raising an exception.:Determine the value of the currently active configuration.You could formulate your own control request to obtain this information, but this function has the advantage that it may be able to retrieve the information from operating system caches (no I/O involved).If the OS does not cache this information, then this function will block while a control transfer is submitted to retrieve the information.This function returns G( if the device is in unconfigured state. Exceptions: % if the device has been disconnected.Another .*Set the active configuration for a device.The operating system may or may not have already set an active configuration on the device. It is up to your application to ensure the correct configuration is selected before you attempt to claim interfaces and perform other operations.TIf you call this function on a device already configured with the selected configuration, then this function will act as a lightweight device reset: it will issue a SET_CONFIGURATION request using the current configuration, causing most USB-related device state to be reset (altsetting reset to zero, endpoint halts cleared, toggles reset).mYou cannot change/reset configuration if your application has claimed interfaces - you should free them with g first. You cannot change/reset configuration if other applications or drivers have claimed interfaces.A configuration value of G will put the device in an unconfigured state. The USB specification states that a configuration value of 0 does this, however buggy devices exist which actually have a configuration 0.You should always use this function rather than formulating your own SET_CONFIGURATION control request. This is because the underlying operating system needs to know when such changes happen.This is a blocking function. Exceptions: / if the requested configuration does not exist.% if interfaces are currently claimed. $ if the device has been disconnectedAnother .,Claim an interface on a given device handle.`You must claim the interface you wish to use before you can perform I/O on any of its endpoints.~It is legal to attempt to claim an already-claimed interface, in which case this function just returns without doing anything.Claiming of interfaces is a purely logical operation; it does not cause any requests to be sent over the bus. Interface claiming is used to instruct the underlying operating system that your application wishes to take ownership of the interface. This is a non-blocking function. Exceptions: + if the requested interface does not exist.% if the interface is already claimed. % if the device has been disconnected.Another .-Release an interface previously claimed with .IYou should release all claimed interfaces before closing a device handle.This is a blocking function. A SET_INTERFACE control request will be sent to the device, resetting interface state to the first alternate setting. Exceptions: " if the interface was not claimed. $ if the device has been disconnectedAnother .withClaimedInterfacec claims the interface on the given device handle then executes the given computation. On exit from withClaimedInterfaceU, the interface is released whether by normal termination or by raising an exception./Activate an alternate setting for an interface.5The interface must have been previously claimed with .You should always use this function rather than formulating your own SET_INTERFACE control request. This is because the underlying operating system needs to know when such changes happen.This is a blocking function. Exceptions: W if the interface was not claimed or the requested alternate setting does not exist. % if the device has been disconnected.Another ./Clear the halt/stall condition for an endpoint.fEndpoints with halt status are unable to receive or transmit data until the halt condition is stalled.VYou should cancel all pending transfers before attempting to clear the halt condition.This is a blocking function. Exceptions:  if the endpoint does not exist. % if the device has been disconnected.Another .2Perform a USB port reset to reinitialize a device.sThe system will attempt to restore the previous configuration and alternate settings after the reset has completed.If the reset fails, the descriptors change, or the previous state cannot be restored, the device will appear to be disconnected and reconnected. This means that the device handle is no longer valid (you should close it) and rediscover the device. A  - is raised to indicate that this is the case.DThis is a blocking function which usually incurs a noticeable delay. Exceptions: J if re-enumeration is required, or if the device has been disconnected.Another .Enable/disable libusb's; automatic kernel driver detachment. When this is enabled libusb will automatically detach the kernel driver on an interface when claiming the interface, and attach it when releasing the interface.ZAutomatic kernel driver detachment is disabled on newly opened device handles by default.#On platforms which do not have the ( capability this function will throw a , and libusb5 will continue as if this function was never called.7Determine if a kernel driver is active on an interface.gIf a kernel driver is active, you cannot claim the interface, and libusb will be unable to perform I/O. Exceptions: % if the device has been disconnected.Another .)Detach a kernel driver from an interface.LIf successful, you will then be able to claim the interface and perform I/O. Exceptions:  if no kernel driver was active. ! if the interface does not exist. % if the device has been disconnected.Another .LRe-attach an interface's kernel driver, which was previously detached using . Exceptions:  if no kernel driver was active. ! if the interface does not exist. % if the device has been disconnected.] if the driver cannot be attached because the interface is claimed by a program or driver.Another .BIf a kernel driver is active on the specified interface the driver is detached and the given action is executed. If the action terminates, whether by normal termination or by raising an exception, the kernel driver is attached again. If a kernel driver is not active on the specified interface the action is just executed. Exceptions: % if the device has been disconnected.Another .Calculate the maximum packet size which a specific endpoint is capable of sending or receiving in the duration of 1 microframe.If acting on an L or J+ endpoint, this function will multiply the > by the additional ?1. If acting on another type of endpoint only the > is returned..This function is mainly useful for setting up  isochronous transfers.1Get the USB device descriptor for a given device.KThis is a non-blocking function; the device descriptor is cached in memory.This function may throw s.MVUnmarshal a a 16bit word as a release number. The 16bit word should be encoded as a  1http://en.wikipedia.org/wiki/Binary-coded_decimalBinary Coded Decimal* using 4 bits for each of the 4 decimals.N|Unmarshal an 8bit word to a string descriptor index. 0 denotes that a string descriptor is not available and unmarshals to G.6Get a USB configuration descriptor based on its index.^This is a non-blocking function which does not involve any requests being sent to the device. Exceptions: % if the configuration does not exist.Another .OsUnmarshal an 8bit word as an endpoint address. This function is primarily used when unmarshalling USB descriptors.P:Marshal an endpoint address so that it can be used by the libusb transfer functions.Q@The size in number of bytes of the header of string descriptors.RDCharacters are encoded as UTF16LE so each character takes two bytes.)Retrieve a vector of supported languages.This function may throw s.S4retrieveStrDesc devHndl strIx langId maxSize dataPtr! retrieves the string descriptor strIx in the language langId from the devHndl and writes at most maxSize8 bytes from that string descriptor to the location that dataPtr2 points to. So ensure there is at least space for maxSizei bytes there. Next, the header of the string descriptor is checked for correctness. If it's incorrect an  A is thrown. Finally, the size reported in the header is returned.+Retrieve a string descriptor from a device.This function may throw s.NRetrieve a string descriptor from a device using the first supported language.This function may throw s.&A timeout of 0 denotes no timeout so:  noTimeout = 0.Perform a USB control% request that does not transfer data. Exceptions: if the transfer timed out.7 if the control request was not supported by the device % if the device has been disconnected.Another .Perform a USB control read. Exceptions:7 if the control request was not supported by the device % if the device has been disconnected.Another ."A convenience function similar to W which checks if the specified number of bytes to read were actually read. Throws an   if this is not the case.Perform a USB control write. Exceptions:7 if the control request was not supported by the device % if the device has been disconnected.Another ."A convenience function similar to J which checks if the given bytes were actually fully written. Throws an ! if this is not the case.Perform a USB bulk read. Exceptions: if the endpoint halted.) if the device offered more data, see  9http://libusb.sourceforge.net/api-1.0/packetoverflow.htmlPackets and overflows in the libusb documentation. % if the device has been disconnected.Another .Perform a USB bulk write. Exceptions: if the endpoint halted.) if the device offered more data, see  9http://libusb.sourceforge.net/api-1.0/packetoverflow.htmlPackets and overflows in the libusb documentation. % if the device has been disconnected.Another .Perform a USB  interrupt read. Exceptions: if the endpoint halted.) if the device offered more data, see  9http://libusb.sourceforge.net/api-1.0/packetoverflow.htmlPackets and overflows in the libusb documentation. % if the device has been disconnected.Another .Perform a USB  interrupt write. Exceptions: if the endpoint halted.) if the device offered more data, see  9http://libusb.sourceforge.net/api-1.0/packetoverflow.htmlPackets and overflows in the libusb documentation. % if the device has been disconnected.Another .TAllocate a transfer with the given number of isochronous packets and apply the function to the resulting pointer. The transfer is automatically freed when the function terminates (whether normally or by raising an exception).A  may be thrown.U Create a FunPtrX to the given transfer callback function and pass it to the continuation function. The FunPtrh is automatically freed when the continuation terminates (whether normally or by raising an exception).V&Create a lock in the "unlocked" state.W Acquires the 6,. Blocks if another thread has acquired the 6.acquire behaves as follows:When the state is "unlocked" acquire changes the state to "locked".When the state is "locked" acquire blocks until a call to Xa in another thread wakes the calling thread. Upon awakening it will change the state to "locked".Xrelease9 changes the state to "unlocked" and returns immediately.KThe behaviour is undefined when a lock in the "unlocked" state is released!$If there are any threads blocked on W the thread that first called acquire will be woken up.Perform a USB  isochronous read.WARNING:* You need to enable the threaded runtime ( -threadedK) for this function to work correctly. It throws a runtime error otherwise! Exceptions: if the endpoint halted.) if the device offered more data, see  9http://libusb.sourceforge.net/api-1.0/packetoverflow.htmlPackets and overflows in the libusb documentation. % if the device has been disconnected.Another .Perform a USB  isochronous write.WARNING:* You need to enable the threaded runtime ( -threadedK) for this function to work correctly. It throws a runtime error otherwise! Exceptions: if the endpoint halted.) if the device offered more data, see  9http://libusb.sourceforge.net/api-1.0/packetoverflow.htmlPackets and overflows in the libusb documentation. % if the device has been disconnected.Another .YLAn isochronous packet descriptor with all fields zero except for the length.ZSafely operate on the internal libusb transfer structure.:Create a new control transfer which doesn't transfer data.7Execute a control transfer which doesn't transfer data./Update the device handle of a control transfer.)Update the timeout of a control transfer.2Update the setup parameters of a control transfer.1Retrieve the device handle of a control transfer.+Retrieve the timeout of a control transfer.@Create a new control transfer which can read data from a device.8Execute a control transfer to read data from the device.MUpdate the device handle of a control transfer that reads data from a device.GUpdate the timeout of a control transfer that reads data from a device.QUpdate the setup parameters of a control transfer that reads data from a device..ORetrieve the device handle of a control transfer that reads data from a device.IRetrieve the timeout of a control transfer that reads data from a device.?Create a new control transfer which can write data to a device.;Execute a control transfer to write the data to the device.LUpdate the device handle of a control transfer that writes data to a device.FUpdate the timeout of a control transfer that writes data to a device.OUpdate the setup parameters of a control transfer that writes data to a device.NRetrieve the device handle of a control transfer that writes data to a device.HRetrieve the timeout of a control transfer that writes data to a device.ICreate a new bulk or interrupt transfer that can read data from a device.@Execute a bulk or interrupt transfer to read data from a device.DSpecify whether the transfer should perform bulk or interrupt reads.>Update the device handle of a bulk or interrupt read transfer.AUpdate the endpoint address of a bulk or interrupt read transfer.8Update the timeout of a bulk or interrupt read transfer.DUpdate the number of bytes to read for a bulk or interrupt transfer.4Check if this transfer does bulk or interrupt reads.@Retrieve the device handle of a bulk or interrupt read transfer.CRetrieve the endpoint address of a bulk or interrupt read transfer.FRetreive the number of bytes to read for a bulk or interrupt transfer.:Retrieve the timeout of a bulk or interrupt read transfer.HCreate a new bulk or interrupt transfer that can write data to a device.?Execute a bulk or interrupt transfer to write data to a device.ESpecify whether the transfer should perform bulk or interrupt writes.?Update the device handle of a bulk or interrupt write transfer.BUpdate the endpoint address of a bulk or interrupt write transfer.9Update the timeout of a bulk or interrupt write transfer. ;Update the bytes to write for a bulk or interrupt transfer. 5Check if this transfer does bulk or interrupt writes. ARetrieve the device handle of a bulk or interrupt write transfer. DRetrieve the endpoint address of a bulk or interrupt write transfer. >Retreive the bytes to write from a bulk or interrupt transfer.;Retrieve the timeout of a bulk or interrupt write transfer.SCreate a new isochronous transfer that can read isochronous packets from a device.=Execute a transfer to read isochronous packets from a device.9Update the device handle of an isochronous read transfer.<Update the endpoint address of an isochronous read transfer.?Update the size of packets to read for an isochronous transfer.;Retrieve the device handle of an isochronous read transfer.>Retrieve the endpoint address of an isochronous read transfer.?Retrieve the packets sizes to read for an isochronous transfer.RCreate a new isochronous transfer that can write isochronous packets to a device.<Execute a transfer to write isochronous packets to a device.:Update the device handle of an isochronous write transfer.=Update the endpoint address of an isochronous write transfer.8Update the packets to write for an isochronous transfer.<Retrieve the device handle of an isochronous write transfer.?Retrieve the endpoint address of an isochronous write transfer.:Retrieve the packets to write for an isochronous transfer.[handleUSBException action executes action. If action$ returned an error code other than 'c\'LIBUSB_SUCCESS', the error is converted to a  and thrown.\checkUSBException action executes action. If action< returned a negative integer the integer is converted to a . and thrown. If not, the integer is returned.] Convert a C'libusb_error to a  . If the C'libusb_error is unknown an ^ is thrown._Association list mapping `s to s. A general  .  ) that is thrown when the number of bytes read% doesn't equal the requested number.! ) that is thrown when the number of bytes written% doesn't equal the requested number.aUse b( to specify the empty set of flags. Use c e1 e2 to join the flags in e1 and e2.dUse b) to specify the empty set of events. Use c e1 e2 to join the events in e1 and e2.eDevices are shown as: Bus < > Device <> fghijklmnopqrs8tu47v96w;@ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~xyz{|}~C5DFI'Context to register this callback with..Set of events that will trigger this callback.Set of configuration flags.H the vendor id to match or G to match anything.H the product id to match or G to match anything.H the device class to match or G to match anything.6The function to be invoked on a matching event/device.gThe maximum number of ports allowed in the resulting vector. If there are more ports than this number G\ will be returned. As per the USB 3.0 specs, the current maximum limit for the depth is 7.KMNOPQRS<Maximum number of characters in the requested string. An  H will be thrown when the requested string is larger than this number.<Maximum number of characters in the requested string. An  H will be thrown when the requested string is larger than this number. Make sure U is set to P. Make sure U is set to Q. Make sure U is set to P. Make sure U is set to Q.Encoded endpoint addressEncoded endpoint addressTUVWX Make sure U is set to P.%Sizes of isochronous packets to read. Make sure U is set to Q.Isochronous packets to write.YZAPointer to an input or output buffer with its associated size.Buffer finalizer.Number of bytes to read.Bytes to write.     %Sizes of isochronous packets to read.Isochronous packets to write.[\]_ !ade fghijklmnopqrs8tu47v96w;@ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~xyz{|}~C5DFIKMNOPQRSTUVWXYZ     [\]_ ! fghijklmnopqrs8tu47v96w;@ #"!$%&'()*+-,./012345678;:9<=>?@CBADHGFEIMLKJNOQPRSTUVWXYZ[\]^_ `abcdefghijklmnopqrstuvwxyz {|}~xyz{|}~C5DFIKMNOPQRSTUVWXYZ     [\]_ !ade(c) 2009 2014 Bas van DijkBSD3 (see the file LICENSE)#Bas van Dijk <v.dijk.bas@gmail.com> Trustworthy (c) 2009 2014 Bas van DijkBSD3 (see the file LICENSE)#Bas van Dijk <v.dijk.bas@gmail.com> Trustworthy(c) 2009 2014 Bas van DijkBSD3 (see the file LICENSE)#Bas van Dijk <v.dijk.bas@gmail.com> Trustworthy(c) 2009 2014 Bas van DijkBSD3 (see the file LICENSE)#Bas van Dijk <v.dijk.bas@gmail.com> Trustworthy(c) 2009 2014 Bas van DijkBSD3 (see the file LICENSE)#Bas van Dijk <v.dijk.bas@gmail.com> TrustworthyZ456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Zz{|}~yxwopqrstuvnjklmi_`abcdefghVWXYZ[\]^RSTUOQPNIMLKJDHGFE@CBA<=>?8;:97654(c) 2009 2014 Bas van DijkBSD3 (see the file LICENSE)#Bas van Dijk <v.dijk.bas@gmail.com> Trustworthy( !"#$%&'()*+,-./0123(3210/.+-,$%&'()* #"!(c) 2009 2014 Bas van DijkBSD3 (see the file LICENSE)#Bas van Dijk <v.dijk.bas@gmail.com> Experimental TrustworthyG     G     (c) 2009 2014 Bas van DijkBSD3 (see the file LICENSE)#Bas van Dijk <v.dijk.bas@gmail.com> Trustworthy  !  !(c) 2009 2014 Bas van Dijk BSD-style (see the file LICENSE)#Bas van Dijk <v.dijk.bas@gmail.com>Safe"  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !(c) 2009 2014 Bas van DijkBSD3 (see the file LICENSE)#Bas van Dijk <v.dijk.bas@gmail.com> Trustworthy+ !Endpoint's synchronization frame.See: USB 2.0 Spec. table 9-7 See: USB 2.0 Spec. section 9.4.9 See: USB 2.0 Spec. section 9.4.7+This function is for testing purposes only!You should normally use System.USB.DeviceHandling.b because that function notifies the underlying operating system about the changed configuration. See: USB 2.0 Spec. section 9.4.2+This function is for testing purposes only!You should normally use System.USB.DeviceHandling.M because that functon may exploit operating system caches (no I/O involved). See: USB 2.0 Spec. section 9.4.1 See: USB 2.0 Spec. section 9.4.9NSee: USB 2.0 Spec. section 9.4.9 TODO: What about vendor-specific test modes? See: USB 2.0 Spec. section 9.4.4 See: USB 2.0 Spec. section 9.4.5 See: USB 2.0 Spec. section 9.4.5 See: USB 2.0 Spec. section 9.4.6PThis request is used to set and then report an endpoint's synchronization frame.1When 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.GIf 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                  ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` ` a b c c d e f g h i j k k l m n o p q r s t u u v w x y y z { | } ~                                                                       ! " # $ % & ' ()*+ , - .)/0)12 3)/4 5 6 7 8 9 :);<);=); > ? @ A B C D)EF GHIJHIKHILHIM NOPQRST U V)WX Y)Z[)Z\ ])^_ `Hab c d e f g h i j k l m n o p q r s)tu vHwx y)z{)z| } ~       !  %  &  '  C   A                                                                       usb-1.3.0.2System.USB.ExceptionsSystem.USB.IO.Transfers System.USB.IOSystem.USB.DescriptorsSystem.USB.DeviceHandlingSystem.USB.EnumerationSystem.USB.MiscSystem.USB.InitializationSystemEventManagerUtilsEventPollSystem.USB.Base System.USB$System.USB.IO.StandardDeviceRequests USBExceptionOtherExceptionNotSupportedExceptionNoMemExceptionInterruptedException PipeExceptionOverflowExceptionTimeoutException BusyExceptionNotFoundExceptionNoDeviceExceptionAccessExceptionInvalidParamException IOExceptionIsochronousWriteTransferIsochronousReadTransfer WriteTransfer ReadTransferRepeatableTransferTypeInterruptTransfer BulkTransferControlWriteTransferControlReadTransferControlTransferIndexValueRequest RecipientToOther ToEndpoint ToInterfaceToDevice RequestTypeVendorClassStandard ControlSetupcontrolSetupRequestTypecontrolSetupRecipientcontrolSetupRequestcontrolSetupValuecontrolSetupIndexStatusTimedOut CompletedTimeoutSizeWriteExactAction WriteActionReadExactAction ReadActionStrIx SubLangId PrimaryLangIdLangIdTransactionOpportunitiesTwoOneZero MaxPacketSize maxPacketSizetransactionOpportunitiesUsageImplicitFeedbackDataSynchronization SynchronousAdaptive AsynchronousNoSynchronization TransferType InterruptBulk IsochronousControlEndpointAttribsTransferDirectionInOutEndpointAddressendpointNumbertransferDirection EndpointDescendpointAddressendpointAttribsendpointMaxPacketSizeendpointIntervalendpointRefreshendpointSynchAddress endpointExtra InterfaceDescinterfaceNumberinterfaceAltSettinginterfaceClassinterfaceSubClassinterfaceProtocolinterfaceStrIxinterfaceEndpointsinterfaceExtra Interface DeviceStatus remoteWakeup selfPowered ConfigAttribs ConfigDesc configValue configStrIx configAttribsconfigMaxPowerconfigInterfaces configExtra ProductIdVendorId ReleaseNumber DeviceDescdeviceUSBSpecReleaseNumber deviceClassdeviceSubClassdeviceProtocoldeviceMaxPacketSize0deviceVendorIddeviceProductIddeviceReleaseNumberdeviceManufacturerStrIxdeviceProductStrIxdeviceSerialNumberStrIxdeviceNumConfigsInterfaceAltSettingInterfaceNumber ConfigValue DeviceHandle getDeviceSpeed SuperSpeed HighSpeed FullSpeedLowSpeedHotplugCallbackHandleCallbackRegistrationStatusDeregisterThisCallbackKeepCallbackRegisteredHotplugCallback HotplugFlag HotplugEventDevice CapabilitySupportsDetachKernelDriver HasHidAccess HasHotplug HasCapability LibusbVersionmajorminormicronanorc Verbosity PrintDebug PrintInfo PrintWarnings PrintErrors PrintNothingCtxnewCtxnewCtx'setDebug libusbVersion toVersion hasCapability getDevices deviceArrived deviceLeftmatchDeviceArrivedmatchDeviceLeft enumerateregisterHotplugCallbackderegisterHotplugCallback busNumber portNumber portNumbers deviceAddress deviceSpeed openDevice closeDevicewithDeviceHandle getConfig setConfigclaimInterfacereleaseInterfacewithClaimedInterfacesetInterfaceAltSetting clearHalt resetDevicesetAutoDetachKernelDriverkernelDriverActivedetachKernelDriverattachKernelDriverwithDetachedKernelDrivermaxIsoPacketSize getDeviceDesc getConfigDesc getLanguages getStrDescgetStrDescFirstLang noTimeoutcontrol readControlreadControlExact writeControlwriteControlExactreadBulk writeBulk readInterruptwriteInterruptreadIsochronouswriteIsochronousnewControlTransferperformControlTransfersetControlTransferDeviceHandlesetControlTransferTimeoutsetControlSetupgetControlTransferDeviceHandlegetControlTransferTimeoutnewControlReadTransferperformControlReadTransfer"setControlReadTransferDeviceHandlesetControlReadTransferTimeoutsetControlReadSetup"getControlReadTransferDeviceHandlegetControlReadTransferTimeoutnewControlWriteTransferperformControlWriteTransfer#setControlWriteTransferDeviceHandlesetControlWriteTransferTimeoutsetControlWriteSetup#getControlWriteTransferDeviceHandlegetControlWriteTransferTimeoutnewReadTransferperformReadTransfersetReadTransferTypesetReadTransferDeviceHandlesetReadTransferEndpointAddresssetReadTransferTimeoutsetReadTransferSizegetReadTransferTypegetReadTransferDeviceHandlegetReadTransferEndpointAddressgetReadTransferSizegetReadTransferTimeoutnewWriteTransferperformWriteTransfersetWriteTransferTypesetWriteTransferDeviceHandlesetWriteTransferEndpointAddresssetWriteTransferTimeoutsetWriteTransferInputgetWriteTransferTypegetWriteTransferDeviceHandlegetWriteTransferEndpointAddressgetWriteTransferInputgetWriteTransferTimeoutnewIsochronousReadTransferperformIsochronousReadTransfer&setIsochronousReadTransferDeviceHandle)setIsochronousReadTransferEndpointAddresssetIsochronousReadTransferSizes&getIsochronousReadTransferDeviceHandle)getIsochronousReadTransferEndpointAddressgetIsochronousReadTransferSizesnewIsochronousWriteTransferperformIsochronousWriteTransfer'setIsochronousWriteTransferDeviceHandle*setIsochronousWriteTransferEndpointAddress"setIsochronousWriteTransferPackets'getIsochronousWriteTransferDeviceHandle*getIsochronousWriteTransferEndpointAddress"getIsochronousWriteTransferPackets ioExceptionincompleteReadExceptionincompleteWriteExceptionbaseGHC.Event.ThreadgetSystemEventManagerbitsbetween genToEnumGHC.EnumtoEnumGHC.RealIntegral genFromEnumfromEnum mapPeekArray pokeVectorifM peekVector allocaPeekunconsGHC.Event.InternalevtWriteevtReadtoEvent transWaitWaitLock transDevHndlTransferThreadSafeTransferGHC.MVarMVarC'TransferTypebindings-libusb-1.4.5.0Bindings.Libusb.Descriptorsc'LIBUSB_TRANSFER_TYPE_CONTROL"c'LIBUSB_TRANSFER_TYPE_ISOCHRONOUSc'LIBUSB_TRANSFER_TYPE_BULK c'LIBUSB_TRANSFER_TYPE_INTERRUPTC'TransferFuncbytestring-0.10.4.0Data.ByteString.Internal ByteStringghc-prim GHC.TypesIOgetCtx libusb_initGHC.IO.Handle.FDstderrgetWait Data.MaybeNothingJust requireWait Data.VersionVersionwithDevHndlPtr&Bindings.Libusb.HandlingAndEnumerationC'libusb_device_handleunmarshalReleaseNumberunmarshalStrIxunmarshalEndpointAddressmarshalEndpointAddressstrDescHeaderSizecharSizeretrieveStrDescallocaTransfer withCallbacknewLockacquirereleaseinitIsoPacketDesc withTransPtrhandleUSBExceptioncheckUSBExceptionconvertUSBExceptionGHC.Errerrorlibusb_error_to_USBExceptionBindings.Libusb.MiscellaneousC'libusb_error$fMonoidHotplugFlag Data.Monoidmemptymappend$fMonoidHotplugEvent $fShowDeviceunIsochronousWriteTransferunIsochronousReadTransferunWriteTransferunReadTransferunControlWriteTransferunControlReadTransferunControlTransfertransForeignPtrtransBufferFinalizerIORef getDevHndlPtr unHotplugFlagunHotplugEvent getDevFrgnPtr ctxGetWait getCtxFrgnPtr withCtxPtrnewCtxNoEventManagermarshallVerbositymarshallCapability withDevicePtrmkDevisEventunmarshallSpeedconvertDeviceDescconvertConfigDescunmarshalConfigAttribsgetExtraconvertInterfaceconvertInterfaceDescconvertEndpointDescunmarshalEndpointAttribsunmarshalMaxPacketSizeunmarshalLangId marshalLangIdmarshallControlSetupmarshalRequestTypecontrolSetupSizecontrolEndpointcontrolTransferSyncreadTransferSyncwriteTransferSync transferSyncreadTransferAsyncwriteTransferAsync transferAsyncwithTerminatedTransfermallocTransfer getPacketsgetSizescopyIsosnewThreadSafeTransferperformThreadSafeTransfersetTransferPropertysetTransferTypesetTransferDeviceHandlesetTransferEndpointAddresssetTransferTimeoutgetTransferPropertygetTransferTypegetTransferDeviceHandlegetTransferEndpointAddressgetTransferTimeoutmarshallRepeatableTransferTypeunmarshalRepeatableTransferTypecreateAndTrimNoOffsetincompleteException moduleError thisModule$fExceptionUSBException$fShowDeviceHandle$fEqDeviceHandle $fEqDevice$fEqCtx FrameNumberTestModesetHaltclearRemoteWakeupsetRemoteWakeupsetStandardTestModegetInterfaceAltSettinggetDeviceStatusgetEndpointStatussetDeviceAddress synchFrameTest_Force_Enable Test_Packet Test_SE0_NAKTest_KTest_J haltFeatureremoteWakeupFeaturetestModeFeature