NpduCanTp

class mtf.network_port.iso_tp.Npdu_can_tp.npdu_cantp.NpduCanTp
__init__()

Constructor for NPDU CanTp class. Initializes an instance of NPDU CanTp.

Args:

None

Returns:

None

send(payload: list)

Sends a payload using the configured NPDU can tp connection.

Args:

payload (list): The payload to be sent.

Returns:
None or bool: Returns None if the controller is not configured,

else returns the result of the controller’s transmit method.

close()

Closes the NPDU CanTp instance and cleans up the controller.

Args:

None

Returns:

bool: True if successfully closed, False otherwise.

recv()

Receives a frame from the configured controller.

Args:

None

Returns:

None or received_frame: None if no frame received, else the received frame.

Configure(source_tunnel: str, source_pdu_id: int, target_tunnel: str, target_pdu_id: int, tx_pdu_length: int, flow_timeout: int, padding: int, *args, **kwargs)

Configures the NPDU CanTp communication with specified parameters. This function is used to configure the NPDU CANTP connection by specifying the connection parameters.

Args:

source_tunnel (str): Name of the source tunnel. source_pdu_id (int): Source PDU frame ID. target_tunnel (str): Name of the target tunnel. target_pdu_id (int): Target PDU frame ID. tx_pdu_length (int): Target pdu length. flow_timeout (int): Flow timeout. padding (int): Padding value.

Returns:

bool: True if successful, False otherwise.

get_npdu_can_tp_queue()

Gets the NPDU CanTp queue.

Returns:

list: The CanTp queue.

reset_npdu_can_tp_queue()

Resets the NPDU CanTp queue.

Returns:

None

clean_up()

Performs cleanup for the NPDU CanTp instance.

Returns:

bool: True if successful, False otherwise.

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

Initialize a new instance of the ControllerBase.

The instance will be automatically added to the list of controllers.

bind(interface, address, *args, **kwargs)
classmethod controllers_cleanup()

Clean up all controller instances.

Calls the clean_up() method for each instance.