Flexray Tp Module

class mtf.diag_port.flexray_tp.FlexrayTp
__init__()

Constructor for FlexrayTp class. Initializes an instance of FlexrayTp.

Args:

None

Returns:

None

send(payload: list)

Sends a payload using the configured Flexray tp connection.

Args:

payload (list): The payload to be sent.

Returns:
None or bool: Returns None if the controller is not configured,

else returns the result of the controller’s transmit method.

recv()

Receives a frame from the configured controller.

Args:

None

Returns:

None or received_frame: None if no frame received, else the received frame.

close()

Closes the FlexrayTp instance and cleans up the controller.

Args:

None

Returns:

bool: True if successfully closed, False otherwise.

bind(flexray_config: FlexrayTpConfig)

Binds the FlexrayTp communication with a specific Flexray configuration.

Args:

flexray_config (FlexrayTpConfig): Flexray configuration object.

Returns:

bool: True if successful, False otherwise.

get_flexray_tp_queue()

Gets the FlexrayTp queue.

Returns:

list: The FlexrayTp queue.

reset_flexray_tp_queue()

Performs cleanup for the FlexrayTp instance.

Returns:

bool: True if successful, False otherwise.

clean_up()

Performs cleanup for the FlexrayTp instance.

Returns:

bool: True if successful, False otherwise.

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

Creates a new instance.

Args:

*args: The variable arguments list. **wargs: The keyword arguments list.

Returns:

ControllersBase: The newly created instance.

Note:

Note

The instance will be automatically added to the list of controllers to be cleaned up later. It guarantees that all the controller instances are followed up and cleaned up when the associate method ‘controllers_cleanup(cls)’ is called.

Important

Do not override this method in subclasses to maintain this functionality.

classmethod controllers_cleanup()

Cleans up all controller instances.

It calls clean_up() for each controller in the list. If a cleanup fails, an error is raised, but the method continues processing the remaining controllers.

Returns:
bool: True indicating that all controllers were cleaned up successfully.

Otherwise, False is returned when an error occurs during the cleanup process.