Skip to content

Commit d566e58

Browse files
committed
client: use digital input protocol for io get
Resolve labgrid-client io get via DigitalInputProtocol when a matching driver is configured. This allows input-only drivers to use the existing io command. Keep the existing NetworkSysfsGPIO fallback on GpioDigitalOutputDriver so resource-only configurations continue to behave as before. Co-developed-by: Felix Zwettler <Felix.Zwettler@duagon.com> Signed-off-by: Felix Zwettler <Felix.Zwettler@duagon.com> Signed-off-by: Ozan Durgut <ozan.durgut@analog.com>
1 parent fd14ffe commit d566e58

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

labgrid/remote/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,10 @@ def digital_io(self):
991991

992992
drv = None
993993
try:
994-
drv = target.get_driver("DigitalOutputProtocol", name=name)
994+
if action == "get":
995+
drv = target.get_driver("DigitalInputProtocol", name=name)
996+
else:
997+
drv = target.get_driver("DigitalOutputProtocol", name=name)
995998
except NoDriverFoundError:
996999
for resource in target.resources:
9971000
if name and resource.name != name:

0 commit comments

Comments
 (0)