labgrid.util.agents package

Submodules

labgrid.util.agents.deditec_relais8 module

This module implements the communication protocol to switch the digital outputs on the Deditec Relais8 board.

Supported modules:

  • Relais8

Supported Functionality:

  • Turn digital output on and off

class labgrid.util.agents.deditec_relais8.Relais8(**args)[source]

Bases: object

__init__(**args)[source]
read(size)[source]
write_config_request(address)[source]
write(data)[source]
set_all_outputs(status, reset=False)[source]
set_output(number, status)[source]
get_output(number)[source]
__del__()[source]
__dict__ = mappingproxy({'__module__': 'labgrid.util.agents.deditec_relais8', '_padding': 'FEFEFEFEFEFEFEFEFF', '_post_padding': '000000', '_configuration_sequence': ['3430FF', '3434FF', '34C0FF', '3400FF', '3402FF', '340CFF', '340EFF', '3404FF', '3406FF', '3408FF', '340AFF', '3410FF', '3412FF', '3414FF', '3416FF', '34F4FF', '34F5FF', '34F6FF', '34F7FF', '34F0FF', '34ECFF'], '__init__': <function Relais8.__init__>, '_run_configuration_sequence': <function Relais8._run_configuration_sequence>, 'read': <function Relais8.read>, 'write_config_request': <function Relais8.write_config_request>, 'write': <function Relais8.write>, 'set_all_outputs': <function Relais8.set_all_outputs>, 'set_output': <function Relais8.set_output>, 'get_output': <function Relais8.get_output>, '__del__': <function Relais8.__del__>, '__dict__': <attribute '__dict__' of 'Relais8' objects>, '__weakref__': <attribute '__weakref__' of 'Relais8' objects>, '__doc__': None, '__annotations__': {}})
__module__ = 'labgrid.util.agents.deditec_relais8'
__weakref__

list of weak references to the object (if defined)

labgrid.util.agents.deditec_relais8.handle_set(busnum, devnum, number, status)[source]
labgrid.util.agents.deditec_relais8.handle_get(busnum, devnum, number)[source]

labgrid.util.agents.dummy module

labgrid.util.agents.dummy.handle_neg(value)[source]

labgrid.util.agents.network_interface module

class labgrid.util.agents.network_interface.Future[source]

Bases: object

__init__()[source]
set(result)[source]
wait()[source]
__dict__ = mappingproxy({'__module__': 'labgrid.util.agents.network_interface', '__init__': <function Future.__init__>, 'set': <function Future.set>, 'wait': <function Future.wait>, '__dict__': <attribute '__dict__' of 'Future' objects>, '__weakref__': <attribute '__weakref__' of 'Future' objects>, '__doc__': None, '__annotations__': {}})
__module__ = 'labgrid.util.agents.network_interface'
__weakref__

list of weak references to the object (if defined)

class labgrid.util.agents.network_interface.BackgroundLoop[source]

Bases: Thread

__init__()[source]

This constructor should always be called with keyword arguments. Arguments are:

group should be None; reserved for future extension when a ThreadGroup class is implemented.

target is the callable object to be invoked by the run() method. Defaults to None, meaning nothing is called.

name is the thread name. By default, a unique name is constructed of the form “Thread-N” where N is a small decimal number.

args is a list or tuple of arguments for the target invocation. Defaults to ().

kwargs is a dictionary of keyword arguments for the target invocation. Defaults to {}.

If a subclass overrides the constructor, it must make sure to invoke the base class constructor (Thread.__init__()) before doing anything else to the thread.

run()[source]

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

block_on(func, *args, **kwargs)[source]
__module__ = 'labgrid.util.agents.network_interface'
labgrid.util.agents.network_interface.address_from_str(s)[source]
labgrid.util.agents.network_interface.connection_from_dict(data)[source]
class labgrid.util.agents.network_interface.NMDev(interface)[source]

Bases: object

__init__(interface)[source]
get_settings()[source]
get_active_settings()[source]
configure(data)[source]
wait_state(expected, timeout)[source]
disable()[source]
get_state()[source]
request_scan()[source]
get_access_points(scan)[source]
get_dhcpd_leases()[source]
__dict__ = mappingproxy({'__module__': 'labgrid.util.agents.network_interface', '__init__': <function NMDev.__init__>, '_delete_connection': <function NMDev._delete_connection>, 'get_settings': <function NMDev.get_settings>, 'get_active_settings': <function NMDev.get_active_settings>, 'configure': <function NMDev.configure>, 'wait_state': <function NMDev.wait_state>, 'disable': <function NMDev.disable>, '_flags_to_str': <function NMDev._flags_to_str>, '_accesspoint_to_dict': <function NMDev._accesspoint_to_dict>, 'get_state': <function NMDev.get_state>, 'request_scan': <function NMDev.request_scan>, 'get_access_points': <function NMDev.get_access_points>, 'get_dhcpd_leases': <function NMDev.get_dhcpd_leases>, '__dict__': <attribute '__dict__' of 'NMDev' objects>, '__weakref__': <attribute '__weakref__' of 'NMDev' objects>, '__doc__': None, '__annotations__': {}})
__module__ = 'labgrid.util.agents.network_interface'
__weakref__

