public class WriteCoilResponse extends ModbusResponse
ModbusResponse.AuxiliaryMessageTypes| Constructor and Description |
|---|
WriteCoilResponse()
Constructs a new WriteCoilResponse instance.
|
WriteCoilResponse(int reference,
boolean b)
Constructs a new WriteCoilResponse instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
getCoil()
Gets the state that has been returned in this WriteCoilRequest.
|
byte[] |
getMessage()
Returns the raw message as an array of bytes.
|
int |
getReference()
Returns the reference of the register of the coil that has been written
to with the request.
|
void |
readData(DataInput din)
Reads the subclass specific data from the given DataInput instance.
|
void |
setCoil(boolean b)
Sets the state that has been returned in the raw response.
|
void |
setReference(int ref)
Sets the reference of the register of the coil that has been written to
with the request.
|
void |
writeData(DataOutput dout)
Writes the subclass specific data to the given DataOutput.
|
createModbusResponse, getAuxiliaryType, setAuxiliaryTypegetDataLength, getFunctionCode, getHexMessage, getOutputLength, getProtocolID, getTransactionID, getUnitID, isHeadless, readFrom, setDataLength, setHeadless, setHeadless, setProtocolID, setTransactionID, setUnitID, writeTopublic WriteCoilResponse()
public WriteCoilResponse(int reference,
boolean b)
reference - the offset were writing was started from.b - the state of the coil; true set, false reset.public boolean getCoil()
public void setCoil(boolean b)
b - true if the coil should be set of false if it should be unset.public int getReference()
public void setReference(int ref)
ref - the reference of the coil's register.public void writeData(DataOutput dout) throws IOException
ModbusMessageImplwriteData in class ModbusMessageImpldout - the DataOutput to be written to.IOException - if an I/O related error occurs.public void readData(DataInput din) throws IOException
ModbusMessageImplreadData in class ModbusMessageImpldin - the DataInput to read from.IOException - if an I/O related error occurs.public byte[] getMessage()
ModbusMessageCopyright © 2025. All Rights Reserved.