CTSFlowControl
- class mtf.network_port.iso_tp.custom_fr_tp.fr_tp_frames.CTSFlowControl
Represent a specific type of flow control in a communication protocol
- __init__(source_address: int = 0, target_address: int = 0, bandwidth_control: int = 0, buffer_size: int = 0)
- ACKNOWLEDGE_OFFSET = 5
- BC_OFFSET = 5
- BFS_OFFSET = 6
- BYTE_POSITION_OFFSET = 6
- PCI_OFFSET = 4
- PCI_SIZE_ACK_RET = 4
- PCI_SIZE_CTS = 4
- SRC_ADDR_OFFSET = 2
- TGT_ADDR_OFFSET = 0
- property acknowledge
provides read access to the _acknowledge attribute
- Returns:
SfAckValues: acknowledge
- property address_information
Create a list called payload initialized with zeros
- Returns:
list[int]: contains address information formatted in a specific way
- property bandwidth_control
Provides read access to the _bandwidth_control attribute
- Returns:
int: bandwidth control
- property buffer_size
Provides read access to the _buffer_size attribute
- Returns:
int: buffer size
- property byte_position
Provides read access to the _byte_position attribute
- Returns:
int: byte position
- property flow_status
Provides read access to the _flow_status attribute
- Returns:
FrFlowStatus: flow status
- from_payload(payload: List[int]) bool
Extract and initialize the attributes of a FlowFrame instance from a FramePayload object
- Args:
payload (FramePayload): The payload to be sent
- Returns:
bool: If this extraction fails, the method returns False
- classmethod get_pci_type(payload: List[int])
Extract and return the PCI type from a FramePayload
- Args:
payload (FramePayload): The payload to be sent
- Returns:
int: returns an integer representing the PCI type, or 0 if the extraction fails
- classmethod get_source_address(payload: List[int]) Tuple[bool, int]
Extract a source address from a FramePayload
- Args:
payload (FramePayload): The payload to be sent
- Returns:
- Tuple[bool, int]: bool: Indicates whether the extraction was successful or not
int: The extracted source address (if the extraction is successful), otherwise 0
- classmethod get_target_address(payload: List[int]) Tuple[bool, int]
Extract a target address from a FramePayload
- Args:
payload (FramePayload): The payload to be sent
- Returns:
- Tuple[bool, int]: bool: Indicates whether the extraction was successful or not
int: The extracted target address (if the extraction is successful), otherwise 0
- parse_address_information(payload: List[int]) bool
Extract address information from a FramePayload and update the object’s attributes
- Args:
payload (FramePayload): The payload to be sent
- Returns:
bool: Returns True if all extraction and update operations were successful
- property source_address
Provides read access to the _source_address attribute
- Returns:
int: source address
- property target_address
Provides read access to the _target_address attribute
- Returns:
int: target address
- to_payload() List[int]
Convert the attributes of a FlowControl instance into a binary representation as a FramePayload
- Returns:
list[int]