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 java.lang.Object implements com.ghgande.j2mod.modbus.procimg.Register
Largely copied fromSynchronizedAbstractRegister
.
-
-
Constructor Summary
Constructors Constructor Description MyRegister(int index, byte byte1, byte byte2, java.util.function.Consumer<MyRegister> callback)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected byte
getByte1()
protected byte
getByte2()
protected int
getIndex()
int
getValue()
void
setValue(byte[] bytes)
protected void
setValue(byte byte1, byte byte2)
void
setValue(int v)
void
setValue(short s)
byte[]
toBytes()
short
toShort()
int
toUnsignedShort()
-
-
-
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 interfacecom.ghgande.j2mod.modbus.procimg.InputRegister
-
toUnsignedShort
public int toUnsignedShort()
- Specified by:
toUnsignedShort
in interfacecom.ghgande.j2mod.modbus.procimg.InputRegister
-
toShort
public short toShort()
- Specified by:
toShort
in interfacecom.ghgande.j2mod.modbus.procimg.InputRegister
-
toBytes
public byte[] toBytes()
- Specified by:
toBytes
in interfacecom.ghgande.j2mod.modbus.procimg.InputRegister
-
setValue
protected void setValue(byte byte1, byte byte2)
-
setValue
public void setValue(int v)
- Specified by:
setValue
in interfacecom.ghgande.j2mod.modbus.procimg.Register
-
setValue
public final void setValue(short s)
- Specified by:
setValue
in interfacecom.ghgande.j2mod.modbus.procimg.Register
-
setValue
public void setValue(byte[] bytes)
- Specified by:
setValue
in interfacecom.ghgande.j2mod.modbus.procimg.Register
-
-