Class ModbusReadRequestBlueprint

java.lang.Object
org.openhab.core.io.transport.modbus.ModbusReadRequestBlueprint

@NonNullByDefault public class ModbusReadRequestBlueprint extends Object
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 Details Link icon

    • ModbusReadRequestBlueprint Link icon

      public ModbusReadRequestBlueprint(int slaveId, ModbusReadFunctionCode functionCode, int start, int length, int maxTries)
  • Method Details Link icon

    • getUnitID Link icon

      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 Link icon

      public int getReference()
    • getFunctionCode Link icon

      public ModbusReadFunctionCode getFunctionCode()
    • getDataLength Link icon

      public int getDataLength()
    • getMaxTries Link icon

      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 Link icon

      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 Link icon

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object
    • equals Link icon

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object