LegacyChannel
- class mtf.libs.mtf_pybinder.LegacyChannel
- __init__(*args, **kwargs)
- __new__(**kwargs)
- check_if_traffic_received(self: mtf.libs.mtf_pybinder.LegacyChannel, timeout: int, event_type: int) bool
Check if there was traffic on the bus before a specific timeout. PS: The bus observer needs to be started. Arg:
timeout (int): The duration for which to monitor event traffic, expressed in milliseconds event_type (int): Specifies the type of event for which traffic should be monitored
Return: bool type
- clear_history(self: mtf.libs.mtf_pybinder.LegacyBusListener) None
clear legacy bus listener history
- static get_can_channel(channel_name: str) mtf.libs.mtf_pybinder.CanChannel
Get a CAN channel instance. Arg:
channel_name (string)
Return: CANBus
- static get_ethernet_channel(channel_name: str) mtf.libs.mtf_pybinder.EthernetChannel
Get a Ethernet channel instance. Arg:
channel_name (string)
Return: EthernetBus
- static get_flexray_channel(channel_name: str) mtf.libs.mtf_pybinder.FlexRayChannel
Get a FlexRay channel instance. Arg:
channel_name (string)
Return: FlexrayBus
- get_frame_by_id(self: mtf.libs.mtf_pybinder.LegacyChannel, frame_id: int | str | mtf.libs.mtf_pybinder.FrFrameIdParts) mtf.libs.mtf_pybinder.LegacyFrame
Get frame instance by id Arg:
frame_id (FrameIDVariant): A frame identifier (frame ID) encapsulated in a variant (FrameIDVariant)
Return: LegacyFrameSptr type
- get_frames_by_name(self: mtf.libs.mtf_pybinder.LegacyChannel, frame_name: str) list[mtf.libs.mtf_pybinder.LegacyFrame]
Get frame instance by name Arg:
frame_name (string): The name of the frame for which instances need to be retrieved
Return: vector of LegacyFrameSptr type
- get_history(self: mtf.libs.mtf_pybinder.LegacyBusListener) list[mtf.libs.mtf_pybinder.MtfDataFrameEvent]
- Get legacy bus listener history
Return: vector of DataFramePtr
- static get_instance(channel_name: str) mtf.libs.mtf_pybinder.Channel
Get a channel instance. Arg:
channel_name (string)
Return: Channel
- static get_io_channel(channel_name: str) mtf.libs.mtf_pybinder.IoChannel
Get a IO channel instance. Arg:
channel_name (string)
Return: IoChannel
- static get_lin_channel(channel_name: str) mtf.libs.mtf_pybinder.LinChannel
Get a LIN channel instance. Arg:
channel_name (string)
Return: LinBus
- static get_serial_channel(channel_name: str) mtf.libs.mtf_pybinder.SerialChannel
Get a Serial channel instance. Arg:
channel_name (string)
Return: SerialChannel
- monitor_traffic(self: mtf.libs.mtf_pybinder.LegacyChannel, timeout: int, event_type: int) bool
Monitor traffic in the legacy bus during a timeout Arg:
timeout (int): The duration for which to monitor event traffic, expressed in milliseconds event_type (int): Specifies the type of event for which traffic should be monitored
Return: bool type
- property name
Get channel name
- set_interception_function(self: mtf.libs.mtf_pybinder.Channel, interception_function: Callable[[mtf.libs.mtf_pybinder.MtfDataFrameEvent], None]) bool
Set a function to be called before sending any frame for the specified channel. The function is responsible for processing the data frame request and may modify the payload using “set_payload” method. If you want to drop the frame, you just need to set it to “None”. It is not thread-safe and should be used with caution. So, it is advised to set it once prior to any transmission on the corresponding channel. Arg:
- interception_function: It is used to store a callback function or a callable object that will be executed with an argument
of type mtf::core::DataFrameRequestPtr
Return: bool type
- start_listening(self: mtf.libs.mtf_pybinder.LegacyBusListener, callback: Callable[[mtf.libs.mtf_pybinder.MtfDataFrameEvent], None] | None = None, listening_flags: int | None = None) bool
Start the data acquisition Args:
callback: optional callable listening_flags: optional int bitmask
Return: bool
- start_observer(self: mtf.libs.mtf_pybinder.LegacyChannel, event_type: int) bool
Start legacy bus observer Arg:
event_type: (int): Specifies the type of event for which observation should be started
Return: bool type
- stop_listening(self: mtf.libs.mtf_pybinder.LegacyBusListener) bool
- Stop the data acquisition
Return: bool type
- stop_observer(self: mtf.libs.mtf_pybinder.LegacyChannel, event_type: int) bool
Start legacy bus observer Arg:
event_type (int): Specifies the type of event for which observation should be stopped
Return: bool type
- property type
Get channel type
- unset_interception_function(self: mtf.libs.mtf_pybinder.Channel) None
Unset the previously set interception function for the specified channel.