Class VelbusPacket
java.lang.Object
org.openremote.agent.protocol.velbus.VelbusPacket
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Command for inbound packetsstatic enum
Command for outbound packetsstatic enum
Packet priority. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byte
static final int
Maximum packet size used by the Velbus protocol.static final int
Minimum 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 byte
calculateChecksum
(VelbusPacket packet) clone()
boolean
static VelbusPacket
fromString
(String packetStr) int
byte
getByte
(int index) byte
Get the checksum byteint
int
int
getInt
(int index) boolean
getRtr()
int
getSize()
int
boolean
int
hashCode()
boolean
boolean
isValid()
byte[]
pack()
void
setAddress
(int address) void
setByte
(int index, byte value) void
setCommand
(int command) void
setDataSize
(int dataSize) void
setHandled
(boolean handled) void
setPriority
(VelbusPacket.PacketPriority priority) void
setRtr
(boolean rtr) void
setTypeCode
(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
-