001 /*
002 * ===========================================================================================
003 * = COPYRIGHT
004 *          PAX Computer Technology (Shenzhen) Co., Ltd. PROPRIETARY INFORMATION
005 *   This software is supplied under the terms of a license agreement or nondisclosure
006 *   agreement with PAX Computer Technology (Shenzhen) Co., Ltd. and may not be copied or
007 *   disclosed except in accordance with the terms in that agreement.
008 *     Copyright (C) 2017-2023 PAX Computer Technology (Shenzhen) Co., Ltd. All rights reserved.
009 * Description: // Detail description about the function of this module,
010 *             // interfaces with the other modules, and dependencies.
011 * Revision History:
012 * Date                         Author                        Action
013 * 2017/04/01                   PAX                     Create/Add/Modify/Delete
014 * ===========================================================================================
015 */
016 
017package com.pax.dal.exceptions;
018
019import com.pax.dal.utils.Utils;
020
021public enum EPiccDevException {
022    /**
023     * <div class="zh"> 未知异常 </div> <div class="en"> unexpected error </div>
024     */
025    DEVICES_ERR_UNEXPECTED(97, "unexpected error", "未知异常"),
026    /**
027     * <div class="zh"> 参数错误 </div> <div class="en"> invalid argument error </div>
028     */
029    DEVICES_ERR_INVALID_ARGUMENT (98, "invalid argument error", "参数错误"),
030    /**
031     * <div class="zh"> RPC I/O 连接异常 </div> <div class="en"> connect error </div>
032     */
033    DEVICES_ERR_CONNECT(99, "connect error", "RPC I/O 连接异常"),
034    /**
035     * <div class="zh"> 不支持 </div> <div class="en"> not support error </div>
036     */
037    DEVICES_ERR_NO_SUPPORT(100, "not support error", "不支持"),
038    /**
039     * <div class="zh"> 无权限异常</div> <div class="en"> no permission error </div>
040     */
041    DEVICES_ERR_NO_PERMISSION(101,"no permission error","无权限异常"),
042    
043    /**
044     * <div class="zh"> 模块被禁用 </div> <div class="en"> module disabled </div>
045     */
046    ERROR_DISABLED(102, "module disabled", "模块被禁用"), 
047    
048    /**
049     * <div class="zh"> 插件方法未找到</div> <div class="en"> plugin method not found </div>
050     */
051    ERROR_PLUGIN_METHOD_NOT_FOUND(103,"plugin method not found","插件方法未找到"),
052    
053    /**
054     * <div class="zh"> 不在白名单中 </div> <div class="en"> not in whiteList </div>
055     */
056    ERROR_NOT_IN_WHITELIST(104,"not in whiteList","不在白名单中"),
057    
058    /**
059     * <div class="zh"> 参数错误 </div> <div class="en"> Parameter error </div>
060     */
061    PICC_ERR_PARA(1, "para error", "参数错误"),
062    /**
063     * <div class="zh"> 射频模块未开启 </div> <div class="en"> RF module close </div>
064     */
065    PICC_ERR_NOT_OPEN(2, "not open error", "射频模块未开启"),
066    /**
067     * <div class="zh"> 未搜寻到卡片(感应区内无指定类型的卡片) </div> <div class="en"> No specific card in sensing area </div>
068     */
069    PICC_ERR_NOT_SEARCH_CARD(3, "not search card error", "未搜寻到卡片(感应区内无指定类型的卡片)"),
070    /**
071     * <div class="zh"> 感应区内卡片过多(出现通讯冲突) </div> <div class="en"> Too much card in sensing area(communication conflict)
072     * </div>
073     */
074    PICC_ERR_CARD_TOO_MANY(4, "too many card error", "感应区内卡片过多(出现通讯冲突)"),
075    /**
076     * <div class="zh"> 协议错误(卡片应答中出现违反协议规定的数据) </div> <div class="en"> Protocol error(The data response from card
077     * breaches the agreement) </div>
078     */
079    PICC_ERR_PROTOCOL1(5, "protocol1 error", "协议错误(卡片应答中出现违反协议规定的数据)"),
080    /**
081     * <div class="zh"> 卡片未激活 </div> <div class="en"> Card not activated </div>
082     */
083    PICC_ERR_NO_ACTIVATION(6, "no activation error", "卡片未激活"),
084    /**
085     * <div class="zh"> 多卡冲突 </div> <div class="en"> Multi-card conflict </div>
086     */
087    PICC_ERR_MUTI_CARD(7, "muti card error", "多卡冲突"),
088    /**
089     * <div class="zh"> 超时无响应 </div> <div class="en"> No response timeout </div>
090     */
091    PICC_ERR_TIMEOUT(8, "timeout error", " 超时无响应"),
092    /**
093     * <div class="zh"> 协议错误 </div> <div class="en"> Protocol error </div>
094     */
095    PICC_ERR_PROTOCOL2(9, "protocol2 error", "协议错误"),
096    /**
097     * <div class="zh"> 通信传输错误 </div> <div class="en"> Communication transmission error </div>
098     */
099    PICC_ERR_IO(10, "io error", "通信传输错误"),
100    /**
101     * <div class="zh"> M1卡认证失败 </div> <div class="en"> M1 Card authentication failure </div>
102     */
103    PICC_ERR_M1_VERIFY(11, "M1 verify error", " M1卡认证失败"),
104    /**
105     * <div class="zh"> 扇区未认证 </div> <div class="en"> Sector is not certified </div>
106     */
107    PICC_ERR_FAN_VERIFY(12, "fan verify error", "扇区未认证"),
108    /**
109     * <div class="zh"> 数值块数据格式有误 </div> <div class="en"> The data format of value block is incorrect </div>
110     */
111    PICC_ERR_DATA_BLOCK(13, "data block error", "数值块数据格式有误"),
112    /**
113     * <div class="zh"> 卡片仍在感应区内 </div> <div class="en"> Card is still in sensing area </div>
114     */
115    PICC_ERR_CARD_SENSE(14, "card sense error", "卡片仍在感应区内"),
116    /**
117     * <div class="zh"> 卡片状态错误(如A/B卡调用M1卡接口, 或M1卡调用isoCommandByApdu接口) </div> <div class="en"> Card status error(If A/B
118     * card call M1 card interface, or M1 card call PiccIsoCommand interface) </div>
119     */
120    PICC_ERR_CARD_STATUS(15, "card status error", "卡片状态错误(如A/B卡调用M1卡接口, 或M1卡调用isoCommandByApdu接口)"),
121    /**
122     * <div class="zh"> 接口芯片不存在或异常 </div> <div class="en"> Interface chip does not exist or abnormal. </div>
123     */
124    PICC_ERR_NOT_CALL(16, "not call error", "接口芯片不存在或异常"),
125    /**
126     * <div class="zh"> cardEmulateListen没有调用成功 </div> <div class="en"> cardEmulateListen is not called successfully. </div>
127     */
128    PICC_ERR_NOT_LISTEN_OK(17, "cardEmulateListen is not called successfully", "cardEmulateListen没有调用成功"),
129    /**
130     * <div class="zh"> 没有调用cardEmulateSetListenPara函数设置参数</div> <div class="en"> The cardEmulateSetListenPara is not called to set the parameters. </div>
131     */
132    PICC_ERR_NOT_SET_PARA(18,"The cardEmulateSetListenPara is not called to set the parameters","没有调用cardEmulateSetListenPara函数设置参数"),
133    /**
134     * <div class="zh"> 非接芯片不支持模拟卡片</div> <div class="en"> Card emulate not support. </div>
135     */
136    PICC_ERR_NOT_SUPPORT(19,"Card emulate not support", "非接芯片不支持模拟卡片"),
137    /**
138     * <div class="zh"> 接收长度超出限制</div> <div class="en"> The receive length exceeded the limit. </div>
139     */
140    PICC_ERR_RX_LEN_EXCEED_EXP(20,"The receive length exceeded the limit", "接收长度超出限制"),
141
142    ;
143    private int errCodeFromBasement;
144    private String errMsgCn;
145    private String errMsgEn;
146
147    private EPiccDevException(int errCodeFromBasement, String errMsgEn, String errMsnCn) {
148        this.errCodeFromBasement = errCodeFromBasement;
149        this.errMsgCn = errMsnCn;
150        this.errMsgEn = errMsgEn;
151    }
152
153    public int getErrCodeFromBasement() {
154        return errCodeFromBasement;
155    }
156
157    public String getErrMsg() {
158        if (Utils.isZh()) {
159            return errMsgCn;
160        } else {
161            return errMsgEn;
162        }
163
164    }
165
166}