Can Tp Utils Module
- class mtf.network_port.iso_tp.custom_can_tp.can_tp_utils.CanFrameType
Provides a structured way to represent and identify different types of frames in the CAN protocol
- SINGLE
- FIRST
- CONSECUTIVE
- FLOW_CONTROL
- UNKNOWN
- classmethod get_frame_type(addressing_format: AddrFormat, payload: List[int]) CanFrameType
Converts the upper 4 bits into a member of the CanFrameType enumeration. If these bits do not correspond to any member of the enumeration, it returns CanFrameType.UNKNOWN.
- Args:
addressing_format (AddrFormat): An object or value defining the addressing format payload (FramePayload): A sequence of bytes
- Returns:
CanFrameType
- class mtf.network_port.iso_tp.custom_can_tp.can_tp_utils.CanFlowStatus
Provides a structured way to represent the different states or status codes used to control data flow in CAN protocols.
- CLS
- WAIT
- OVFLW
- class mtf.network_port.iso_tp.custom_can_tp.can_tp_utils.CanFCConfig
Store and manage flow control parameters in CAN communications.
- flow_status: CanFlowStatus
- block_size: int
- separation_time: int
- __init__(flow_status: CanFlowStatus = CanFlowStatus.CLS, block_size: int = 0, separation_time: int = 0) None
- mtf.network_port.iso_tp.custom_can_tp.can_tp_utils.get_payload_length(pdu_size)
determines the appropriate payload length based on the size of the PDU, adhering to minimum sizes and valid lengths for larger sizes
- Args:
pdu_size (int): The size of the PDU.
- Returns:
int