Core Types
USB types – defines enumerations that describe standard USB types
- class usb_construct.types.USBDirection(value)
Class representing USB directions.
- classmethod parse(value) USBDirection
Helper that converts a numeric field into a direction.
- classmethod from_request_type(request_type_int: int) USBDirection
Helper method that extracts the direction from a request_type integer.
- classmethod from_endpoint_address(address: int) USBDirection
Helper method that extracts the direction from an endpoint address.
- token() USBPacketID
Generates the token corresponding to the given direction.
- class usb_construct.types.USBPIDCategory(value)
Category constants for each of the groups that PIDs can fall under.
- class usb_construct.types.USBPacketID(value)
Enumeration specifying all of the valid USB PIDs we can handle.
- classmethod from_byte(byte: Iterable[SupportsIndex] | SupportsBytes, skip_checks: bool = False) USBPacketID
Creates a PID object from a byte.
- classmethod from_int(value: int, skip_checks: bool = True) USBPacketID
Create a PID object from an integer.
- classmethod from_name(name: str) USBPacketID
Create a PID object from a string representation of its name.
- classmethod parse(value: bytes | str | int) USBPacketID
Attempt to create a PID object from a number, byte, or string.
- category() USBPIDCategory
Returns the USBPIDCategory that each given PID belongs to.
- class usb_construct.types.USBRequestRecipient(value)
Enumeration that describes each ‘recipient’ of a USB request field.
- classmethod from_integer(value: int) USBRequestRecipient
Special factory that correctly handles reserved values.
- classmethod from_request_type(request_type_int: int) USBRequestRecipient
Helper method that extracts the type from a request_type integer.
- class usb_construct.types.USBRequestType(value)
Enumeration that describes each possible Type field for a USB request.
- classmethod from_request_type(request_type_int: int) USBRequestType
Helper method that extracts the type from a request_type integer.
- class usb_construct.types.USBTransferType(value)
An enumeration.
- class usb_construct.types.LanguageIDs(value)
An enumeration.
- class usb_construct.types.DescriptorTypes(value)
An enumeration.
- class usb_construct.types.USBSynchronizationType(value)
An enumeration.
- class usb_construct.types.USBUsageType(value)
An enumeration.
- class usb_construct.types.USBStandardRequests(value)
An enumeration.