Class S7Message
- java.lang.Object
-
- org.apache.plc4x.java.s7.readwrite.S7Message
-
- All Implemented Interfaces:
Message,Serializable
- Direct Known Subclasses:
S7MessageRequest,S7MessageResponse,S7MessageResponseData,S7MessageUserData
public abstract class S7Message extends Object implements Message
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceS7Message.S7MessageBuilder
-
Field Summary
Fields Modifier and Type Field Description protected S7Parameterparameterprotected S7Payloadpayloadstatic ShortPROTOCOLIDprotected inttpduReference
-
Constructor Summary
Constructors Constructor Description S7Message(int tpduReference, S7Parameter parameter, S7Payload payload)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)intgetLengthInBits()intgetLengthInBytes()abstract ShortgetMessageType()S7ParametergetParameter()S7PayloadgetPayload()shortgetProtocolId()intgetTpduReference()inthashCode()voidserialize(WriteBuffer writeBuffer)protected abstract voidserializeS7MessageChild(WriteBuffer writeBuffer)static S7MessagestaticParse(ReadBuffer readBuffer)static S7MessagestaticParse(ReadBuffer readBuffer, Object... args)StringtoString()
-
-
-
Field Detail
-
PROTOCOLID
public static final Short PROTOCOLID
-
tpduReference
protected final int tpduReference
-
parameter
protected final S7Parameter parameter
-
payload
protected final S7Payload payload
-
-
Constructor Detail
-
S7Message
public S7Message(int tpduReference, S7Parameter parameter, S7Payload payload)
-
-
Method Detail
-
getMessageType
public abstract Short getMessageType()
-
getTpduReference
public int getTpduReference()
-
getParameter
public S7Parameter getParameter()
-
getPayload
public S7Payload getPayload()
-
getProtocolId
public short getProtocolId()
-
serializeS7MessageChild
protected abstract void serializeS7MessageChild(WriteBuffer writeBuffer) throws SerializationException
- Throws:
SerializationException
-
serialize
public void serialize(WriteBuffer writeBuffer) throws SerializationException
- Specified by:
serializein interfaceSerializable- Throws:
SerializationException
-
getLengthInBytes
public int getLengthInBytes()
- Specified by:
getLengthInBytesin interfaceMessage
-
getLengthInBits
public int getLengthInBits()
- Specified by:
getLengthInBitsin interfaceMessage
-
staticParse
public static S7Message staticParse(ReadBuffer readBuffer, Object... args) throws ParseException
- Throws:
ParseException
-
staticParse
public static S7Message staticParse(ReadBuffer readBuffer) throws ParseException
- Throws:
ParseException
-
-