Class ModbusWriteRequestBlueprint

java.lang.Object
org.openhab.core.io.transport.modbus.ModbusWriteRequestBlueprint
Direct Known Subclasses:
ModbusWriteCoilRequestBlueprint, ModbusWriteRegisterRequestBlueprint

@NonNullByDefault public abstract class ModbusWriteRequestBlueprint extends Object
Base interface for Modbus write requests
Author:
Sami Salonen - Initial contribution
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    Accept visitor
    Returns the function code of this ModbusMessage as int.
    The function code is a 1-byte non negative integer value valid in the range of 0-127.
    Function codes are ordered in conformance classes their values are specified in net.wimpi.modbus.Modbus.
    abstract int
    Get maximum number of tries, in case errors occur.
    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.
    abstract int
    Returns the reference of the register/coil/discrete input to to start writing with this request
    abstract 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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ModbusWriteRequestBlueprint

      public ModbusWriteRequestBlueprint()
  • Method Details

    • 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.
    • getReference

      public abstract int getReference()
      Returns the reference of the register/coil/discrete input to to start writing with this request

      Returns:
      the reference of the register to start reading from as int.
    • getUnitID

      public abstract 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.
    • getFunctionCode

      public abstract ModbusWriteFunctionCode getFunctionCode()
      Returns the function code of this ModbusMessage as int.
      The function code is a 1-byte non negative integer value valid in the range of 0-127.
      Function codes are ordered in conformance classes their values are specified in net.wimpi.modbus.Modbus.

      Returns:
      the function code as int.
      See Also:
      • Modbus
    • getMaxTries

      public abstract int getMaxTries()
      Get maximum number of tries, in case errors occur. Should be at least 1.
    • accept

      public abstract void accept(ModbusWriteRequestBlueprintVisitor visitor)
      Accept visitor
      Parameters:
      visitor -