public interface ModbusFunction
This API exists to support user-defined Modbus functions that are not defined in the specification.
| Modifier and Type | Method | Description |
|---|---|---|
ModbusBlockType |
blockType() |
Get the register block type related to this function.
|
boolean |
equals(Object obj) |
|
default ModbusFunctionCode |
functionCode() |
Get this function as a
ModbusFunctionCode. |
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.
|
byte getCode()
default ModbusFunctionCode functionCode()
ModbusFunctionCode.String toDisplayString()
boolean isReadFunction()
ModbusFunction oppositeFunction()
This 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
ModbusBlockType blockType()