Ecu

class mtf.libs.mtf_pybinder.Ecu

SomeIp ECU class

__init__(*args, **kwargs)
__new__(**kwargs)
activate(self: mtf.libs.mtf_pybinder.Ecu, start_communication: bool = True) mtf.libs.mtf_pybinder.Result

Activate SomeIp in Ecu and start SomeIp/SomeIpSd communication if “start_communication” argument is set to True.

static create(ecu_datamodel: mtf.libs.mtf_pybinder.mtf_datamodel_system_topology.EcuDataModel) mtf.libs.mtf_pybinder.Ecu

create a COM ECU from ECU datamodel

deactivate(self: mtf.libs.mtf_pybinder.Ecu) mtf.libs.mtf_pybinder.Result

Deactivate SomeIp in Ecu and stop SomeIp/SomeIpSd communication if it is already started.

get_all_consumed_service_ids(self: mtf.libs.mtf_pybinder.Ecu) list[int]

Get list of all consumed service ids

get_all_consumed_services(self: mtf.libs.mtf_pybinder.Ecu) list[mtf.libs.mtf_pybinder.SomeIpConsumedService]

Get list of all consumed services

static get_all_ecus() list[mtf.libs.mtf_pybinder.Ecu]

Get list of all ECU instances with respect to provided DB

get_all_output_frames(self: mtf.libs.mtf_pybinder.Ecu) list[mtf.libs.mtf_pybinder.ComFrame]

Retrieves frame instances of all frames of as specific channel connected to this ECU

get_all_output_frames_by_channel(self: mtf.libs.mtf_pybinder.Ecu, channel_name: str) list[mtf.libs.mtf_pybinder.ComFrame]

Retrieves frame instances of all frames of as specific channel connected to this ECU

get_all_provided_service_ids(self: mtf.libs.mtf_pybinder.Ecu) list[int]

Get list of all provided service ids

get_all_provided_services(self: mtf.libs.mtf_pybinder.Ecu) list[mtf.libs.mtf_pybinder.SomeIpProvidedService]

Get list of all provided services

get_connected_channels(self: mtf.libs.mtf_pybinder.Ecu) list[mtf.libs.mtf_pybinder.ComChannel]

Retrieves the names of all sender channels connected to this ECU

get_ip_addresses(self: mtf.libs.mtf_pybinder.Ecu) list[str]

Retrieves the local/remote IP addresses of the ecu’s network endpoints

get_npdu_infos(self: mtf.libs.mtf_pybinder.Ecu, npdu_identifier: str | int, tx_direction: bool, channel: str | None = None) mtf.libs.mtf_pybinder.NpduInfo | None

Retrieves Npdu information, including destination IP, destination port, source IP, source port, protocol, and channel for a given Npdu name or Npdu ID. You can specify whether the Npdu is IN or OUT, as well as the associated channel.

Args:

npdu_identifier (int | str): The Npdu identifier, which can be either an integer or a string. tx_direction (bool): Specifies the transmission direction. Set to True for OUT (transmitted)

and False for IN (received).

channel (str, optional): If provided, ensures that the Npdu belongs to this channel.Defaults to nullopt.

Returns:

NpduInfo: An object containing all relevant Npdu details.

get_out_npdus(self: mtf.libs.mtf_pybinder.Ecu, channel_name: str = '') list[mtf.libs.mtf_pybinder.NPdu]

Retrieve all output NPdus for a given channel name. If no channel name is specified, it will return all NPdus regardless of the channel.

get_out_npdus_by_id(self: mtf.libs.mtf_pybinder.Ecu, npdu_id: int, channel_name: str = '') list[mtf.libs.mtf_pybinder.NPdu]

Retrieve all output NPdus having the given ID and channel If no channel name is specified, it will return all NPdus regardless of the channel.

get_out_npdus_by_name(self: mtf.libs.mtf_pybinder.Ecu, npdu_name: str, channel_name: str = '') list[mtf.libs.mtf_pybinder.NPdu]

