package com.tomas.ckd_system;

import org.json.JSONException;
import org.json.JSONObject;

public class WsProtocol {
    public static String encapsulation(String cmd, JSONObject ext) {
        String tmp = "";
        try {
            JSONObject json = new JSONObject();
            json.put("cmd", cmd);
            if (ext != null) {
                json.put("ext", ext);
            }

            tmp = json.toString();
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return tmp;
    }

    public enum COMMAND {

        HELLO,
        RESET_REQUEST,
        RESET_ACK,

        GET_DEVICE_LIST_REQUEST,
        GET_DEVICE_LIST_ACK,

        REGISTER_REQUEST,
        REGISTER_ACK,

        SET_MODE_REQUEST,
        SET_MODE_ACK,

        AREA_CHANGE_NOTIFY_REQUEST,
        AREA_CHANGE_NOTIFY_ACK,

        MEIJI_CARD_DISPLAY_REQUEST,
        MEIJI_CARD_DISPLAY_ACK,

        DATA_REDRAW_REQUEST,
        DATA_REDRAW_ACK,

        EVENT_LOG_REQUEST,
        EVENT_LOG_ACK,

        DEVICE_CONNECT_NOTIFY_REQUEST,
        DEVICE_CONNECT_NOTIFY_ACK,

        DEVICE_DISCONNECT_NOTIFY_REQUEST,
        DEVICE_DISCONNECT_NOTIFY_ACK,

        OUTER_LINE_NOTIFY_REQUEST,
        OUTER_LINE_NOTIFY_ACK,
        TB_STAGING_MONITOR_MEIJI_CARD_OPEN,
        STAGING_DATA_TABLE_DISPLAY_REQUEST

    }

    public enum EVENT {

        TB_MEIJI_CARD_SUCCESS,

        TB_STAGING_MONITOR_MEIJI_CARD_SUCCESS,
        TB_STAGING_MONITOR_PACKING_METHOD_SUCCESS,
        TB_OUTER_PACKING_LEADER_CONFIRM_OPEN,
        TB_OUTER_PACKING_SUB_LEADER_CONFIRM_OPEN,
        TB_OUTER_PACKING_STOP_CASE_OPEN


    }
}


