public final class UserModbusFunction extends Object implements ModbusFunction
| Constructor | Description |
|---|---|
UserModbusFunction(byte code) |
Constructor.
|
UserModbusFunction(String displayName,
byte code) |
Constructor.
|
UserModbusFunction(String displayName,
byte code,
ModbusBlockType blockType,
boolean readFunction,
ModbusFunction oppositeFunction) |
Constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
ModbusBlockType |
blockType() |
Get the register block type related to this function.
|
boolean |
equals(Object obj) |
|
byte |
getCode() |
Get the function code.
|
int |
hashCode() |
|
boolean |
isReadFunction() |
Return true if this function represents a read operation.
|
ModbusFunction |
oppositeFunction() |
Get an "opposite" function from this function.
|
String |
toDisplayString() |
Get a friendly display string for this function.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitfunctionCodepublic UserModbusFunction(byte code)
code - the function codepublic UserModbusFunction(String displayName, byte code)
displayName - the display namecode - the function codepublic UserModbusFunction(String displayName, byte code, ModbusBlockType blockType, boolean readFunction, ModbusFunction oppositeFunction)
displayName - the display namecode - the function codeblockType - the block typereadFunction - the read function flagoppositeFunction - the opposite functionpublic int hashCode()
hashCode in interface ModbusFunctionhashCode in class Objectpublic boolean equals(Object obj)
equals in interface ModbusFunctionequals in class Objectpublic byte getCode()
ModbusFunctiongetCode in interface ModbusFunctionpublic ModbusBlockType blockType()
ModbusFunctionblockType in interface ModbusFunctionpublic boolean isReadFunction()
ModbusFunctionisReadFunction in interface ModbusFunctionpublic ModbusFunction oppositeFunction()
ModbusFunctionThis method is used to get a read function for a given write function, and a write function for a given read function. Note that not all functions have exact opposites, such that:
ModbusFunction a = myFunction();
ModbusFunction b = a.oppositeFunction();
ModbusFunction c = b.oppositeFunction();
// at this stage c is not necessarily equal to a
oppositeFunction in interface ModbusFunctionpublic String toDisplayString()
ModbusFunctiontoDisplayString in interface ModbusFunction