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 Data Individual Vehicle 요청
 */
public class VdsReqDataVehicle extends VdsReqFramePacket {

    private final VdsFramePacket framePacket;

    public VdsReqDataVehicle(TbVdsCtlrDto vdsObj) {
        this.opCode = eVdsOpCode.OP_VDS_DATA_VEHICLE;
        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();
    }

}
