Class MyRegister

  • All Implemented Interfaces:
    com.ghgande.j2mod.modbus.procimg.InputRegister, com.ghgande.j2mod.modbus.procimg.Register

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

      • MyRegister

        public MyRegister​(int index,
                          byte byte1,
                          byte byte2,
                          java.util.function.Consumer<MyRegister> callback)
    • Method Detail

      • 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