diff --git a/doc/configuration.rst b/doc/configuration.rst index f70bf2b66..5b7910f0a 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -641,6 +641,23 @@ device available on a remote computer. The NetworkUSBMassStorage can be used in test cases by calling the ``write_files()``, ``write_image()``, and ``get_size()`` functions. +GenericUSBPort +~~~~~~~~~~~~~~ +A :any:`GenericUSBPort` resource describes a generic USB device, that has no +specific driver yet. Useful if your DUT creates its own USB endpoint, that you +want to test. + +.. code-block:: yaml + + GenericUSBPort: + match: + ID_PATH: pci-0000:3c:00.0-usb-0:1.2:1.0 + +NetworkGenericUSBPort +~~~~~~~~~~~~~~~~~~~ +A :any:`NetworkGenericUSBPort` describes a `GenericUSBPort`_ available on a remote +computer. + SigrokDevice ~~~~~~~~~~~~ A :any:`SigrokDevice` resource describes a *Sigrok* device. To select a diff --git a/labgrid/remote/exporter.py b/labgrid/remote/exporter.py index 86a261c92..ebc666bc7 100755 --- a/labgrid/remote/exporter.py +++ b/labgrid/remote/exporter.py @@ -550,6 +550,7 @@ def __attrs_post_init__(self): exports["USBSDWireDevice"] = USBSDWireExport exports["USBDebugger"] = USBGenericExport +exports["GenericUSBPort"] = USBGenericExport exports["USBMassStorage"] = USBGenericExport exports["USBVideo"] = USBGenericExport exports["USBAudioInput"] = USBAudioInputExport diff --git a/labgrid/resource/__init__.py b/labgrid/resource/__init__.py index dd7554dff..a86a952bf 100644 --- a/labgrid/resource/__init__.py +++ b/labgrid/resource/__init__.py @@ -12,6 +12,7 @@ AndroidUSBFastboot, DFUDevice, DeditecRelais8, + GenericUSBPort, HIDRelay, IMXUSBLoader, LXAUSBMux, diff --git a/labgrid/resource/remote.py b/labgrid/resource/remote.py index b8adb2524..aad343833 100644 --- a/labgrid/resource/remote.py +++ b/labgrid/resource/remote.py @@ -294,6 +294,15 @@ def __attrs_post_init__(self): super().__attrs_post_init__() +@target_factory.reg_resource +@attr.s(eq=False) +class NetworkGenericUSBPort(RemoteUSBResource): + """The NetworkGenericUSBPort describes a remotely accessible USB device""" + def __attrs_post_init__(self): + self.timeout = 10.0 + super().__attrs_post_init__() + + @target_factory.reg_resource @attr.s(eq=False) class NetworkUSBDebugger(RemoteUSBResource): diff --git a/labgrid/resource/udev.py b/labgrid/resource/udev.py index 54c6a9fd3..fe1ae2090 100644 --- a/labgrid/resource/udev.py +++ b/labgrid/resource/udev.py @@ -228,6 +228,12 @@ def read_attr(self, attribute): return None +@target_factory.reg_resource +@attr.s(eq=False) +class GenericUSBPort(USBResource): + pass + + @target_factory.reg_resource @attr.s(eq=False) class USBSerialPort(USBResource, SerialPort):