org.avineas.fins.payload
public class WriteCommand extends IOCommand
Modifier and Type | Field and Description |
---|---|
static int |
SRC
The sub request code for a write command.
|
ADDRESSOFFSET, AREACODEOFFSET, MRC, SIZEOFFSET, STARTDATAOFFSET
MAXPAYLOADSIZE
Constructor and Description |
---|
WriteCommand(byte[] payload) |
WriteCommand(int areaCode,
int startAddress,
int bytesPerAddress,
int[] values) |
WriteCommand(int areaCode,
int startAddress,
int bytesPerAddress,
int[] values,
int size)
Create a write command.
|
Modifier and Type | Method and Description |
---|---|
int |
getBytesPerAddress() |
int[] |
getValues()
Get the values as coded in this command.
|
void |
setContents(byte[] contents,
int bytesPerAddress)
Set the bytes for the contents of the write command as well as the
size this is in units.
|
getAreaCode, getMaxAddresses, getNumberOfValues, getStartAddress, getStartBitAddress, setStartAddress, setStartBitAddress
decode, encode, getBytes, getBytes, getMrc, getRequestCode, getSrc, setMrc, setRequestCode, setRequestCode, setSrc
public static final int SRC
public WriteCommand(byte[] payload) throws java.lang.Exception
java.lang.Exception
public WriteCommand(int areaCode, int startAddress, int bytesPerAddress, int[] values, int size)
areaCode
- The area codestartAddress
- The start address (word, not bit)bytesPerAddress
- The number of bytes per addressvalues
- The values as integer arraypublic WriteCommand(int areaCode, int startAddress, int bytesPerAddress, int[] values)
public int getBytesPerAddress()
public int[] getValues()
public void setContents(byte[] contents, int bytesPerAddress)
contents
- The contents, as byte arraybytesPerAddress
- The number of bytes per address