itchcraft.backend ================= .. py:module:: itchcraft.backend .. autoapi-nested-parse:: USB backend management Classes ------- .. autoapisummary:: itchcraft.backend.BulkTransferDevice itchcraft.backend.UsbBulkTransferDevice Module Contents --------------- .. py:class:: BulkTransferDevice Bases: :py:obj:`abc.ABC` Abstract base class for USB devices with two bulk transfer endpoints. .. py:method:: bulk_transfer(request) :abstractmethod: Sends a payload via USB bulk transfer and waits for a response from the device. :param `request`: the request payload from the host. :return: the response received from the device. .. py:property:: product_name :type: Optional[str] :abstractmethod: Product name of the device that this backend represents. .. py:property:: serial_number :type: Optional[str] :abstractmethod: Serial number of the device that this backend represents. .. py:class:: UsbBulkTransferDevice(device) Bases: :py:obj:`BulkTransferDevice` USB device with two bulk transfer endpoints. :param device: the PyUSB device with which to initiate the bulk transfer. .. py:attribute:: MAX_RESPONSE_LENGTH :value: 12 .. py:attribute:: device :type: usb.core.Device .. py:attribute:: endpoint_out :type: usb.core.Endpoint .. py:attribute:: endpoint_in :type: usb.core.Endpoint .. py:method:: bulk_transfer(request) Sends a payload via USB bulk transfer and waits for a response from the device. :param `request`: the request payload from the host. :return: the response received from the device. .. py:property:: product_name :type: Optional[str] Product name of the device that this backend represents. .. py:property:: serial_number :type: Optional[str] Serial number of the device that this backend represents.