package com.dlc.eboard.finger

import com.eyecool.fp.util.FpConst

/**
 * info
 *
 * @author ReiChin_
 */
object FingerErrorCode {

    private val errMap = mutableMapOf<Int, String>().apply {
        put(FpConst.TCY_SUCC, "成功")
        put(FpConst.TCY_FAIL, "失败")
        put(FpConst.TCY_ERRO, "校验错误")
        put(FpConst.TCY_PARA, "参数错误")
        put(FpConst.TCY_EMPT, "空特征库")
        put(FpConst.TCY_NOFP, "未按或孬")
        put(FpConst.TCY_NSAM, "值不相关")
        put(FpConst.TCY_NMAT, "值不匹配")
        put(FpConst.TCY_NMEM, "内存不足")
        put(FpConst.TCY_FLSH, "有闪存错")
        put(FpConst.TCY_NODV, "传感器错")
        put(FpConst.TCY_TOLV, "请抬起手")
        put(FpConst.TCY_NSUP, "不支持令")
        put(FpConst.TCY_TMOT, "操作超时")
        put(FpConst.TCY_BUSY, "我很忙啊")
        put(FpConst.TCY_NLNK, "设备断开")
        put(FpConst.TCY_LESS, "特点过少")
        put(FpConst.TCY_CNCL, "取消操作")
        put(FpConst.TCY_FILE, "文件错误")
    }

    fun decode(code: Int?) = code?.let { errMap[code] } ?: "未知错误：$code"

}