EthernetTransmitter

class mtf.network_port.bus_transmitter.EthernetTransmitter
transmitter = <mtf.libs.mtf_pybinder.mtf_ethernet_transmitter object>
lock = <unlocked _thread.lock object>
classmethod transmit_frame(channel_name: str, payload: List)

Abstract method that transmits a frame.

Raises:

NotImplementedError: This method must be implemented by a subclass.

classmethod transmit_frame_queue(channel_name: str, timestamped_queue: List[tuple[int, List[int]]])

transmit queue of packets with respect to the delays between successive frames. timestamped_queue contains list tuples, ech tuple contains:

first the delay between the previous message and the current message second the payload to be sent

note:

first delay means we will send the packets immediately or after certain delay. delay is in nanoseconds

[(0,[1,2,3]), (2,[1,2,3]) …..]

classmethod configure_frame_queue(channel_name: str, timestamped_queue: List[tuple[int, List[int]]])

Configure an ethernet frame queue transmission by specifying the dedicated channel and timestamped_queue.

Parameters:
  • channel_name – name of the ethernet channel to be configured.

  • timestamped_queue

    contains list tuples, each tuple contains:
    • first the delay between the previous message and the current message

    • second the payload to be sent

    note:

    first delay means we will send the packets immediately or after certain delay. delay is in nanoseconds

Returns:

True if the queue transmission is configured. False otherwise.

Examples: >>> MtfBase.bus_manager.bus_transmitter(BusType.ETHERNET).configure_frame_queue(“ethernet_channel_name”, [(0,[1,2,3]), (2,[1,2,3]) …..])

classmethod start_frame_queue(channel_name: str)

Start transmission of the ethernet queue associated with the given channel. For the transmission to occur, it must first be configured.

Parameters:

channel_name – name of the ethernet channel.

Returns:

True if the queue transmission task is triggered. False otherwise.

Examples: >>> MtfBase.bus_manager.bus_transmitter(BusType.ETHERNET).start_frame_queue(“ethernet_channel_name”)