org.avineas.modbus
public class ModbusPacket extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static int[] |
decode(byte[] data,
int offset,
int length)
Decode a part of contents as integer/word array.
|
static byte[] |
encode(int[] data)
Encode a number of words, encoded as integer values to bytes.
|
int |
getFunction()
Get the function code of this packet.
|
byte[] |
toBytes()
Convert this packet to bytes.
|
public int getFunction()
public byte[] toBytes()
public static byte[] encode(int[] data)
data - The data to encodepublic static int[] decode(byte[] data,
int offset,
int length)
data - The data to decode fromoffset - The starting offset to start decodinglength - The lengh to decode, in bytes