package com.ningdatech.carapi.client;

import lombok.Data;

@Data
public class RadarPacket {
    private static final byte[] HEADER = {0x55, (byte) 0xAA, 0x55, (byte) 0xBB};
    private static final byte[] FOOTER = {0x55, (byte) 0xCC, 0x55, (byte) 0xDD};

    private short dataLength;
    private byte dataType;
    private byte checksum;
    private String deviceId;
    private long timestamp;
    private byte[] data;

    // 构造函数、getter和setter方法
    // ...

    public byte[] toByteArray() {
        // 实现将数据包转换为字节数组的逻辑
        return new byte[0];
    }

    public static RadarPacket fromByteArray(byte[] bytes) {
        // 实现从字节数组解析数据包的逻辑
        return new RadarPacket();
    }
}