Custom Fr Tp Module
- mtf.network_port.iso_tp.custom_fr_tp.is_consecutive_pci(pci) bool
Checks if a PCI code belongs to a specific set of consecutive frame types
- Args:
pci (int)
- Returns:
bool: Returns True if the provided PCI code is one of the defined consecutive frame types, otherwise, it returns False
- mtf.network_port.iso_tp.custom_fr_tp.is_valid_pci(pci) bool
Check if a PCI code is valid by comparing it to a set of predefined frame types
- Args:
pci (int)
- Return:
bool: Returns True if the PCI code is either a consecutive frame or one of the specified additional frame types. Otherwise, it returns False
- class mtf.network_port.iso_tp.custom_fr_tp.CustomFrTp
Manages the transport of data using the FlexRay protocol
- __init__() None
- configure(config: IsoTpConfig) bool
Configures the CustomFrTp with the provided ISO-TP configuration.
- Args:
config (IsoTpConfig): The ISO-TP configuration to use for communication.
- Returns:
bool: True if configuration is successful, False otherwise.
- configure_reception_flow_control(flow_status: FrFlowStatus, bandwidth_control: int = 0, buffer_size: int = 0, acknowledge: SfAckValues = 1, byte_position: int = 0) bool
Configures the reception flow control based on the specified parameters.
- Args:
flow_status (FrFlowStatus): The flow control status to configure. bandwidth_control (int): Bandwidth control parameter for CTS flow control. buffer_size (int): Buffer size for CTS flow control. acknowledge (SfAckValues): Acknowledge value for ACK_RET flow control. byte_position (int): Byte position for ACK_RET flow control.
- Returns:
bool: True if configuration is successful, False otherwise.
- bind() bool
Binds the CustomFrTp for communication by starting the RX and TX listeners and setting the communication to active.
- Returns:
bool: True if the binding is successful, False otherwise.
- enable_faulty_speration_time(value: int) None
Enables a custom separation time with the specified value.
- Args:
value (int): The value for the custom separation time.
- disable_faulty_speration_time() None
Disables the custom separation time.
- close() bool
Closes the CustomFrTp communication.
- Returns:
bool: True if the communication is successfully closed, False otherwise.
- send(payload: List[int]) bool
Sends a frame or message over the CustomFrTp communication.
- Args:
payload (FramePayload): The payload to be sent.
- Returns:
bool: True if the send operation is successful, False otherwise.
- get_queue() List[List[int]]
Returns the queue of received frames or messages.
- Returns:
List[FramePayload]: A list of received frames or messages in the queue.
- clean_up() bool
Cleans up the controller instance.
This method should be overridden to provide the specific cleanup logic. If an instance does not override it,a default message is shown to indicate that no cleanup logic is implemented.
- Returns:
bool: True on success, False otherwise.
Note:
Important
This method must be overridden to implement the proper clean-up process for the respective instance/subclass.
- static __new__(cls, *args, **kwargs)
Creates a new instance.
- Args:
*args: The variable arguments list. **wargs: The keyword arguments list.
- Returns:
ControllersBase: The newly created instance.
Note:
Note
The instance will be automatically added to the list of controllers to be cleaned up later. It guarantees that all the controller instances are followed up and cleaned up when the associate method ‘controllers_cleanup(cls)’ is called.
Important
Do not override this method in subclasses to maintain this functionality.
- classmethod controllers_cleanup()
Cleans up all controller instances.
It calls clean_up() for each controller in the list. If a cleanup fails, an error is raised, but the method continues processing the remaining controllers.
- Returns:
- bool: True indicating that all controllers were cleaned up successfully.
Otherwise, False is returned when an error occurs during the cleanup process.