package com.its.op.xnetudp.protocol;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.nio.ByteBuffer;
import java.nio.ByteOrder;

@Data
@EqualsAndHashCode(callSuper=false)
public class CENTER_VMS_REQ_NOTIFY extends CENTER_VMS_COMM_MESSAGE {

	public CENTER_VMS_REQ_NOTIFY(int opCode) {
		super(CENTER_COMM_DEFINE.INT_ID_VMS_SERVER, opCode, 0, (byte)0x00);
	}

	@Override
	public ByteBuffer getBuffer() {
		int pktSize = 2;

		setLength(pktSize);

		ByteBuffer byteBuffer = ByteBuffer.allocate(CENTER_HEADER_SIZE + getLength());
		byteBuffer.order(ByteOrder.LITTLE_ENDIAN);

		byteBuffer.put(getSendId());
		byteBuffer.put(getRecvId());
		byteBuffer.put(getTotalFrame());
		byteBuffer.put(getCurrentFrame());
		byteBuffer.put(getMsgSeq());
		byteBuffer.put(getOpCode());
		byteBuffer.putShort(getLength());

		return byteBuffer;

	}


}
