Skip to content

Commit 9923f40

Browse files
authored
Merge pull request #1548 from jluebbe/usbhub-resource
add USBHub resource and export
2 parents a718045 + 68e6fa3 commit 9923f40

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

doc/configuration.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,27 @@ Arguments:
12221222
Used by:
12231223
- `HTTPVideoDriver`_
12241224

1225+
USBHub
1226+
~~~~~~
1227+
1228+
A :any:`USBHub` resource describes an USB hub.
1229+
There is no corresponding driver, as this resource is only useful to monitor
1230+
whether the expected USB hubs are detected by an exporter.
1231+
To control individual ports, use `USBPowerPort`_.
1232+
1233+
.. code-block:: yaml
1234+
1235+
USBHub:
1236+
match:
1237+
ID_PATH: 'pci-0000:02:00.0-usb-0:4:1.0'
1238+
1239+
1240+
Arguments:
1241+
- match (dict): key and value pairs for a udev match, see `udev Matching`_
1242+
1243+
Used by:
1244+
- none
1245+
12251246
Providers
12261247
~~~~~~~~~
12271248
Providers describe directories that are accessible by the target over a

labgrid/remote/exporter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ def __attrs_post_init__(self):
549549
exports["USBSDMuxDevice"] = USBSDMuxExport
550550
exports["USBSDWireDevice"] = USBSDWireExport
551551
exports["USBDebugger"] = USBGenericExport
552-
552+
exports["USBHub"] = USBGenericRemoteExport
553553
exports["USBMassStorage"] = USBGenericExport
554554
exports["USBVideo"] = USBGenericExport
555555
exports["USBAudioInput"] = USBAudioInputExport

labgrid/resource/udev.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,20 @@ def update(self):
542542
def path(self):
543543
return self.disk_path
544544

545+
546+
@target_factory.reg_resource
547+
@attr.s(eq=False)
548+
class USBHub(USBResource):
549+
"""The USBHub describes a USB hub.
550+
551+
This is mainly useful to monitor if all expected hubs are detected.
552+
"""
553+
def __attrs_post_init__(self):
554+
self.match['DEVTYPE'] = 'usb_interface'
555+
self.match['DRIVER'] = 'hub'
556+
super().__attrs_post_init__()
557+
558+
545559
@target_factory.reg_resource
546560
@attr.s(eq=False)
547561
class USBPowerPort(USBResource):

0 commit comments

Comments
 (0)