list of weak references to the object (if defined)

labgrid.util.agents.network_interface.handle_configure(interface, settings)[source]
labgrid.util.agents.network_interface.handle_wait_state(interface, expected, timeout=60)[source]
labgrid.util.agents.network_interface.handle_disable(interface)[source]
labgrid.util.agents.network_interface.handle_get_active_settings(interface)[source]
labgrid.util.agents.network_interface.handle_get_settings(interface)[source]
labgrid.util.agents.network_interface.handle_get_state(interface)[source]
labgrid.util.agents.network_interface.handle_get_dhcpd_leases(interface)[source]
labgrid.util.agents.network_interface.handle_request_scan(interface)[source]
labgrid.util.agents.network_interface.handle_get_access_points(interface, scan=None)[source]

labgrid.util.agents.sysfsgpio module

This module implements switching GPIOs via sysfs GPIO kernel interface.

Takes an integer property ‘index’ which refers to the already exported GPIO device.

class labgrid.util.agents.sysfsgpio.GpioDigitalOutput(index)[source]

Bases: object

__init__(index)[source]
__del__()[source]
get()[source]
set(status)[source]
__dict__ = mappingproxy({'__module__': 'labgrid.util.agents.sysfsgpio', '_gpio_sysfs_path_prefix': '/sys/class/gpio', '_assert_gpio_line_is_exported': <staticmethod(<function GpioDigitalOutput._assert_gpio_line_is_exported>)>, '__init__': <function GpioDigitalOutput.__init__>, '__del__': <function GpioDigitalOutput.__del__>, 'get': <function GpioDigitalOutput.get>, 'set': <function GpioDigitalOutput.set>, '__dict__': <attribute '__dict__' of 'GpioDigitalOutput' objects>, '__weakref__': <attribute '__weakref__' of 'GpioDigitalOutput' objects>, '__doc__': None, '__annotations__': {}})
__module__ = 'labgrid.util.agents.sysfsgpio'
__weakref__

list of weak references to the object (if defined)

labgrid.util.agents.sysfsgpio.handle_set(index, status)[source]
labgrid.util.agents.sysfsgpio.handle_get(index)[source]

labgrid.util.agents.udisks2 module

This module implements mounting file systems via communication with udisksd.

class labgrid.util.agents.udisks2.UDisks2Device(devpath)[source]

Bases: object

UNMOUNT_MAX_RETRIES = 5
UNMOUNT_BUSY_WAIT = 3
__init__(devpath)[source]
mount(readonly=False)[source]
unmount(lazy=False)[source]
__dict__ = mappingproxy({'__module__': 'labgrid.util.agents.udisks2', 'UNMOUNT_MAX_RETRIES': 5, 'UNMOUNT_BUSY_WAIT': 3, '__init__': <function UDisks2Device.__init__>, 'mount': <function UDisks2Device.mount>, '_unmount_lazy': <function UDisks2Device._unmount_lazy>, '_unmount': <function UDisks2Device._unmount>, 'unmount': <function UDisks2Device.unmount>, '__dict__': <attribute '__dict__' of 'UDisks2Device' objects>, '__weakref__': <attribute '__weakref__' of 'UDisks2Device' objects>, '__doc__': None, '__annotations__': {}})
__module__ = 'labgrid.util.agents.udisks2'
__weakref__

list of weak references to the object (if defined)

labgrid.util.agents.udisks2.handle_mount(devpath)[source]
labgrid.util.agents.udisks2.handle_unmount(devpath, lazy=False)[source]

labgrid.util.agents.usb_hid_relay module

This module implements the communication protocol to switch the digital outputs on a “dcttech” USB Relay.

Supported modules:

  • USBRelay2 (and likely others)

Supported Functionality:

  • Turn digital output on and off

class labgrid.util.agents.usb_hid_relay.USBHIDRelay(**args)[source]

Bases: object

__init__(**args)[source]
set_output(number, status)[source]
get_output(number)[source]
__del__()[source]
__dict__ = mappingproxy({'__module__': 'labgrid.util.agents.usb_hid_relay', '__init__': <function USBHIDRelay.__init__>, 'set_output': <function USBHIDRelay.set_output>, 'get_output': <function USBHIDRelay.get_output>, '__del__': <function USBHIDRelay.__del__>, '__dict__': <attribute '__dict__' of 'USBHIDRelay' objects>, '__weakref__': <attribute '__weakref__' of 'USBHIDRelay' objects>, '__doc__': None, '__annotations__': {}})
__module__ = 'labgrid.util.agents.usb_hid_relay'
__weakref__

list of weak references to the object (if defined)

labgrid.util.agents.usb_hid_relay.handle_set(busnum, devnum, number, status)[source]
labgrid.util.agents.usb_hid_relay.handle_get(busnum, devnum, number)[source]