package com.mvc.iot.aep.enums;

public enum AepMsgType {
    DATAREPORT(1, "dataReport"),//设备数据变化
    COMMANDRESPONSE(2, "commandResponse"),//设备命令响应
    EVENTREPORT(3, "eventReport"),//设备事件上报
    DEVICEONLINEOFFLINEREPORT(6, "deviceOnlineOfflineReport"),//设备上下线
    DATAREPORTTUPUNION(5, "dataReportTupUnion"),//TUP合并数据变化
    ADDDELETEDEVICE(6, "addDeleteDevice")//6.设备增加删除
    ;

    private final int category;
    private final String description;

    AepMsgType(int category, String description) {
        this.category = category;
        this.description = description;
    }

    public static AepMsgType getByDescription(String description) {
        for (AepMsgType type : values()) {
            if (type.description.equals(description)) {
                return type;
            }
        }
        return null;
    }

    public int getCategory() {
        return category;
    }

    public String getDescription() {
        return description;
    }
}
