|
jamod at SF | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.wimpi.modbus.msg.ModbusMessageImpl net.wimpi.modbus.msg.ModbusRequest net.wimpi.modbus.msg.WriteCoilRequest
Class implementing a WriteCoilRequest. The implementation directly correlates with the class 0 function write coil (FC 5). It encapsulates the corresponding request message.
Constructor Summary | |
WriteCoilRequest()
Constructs a new WriteCoilRequest instance. |
|
WriteCoilRequest(int ref,
boolean b)
Constructs a new WriteCoilRequest instance with a given reference and state to be written. |
Method Summary | |
ModbusResponse |
createResponse()
Returns the ModbusResponse that represents the answer to this ModbusRequest. |
boolean |
getCoil()
Returns the state that should be written with this WriteCoilRequest. |
int |
getReference()
Returns the reference of the register of the coil that should be written to with this ReadCoilsRequest. |
void |
readData(java.io.DataInput din)
Reads the subclass specific data from the given DataInput instance. |
void |
setCoil(boolean b)
Sets the state that should be written with this WriteCoilRequest. |
void |
setReference(int ref)
Sets the reference of the register of the coil that should be written to with this ReadCoilsRequest. |
void |
writeData(java.io.DataOutput dout)
Writes the subclass specific data to the given DataOutput. |
Methods inherited from class net.wimpi.modbus.msg.ModbusRequest |
createExceptionResponse, createModbusRequest |
Methods inherited from class net.wimpi.modbus.msg.ModbusMessageImpl |
getDataLength, getFunctionCode, getHexMessage, getOutputLength, getProtocolID, getTransactionID, getUnitID, isHeadless, readFrom, setDataLength, setFunctionCode, setHeadless, setHeadless, setProtocolID, setTransactionID, setUnitID, writeTo |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public WriteCoilRequest()
public WriteCoilRequest(int ref, boolean b)
ref
- the reference number of the register
to read from.b
- true if the coil should be set of
false if it should be unset.Method Detail |
public ModbusResponse createResponse()
ModbusRequest
The implementation should take care about assembling the reply to this ModbusRequest.
createResponse
in class ModbusRequest
public void setReference(int ref)
ref
- the reference of the coil's register.public int getReference()
public void setCoil(boolean b)
b
- true if the coil should be set of
false if it should be unset.public boolean getCoil()
public void writeData(java.io.DataOutput dout) throws java.io.IOException
ModbusMessageImpl
writeData
in class ModbusMessageImpl
dout
- the DataOutput to be written to.
java.io.IOException
- if an I/O related error occurs.public void readData(java.io.DataInput din) throws java.io.IOException
ModbusMessageImpl
readData
in class ModbusMessageImpl
din
- the DataInput to read from.
java.io.IOException
- if an I/O related error occurs.
|
jamod at SF | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |