Class ModbusReadRequestBlueprint
java.lang.Object
org.openhab.core.io.transport.modbus.ModbusReadRequestBlueprint
Implementation of immutable representation of modbus read request
Equals and hashCode implemented keeping
PollTask
in mind: two instances of this class are considered the same
if they have
the equal parameters (same slave id, start, length, function code and maxTries).- Author:
- Sami Salonen - Initial contribution
-
Constructor Summary
ConstructorDescriptionModbusReadRequestBlueprint
(int slaveId, ModbusReadFunctionCode functionCode, int start, int length, int maxTries) -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
int
Maximum number of tries to execute the request, when request fails For example, number 1 means on try only with no re-tries.int
Returns the protocol identifier of this ModbusMessage as int.
The identifier is a 2-byte (short) non negative integer value valid in the range of 0-65535.int
int
Returns the unit identifier of this ModbusMessage as int.
The identifier is a 1-byte non negative integer value valid in the range of 0-255.int
hashCode()
toString()
-
Constructor Details
-
ModbusReadRequestBlueprint
public ModbusReadRequestBlueprint(int slaveId, ModbusReadFunctionCode functionCode, int start, int length, int maxTries)
-
-
Method Details
-
getUnitID
public int getUnitID()Returns the unit identifier of this ModbusMessage as int.
The identifier is a 1-byte non negative integer value valid in the range of 0-255.- Returns:
- the unit identifier as int.
-
getReference
public int getReference() -
getFunctionCode
-
getDataLength
public int getDataLength() -
getMaxTries
public int getMaxTries()Maximum number of tries to execute the request, when request fails For example, number 1 means on try only with no re-tries.- Returns:
- number of maximum tries
-
getProtocolID
public int getProtocolID()Returns the protocol identifier of this ModbusMessage as int.
The identifier is a 2-byte (short) non negative integer value valid in the range of 0-65535.- Returns:
- the protocol identifier as int.
-
hashCode
public int hashCode() -
toString
-
equals
-