|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.wimpi.modbus.msg.ModbusMessageImpl
net.wimpi.modbus.msg.ModbusResponse
net.wimpi.modbus.msg.WriteCoilResponse
public final class WriteCoilResponse
Class implementing a WriteCoilResponse. The implementation directly correlates with the class 0 function write coil (FC 5). It encapsulates the corresponding response message.
| Field Summary | |
|---|---|
private boolean |
m_Coil
|
private int |
m_Reference
|
| Constructor Summary | |
|---|---|
WriteCoilResponse()
Constructs a new WriteCoilResponse instance. |
|
WriteCoilResponse(int reference,
boolean b)
Constructs a new WriteCoilResponse instance. |
|
| Method Summary | |
|---|---|
boolean |
getCoil()
Gets the state that has been returned in this WriteCoilRequest. |
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. |
private void |
setCoil(boolean b)
Sets the state that has been returned in the raw response. |
private 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. |
| Methods inherited from class net.wimpi.modbus.msg.ModbusResponse |
|---|
createModbusResponse, setMessage |
| 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 |
| Field Detail |
|---|
private boolean m_Coil
private int m_Reference
| Constructor Detail |
|---|
public 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.| Method Detail |
|---|
private void setCoil(boolean b)
b - true if the coil should be set of
false if it should be unset.public boolean getCoil()
public int getReference()
private void setReference(int ref)
ref - the reference of the coil's register.
public void writeData(DataOutput dout)
throws IOException
ModbusMessageImpl
writeData in class ModbusMessageImpldout - the DataOutput to be written to.
IOException - if an I/O related error occurs.
public void readData(DataInput din)
throws IOException
ModbusMessageImpl
readData in class ModbusMessageImpldin - the DataInput to read from.
IOException - if an I/O related error occurs.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||