Class MyRegister

java.lang.Object
io.openems.edge.controller.api.modbus.MyRegister
All Implemented Interfaces:
com.ghgande.j2mod.modbus.procimg.InputRegister, com.ghgande.j2mod.modbus.procimg.Register

public class MyRegister extends Object implements com.ghgande.j2mod.modbus.procimg.Register
Largely copied from SynchronizedAbstractRegister.
  • Constructor Details

    • MyRegister

      public MyRegister(int index, byte byte1, byte byte2, Consumer<MyRegister> callback)
  • Method Details

    • getIndex

      protected int getIndex()
    • getByte1

      protected byte getByte1()
    • getByte2

      protected byte getByte2()
    • getValue

      public int getValue()
      Specified by:
      getValue in interface com.ghgande.j2mod.modbus.procimg.InputRegister
    • toUnsignedShort

      public int toUnsignedShort()
      Specified by:
      toUnsignedShort in interface com.ghgande.j2mod.modbus.procimg.InputRegister
    • toShort

      public short toShort()
      Specified by:
      toShort in interface com.ghgande.j2mod.modbus.procimg.InputRegister
    • toBytes

      public byte[] toBytes()
      Specified by:
      toBytes in interface com.ghgande.j2mod.modbus.procimg.InputRegister
    • setValue

      protected void setValue(byte byte1, byte byte2)
    • setValue

      public void setValue(int v)
      Specified by:
      setValue in interface com.ghgande.j2mod.modbus.procimg.Register
    • setValue

      public final void setValue(short s)
      Specified by:
      setValue in interface com.ghgande.j2mod.modbus.procimg.Register
    • setValue

      public void setValue(byte[] bytes)
      Specified by:
      setValue in interface com.ghgande.j2mod.modbus.procimg.Register