IoController

class mtf.network_port.io_controller.IoController
__init__()
set_io_value(channel_name: str, value: float)

Set io value.

Parameters:
  • channel_name – The IO channel name.

  • value – IO value to be set.

Returns (boolean)boolean):

True if IO value is set, else False.

set_io_raw_value(channel_name: str, value: float)

Set io raw value.

Parameters:

channel_name – The IO channel name.

Value (float)float):

raw value to be set.

Returns (boolean)boolean):

True if IO raw value is set, else False.

io_apply_faulty(channel_name: str, fault_type: int | IoFaultyTypes)

Start apply faulty, Apply physical Short to VBat or Short to GND on channel_name.

Parameters:
  • channel_name – The IO channel name.

  • fault_type – Code to represent the fault type

Returns (boolean)boolean):

True if IO apply faulty is set, else False.

fault_type codes:

0 -> ShortCutToGnd
1 -> ShortcutToVbat
2 -> CableBreak
io_stop_faulty(channel_name: str, fault_type: int | IoFaultyTypes)

Stop apply faulty, Remove physical Short to VBat or Short to GND on channel_name.

Parameters:
  • channel_name – The IO channel name.

  • fault_type – Code to represent the fault type

Returns (boolean)boolean):

True if IO apply faulty is stopped, else False.

fault_type codes:

0 -> ShortCutToGnd
1 -> ShortcutToVbat
2 -> CableBreak
io_set_current(channel_name: str, value: float)

Set io current value.

Parameters:
  • channel_name – The IO channel name.

  • value – Current value to be set.

Returns (boolean)boolean):

True if IO current set, else False.

io_set_resistance(channel_name: str, value: int)

Set io resistance.

Parameters:
  • channel_name – The IO channel name.

  • value – Resistance value to be set.

Returns (boolean)boolean):

True if IO resistance set, else False.

io_set_voltage(channel_name: str, value: float)

Set io voltage.

Parameters:

channel_name – The IO channel name.

Value (float)float):

Value to be set.

Returns (boolean)boolean):

True if value set, else False.

io_generate_pattern(channel_name: str, value: list)

Generate io pattern.

Parameters:

channel_name – The IO channel name.

:param value : Data used to generate the pattern. :returns (boolean): True if pattern generated, else False.

is_channel_available(channel_name: str)

Check if io channels physically connected.

Parameters:

channel_name – The IO channel name.

Returns (boolean)boolean):

True if channel_name is available, else False.

io_get_last_value(channel_name: str, property_name: IoProperty)

Get last value of given signal property for io channel.

Parameters:
  • channel_name – The IO channel name.

  • property_name – IO type.

Returns (int)int):

Last received IO value.

io_read_current(channel_name: str)

read io current value.

Parameters:

channel_name – The IO channel name.

Returns (float)float):

current value for specific channel.

io_read_voltage(channel_name: str)

read io voltage value.

Parameters:

channel_name – The IO channel name.

Returns (float)float):

voltage value for specific channel.