Class VelbusPacket
java.lang.Object
org.openremote.agent.protocol.velbus.VelbusPacket
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumCommand for inbound packetsstatic enumCommand for outbound packetsstatic enumPacket priority. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final bytestatic final intMaximum packet size used by the Velbus protocol.static final intMinimum packet sizestatic final byte -
Constructor Summary
ConstructorsConstructorDescriptionVelbusPacket(byte[] content) VelbusPacket(int address) VelbusPacket(int address, int command, byte... dataBytes) VelbusPacket(int address, int command, VelbusPacket.PacketPriority priority, byte... dataBytes) VelbusPacket(int address, VelbusPacket.PacketPriority priority, int dataSize, boolean rtr) -
Method Summary
Modifier and TypeMethodDescriptionstatic bytecalculateChecksum(VelbusPacket packet) clone()booleanstatic VelbusPacketfromString(String packetStr) intbytegetByte(int index) byteGet the checksum byteintintintgetInt(int index) booleangetRtr()intgetSize()intbooleaninthashCode()booleanbooleanisValid()byte[]pack()voidsetAddress(int address) voidsetByte(int index, byte value) voidsetCommand(int command) voidsetDataSize(int dataSize) voidsetHandled(boolean handled) voidsetPriority(VelbusPacket.PacketPriority priority) voidsetRtr(boolean rtr) voidsetTypeCode(int typeCode) toString()
-
Field Details
-
MIN_PACKET_SIZE
public static final int MIN_PACKET_SIZEMinimum packet size- See Also:
-
MAX_PACKET_SIZE
public static final int MAX_PACKET_SIZEMaximum packet size used by the Velbus protocol.- See Also:
-
STX
public static final byte STX- See Also:
-
ETX
public static final byte ETX- See Also:
-
-
Constructor Details
-
VelbusPacket
public VelbusPacket(byte[] content) -
VelbusPacket
public VelbusPacket() -
VelbusPacket
public VelbusPacket(int address) -
VelbusPacket
public VelbusPacket(int address, int command, byte... dataBytes) -
VelbusPacket
public VelbusPacket(int address, int command, VelbusPacket.PacketPriority priority, byte... dataBytes) -
VelbusPacket
-
-
Method Details
-
calculateChecksum
-
getAddress
public int getAddress() -
setAddress
public void setAddress(int address) -
getTypeCode
public int getTypeCode() -
setTypeCode
public void setTypeCode(int typeCode) -
getDataSize
public int getDataSize() -
setDataSize
public void setDataSize(int dataSize) -
getSize
public int getSize() -
getChecksum
public byte getChecksum()Get the checksum byte -
getPriority
-
setPriority
-
getRtr
public boolean getRtr() -
setRtr
public void setRtr(boolean rtr) -
getByte
public byte getByte(int index) -
setByte
public void setByte(int index, byte value) -
getInt
public int getInt(int index) -
getCommand
public int getCommand() -
setCommand
public void setCommand(int command) -
hasCommand
public boolean hasCommand() -
isHandled
public boolean isHandled() -
setHandled
public void setHandled(boolean handled) -
pack
public byte[] pack() -
clone
-
isValid
public boolean isValid() -
toString
-
hashCode
public int hashCode() -
equals
-
fromString
-