All Downloads are FREE. Search and download functionalities are using the official Maven repository.

me.martiii.modbustcpjava.protocol.ModbusHeader Maven / Gradle / Ivy

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 +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy