CanFdTransmitter

class mtf.network_port.bus_transmitter.CanFdTransmitter

This class implements CAN-FD frames transmission.

classmethod transmit_frame(channel_name: str, frame_id: int, payload: List, bit_rate_switch=True, error_flags: int = 0)

Transmits the given frame on the given channel.

Args:

channel_name (str): The name of the CANFD channel to transmit the frame over. frame_id (int): The ID of the CANFD frame to transmit. payload (FramePayload): The payload of the CANFD frame to transmit. bit_rate_switch (bool, optional): Whether to use the bit rate switch (BRS) feature.

True -> BRS.ON False -> BRS.OFF Defaults to True.

error_flags (int): Whether to set a CRC error. Defaults to 0.

Returns:

bool: True on success; False otherwise.

classmethod start_transmit_cyclic_frame(channel_name: str, frame_id: int, payload: List, cycle: int)

Starts cyclic transmission of a CANFD frame on a specific channel.

Args:

channel_name (str): The channel name to start transmitting over. frame_id (int): The ID of the CANFD frame. payload (FramePayload): The payload of the CANFD frame to transmit. cycle (int): The cycle duration (in µs).

Returns:

bool: True if the cyclic transmission was started successfully; False otherwise.

classmethod stop_transmit_cyclic_frame(channel_name: str, frame_id: int)

Stops the cyclic transmission of a CANFD frame on a specific channel.

Args:

channel_name (str): The channel name to stop transmitting over. frame_id (int): The ID of the CANFD frame.

Returns:

bool: True if the cyclic transmission was successfully stopped; False otherwise.

transmitter = <mtf.libs.mtf_pybinder.mtf_can_transmitter object>