package at.acdp.urweb.rtde.packets;

import at.acdp.urweb.rtde.CommandType;
import at.acdp.urweb.rtde.RTDEClient;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

import static at.acdp.urweb.rtde.CommandType.RTDE_GET_URCONTROL_VERSION;

public class RtdeRequestURVersion implements IRtdeData {
    private int replySize;
    public int major;
    public int minor;
    public int bugfix;
    public int build;

    @Override
    public int getType() {
        return RTDE_GET_URCONTROL_VERSION;
    }

    @Override
    public int getSize() {
        return 3;
    }

    @Override
    public void setReplySize(int s) {
        replySize = s;
    }

    @Override
    public RtdeRequestURVersion read(DataInputStream di) throws IOException {
        major=di.readInt();
        minor=di.readInt();
        bugfix=di.readInt();
        build=di.readInt();

        return this;
    }

    @Override
    public RtdeRequestURVersion send(DataOutputStream dos) throws IOException {
        sendHeader(dos);
        return this;
    }
}
