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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy