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 EPedDevException {
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"> Key does not exist </div>
050     */
051    PED_ERR_NO_KEY(1, "Key does not exist", "密钥不存在"),
052    /**
053     * <div class="zh"> 密钥索引错,参数索引不在范围内 </div> <div class="en"> Key index error, parameter index is not in the range
054     * </div>
055     */
056    PED_ERR_KEYIDX(2, "key index error", "密钥索引错,参数索引不在范围内"),
057    /**
058     * <div class="zh"> 密钥写入时,源密钥的层次比目的密钥低 </div> <div class="en"> When key is written, the source key level is lower
059     * than the destination level. </div>
060     */
061    PED_ERR_DERIVE(3, "derive error", "密钥写入时,源密钥的层次比目的密钥低"),
062    /**
063     * <div class="zh"> 密钥验证失败 </div> <div class="en"> Key verification failed </div>
064     */
065    PED_ERR_CHECK_KEY_FAIL(4, "check key fail error", " 密钥验证失败"),
066    /**
067     * <div class="zh"> 取消输入PIN </div> <div class="en"> Cancel to enter PIN. </div>
068     */
069    PED_ERR_INPUT_CANCEL(5, "input cancel error", "取消输入PIN"),
070    /**
071     * <div class="zh"> 函数调用小于最小间隔时间 </div> <div class="en"> Calling function interval is less than minimum interval
072     * time. </div>
073     */
074    PED_ERR_WAIT_INTERVAL(6, "wait interval error", "函数调用小于最小间隔时间"),
075    /**
076     * <div class="zh"> KCV模式错,不支持 </div> <div class="en"> KCV mode error, do not support </div>
077     */
078    PED_ERR_CHECK_MODE(7, "check mode error", "KCV模式错,不支持"),
079    /**
080     * <div class="zh"> 无权使用该密钥,当出现密钥标签不对,或者写入密钥时,源密钥类型的值大于目的密钥类型,都会返回该密钥 </div> <div class="en"> Not allowed to use the
081     * key. When key label is not correct or source key type is bigger than destination key type, PED will return this
082     * code </div>
083     */
084    PED_ERR_NO_RIGHT_USE(8, "no right user error", " 无权使用该密钥,当出现密钥标签不对,或者写入密钥时,源密钥类型的值大于目的密钥类型,都会返回该密钥"),
085    /**
086     * <div class="zh"> 密钥类型错 </div> <div class="en"> Key type error </div>
087     */
088    PED_ERR_KEY_TYPE(9, "key type error", "密钥类型错"),
089    /**
090     * <div class="zh"> 期望PIN的长度字符串错 </div> <div class="en"> Expected PIN length string error </div>
091     */
092    PED_ERR_EXPLEN(10, "explen error", "期望PIN的长度字符串错"),
093    /**
094     * <div class="zh"> 目的密钥索引错,不在范围内 </div> <div class="en"> Destination key index error </div>
095     */
096    PED_ERR_DSTKEY_IDX(11, "dstKey index error", "目的密钥索引错,不在范围内"),
097    /**
098     * <div class="zh"> 源密钥索引错,不在范围内 </div> <div class="en"> Source key index error </div>
099     */
100    PED_ERR_SRCKEY_IDX(12, "srcKey index error", "源密钥索引错,不在范围内"),
101    /**
102     * <div class="zh"> 密钥长度错 </div> <div class="en"> Key length error </div>
103     */
104    PED_ERR_KEY_LEN(13, "key length error", "密钥长度错"),
105    /**
106     * <div class="zh"> 输入PIN超时 </div> <div class="en"> PIN input timeout </div>
107     */
108    PED_ERR_INPUT_TIMEOUT(14, "input timeout error", "输入PIN超时"),
109    /**
110     * <div class="zh"> IC卡不存在 </div> <div class="en"> IC card does not exist </div>
111     */
112    PED_ERR_NO_ICC(15, "no icc error", "IC卡不存在"),
113    /**
114     * <div class="zh"> IC卡未初始化 </div> <div class="en"> IC card is not initialized </div>
115     */
116    PED_ERR_ICC_NO_INIT(16, "icc no init error", " IC卡未初始化"),
117    /**
118     * <div class="zh"> DUKPT组索引号错 </div> <div class="en"> DUKPT index error </div>
119     */
120    PED_ERR_GROUP_IDX(17, "group index error", " DUKPT组索引号错"),
121    /**
122     * <div class="zh"> 指针参数非法为空 </div> <div class="en"> Pointer parameter error </div>
123     */
124    PED_ERR_PARAM_PTR_NULL(18, "param ptr null error", "指针参数非法为空"),
125    /**
126     * <div class="zh"> PED已锁 </div> <div class="en"> PED locked </div>
127     */
128    PED_ERR_LOCKED(19, "locked error", "PED已锁"),
129    /**
130     * <div class="zh"> PED通用错误 </div> <div class="en"> PED general error </div>
131     */
132    PED_ERROR(20, "ped error", "PED通用错误"),
133    /**
134     * <div class="zh"> 没有空闲的缓冲 </div> <div class="en"> No free buffer </div>
135     */
136    PED_ERR_NOMORE_BUF(21, "nomore buf error", " 没有空闲的缓冲"),
137    /**
138     * <div class="zh"> 需要取得高级权限 </div> <div class="en"> Not administration </div>
139     */
140    PED_ERR_NEED_ADMIN(22, "need admin error", "需要取得高级权限"),
141    /**
142     * <div class="zh"> DUKPT已经溢出 </div> <div class="en"> DUKPT overflow </div>
143     */
144    PED_ERR_DUKPT_OVERFLOW(23, "dukpt overFlow error", "DUKPT已经溢出"),
145    /**
146     * <div class="zh"> KCV 校验失败 </div> <div class="en"> KCV check error </div>
147     */
148    PED_ERR_KCV_CHECK_FAIL(24, "kcv check error", "KCV 校验失败"),
149    /**
150     * <div class="zh"> 源密钥类型错 </div> <div class="en"> Source key type error </div>
151     */
152    PED_ERR_SRCKEY_TYPE(25, "srcKey type error", "源密钥类型错"),
153    /**
154     * <div class="zh"> 命令不支持 </div> <div class="en"> Command not support </div>
155     */
156    PED_ERR_UNSPT_CMD(26, "unsupport cmd error", "命令不支持"),
157    /**
158     * <div class="zh"> 通讯错误 </div> <div class="en"> Communication error </div>
159     */
160    PED_ERR_COMM(27, "communication error", "通讯错误"),
161    /**
162     * <div class="zh"> 没有用户认证公钥 </div> <div class="en"> No user authentication public key </div>
163     */
164    PED_ERR_NO_UAPUK(28, "no uapuk error", "没有用户认证公钥"),
165    /**
166     * <div class="zh"> 取系统敏感服务失败 </div> <div class="en"> Administration error </div>
167     */
168    PED_ERR_ADMIN(29, "admin error", "取系统敏感服务失败"),
169    /**
170     * <div class="zh"> PED处于下载非激活状态 </div> <div class="en"> PED download inactive </div>
171     */
172    PED_ERR_DOWNLOAD_INACTIVE(30, "downLoad inactive error", " PED处于下载非激活状态"),
173    /**
174     * <div class="zh"> KCV 奇校验失败 </div> <div class="en"> KCV parity check fail </div>
175     */
176    PED_ERR_KCV_ODD_CHECK_FAIL(31, "kcv odd check fail error", " KCV 奇校验失败"),
177    /**
178     * <div class="zh"> 读取PED数据失败 </div> <div class="en"> Read PED data fail </div>
179     */
180    PED_ERR_PED_DATA_RW_FAIL(32, "ped data rw fail error", "读取PED数据失败"),
181    /**
182     * <div class="zh"> 卡操作错误(脱机明文、密文密码验证) </div> <div class="en"> ICC operation fail </div>
183     */
184    PED_ERR_ICC_CMD(33, "icc cmd error", "卡操作错误(脱机明文、密文密码验证)"),
185    /**
186     * <div class="zh"> 用户按CLEAR键退出输入PIN </div> <div class="en"> Pressing CLEAR to exit input </div>
187     */
188    PED_ERR_INPUT_CLEAR(34, "input clear error", " 用户按CLEAR键退出输入PIN"),
189    /**
190     * <div class="zh"> PED存储空间不足 </div> <div class="en"> PED has no enough storage space </div>
191     */
192    PED_ERR_NO_FREE_FLASH(35, "no free flash error", "PED存储空间不足"),
193    /**
194     * <div class="zh"> DUKPT KSN需要先加1 </div> <div class="en"> DUKPT KSN need to plus 1 first </div>
195     */
196    PED_ERR_DUKPT_NEED_INC_KSN(36, "dukpt need increase ksn", " DUKPT KSN需要先加1"),
197    /**
198     * <div class="zh"> KCV MODE错误 </div> <div class="en"> KCV MODE error </div>
199     */
200    PED_ERR_KCV_MODE(37, "kcv mode error", " KCV MODE错误"),
201    /**
202     * <div class="zh"> 无 KCV </div> <div class="en"> NO KCV </div>
203     */
204    PED_ERR_DUKPT_NO_KCV(38, "dukpt no kcv error", " 无 KCV"),
205    /**
206     * <div class="zh"> 按FN/ATM4键取消PIN输入 </div> <div class="en"> Press FN/ATM4 to cancel PIN inputting. </div>
207     */
208    PED_ERR_PIN_BYPASS_BYFUNKEY(39, "Pass or Funkey to cancle pin input error", "按FN/ATM4键取消PIN输入"),
209    /**
210     * <div class="zh"> 数据MAC校验错 </div> <div class="en"> Data MAC check error </div>
211     */
212    PED_ERR_MAC(40, "mac error", " 数据MAC校验错"),
213    /**
214     * <div class="zh"> 数据CRC校验错 </div> <div class="en"> Data CRC check error </div>
215     */
216    PED_ERR_CRC(41, "crc error", " 数据CRC校验错"),
217
218    /**
219     * <div class="zh"> 数据包长度非法 </div> <div class="en"> Length of data illegal </div>
220     */
221    PED_ERR_EX_A_LEN(42, "Length of data illegal", "数据包长度非法"),
222    /**
223     * <div class="zh"> 无效的密钥标志号 </div> <div class="en"> Invalid Key Index </div>
224     */
225    PED_ERR_EX_A_INVALID_INDEX(43, "Invalid  Key Index", " 无效的密钥标志号"),
226    /**
227     * <div class="zh"> mode非法 </div> <div class="en"> Mode Illegal </div>
228     */
229    PED_ERR_EX_A_INVALID_MODE(44, "Mode Illegal", "mode非法"),
230    /**
231     * <div class="zh"> 显示坐标值错 </div> <div class="en"> Displayed Coordinate Value Error </div>
232     */
233    PED_ERR_EX_A_COORDONATE(45, "Displayed Coordinate Value Error", " 显示坐标值错"),
234    /**
235     * <div class="zh"> 无效的允许输入长度(非法MinLen或MaxLen) </div> <div class="en"> Invalid allowed typing length(Illegal MinLen
236     * or MaxLen) </div>
237     */
238    PED_ERR_EX_A_INPUT_LEN(46, "Invalid allowed typing length(Illegal MinLen or MaxLen)", "无效的允许输入长度(非法MinLen或MaxLen)"),
239    /**
240     * <div class="zh"> 中止输入(收到POS端的中止命令包) </div> <div class="en"> Abort typing (receive the abort command package from
241     * POS port) </div>
242     */
243    PED_ERR_EX_A_SUSPEND(47, "Abort typing (receive the abort command package from POS port)", " 中止输入(收到POS端的中止命令包)"),
244    /**
245     * <div class="zh"> 输入超时(缺省超时时长为120秒) </div> <div class="en"> Typing overtime(default timeout is 120 seconds) </div>
246     */
247    PED_ERR_EX_A_TIMEOUT(48, "Typing overtime(default timeout is 120 seconds)", "输入超时(缺省超时时长为120秒)"),
248    /**
249     * <div class="zh"> 两次输入的密码不一致 </div> <div class="en"> The Passwords entered two times are not the same </div>
250     */
251    PED_ERR_EX_A_NOT_CONSISTENT(49, "The Passwords entered two times are not the same", "两次输入的密码不一致"),
252    /**
253     * <div class="zh"> 指定的密钥不存在 </div> <div class="en"> Specific Key not exists </div>
254     */
255    PED_ERR_EX_A_NOT_EXIST(50, "Specific Key not exists", "指定的密钥不存在"),
256    /**
257     * <div class="zh"> 内存错 </div> <div class="en"> Memory Error </div>
258     */
259    PED_ERR_EX_A_MEMERY(51, "Memory Error", "内存错"),
260    /**
261     * <div class="zh"> 奇校验错 </div> <div class="en"> Odd Verify Error </div>
262     */
263    PED_ERR_EX_A_ODD_CHECK(52, "Odd Verify Error", " 奇校验错"),
264    /**
265     * <div class="zh"> TMK错 </div> <div class="en"> TMK error </div>
266     */
267    PED_ERR_EX_A_TMK(53, "TMK Error", "TMK错"),
268    /**
269     * <div class="zh"> MAC2不相等 </div> <div class="en"> MAC2 not equal </div>
270     */
271    PED_ERR_EX_A_MAC2(54, "MAC2 not equal", "MAC2不相等"),
272    /**
273     * <div class="zh"> 连续两次输入的间隔时间未达到指定时长(30秒) </div> <div class="en"> The interval between two consecutive typing is
274     * not reach the specific time(30 seconds) </div>
275     */
276    PED_ERR_EX_A_TIME_INTERVAL(55,
277            "The interval between two  consecutive typing is not reach the specific time(30 seconds)",
278            "连续两次输入的间隔时间未达到指定时长(30秒)"),
279    /**
280     * <div class="zh"> 指定的密钥不存在或无效 </div> <div class="en"> Specific key not exists or invalid </div>
281     */
282    PED_ERR_EX_A_KEY(56, "Specific Key not exists or invalid", "指定的密钥不存在或无效"),
283    /**
284     * <div class="zh"> 无空闲的DUKPT密钥存储空间 </div> <div class="en"> No free DUKPT key memory space </div>
285     */
286    PED_ERR_EX_A_DUKPT_FULL(57, "No free DUKPT key memory space", "无空闲的DUKPT密钥存储空间"),
287    /**
288     * <div class="zh"> 无效的应用标志号 </div> <div class="en"> Invalid Application Flag </div>
289     */
290    PED_ERR_EX_A_APP_NO(58, "Invalid Application Flag", "无效的应用标志号"),
291    /**
292     * <div class="zh"> 指定密钥的校验字不符 </div> <div class="en"> Not match the specific check value </div>
293     */
294    PED_ERR_EX_A_KEY_CHECK(59, "Not match the specific check value", " 指定密钥的校验字不符"),
295    /**
296     * <div class="zh"> 无效的密钥(BDK)长度 </div> <div class="en"> Invalid Key(BDK) Length </div>
297     */
298    PED_ERR_EX_A_BDK_LEN(60, "Invalid Key(BDK) Length ", "无效的密钥(BDK)长度"),
299    /**
300     * <div class="zh"> 无效的密钥序号(KSN)长度 </div> <div class="en"> Invalid Key(BDK) Length </div>
301     */
302    PED_ERR_EX_A_KSN_LEN(61, "Invalid Key Serial No.(KSN) Length", " 无效的密钥序号(KSN)长度"),
303    /**
304     * <div class="zh"> 欲清除的密钥已不存在 </div> <div class="en"> want to clear key already not exists </div>
305     */
306    PED_ERR_EX_A_NOEXIST(62, "Want to clear key already not exists", "欲清除的密钥已不存在"),
307    /**
308     * <div class="zh"> PINPAD取消 (pinpad 端) </div> <div class="en"> PINPAD Canceled </div>
309     */
310    PED_ERR_EX_A_CANCEL(63, "PINPAD Canceled", "PINPAD取消 (pinpad 端)"),
311    /**
312     * <div class="zh"> PINPAD被锁 </div> <div class="en"> PINPAD Locked </div>
313     */
314    PED_ERR_EX_A_LOCK(64, "PINPAD Locked", "PINPAD被锁"),
315    /**
316     * <div class="zh"> 解锁失败 </div> <div class="en"> unlock failure </div>
317     */
318    PED_ERR_EX_A_UNLOCK(65, "Unlock Failure", "解锁失败"),
319    /**
320     * <div class="zh"> 无效的命令请求字 </div> <div class="en"> invalid command request </div>
321     */
322    PED_ERR_EX_A_CMD(66, "Invalid Command Request", "无效的命令请求字"),
323    /**
324     * <div class="zh"> TXK存取失败 </div> <div class="en"> TXK Access failure </div>
325     */
326    PED_ERR_EX_A_TXK(67, "TXK Access  Failure", "TXK存取失败"),
327    /**
328     * <div class="zh"> 工作密钥长度错 </div> <div class="en"> work key length error </div>
329     */
330    PED_ERR_EX_A_WKEY_LEN(68, "Work Key Length Error", " 工作密钥长度错"),
331    /**
332     * <div class="zh"> 扩展MAC CihperFlag错误或者INPUTMODE错误 </div> <div class="en"> Expand MAC CihperFlag Error or INPUTMODE
333     * Error </div>
334     */
335    PED_ERR_EX_A_MAC_CIPHER_FLAG(69, "Expand MAC CihperFlag Error or INPUTMODE Error",
336            "扩展MAC  CihperFlag错误或者INPUTMODE错误"),
337    /**
338     * <div class="zh"> 按clear键取消 </div> <div class="en"> Press clear button to cancel </div>
339     */
340    PED_ERR_EX_A_CLEAR_CANCEL(70, "Press clear button to cancel ", "按clear键取消"),
341    /**
342     * <div class="zh"> 其他错误 </div> <div class="en"> others error </div>
343     */
344    PED_ERR_EX_A_OTHER(71, "Others Error", " 其他错误"),
345    /**
346     * <div class="zh"> 数据收发失败 </div> <div class="en"> data send-recvive failure </div>
347     */
348    PED_ERR_EX_A_COMM(72, "Data Send-reveive Failure", " 数据收发失败"),
349    /**
350     * <div class="zh"> LRC校验失败 </div> <div class="en"> LRC verify error </div>
351     */
352    PED_ERR_EX_A_LRC(73, "LRC Verify Error", "LRC校验失败"),
353    /**
354     * <div class="zh"> 不支持的调用 </div> <div class="en"> unsupported call </div>
355     */
356    PED_ERR_EX_A_NOT_SUPPORT(74, "Unsupported Call", " 不支持的调用"),
357    // add date:20170427
358    /**
359     * <div class="zh"> TRSYS Buf太小 </div> <div class="en"> TRSYS Buf too small </div>
360     */
361    TRSYS_RET_BUF_TOO_SMALL(75, "TRSYS Buf too small", "TRSYS Buf太小"),
362    /**
363     * <div class="zh"> TRSYS Cert 格式化错误 </div> <div class="en"> TRSYS Cert format error </div>
364     */
365    TRSYS_RET_CERT_FORMAT_ERR(76, "TRSYS Cert format error", "TRSYS Cert 格式化错误"),
366    /**
367     * <div class="zh"> TRSYS 通用错误 </div> <div class="en"> TRSYS common error </div>
368     */
369    TRSYS_RET_ERROR(77, "TRSYS common error", "TRSYS 通用错误"),
370    /**
371     * <div class="zh"> TRSYS Kcv 校验失败 </div> <div class="en"> TRSYS Kcv check Fail </div>
372     */
373    TRSYS_RET_KCV_CHECK_FAIL(78, "TRSYS Kcv check Fail", "TRSYS Kcv 校验失败"),
374    /**
375     * <div class="zh"> TRSYS Kcv 模式错误 </div> <div class="en"> TRSYS Kcv mode error </div>
376     */
377    TRSYS_RET_KCV_MODE_ERR(79, "TRSYS Kcv mode error", "TRSYS Kcv 模式错误"),
378    /**
379     * <div class="zh"> TRSYS Key已经存在 </div> <div class="en"> TRSYS Key already exists </div>
380     */
381    TRSYS_RET_KEY_PRESENT(80, " TRSYS Key already exists", "TRSYS Key已经存在"),
382    /**
383     * <div class="zh"> TRSYS 没有rsa证书 </div> <div class="en"> TRSYS No rsa cert </div>
384     */
385    TRSYS_RET_NO_RSA_CERT(81, "TRSYS No rsa cert", "TRSYS 没有rsa证书"),
386    /**
387     * <div class="zh"> TRSYS 没有rsa秘钥 </div> <div class="en"> TRSYS No rsa key </div>
388     */
389    TRSYS_RET_NO_RSA_KEY(82, " TRSYS No rsa key", "TRSYS 没有rsa秘钥"),
390    /**
391     * <div class="zh"> TRSYS 参数非法 </div> <div class="en"> TRSYS Invalid param </div>
392     */
393    TRSYS_RET_PARAM_INVALID(83, "TRSYS Invalid param", "TRSYS 参数非法"),
394    /**
395     * <div class="zh"> TRSYS rsa padding 错误 </div> <div class="en"> TRSYS Rsa padding error </div>
396     */
397    TRSYS_RET_RSA_PADDING_ERROR(84, "TRSYS Rsa padding error", "TRSYS rsa padding 错误"),
398    /**
399     * <div class="zh"> TRSYS ped 篡改 </div> <div class="en"> TRSYS Ped Tampered </div>
400     */
401    TRSYS_RET_TAMPERED(85, "TRSYS Ped Tampered", "TRSYS ped 篡改"),
402    /**
403     * <div class="zh"> TRSYS 验证秘钥失败 </div> <div class="en"> TRSYS Verify key fail </div>
404     */
405    TRSYS_RET_VERIFY_KEY_FAIL(86, "TRSYS Verify key fail", "TRSYS 验证秘钥失败"),
406    /**
407     * <div class="zh"> 未输入密码异常 </div> <div class="en"> no pin input error </div>
408     */
409    PED_ERR_NO_PIN_INPUT(87, "no pin input error", "未输入密码异常"),
410    /**
411     * <div class="zh"> ped密钥隔离查找异常 </div> <div class="en"> ped slot allocate find error </div>
412     */
413    PED_ERR_ALLOCATE_FIND(88, "ped slot allocate find error", "ped密钥隔离查找异常"),
414    /**
415     * <div class="zh">预分配索引失败</div> <div class="en">preallocate error </div>
416     */
417    PED_ERR_ALLOCATE_PREALLOCATE(89, "preallocate error", "预分配索引失败"),
418    /**
419     * <div class="zh"> 分配索引失败 </div> <div class="en"> allocated error </div>
420     */
421    PED_ERR_ALLOCATE_SETALLOCATED(90, "set allocated error", "分配索引失败"),
422    /**
423     * <div class="zh">释放出错 </div> <div class="en"> deallocate error </div>
424     */
425    PED_ERR_ALLOCATE_DEALLOCATE(91, "deallocate error", "释放索引出错"),
426    /**
427     * <div class="zh">获取索引分配器锁失败 </div> <div class="en">get slot allocator lock error</div>
428     */
429    PED_ERR_ALLOCATE_GET_SLOTALLOCATOR_LOCK(92, "get slot allocator lock error", "获取索引分配器锁失败"),
430    /**
431     * <div class="zh"> 释放索引分配器锁失败 </div> <div class="en">release slot allocator lock error</div>
432     */
433    PED_ERR_ALLOCATE_RELEASE_SLOTALLOCATOR_LOCK(93, "release slot allocator lock error", "释放索引分配器锁失败"),
434    /**
435     * <div class="zh"> 新属主的逻辑索引已分配 </div> <div class="en">the logical index of the new owner has been assigned</div>
436     */
437    PED_ERR_ALLOCATE_LOGICAL_ALLOCATED(94, "logical index conflict", "新属主的逻辑索引已分配"),
438    
439    /**
440     * <div class="zh"> 数据包长度非法 </div> <div class="en"> Length of data illegal </div>
441     */
442    PED_ERR_EX_C_LEN(200, "Length of data illegal", "数据包长度非法"),
443    /**
444     * <div class="zh"> 无效的密钥标志号 </div> <div class="en"> Invalid Key Index </div>
445     */
446    PED_ERR_EX_C_INVALID_INDEX(201, "Invalid  Key Index", " 无效的密钥标志号"),
447    
448    /**
449     * <div class="zh"> 处理中止(收到PINPAD的终止命令包) </div> <div class="en"> Abort (receive the abort command package from
450     * POS port) </div>
451     */
452    PED_ERR_EX_C_SUSPEND(202, "Abort (receive the abort command package from POS port)", " 中止(收到POS端的中止命令包)"),
453    /**
454     * <div class="zh"> 非法参数 </div> <div class="en"> invalid argument </div>
455     */
456    PED_ERR_EX_C_INVALID_ARG(203, "参数非法", "invalid argument"),
457    /**
458     * <div class="zh"> 指定的密钥不存在或无效 </div> <div class="en"> Specific key not exists or invalid </div>
459     */
460    PED_ERR_EX_C_KEY(204, "Specific Key not exists or invalid", "指定的密钥不存在或无效"),
461    
462    /**
463     * <div class="zh"> 无效的密钥序号(KSN)长度 </div> <div class="en"> Invalid Key(BDK) Length </div>
464     */
465    PED_ERR_EX_C_KSN_LEN(205, "Invalid Key Serial No.(KSN) Length", " 无效的密钥序号(KSN)长度"),
466
467    /**
468     * <div class="zh"> 工作密钥长度错 </div> <div class="en"> work key length error </div>
469     */
470    PED_ERR_EX_C_WKEY_LEN(206, "Work Key Length Error", " 工作密钥长度错"),
471    /**
472     * <div class="zh"> 无效的允许输入长度(非法MinLen或MaxLen) </div> <div class="en"> Invalid allowed typing length(Illegal MinLen
473     * or MaxLen) </div>
474     */
475    PED_ERR_EX_C_INPUT_LEN(207, "Invalid allowed typing length(Illegal MinLen or MaxLen)", "无效的允许输入长度(非法MinLen或MaxLen)"),
476    
477    /**
478     * <div class="zh"> 数据收发失败 </div> <div class="en"> data send-recvive failure </div>
479     */
480    PED_ERR_EX_C_INVALID_RESP(208, "Data Send-reveive Failure", " 数据收发失败"),
481    /**
482     * <div class="zh"> 数据收发失败 </div> <div class="en"> data send-recvive failure </div>
483     */
484    PED_ERR_EX_C_COMM(209, "Data Send-reveive Failure", " 数据收发失败"),
485    
486    /**
487     * <div class="zh">超时</div> <div class="en"> timeout </div>
488     */
489    PED_ERR_EX_C_TIMEOUT(210, "timeout", " 超时"),
490    
491    /**
492     * <div class="zh"> LRC校验失败 </div> <div class="en"> LRC verify error </div>
493     */
494    PED_ERR_EX_C_LRC(211, "LRC Verify Error", "LRC校验失败"),
495    /**
496     * <div class="zh"> 不支持的调用 </div> <div class="en"> unsupported call </div>
497     */
498    PED_ERR_EX_C_NOT_SUPPORT(212, "Unsupported Call", " 不支持的调用"),
499    /**
500     * <div class="zh"> 其他错误 </div> <div class="en"> others error </div>
501     */
502    PED_ERR_EX_C_OTHER(213, "Others Error", " 其他错误"),
503    /**
504     * <div class="zh"> 参数错误或无效 </div> <div class="en"> Wrong or invalid parameter </div>
505     */
506    PED_ERR_PARAM_INVALID(214, "Wrong or invalid parameter", "参数错误或无效"),
507    /**
508     * <div class="zh"> 参数长度错误 </div> <div class="en"> Parameter length error </div>
509     */
510    PED_ERR_PARAM_LEN(215, "Parameter length error", "参数长度错误"),
511
512    /**
513     * <div class="zh">当前不是PED隔离模式</div> <div class="en">Current ped mode is not isolation</div>
514     */
515    PED_ERR_MODE_NOT_ISOLATION(300, "Current ped mode is not isolation", "当前不是PED隔离模式"),
516
517    /**
518     * <div class="zh">找不到相应的物理ID</div> <div class="en">No corresponding physical ID was found</div>
519     */
520    PED_ERR_PHYID_NOT_FOUND(301, "No corresponding physical ID was found", "找不到相应的物理ID"),
521
522    /**
523     * <div class="zh">物理ID已绑定到另一个索引</div> <div class="en">The physical ID has been bound to another index</div>
524     */
525    PED_ERR_PHYID_EXIST(302, "The physical ID has been bound to another index", "物理ID已绑定到另一个索引"),
526
527    /**
528     * <div class="zh">物理ID已满。物理ID不可用</div> <div class="en">The physical ID is full. The physical ID is not available</div>
529     */
530    PED_ERR_PHYID_NO_AVAILABLE(303, "The physical ID is full. The physical ID is not available", "物理ID已满,物理ID不可用"),
531
532    /**
533     * <div class="zh">密钥类型的未知类型</div> <div class="en">Unknown type of key type</div>
534     */
535    PED_ERR_UNKNOWN_KEYTYPE(304, "Unknown type of key type", "密钥类型的未知类型"),
536
537    /**
538     * <div class="zh">数据库文件不存在</div> <div class="en">The database file does not exist</div>
539     */
540    PED_ERR_NO_DATABASE(305, "The database file does not exist", "数据库文件不存在"),
541
542    /**
543     * <div class="zh">无法打开数据库</div> <div class="en">Failed to open database</div>
544     */
545    PED_ERR_OPEN_DATABASE(306, "Failed to open database", "无法打开数据库"),
546
547    /**
548     * <div class="zh">数据库数据中存在异常</div> <div class="en">There is an exception in the database data</div>
549     */
550    PED_ERR_DATABASE_DATA(307, "There is an exception in the database data", "数据库数据中存在异常"),
551
552    /**
553     * <div class="zh">逻辑索引已存在</div> <div class="en">The logical index already exists</div>
554     */
555    PED_ERR_LOGID_EXIST(308, "The logical index already exists", "逻辑索引已存在"),
556
557    /**
558     * <div class="zh">数据库已迁移</div> <div class="en">The database has been migrated</div>
559     */
560    PED_ERR_ALREADY_MIGRATED(309, "The database has been migrated", "数据库已迁移")
561
562
563    ;
564    
565    private int errCodeFromBasement;
566    private String errMsgCn;
567    private String errMsgEn;
568
569    EPedDevException(int errCodeFromBasement, String errMsgEn, String errMsnCn) {
570        this.errCodeFromBasement = errCodeFromBasement;
571        this.errMsgCn = errMsnCn;
572        this.errMsgEn = errMsgEn;
573    }
574
575    public int getErrCodeFromBasement() {
576        return errCodeFromBasement;
577    }
578
579    public String getErrMsg() {
580        if (Utils.isZh()) {
581            return errMsgCn;
582        } else {
583            return errMsgEn;
584        }
585
586    }
587
588}