Frame Listener Module

class mtf.network_port._frame_listener.FrameListerner

Manages listening and handling of frames on a specific communication channel

__init__(channel_name: str, frame_id: str)
get_queue() Queue

Return the queue that stores the frames received by the FrameListener Return:

Queue

reset()

clear listerner event queue

clean_up()

Clean up all controller instances. This method should be overridden to precise the specific cleanup logic. If an instance does not override it, a default message will appear to inform that there are no cleanup logic is implemented.

Return:

bool: True when the cleanup was successful, otherwise False if cleanup failed. By default, it returns True, yet this method should be overridden to present the actual cleanup status.

start_listening(callback: Callable[[MtfDataFrameEvent], None] | None = None, direction: Direction = Direction.Rx, mode: PublishingMode = PublishingMode.Always, silent_mode: bool = False, include_null_frames=False)

start listening for bus events

stop_listening()

stop listening (captured events remain, queue not cleared)

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

Initializes a new instance of the ControllerBase.

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.

Note:

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

Args:

*args: Suitable arguments passed to the constructor of the ControllerBase class. **kwargs: keywords passed to the constructor of the ControllerBase class.

Returns:

instance(ControllerBase): The new instance of the class that has been created.

adapt_queue_elements() Queue[BaseEvent]

ensure the object.timestamp, object.payload

classmethod controllers_cleanup()

Cleans up all controller instances.

It Calls the clean_up() method for each instance, since it iterates through the list of controllers to realize any needed cleanup which can fail so an error will be raised. Then, the remaining instances will continue processing.

Returns:

bool: True indicating that all the controllers are successfully cleaned up, otherwise False when an error occurred during the operation of the cleanup.

class mtf.network_port._frame_listener.FlexrayFrameListener

Manage FlexRay protocol frames

__init__(channel_name: str, frame_id: str)
static __new__(cls, *args, **kwargs)

Initializes a new instance of the ControllerBase.

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.

Note:

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

Args:

*args: Suitable arguments passed to the constructor of the ControllerBase class. **kwargs: keywords passed to the constructor of the ControllerBase class.

Returns:

instance(ControllerBase): The new instance of the class that has been created.

adapt_queue_elements() Queue[BaseEvent]

ensure the object.timestamp, object.payload

clean_up()

Clean up all controller instances. This method should be overridden to precise the specific cleanup logic. If an instance does not override it, a default message will appear to inform that there are no cleanup logic is implemented.

Return:

bool: True when the cleanup was successful, otherwise False if cleanup failed. By default, it returns True, yet this method should be overridden to present the actual cleanup status.

classmethod controllers_cleanup()

Cleans up all controller instances.

It Calls the clean_up() method for each instance, since it iterates through the list of controllers to realize any needed cleanup which can fail so an error will be raised. Then, the remaining instances will continue processing.

Returns:

bool: True indicating that all the controllers are successfully cleaned up, otherwise False when an error occurred during the operation of the cleanup.

get_queue() Queue

Return the queue that stores the frames received by the FrameListener Return:

Queue

reset()

clear listerner event queue

start_listening(callback: Callable[[MtfDataFrameEvent], None] | None = None, direction: Direction = Direction.Rx, mode: PublishingMode = PublishingMode.Always, silent_mode: bool = False, include_null_frames=False)

start listening for bus events

stop_listening()

stop listening (captured events remain, queue not cleared)

class mtf.network_port._frame_listener.LinFrameListener

Manage LIN protocol frames

__init__(channel_name: str, frame_id: str)
static __new__(cls, *args, **kwargs)

Initializes a new instance of the ControllerBase.

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.

Note:

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

Args:

*args: Suitable arguments passed to the constructor of the ControllerBase class. **kwargs: keywords passed to the constructor of the ControllerBase class.

Returns:

instance(ControllerBase): The new instance of the class that has been created.

adapt_queue_elements() Queue[BaseEvent]

ensure the object.timestamp, object.payload

clean_up()

Clean up all controller instances. This method should be overridden to precise the specific cleanup logic. If an instance does not override it, a default message will appear to inform that there are no cleanup logic is implemented.

Return:

bool: True when the cleanup was successful, otherwise False if cleanup failed. By default, it returns True, yet this method should be overridden to present the actual cleanup status.

classmethod controllers_cleanup()

Cleans up all controller instances.

It Calls the clean_up() method for each instance, since it iterates through the list of controllers to realize any needed cleanup which can fail so an error will be raised. Then, the remaining instances will continue processing.

Returns:

bool: True indicating that all the controllers are successfully cleaned up, otherwise False when an error occurred during the operation of the cleanup.

get_queue() Queue

Return the queue that stores the frames received by the FrameListener Return:

Queue

reset()

clear listerner event queue

start_listening(callback: Callable[[MtfDataFrameEvent], None] | None = None, direction: Direction = Direction.Rx, mode: PublishingMode = PublishingMode.Always, silent_mode: bool = False, include_null_frames=False)

start listening for bus events

stop_listening()

stop listening (captured events remain, queue not cleared)

class mtf.network_port._frame_listener.CanFrameListener

Manage CAN protocol frames

get_payloads()

gather payloads from captured events

__init__(channel_name: str, frame_id: str)
static __new__(cls, *args, **kwargs)

Initializes a new instance of the ControllerBase.

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.

Note:

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

Args:

*args: Suitable arguments passed to the constructor of the ControllerBase class. **kwargs: keywords passed to the constructor of the ControllerBase class.

Returns:

instance(ControllerBase): The new instance of the class that has been created.

adapt_queue_elements() Queue[BaseEvent]

ensure the object.timestamp, object.payload

clean_up()

Clean up all controller instances. This method should be overridden to precise the specific cleanup logic. If an instance does not override it, a default message will appear to inform that there are no cleanup logic is implemented.

Return:

bool: True when the cleanup was successful, otherwise False if cleanup failed. By default, it returns True, yet this method should be overridden to present the actual cleanup status.

classmethod controllers_cleanup()

Cleans up all controller instances.

It Calls the clean_up() method for each instance, since it iterates through the list of controllers to realize any needed cleanup which can fail so an error will be raised. Then, the remaining instances will continue processing.

Returns:

bool: True indicating that all the controllers are successfully cleaned up, otherwise False when an error occurred during the operation of the cleanup.

get_queue() Queue

Return the queue that stores the frames received by the FrameListener Return:

Queue

reset()

clear listerner event queue

start_listening(callback: Callable[[MtfDataFrameEvent], None] | None = None, direction: Direction = Direction.Rx, mode: PublishingMode = PublishingMode.Always, silent_mode: bool = False, include_null_frames=False)

start listening for bus events

stop_listening()

stop listening (captured events remain, queue not cleared)