Class 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 Detail

      • ModbusReadRequestBlueprint

        public ModbusReadRequestBlueprint​(int slaveId,
                                          ModbusReadFunctionCode functionCode,
                                          int start,
                                          int length,
                                          int maxTries)
    • Method Detail

      • 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()
      • 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()
        Overrides:
        hashCode in class Object
      • equals

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