ait.dsn.sle.frames module
- class ait.dsn.sle.frames.AOSConfig(*args, **kwargs)
Bases:
object
AOS frame configuration class.
This configuration contains information regarding the inclusion of optional AOS frame fields and a dictionary of virtual channel values to AOS data frame types.
- get_data_field_indices()
Returns the slice-indices for the data field in AOS frame :return: Data field indices
- get_data_field_type(vc_number)
- Returns the data field type associated with a virtual
channel id. If the virtual channel id is undeclared, then None is returned.
- Parameters
vc_number – THe virtual channel id number (int)
- Returns
AOSDataFieldType enum value associated with virtual channel id
- get_frame_error_control_field_indices()
Returns the slice-indices for the frame error control field if defined, otherwise None is returned :return: Frame error control field indices or None
- get_frame_header_error_control_indices()
Returns the slice-indices for the Frame header control field if defined, otherwise None is returned :return: Frame header error control field indices or None
- get_operational_control_field_indices()
Returns the slice-indices for the operational control field if defined, otherwise None is returned :return: Operation control field indices or None
- get_transfer_frame_insert_zone_indices()
Returns the slice-indices for the transfer frame insert zone if defined, otherwise None is returned :return: Transfer frame insert zone indices or None
- get_virtual_channel_count()
Returns the size of the virtual channel data field type map :return: size of virtual-channel data-field-type map
- property transfer_frame_insert_zone_included
Returns true if Transfer Frame Insert Zone field is defined in AOS Frame, false otherwise :return: Flag indicating Transfer Frame Insert Zone field existence
- class ait.dsn.sle.frames.AOSDataFieldType(value)
Bases:
Enum
Enumeration for AOS Data Field types
- B_PDU = 'B_PDU'
- IDLE = 'IDLE'
- M_PDU = 'M_PDU'
- VCA_SDU = 'VCA_SDU'
- class ait.dsn.sle.frames.AOSTransFrame(data=None, config=None)
Bases:
BaseTransferFrame
Implementation of the AOS transfer frame.
The AOSTransFrame class decodes data packets to extract information from header, data-field, and trailer. An instance of AOSConfig guides the process by indicating which optional fields are included, as well as determining the type of the datafield via the virtual channel id.
- decode(data)
Decode data as a AOS Transfer Frame
- decode_dataField_BPDU(datafield)
Decodes the B_PDU datafield
- Parameters
datafield – AOS datafield to be decoded
- decode_dataField_Idle(datafield)
Decodes the IDLE datafield
- Parameters
datafield – AOS datafield to be decoded
- decode_dataField_MPDU(datafield)
Decodes the M_PDU datafield
- Parameters
datafield – AOS datafield to be decoded
- decode_dataField_VCASDU(datafield)
Decodes the VCA_SDU datafield
- Parameters
datafield – AOS datafield to be decoded
- decode_data_field(datafield)
Decode the data-field section of the data, using the virtual channel id which indicates that data field type
- Parameters
datafield – Data-field section of the AOS frame
- defaultConfig = <ait.dsn.sle.frames.AOSConfig object>
- encode()
- class ait.dsn.sle.frames.BaseTransferFrame(data=None)
Bases:
dict
Transfer Frame interface “base” class
The BaseTransformFrame class provides Transfer Frame interface-agnostic methods and attributes for interfacing with Frames.
- contains_data()
Returns True if frame contains data, False otherwise
- Returns:
Boolean value indicating if frame contains data
- property data_field
Returns the data portion of the transfer frame.
- Returns
The frame data portion, including potential inner-dataframe headers
- property is_idle_frame
- Returns True if this frame is an Idle frame, as indicated by
the special Idle virtual channel ID, False otherwise. (Note: This is different from an M_PDU Idle data-field section)
- Returns:
Boolean value indicating if this is an IDLE frame.
- property master_channel_id
Returns Master Channel ID (integer)
- property virtual_channel
Returns Virtual Channel ID (integer)
- class ait.dsn.sle.frames.TMTransFrame(data=None)
Bases:
BaseTransferFrame
- decode(data)
Decode data as a TM Transfer Frame
- encode()