usb
index
/opt/lib/python2.5/site-packages/usb.so

USB access module

 
Classes
       
__builtin__.object
Bus
Configuration
Device
DeviceHandle
Endpoint
Interface
exceptions.IOError(exceptions.EnvironmentError)
USBError

 
class Bus(__builtin__.object)
    Bus object
 
  Data descriptors defined here:
devices
Tuple with the bus devices
dirname
location

Data and other attributes defined here:
__new__ = <built-in method __new__ of type object at 0x404b62d4>
T.__new__(S, ...) -> a new object with type S, a subtype of T

 
class Configuration(__builtin__.object)
    Configuration descriptor object
 
  Data descriptors defined here:
iConfiguration
Index to a string that describes the
configuration.
interfaces
Tuple with a tuple of the configuration interfaces.
Each element represents a sequence of the
alternate settings for each interface.
maxPower
Specifies the device current. This is the absolute value,
already multiplied by 2
remoteWakeup
True if the device supports remote wakeup feature.
selfPowered
True if the device is self powered.
totalLength
The number of data bytes that the device returns,
including the bytes for all of the configuration's interfaces and
endpoints.
value
Identifies the configuration.

Data and other attributes defined here:
__new__ = <built-in method __new__ of type object at 0x404b6454>
T.__new__(S, ...) -> a new object with type S, a subtype of T

 
class Device(__builtin__.object)
    Device descriptor object
 
  Methods defined here:
open(...)
open() -> DeviceHandle
 
Open the device for use.
Returns a DeviceHandle object.

Data descriptors defined here:
configurations
Tuple with the device configurations.
deviceClass
For devices that belong to a class, this field may
name the class.
deviceProtocol
This field may specify a protocol defined by the
selected class or subclass.
deviceSubClass
For devices that belong to a class, this field may
specify a subclass within the class.
deviceVersion
String containing the device's release number.
filename
iManufacturer
An index that points to a string describing the
manufacturer.
iProduct
An index that points to a string describing the product.
iSerialNumber
An index that points to a string containing the
device's serial number.
idProduct
The manufacturer assigns a Product ID to identify the
device.
idVendor
Unique vendor identifier.
maxPacketSize
The maximum packet size for Endpoint 0.
usbVersion
String containing the USB specification number that
the device and its descriptors comply with.

Data and other attributes defined here:
__new__ = <built-in method __new__ of type object at 0x404b6394>
T.__new__(S, ...) -> a new object with type S, a subtype of T

 
class DeviceHandle(__builtin__.object)
    DeviceHandle object
 
  Methods defined here:
bulkRead(...)
bulkRead(endpoint, size, timeout=100) -> buffer
 
Performs a bulk read request to the endpoint specified.
Arguments:
        endpoint: endpoint number.
        size: number of bytes to read.
        timeout: operation timeout in miliseconds. (default: 100)
Returns a tuple with the data read.
bulkWrite(...)
bulkWrite(endpoint, buffer, timeout=100) -> bytesWritten
 
Performs a bulk write request to the endpoint specified.
Arguments:
        endpoint: endpoint number.
        buffer: sequence data buffer to write.
              This parameter can be any sequence type
        timeout: operation timeout in miliseconds. (default: 100)
Returns the number of bytes written.
claimInterface(...)
claimInterface(interface) -> None
 
Claims the interface with the Operating System.
Arguments:
        interface: interface number or an Interface object.
clearHalt(...)
clearHalt(endpoint) -> None
 
Clears any halt status on the specified endpoint.
Arguments:
        endpoint: endpoint number.
controlMsg(...)
controlMsg(requestType, request, buffer, value=0, index=0, timeout=100) -> bytesWritten|buffer
 
Performs a control request to the default control pipe on a device.
Arguments:
        requestType: specifies the direction of data flow, the type
                     of request, and the recipient.
        request: specifies the request.
        buffer: if the transfer is a write transfer, buffer is a sequence 
                with the transfer data, otherwise, buffer is the number of
                bytes to read.
        value: specific information to pass to the device. (default: 0)
        index: specific information to pass to the device. (default: 0)
        timeout: operation timeout in miliseconds. (default: 100)
Returns the number of bytes written.
detachKernelDriver(...)
detachKernelDriver(interface) -> None
 
Detaches a kernel driver from the interface (if one is attached,
we have permission and the operation is supported by the OS)
Arguments:
        interface: interface number or an Interface object.
getDescriptor(...)
getDescriptor(type, index, len, endpoint = -1) -> descriptor
 
Retrieves a descriptor from the device identified by the type
and index of the descriptor.
Arguments:
        type: descriptor type.
        index: index of the descriptor.
        len: descriptor length.
        endpoint: endpoint number from descriptor is read. If it is
                  omitted, the descriptor is read from default control pipe.
getString(...)
getString(index, len, langid = -1) -> string
 
Retrieves the string descriptor specified by index
and langid from a device.
Arguments:
        index: index of descriptor in the device.
        len: number of bytes of the string
        langid: Language ID. If it is omittedi, will be
                used the first language.
interruptRead(...)
interruptRead(endpoint, size, timeout=100) -> buffer
 
Performs a interrupt read request to the endpoint specified.
Arguments:
        endpoint: endpoint number.
        size: number of bytes to read.
        timeout: operation timeout in miliseconds. (default: 100)
Returns a tuple with the data read.
interruptWrite(...)
interruptWrite(endpoint, buffer, timeout=100) -> bytesWritten
 
