Custom Can Tp Module

class mtf.network_port.iso_tp.custom_can_tp.CustomCanTp
__init__()

CustomCanTp is a class for handling Custom CAN Transport Protocol (CAN TP) communication.

It provides methods for configuring and managing the communication over a CAN network, including sending and receiving messages using a custom CAN TP protocol.

Methods:

configure(config: IsoTpConfig) -> None: Configure the CAN TP with the provided configuration. configure_reception_flow_control(state, block_size, separation_time) -> None: Configure the reception flow control parameters. enable_faulty_speration_time(value: int) -> None: Enable faulty separation time with the given value. disable_faulty_speration_time() -> None: Disable faulty separation time. bind() -> bool: Bind the CAN TP for communication. close() -> bool: Close the CAN TP connection. send(payload: list[int]) -> bool: Send a message over the CAN TP. get_queue() -> list[FramePayload]: Get the list of received frames in the frame queue.

configure(config: IsoTpConfig)

Configure the CustomCanTp with the provided configuration.

Args:

config (IsoTpConfig): The configuration for the CAN TP communication.

configure_reception_flow_control(state, block_size, separation_time) None

Configure the reception flow control parameters.

Args:

state: The flow control state. block_size: The block size for flow control. separation_time: The separation time for flow control.

enable_faulty_speration_time(value: int) None

Enable faulty separation time with the given value.

Args:

value (int): The new separation time value.

disable_faulty_speration_time() None

Disable faulty separation time.

bind() bool

Bind the CustomCanTp for communication.

Returns:

bool: True if the binding is successful, False otherwise.

close() bool

Close the CustomCanTp connection.

Returns:

bool: True if the connection is successfully closed, False otherwise.

send(payload: list[int]) bool

Send a message over the CustomCanTp.

Args:

payload (list[int]): The payload to be sent.

Returns:

bool: True if the message is sent successfully, False otherwise.

get_queue() list[List[int]]

Get the list of received frames in the frame queue.

Returns:

list[FramePayload]: A list of received frames.

clean_up() bool
static __new__(cls, *args, **kwargs)

Initialize a new instance of the ControllerBase.

The instance will be automatically added to the list of controllers.

classmethod controllers_cleanup()

Clean up all controller instances.

Calls the clean_up() method for each instance.