Retrieve all output NPdus having the given name and channel If no channel name is specified, it will return all NPdus regardless of the channel.

property name

Get ecu name

start_all_npdus(self: mtf.libs.mtf_pybinder.Ecu, channel_name: str = '') None

Start transmission of all NPdus of the specified optional channel name. If no channel name is specified, it will start transmission of all NPdus regardless of the channel.

start_npdus(self: mtf.libs.mtf_pybinder.Ecu, npdu_ids: set[int], channel_name: str = '') bool

Start transmission for all output NPdus with the specified IDs and optional channel name. If no channel name is specified, transmission of all NPdus with the specified IDs will start on all channels. Returns True if transmission started successfully for all NPdus, False otherwise.

start_someip_communication(self: mtf.libs.mtf_pybinder.Ecu) mtf.libs.mtf_pybinder.Result

start SomeIp/SomeIpSd communication.

stop_all_npdus(self: mtf.libs.mtf_pybinder.Ecu, channel_name: str = '') None

Stop transmission of all NPdus of the specified optional channel name. If no channel name is specified, it will stop transmission of all NPdus regardless of the channel.

stop_npdus(self: mtf.libs.mtf_pybinder.Ecu, npdu_ids: set[int], channel_name: str = '') bool

Stop transmission for all output NPdus with the specified IDs and optional channel name. If no channel name is specified, transmission of all NPdus with the specified IDs will stop on all channels. Returns True if transmission started successfully for all NPdus, False otherwise.

stop_someip_communication(self: mtf.libs.mtf_pybinder.Ecu) mtf.libs.mtf_pybinder.Result

stop SomeIp/SomeIpSd communication.

try_get_all_provided_services_consumed_by_any(self: mtf.libs.mtf_pybinder.Ecu, consumers: set[str]) list[mtf.libs.mtf_pybinder.SomeIpProvidedService]
Returns a list of provided services that are consumed by any of the given consumers.
Parameters:

consumers (Set[str]): A set of consumer ecu names.

Returns:

List[ProvidedService]: A list of ProvidedService consumed by any of the specified consumers.

try_get_consumed_service_by_name_or_id(self: mtf.libs.mtf_pybinder.Ecu, service_name_or_id: int | str, instance_id: int = 65535) mtf.libs.mtf_pybinder.SomeIpConsumedService

Get specific consumed service by name or id. Return any service instance if the “instance_id” argument is set to the default value. Return None if no service found based on the given args values.

static try_get_ecu_by_name(ecu_name: str) mtf.libs.mtf_pybinder.Ecu

Get instance of Ecu with reference to ecu_name. Return None if no ecu has the name ecu_name

static try_get_ecus_by_ip_address(ip_address: str) list[tuple[mtf.libs.mtf_pybinder.Ecu, str]]

Attempt to get ECUs and their corresponding channel names based on a specific IP address.

return: A list of tuples, each containing an ECU object and its corresponding channel name

try_get_out_npdu_by_id(self: mtf.libs.mtf_pybinder.Ecu, npdu_id: int, channel_name: str = '', target_ecu: str = '') mtf.libs.mtf_pybinder.NPdu

Retrieve one NPdu having the given ID, channel and target ecu If no channel or target ecu is specified, returns any NPdu with the given ID. Returns None if no NPdu is found.

try_get_out_npdu_by_name(self: mtf.libs.mtf_pybinder.Ecu, npdu_name: str, channel_name: str = '', target_ecu: str = '') mtf.libs.mtf_pybinder.NPdu

Retrieve one NPdu having the given name, channel and target ecu If no channel or target ecu is specified, returns any NPdu with the given name. Returns None if no NPdu is found.

try_get_provided_service_by_name_or_id(self: mtf.libs.mtf_pybinder.Ecu, service_name_or_id: int | str, instance_id: int = 65535) mtf.libs.mtf_pybinder.SomeIpProvidedService

Get specific provided service by name or id. Return any service instance if the “instance_id” argument is set to the default value. Return None if no service found based on the given args values.