Class ASdu


  • public class ASdu
    extends java.lang.Object
    The application service data unit (ASDU). The ASDU is the payload of the application protocol data unit (APDU). Its structure is defined in IEC 60870-5-101. The ASDU consists of the Data Unit Identifier and a number of Information Objects. The Data Unit Identifier contains:
    • ASduType (1 byte)
    • Variable Structure Qualifier (1 byte) - specifies how many Information Objects and Information Element sets are part of the ASDU.
    • Cause of Transmission (COT, 1 or 2 bytes) - The first byte codes the actual CauseOfTransmission, a bit indicating whether the message was sent for test purposes only and a bit indicating whether a confirmation message is positive or negative. The optional second byte of the Cause of Transmission field is the Originator Address. It is the address of the originating controlling station so that responses can be routed back to it.
    • Common Address of ASDU (1 or 2 bytes) - the address of the target station or the broadcast address. If the field length of the common address is 1 byte then the addresses 1 to 254 are used to address a particular station (station address) and 255 is used for broadcast addressing. If the field length of the common address is 2 bytes then the addresses 1 to 65534 are used to address a particular station and 65535 is used for broadcast addressing. Broadcast addressing is only allowed for certain TypeIDs.
    • A list of Information Objects containing the actual actual data in the form of Information Elements.
    • Constructor Detail

      • ASdu

        public ASdu​(ASduType typeId,
                    boolean isSequenceOfElements,
                    CauseOfTransmission causeOfTransmission,
                    boolean test,
                    boolean negativeConfirm,
                    int originatorAddress,
                    int commonAddress,
                    InformationObject... informationObjects)
        Use this constructor to create standardized ASDUs.
        Parameters:
        typeId - type identification field that defines the purpose and contents of the ASDU
        isSequenceOfElements - if false then the ASDU contains a sequence of information objects consisting of a fixed number of information elements. If true the ASDU contains a single information object with a sequence of elements.
        causeOfTransmission - the cause of transmission
        test - true if the ASDU is sent for test purposes
        negativeConfirm - true if the ASDU is a negative confirmation
        originatorAddress - the address of the originating controlling station so that responses can be routed back to it
        commonAddress - the address of the target station or the broadcast address.
        informationObjects - the information objects containing the actual data
      • ASdu

        public ASdu​(ASduType typeId,
                    boolean isSequenceOfElements,
                    int sequenceLength,
                    CauseOfTransmission causeOfTransmission,
                    boolean test,
                    boolean negativeConfirm,
                    int originatorAddress,
                    int commonAddress,
                    byte[] privateInformation)
        Use this constructor to create private ASDU with TypeIDs in the range 128-255.
        Parameters:
        typeId - type identification field that defines the purpose and contents of the ASDU
        isSequenceOfElements - if false then the ASDU contains a sequence of information objects consisting of a fixed number of information elements. If true the ASDU contains a single information object with a sequence of elements.
        sequenceLength - the number of information objects or the number elements depending on which is transmitted as a sequence
        causeOfTransmission - the cause of transmission
        test - true if the ASDU is sent for test purposes
        negativeConfirm - true if the ASDU is a negative confirmation
        originatorAddress - the address of the originating controlling station so that responses can be routed back to it
        commonAddress - the address of the target station or the broadcast address.
        privateInformation - the bytes to be transmitted as payload
    • Method Detail

      • getTypeIdentification

        public ASduType getTypeIdentification()
      • isSequenceOfElements

        public boolean isSequenceOfElements()
      • getSequenceLength

        public int getSequenceLength()
      • isTestFrame

        public boolean isTestFrame()
      • isNegativeConfirm

        public boolean isNegativeConfirm()
      • getOriginatorAddress

        public java.lang.Integer getOriginatorAddress()
      • getCommonAddress

        public int getCommonAddress()
      • getPrivateInformation

        public byte[] getPrivateInformation()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object