Pdu Listener Module
- class mtf.network_port.pdu_listener.PduListener
Listens for PDU messages on a specified channel, frame, and PDU name.
- __init__(channel_name: str, frame_id: str, pdu_name: str, on_change: bool)
- classmethod get_listener(channel_name: str, frame_id: str, pdu_name: str, on_change: bool)
Retrieves the singleton instance of the PduListener for specified channel, frame, and PDU name.
- Args:
channel_name (str): The name of the channel to listen for PDUs. frame_id (str): The frame identifier within the specified channel. pdu_name (str): The name of the PDU to monitor. on_change (bool): Indicates whether to trigger the listener only on value changes.
- Returns:
PduListener: The singleton instance of PduListener configured with the specified parameters.
- start_pdu_listener(callback=None)
Start the PDU listener with an optional callback.
- Parameters:
callback – Optional callback function to be called on PDU change.
- stop_pdu_listener()
Stop the PDU listener.
- get_history()
Get the history of PDUs.
- Returns:
List of PDUs that have been recorded.
- clear_history()
Clear the history of PDUs.