Can Pdu Assembler Module
- class mtf.network_port.iso_tp.custom_can_tp.can_pdu_assembler.CanPduAssembler
- __init__(addressing_format)
CanPduAssembler is a class for assembling Protocol Data Units (PDUs) received over a CAN network.
It is used for reassembling data frames and managing the state of received messages.
- Methods:
reset(): Reset the assembler’s state. is_message_complete(): Check if the message assembly is complete. add_frame(payload): Add a frame to the assembler for message assembly. get_tp_message(): Get the reassembled TP message. get_target_address(): Get the target address of the assembled message.
- reset()
Reset the assembler’s state.
- is_message_complete()
Check if the message assembly is complete.
- Returns:
bool: True if the message assembly is complete, False otherwise.
- add_frame(payload)
Add a frame to the assembler for message assembly.
- Args:
payload: The payload of the received frame.
- Returns:
bool: True if the frame is successfully added, False otherwise.
- get_tp_message()
Get the reassembled TP message.
- Returns:
List[int]: The reassembled message, or None if the message assembly is not complete.
- get_target_address()
Get the target address of the assembled message.
- Returns:
int: The target address.