package com.mogo.telematic;

import java.util.Arrays;

public class MogoProtocolMsg {
    // 心跳数据包类型
    public static final int HEART_DATA = 0;
    // 普通数据
    public static final int NORMAL_DATA = 1;
    // 业务相关的身份注册
    public static final int IDENTITY_REGIST = 2;
    // 同步美化模式状态
    public static final int SYNC_MODE_STATUS = 3;
    public static final int REQ_CAR_NUMBER = 4;
    public static final int REQ_MAC_ADDRESS = 5;
    // 启动自动驾驶
    public static final int REQ_START_AUTOPILOT = 6;

    private int protocolType;
    private int bodyLength;
    private byte[] body;

    public MogoProtocolMsg() {}

    public MogoProtocolMsg(int protocolType, int bodyLength, byte[] body) {
        this.protocolType = protocolType;
        this.bodyLength = bodyLength;
        this.body = body;
    }

    public int getProtocolType() {
        return protocolType;
    }

    public void setProtocolType(int protocolType) {
        this.protocolType = protocolType;
    }

    public int getBodyLength() {
        return bodyLength;
    }

    public void setBodyLength(int bodyLength) {
        this.bodyLength = bodyLength;
    }

    public byte[] getBody() {
        return body;
    }

    public void setBody(byte[] body) {
        this.body = body;
    }

    @Override
    public String toString() {
        return "MogoProtocolMsg{" +
                "protocolType=" + protocolType +
                ", bodyLength=" + bodyLength +
                ", body=" + Arrays.toString(body) +
                '}';
    }
}
