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

import lombok.Getter;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Getter
public class VdsResFrameTail {

    public static int SIZE = 4;

    protected byte  dle;
    protected byte  etx;
    protected short crc;

    public VdsResFrameTail(byte[] packet, int tailPos) {

        //log.error("{}, {}", packet.length, tailPos);
        this.dle = packet[tailPos+0];
        this.etx = packet[tailPos+1];
        this.crc = (short)((packet[tailPos+2] << 8 | packet[tailPos+3]) & 0xFFFF);
    }
}
