me.martiii.modbustcpjava.protocol.ModbusHeader 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;
public class ModbusHeader {
private int protocolIdentifier;
private byte unitIdentifier;
public ModbusHeader(byte unitIdentifier) {
this(0, unitIdentifier);
}
public ModbusHeader(int protocolIdentifier, byte unitIdentifier) {
this.protocolIdentifier = protocolIdentifier;
this.unitIdentifier = unitIdentifier;
}
public int getProtocolIdentifier() {
return protocolIdentifier;
}
public byte getUnitIdentifier() {
return unitIdentifier;
}
@Override
public String toString() {
return "ModbusHeader{" +
"protocolIdentifier=" + protocolIdentifier +
", unitIdentifier=" + unitIdentifier +
'}';
}
}