package com.its.vds.xnettcp.vds.protocol.impl;

import com.its.vds.dto.TbVdsCtlrDto;
import com.its.vds.xnettcp.vds.protocol.VdsFramePacket;
import com.its.vds.xnettcp.vds.protocol.VdsReqFramePacket;
import com.its.vds.xnettcp.vds.protocol.enums.eVdsOpCode;
import com.its.vds.xnettcp.vds.protocol.impl.andong.VdsAndongFramePacket;

import java.nio.ByteBuffer;

/**
 * VDS Status Validation 요청
 */
public class VdsReqStatusValidation extends VdsReqFramePacket {

    private final VdsFramePacket framePacket;

    public VdsReqStatusValidation(TbVdsCtlrDto vdsObj) {
        this.opCode = eVdsOpCode.OP_VDS_STATUS_VALIDATION;
        this.packetNmbr = (short)this.opCode.getValue();
        byte opCode = (byte)this.opCode.getValue();
        this.packetNmbr = vdsObj.getSeqNext();
        this.framePacket = new VdsAndongFramePacket(vdsObj.getGroupNo().intValue(), vdsObj.getVdsCtlrNmbr().intValue(), this.packetNmbr, opCode);
    }

    @Override
    public ByteBuffer getByteBuffer() {
        return this.framePacket.getByteBuffer();
    }

}
