hwtLib.peripheral.usb.sim package¶
Subpackages¶
- hwtLib.peripheral.usb.sim.usbip package
- Submodules
- hwtLib.peripheral.usb.sim.usbip.connection module
USBIPConnectionUSBIPConnection.OP_COMMONUSBIPConnection.OP_COMMON_SIZEUSBIPConnection.OP_SUBMITUSBIPConnection.OP_SUBMIT_SIZEUSBIPConnection.__init__()USBIPConnection.connection()USBIPConnection.debug_log()USBIPConnection.getDeviceList()USBIPConnection.handle_op_devlist()USBIPConnection.handle_op_import()USBIPConnection.handle_packet()USBIPConnection.handle_urb_submit()USBIPConnection.handle_urb_unlink()USBIPConnection.make_usbip_header_basic()USBIPConnection.pack_device_desc()USBIPConnection.usbip_ret_submit()
USBIPProtocolErrorException
- hwtLib.peripheral.usb.sim.usbip.constants module
- hwtLib.peripheral.usb.sim.usbip.device module
LIBUSB_TRANSFER_STATUSUSBIPDeviceUSBIPOperationPromiseUSBIPPendingUSBIPSimDeviceUSBIPSimDevice.__init__()USBIPSimDevice.close()USBIPSimDevice.controlRead()USBIPSimDevice.controlWrite()USBIPSimDevice.getBusNumber()USBIPSimDevice.getDevice()USBIPSimDevice.getDeviceAddress()USBIPSimDevice.getDeviceClass()USBIPSimDevice.getDeviceProtocol()USBIPSimDevice.getDeviceSpeed()USBIPSimDevice.getDeviceSubClass()USBIPSimDevice.getNumConfigurations()USBIPSimDevice.getProductID()USBIPSimDevice.getTransfer()USBIPSimDevice.getVendorID()USBIPSimDevice.getbcdDevice()USBIPSimDevice.iterConfigurations()USBIPSimDevice.open()
USBIPSimDeviceConfiguration.getConfigurationValue()USBIPSimDeviceConfiguration.getNumInterfaces()USBIPSimDeviceConfiguration.iterInterfaces()USBIPSimDeviceInterface.iterSettings()USBIPSimDeviceInterfaceSettingUSBIPTransfer
- hwtLib.peripheral.usb.sim.usbip.server module
- hwtLib.peripheral.usb.sim.usbip.session_recorder module
UsbipServerReplayerUsbipServerSessionRecordercut_off_empty_time_segments()filter_empty_in()
Submodules¶
hwtLib.peripheral.usb.sim.agent_base module¶
- class hwtLib.peripheral.usb.sim.agent_base.UsbAgent(rx: Deque[UsbPacketToken | UsbPacketData | UsbPacketHandshake], tx: Deque[UsbPacketToken | UsbPacketData | UsbPacketHandshake])[source]¶
Bases:
object- __init__(rx: Deque[UsbPacketToken | UsbPacketData | UsbPacketHandshake], tx: Deque[UsbPacketToken | UsbPacketData | UsbPacketHandshake])[source]¶
- deparse_packet(p)[source]¶
Called to convert the packet from types supported by this class before putting into tx/rx queue
- class hwtLib.peripheral.usb.sim.agent_base.UsbPacketData(pid: int, data: List[int])[source]¶
Bases:
object
- class hwtLib.peripheral.usb.sim.agent_base.UsbPacketToken(pid: USB_PID, addr: int, endp: int)[source]¶
Bases:
object- Note:
bits of individual items are sent in LSB first but the items of the packet are sent in the oreder defined by structure of the packet
- classmethod from_pid_and_body_bytes(pid: int, addr_ep_crc_byte_list: HBitsConst | List[HBitsConst])[source]¶
hwtLib.peripheral.usb.sim.usb_agent_device module¶
- class hwtLib.peripheral.usb.sim.usb_agent_device.UsbDevAgent(rx: Deque[UsbPacketToken | UsbPacketData], tx: Deque[UsbPacketToken | UsbPacketData], descriptors: UsbDescriptorBundle)[source]¶
Bases:
UsbAgentThis agent uses rx and tx queue to comunicate with a USB device. The agnet implements address assignment and descriptor upload and it is meant to be extended with a specific functionality of USB device.
- __annotations__ = {}¶
- __init__(rx: Deque[UsbPacketToken | UsbPacketData], tx: Deque[UsbPacketToken | UsbPacketData], descriptors: UsbDescriptorBundle)[source]¶
hwtLib.peripheral.usb.sim.usb_agent_host module¶
- class hwtLib.peripheral.usb.sim.usb_agent_host.UsbHostAgent(rx: Deque[UsbPacketToken | UsbPacketData | UsbPacketHandshake], tx: Deque[UsbPacketToken | UsbPacketData | UsbPacketHandshake])[source]¶
Bases:
UsbAgentThis agent uses rx and tx queue to comunicate with a USB device. It performs bus enumerations, sets address to a device and downloads the descriptors. Note that the agent is written in a way which allows for easy extension to a driver which can parse the specific descriptors and comunicate with devices further.
- __annotations__ = {}¶
- __init__(rx: Deque[UsbPacketToken | UsbPacketData | UsbPacketHandshake], tx: Deque[UsbPacketToken | UsbPacketData | UsbPacketHandshake])[source]¶
- control_read(addr, bmRequestType_type: USB_REQUEST_TYPE_TYPE, bRequest: int, wValue: int, wIndex: int, wLength: int, bmRequestType_recipient: USB_REQUEST_TYPE_RECIPIENT = 0, bmRequestType_data_transfer_direction: USB_REQUEST_TYPE_DIRECTION = 1)[source]¶
- control_write(addr: int, ep: int, bmRequestType_type: USB_REQUEST_TYPE_TYPE, bRequest: int, wValue: int, wIndex: int, buff: List[int], bmRequestType_recipient: USB_REQUEST_TYPE_RECIPIENT = 0, bmRequestType_data_transfer_direction: USB_REQUEST_TYPE_DIRECTION = 0)[source]¶
- download_descriptor(addr: int, descriptor_t: HStruct | str, index: int, wIndex: int = 0, wLength: int | None = <class 'hwt.constants.NOT_SPECIFIED'>)[source]¶
- get_max_packet_size(addr: int, endp: int, direction: USB_ENDPOINT_DIR)[source]¶
- parse_interface_functional_descriptor(interface_descr: HStructConstBase, data: HBitsConst)[source]¶