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.VdsAndongReqFramePacket;

import java.nio.ByteBuffer;

/**
 * VDS Status Initialize 요청
 */
public class VdsReqStatusInitialize extends VdsReqFramePacket {

    private final VdsFramePacket framePacket;

    public VdsReqStatusInitialize(TbVdsCtlrDto vdsObj) {
        this.opCode = eVdsOpCode.OP_VDS_STATUS_INITIALIZE;
        byte opCode = (byte)this.opCode.getValue();
        this.packetNmbr = vdsObj.getSeqNext();
        this.framePacket = new VdsAndongReqFramePacket(vdsObj.getGroupNo(), vdsObj.getVdsCtlrNmbr().intValue(), this.packetNmbr, opCode);
    }

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

}