Performs a interrupt write request to the endpoint specified.
Arguments:
        endpoint: endpoint number.
        buffer: sequence data buffer to write.
              This parameter can be any sequence type
        timeout: operation timeout in miliseconds. (default: 100)
Returns the number of bytes written.
releaseInterface(...)
releaseInterface() -> None
 
Releases an interface previously claimed with claimInterface.
reset(...)
reset() -> None
 
Resets the specified device by sending a RESET
down the port it is connected to.
resetEndpoint(...)
resetEndpoint(endpoint) -> None
 
Resets all state (like toggles) for the specified endpoint.
Arguments:
        endpoint: endpoint number.
setAltInterface(...)
setAltInterface(alternate) -> None
 
Sets the active alternate setting of the current interface.
Arguments:
        alternate: an alternate setting number or an Interface object.
setConfiguration(...)
setConfiguration(configuration) -> None
 
Sets the active configuration of a device.
Arguments:
        configuration: a configuration value or a Configuration object.

Data and other attributes defined here:
__new__ = <built-in method __new__ of type object at 0x404b6214>
T.__new__(S, ...) -> a new object with type S, a subtype of T

 
class Endpoint(__builtin__.object)
    Endpoint descriptor object
 
  Data descriptors defined here:
address
Contains the endpoint address.
interval
The maximum latency for polling interrupt endpoints, or
the interval for polling isochronous endpoints, or the maximum NAK
rate for high-speed bulk OUT or control endpoints.
maxPacketSize
The maximum number of data bytes the endpoint
can transfer in a transaction.
type
It contains one of the following values, 
indicating the endpoint transfer type:
        ENDPOINT_TYPE_CONTROL
        ENDPOINT_TYPE_ISOCHRONOUS
        ENDPOINT_TYPE_BULK
        ENDPOINT_TYPE_INTERRUPT

Data and other attributes defined here:
__new__ = <built-in method __new__ of type object at 0x404b65d4>
T.__new__(S, ...) -> a new object with type S, a subtype of T

 
class Interface(__builtin__.object)
    Interface descriptor object
 
  Data descriptors defined here:
alternateSetting
Alternate setting number.
endpoints
Tuple with interface endpoints.
interfaceClass
Similar to DeviceClass in the device descriptor, but
for devices with a class specified by the interface.
interfaceNumber
Identifies the interface.
interfaceProtocol
Similar to bDeviceProtocol in the device
descriptor, but for devices whose class is defined by the interface.
interfaceSubClass
Similar to bDeviceSubClass in the device
descriptor, but for devices with a class defined by the interface.

Data and other attributes defined here:
__new__ = <built-in method __new__ of type object at 0x404b6514>
T.__new__(S, ...) -> a new object with type S, a subtype of T

 
class USBError(exceptions.IOError)
    
Method resolution order:
USBError
exceptions.IOError
exceptions.EnvironmentError
exceptions.StandardError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.IOError:
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Data and other attributes inherited from exceptions.IOError:
__new__ = <built-in method __new__ of type object at 0x401189b4>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.EnvironmentError:
__reduce__(...)
__str__(...)
x.__str__() <==> str(x)

Data descriptors inherited from exceptions.EnvironmentError:
errno
exception errno
filename
exception filename
message
exception message
strerror
exception strerror

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args

 
Functions
       
busses(...)
Returns a tuple with the usb busses

 
Data
        CLASS_AUDIO = 1
CLASS_COMM = 2
CLASS_DATA = 10
CLASS_HID = 3
CLASS_HUB = 9
CLASS_MASS_STORAGE = 8
CLASS_PER_INTERFACE = 0
CLASS_PRINTER = 7
CLASS_VENDOR_SPEC = 255
DT_CONFIG = 2
DT_CONFIG_SIZE = 9
DT_DEVICE = 1
DT_DEVICE_SIZE = 18
DT_ENDPOINT = 5
DT_ENDPOINT_AUDIO_SIZE = 9
DT_ENDPOINT_SIZE = 7
DT_HID = 33
DT_HUB = 41
DT_HUB_NONVAR_SIZE = 7
DT_INTERFACE = 4
DT_INTERFACE_SIZE = 9
DT_PHYSICAL = 35
DT_REPORT = 34
DT_STRING = 3
ENDPOINT_ADDRESS_MASK = 15
ENDPOINT_DIR_MASK = 128
ENDPOINT_IN = 128
ENDPOINT_OUT = 0
ENDPOINT_TYPE_BULK = 2
ENDPOINT_TYPE_CONTROL = 0
ENDPOINT_TYPE_INTERRUPT = 3
ENDPOINT_TYPE_ISOCHRONOUS = 1
ENDPOINT_TYPE_MASK = 3
ERROR_BEGIN = 500000
MAXALTSETTING = 128
MAXCONFIG = 8
MAXENDPOINTS = 32
MAXINTERFACES = 32
RECIP_DEVICE = 0
RECIP_ENDPOINT = 2
RECIP_INTERFACE = 1
RECIP_OTHER = 3
REQ_CLEAR_FEATURE = 1
REQ_GET_CONFIGURATION = 8
REQ_GET_DESCRIPTOR = 6
REQ_GET_INTERFACE = 10
REQ_GET_STATUS = 0
REQ_SET_ADDRESS = 5
REQ_SET_CONFIGURATION = 9
REQ_SET_DESCRIPTOR = 7
REQ_SET_FEATURE = 3
REQ_SET_INTERFACE = 11
REQ_SYNCH_FRAME = 12
TYPE_CLASS = 32
TYPE_RESERVED = 96
TYPE_STANDARD = 0
TYPE_VENDOR = 64