HL Port Management

The following high-level functions help you manage test ports.

Reserve/Release Port

async reserve_port(port, force=True, reset=False)[source]

Reserve a port regardless whether it is owned by others or not.

Parameters:
  • port (GenericAnyPort) – The port to reserve

  • force (boolean) – Should force reserve the port

Returns:

Return type:

None

async release_port(port)[source]

Free a port. If the port is reserved by you, release the port. If the port is reserved by others, relinquish the port. The port should have no owner afterwards.

Parameters:

port (GenericAnyPort) – The port to free

Returns:

Return type:

None

async release_ports(*ports)[source]

Free a list of ports. If the port is reserved by you, release the port. If the port is reserved by others, relinquish the port. The port should have no owner afterwards.

Parameters:

ports (GenericAnyPort) – The ports to free

Access Port Object

get_port(tester, module_id, port_id)[source]

Get a port of the module

Parameters:
  • tester (GenericAnyTester) – The tester object

  • module_id (int) – The module index

  • port_id (int) – The port index

Raises:

NoSuchPortError – No port found with the index

Returns:

The port object

Return type:

GenericAnyPort

get_ports(tester, module_id)[source]

Get all ports of the module

Parameters:
  • tester (GenericAnyTester) – The tester object

  • module_id (int) – The module index

Returns:

List of port objects

Return type:

tuple[GenericAnyPort]

get_all_ports(tester)[source]

Get all ports of the tester

Parameters:

tester (GenericAnyTester) – The tester object

Returns:

List of port objects

Return type:

tuple[GenericAnyPort]