Package org.openmuc.j60870
Class ASdu
- java.lang.Object
-
- org.openmuc.j60870.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 Summary
Constructors Constructor Description 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.ASdu(ASduType typeId, boolean isSequenceOfElements, CauseOfTransmission causeOfTransmission, boolean test, boolean negativeConfirm, int originatorAddress, int commonAddress, InformationObject... informationObjects)
Use this constructor to create standardized ASDUs.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CauseOfTransmission
getCauseOfTransmission()
int
getCommonAddress()
InformationObject[]
getInformationObjects()
java.lang.Integer
getOriginatorAddress()
byte[]
getPrivateInformation()
int
getSequenceLength()
ASduType
getTypeIdentification()
boolean
isNegativeConfirm()
boolean
isSequenceOfElements()
boolean
isTestFrame()
java.lang.String
toString()
-
-
-
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 ASDUisSequenceOfElements
- iffalse
then the ASDU contains a sequence of information objects consisting of a fixed number of information elements. Iftrue
the ASDU contains a single information object with a sequence of elements.causeOfTransmission
- the cause of transmissiontest
- true if the ASDU is sent for test purposesnegativeConfirm
- true if the ASDU is a negative confirmationoriginatorAddress
- the address of the originating controlling station so that responses can be routed back to itcommonAddress
- 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 ASDUisSequenceOfElements
- 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 sequencecauseOfTransmission
- the cause of transmissiontest
- true if the ASDU is sent for test purposesnegativeConfirm
- true if the ASDU is a negative confirmationoriginatorAddress
- the address of the originating controlling station so that responses can be routed back to itcommonAddress
- 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()
-
getCauseOfTransmission
public CauseOfTransmission getCauseOfTransmission()
-
isTestFrame
public boolean isTestFrame()
-
isNegativeConfirm
public boolean isNegativeConfirm()
-
getOriginatorAddress
public java.lang.Integer getOriginatorAddress()
-
getCommonAddress
public int getCommonAddress()
-
getInformationObjects
public InformationObject[] getInformationObjects()
-
getPrivateInformation
public byte[] getPrivateInformation()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-