| |
- __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
|
|