package com.njzscloud.common.localizer.contant;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor
public enum MessageType {
    ServerRegisterReply(0x8100),
    ServerTxtMsg(0x8300),
    ServerGeneralReply(0x8001),
    TerminalRegister(0x0100),
    TerminalAuth(0x0102),
    TerminalGeneralReply(0x0001),
    TerminalHeartbeat(0x0002),
    TerminalLocationReport(0x0200),
    TerminalLocationBatchReport(0x704),
    TerminalLocationSearchReply(0x0201),
    TerminalTxtMsg(0x6006),
    ;

    private final int messageId;

    public static MessageType getMessageType(int messageId) {
        MessageType[] values = MessageType.values();
        for (MessageType value : values) {
            if (value.messageId == messageId) {
                return value;
            }
        }
        return null;
    }

}
