FrameController

class mtf.network_port.frame_controller.FrameController

Manage or interact with frame-related operations

__init__()
get_last_received_frame(channel_name: str, frame_id: int) List

Retrieves the last received frame payload.

Args:

channel_name (str): The channel name frame_id (str): The frame id

Returns:

FramePayload: The payload of the last received frame.

get_last_received_pdu(channel_name: str, pdu_name: str, frame_id: int) List

Retrieves the last received PDU associated with the Pdu instance.

Args:

channel_name (str): The channel name pdu_name (str): The pdu name frame_id (str): The frame id

Returns:

FramePayload: The last received PDU associated with the Pdu instance.

transmit_pdu(channel_name: str, pdu_name: str, frame_id: int, payload: List, immediate: bool = False) bool

Transmit the Pdu with the given payload. Set force to True in order to force the transmission i.e ignore triggering conditions

Args:

channel_name (str): The channel name pdu_name (str): The pdu name frame_id (int): The frame id payload (FramePayload): The payload of the PDU. immediate (bool, optional): A flag indicating if the transmission should be immediate. Defaults to False

Return:

bool: True if the PDU transmission was successful, False otherwise

pdu_apply_faulty_corrupt_crc(channel_name: str, frame_id: int, pdu_name: str, on_off: bool = True) bool

Applies a faulty behavior to corrupt the CRC of the PDU

Args:

channel_name (str): The channel name frame_id (int): The frame id pdu_name (str): The pdu name on_off (bool, optional): A flag indicating if the faulty behavior should be enabled or disabled. Defaults to True.

Return:

bool

pdu_apply_faulty_halt_alive_counter(channel_name: str, frame_id: int, pdu_name: str, on_off: bool = True) bool

Applies a faulty behavior to halt the alive counter of the PDU.

Args:

channel_name (str): The channel name frame_id (int): The frame id pdu_name (str): The pdu name on_off (bool, optional): A flag indicating if the faulty behavior should be enabled or disabled. Defaults to True.

Return:

bool: True if the faulty behavior was applied successfully, False otherwise.

pdu_apply_faulty_corrupt_data_id_nibble(channel_name: str, frame_id: int, pdu_name: str, on_off: bool = True) bool

Applies a faulty behavior to corrupt the data ID nibble of the PDU.

Args:

channel_name (str): The channel name frame_id (int): The frame id pdu_name (str): The pdu name on_off (bool, optional): A flag indicating if the faulty behavior should be enabled or disabled. Defaults to True.

Return:

bool: True if the faulty behavior was applied successfully, False otherwise.

get_frame_name(channel_name: str, frame_id: int) str

Get frame name from channel_name and frame_id

Args:

channel_name (str): The channel name pdu_name (str): The pdu name

Return:

str: The frame name