me.martiii.modbustcpjava.protocol.ModbusRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of modbus-tcp-java Show documentation
Show all versions of modbus-tcp-java Show documentation
Modbus-TCP protocol for java.
The newest version!
package me.martiii.modbustcpjava.protocol;
import java.util.Arrays;
public class ModbusRequest {
private byte functionCode;
protected byte[] data;
public ModbusRequest(byte functionCode, byte[] data) {
this.functionCode = functionCode;
this.data = data;
//TODO: Add write request helper class (like ReadRequest)
}
public ModbusRequest(byte functionCode) {
this.functionCode = functionCode;
}
public byte getFunctionCode() {
return functionCode;
}
public byte[] getData() {
return data;
}
@Override
public String toString() {
return "ModbusRequest{" +
"functionCode=" + functionCode +
", data=" + Arrays.toString(data) +
'}';
}
}