FingerprintWithFIPS

com.rscja.deviceapi

## Class FingerprintWithFIPS

- java.lang.Object
- - com.rscja.deviceapi.FingerprintWithFIPS

-     public class FingerprintWithFIPS
      extends java.lang.Object

  FIPS指纹识别模块操作类,
  FIPS fingerprint indentify module operation type,

  注意：
  Attention:
  1、使用前请确认您的机器已安装此模块。
  1. Make sure this module is installed before using.
  2、要正常使用模块需要在\libs\armeabi\目录放置libDeviceAPI.so文件
  2. Put libDeviceAPI.so file in directory \libs\armeabi\ then module can be used normally.
  3、在操作设备前需要调用 `init()` 打开设备，使用完后调用 `free()` 关闭设备
  3. Call `init()` to switch on device before operating, call `free()` to switch off device after using.

  Author:
    liuruifeng

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `FingerprintWithFIPS.DataFormat` 指纹数据格式 Fingerprint data format
    `static interface` | `FingerprintWithFIPS.EnrollCallBack` 采集指纹回调接口 call-back contact for acquiring fingerprint
    `class` | `FingerprintWithFIPS.FingerprintInfo`
    `static interface` | `FingerprintWithFIPS.GRABCallBack` 指纹图像回调接口 fingerprint image call-back contact
    `static interface` | `FingerprintWithFIPS.IdentificationCallBack` 验证指纹的回调接口 call-back contact of verify fingerprint
    `static interface` | `FingerprintWithFIPS.PtCaptureCallBack` 获取指纹模版数据回调接口 Acquire call-back contact fingerprint template data
    `static interface` | `FingerprintWithFIPS.TemplateVerifyCallBack` 指纹模版比对 fingerprint template comparison

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `decryption(byte[] originalBuf, int jdlen)` Deprecated.
    `byte[]` | `decryption(byte[] originalBuf, int jdlen, byte[] key)` Deprecated.
    `byte[]` | `decryption(byte[] originalBuf, int jdlen, java.lang.String key)` Deprecated.
    `int` | `deleteAllFingers()` 删除所有指纹信息 delete all fingerprint information
    `byte[]` | `Encryption(byte[] originalBuf, int jdlen)` Deprecated.
    `byte[]` | `Encryption(byte[] originalBuf, int jdlen, java.lang.String key)` Deprecated.
    `int` | `enroll()` 采集指纹 Acquire fingerprint
    `boolean` | `free()` 释放指纹模块 Release fingerprint module
    `boolean` | `generateImg(byte[] data, java.lang.String filePath)` 生成bmp图片 Generate bmp
    `int` | `getFingersCount()` 获取模块中采集的指纹数量 Acquire collected fingerprint amounts in module.
    `java.lang.String` | `getID()` 获取指纹ID Acquire fingerprint ID
    `static FingerprintWithFIPS` | `getInstance()` 获取指纹模块操作实例 Acquire fingerprint module operation Instance
    `FingerprintWithFIPS.FingerprintInfo` | `getPTInfo()` 获取模块信息 Acquire module information
    `int` | `grab()` 采集图像 Acquire image
    `boolean` | `init()` 初始化指纹模块 Initialize fingerprint module
    `boolean` | `init(Context mContext)` 初始化指纹模块 Initialize fingerprint module
    `boolean` | `isPowerOn()` 判断设备是否上电 Judge the device is powered on or not.
    `int` | `ptCapture()` 获取指纹模版 Acquire fingerprint template
    `byte[]` | `ptConvertTemplateEx(FingerprintWithFIPS.DataFormat jtarget_type, byte[] srcbuf, int jsrclen)`
    `int` | `responseCancel()` 取消当前操作 Cancel current operation
    `byte[]` | `responseContinue()` 继续当前操作 Continue current operation
    `void` | `setEnrollCallBack(FingerprintWithFIPS.EnrollCallBack callBack)` 设置采集指纹回调接口 Setup call-back contact for acquiring fingerprint
    `void` | `setGrabCallBack(FingerprintWithFIPS.GRABCallBack callBack)` 设置获取图片回调接口 Setup call-back contact for acquiring picture
    `boolean` | `setID(java.lang.String hexID)` 设置指纹模块ID Setup fingerprint module ID
    `void` | `setIdentificationCallBack(FingerprintWithFIPS.IdentificationCallBack callBack)` 设置指纹验证回调接口 Setup fingerprint verification
    `void` | `setPtCaptureCallBack(FingerprintWithFIPS.PtCaptureCallBack callBack)` 设置获取指纹模版回调接口 Setup call-back contact for acquiring fingerprint template
    `void` | `setTemplateVerifyCallBack(FingerprintWithFIPS.TemplateVerifyCallBack callBack)` 设置模版比对回调接口 Setup call-back contact for template comparison

    `void`

    `startEnroll()`
    开始采集指纹,注意:请调用
    start acquire fingerprint, attention: call out
    `setEnrollCallBack(EnrollCallBack callBack)` 方法设置接收回调数据
    `setEnrollCallBack(EnrollCallBack callBack)`setup receviced call-back data

    `void`

    `startGRAB()`
    开始获取图片,注意:请调用
    start acquire picture, attention: call out
    `setGrabCallBack(GRABCallBack callBack)` 方法设置接收回调数据
    `setGrabCallBack(GRABCallBack callBack)`method to setup received call-back data.

    `void`

    `startIdentification()`
    开始验证指纹,注意:请调用
    start verify finerprint, attention: call out
    `setIdentificationCallBack(IdentificationCallBack callBack)` 方法设置接收回调数据
    `setIdentificationCallBack(IdentificationCallBack callBack)` setup receviced call-back data

    `void`

    `startPtCapture()`
    开始获取指纹模版,注意:请调用
    Start acquire fingerprint template, attention: call up
    `setPtCaptureCallBack(PtCaptureCallBack callBack)` 方法设置接收回调数据
    `setPtCaptureCallBack(PtCaptureCallBack callBack)` method to setup received call-back data.

    `void`

    `startTemplateVerify(char[] template)`
    开始模版验证,注意:请调用
    start template verification, attention: call out
    `setTemplateVerifyCallBack(TemplateVerifyCallBack callBack)` 方法设置接收回调数据
    `setTemplateVerifyCallBack(TemplateVerifyCallBack callBack)`method to setup received call-back data.

    `void` | `stopEnroll()` 停止采集指纹 Stop acquiring fingerprint
    `void` | `stopGRAB()` 停止获取图片 stop acquiring picture
    `void` | `stopIdentification()` 停止指纹验证 Stop fingerprint verification
    `void` | `stopPtCapture()` 停止获取指纹模版 Stop acquiring fingerprint template
    `void` | `stopTemplateVerify()` 停止模版比对 Stop template comparison
    `int` | `Verify(char[] data, int len)` 模版比对指纹,导入模版数据和当前指纹比对 Compare template and fingerprint, import template data and current fingerprint comparison.
    `int` | `verifyALL()` 验证指纹,验证当前指纹是否在指纹模块库里面存在 Verify fingerprint, verify current fingerprint exist in fingerprint library or not.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getInstance

          public static FingerprintWithFIPS getInstance()
                                                 throws ConfigurationException

      获取指纹模块操作实例
      Acquire fingerprint module operation Instance
      Returns:
        指纹模块操作实例
        return fingerprint operation Instance
      Throws:
        `ConfigurationException` - 配置错误异常
        Configuration error

    - #### init

          public boolean init(Context mContext)

      初始化指纹模块
      Initialize fingerprint module
      Returns:
        true成功，false失败
        true means success, false means failed

    - #### init

          public boolean init()

      初始化指纹模块
      Initialize fingerprint module
      Returns:
        true成功，false失败
        truen means success, false means failed

    - #### free

          public boolean free()

      释放指纹模块
      Release fingerprint module
      Returns:
        true成功，false失败
        true means, false means failed

    - #### enroll

          public int enroll()

      采集指纹
      Acquire fingerprint
      Returns:
        0表示操作成功，其他值表示操作失败
        0 means operation success, other means operation failed.

    - #### verifyALL

          public int verifyALL()

      验证指纹,验证当前指纹是否在指纹模块库里面存在
      Verify fingerprint, verify current fingerprint exist in fingerprint library or not.
      Returns:
        0表示操作成功，其他值表示操作失败
        0 means operation success, other means operation failed.

    - #### Verify

          public int Verify(char[] data,
                            int len)

      模版比对指纹,导入模版数据和当前指纹比对
      Compare template and fingerprint, import template data and current fingerprint comparison.
      Parameters:
        `data` - 模版数据
        data template data
        `len` - 数据长度
        len data length
      Returns:
        0表示操作成功，其他值表示操作失败
        0 means operation success, others means operation failed

    - #### deleteAllFingers

          public int deleteAllFingers()

      删除所有指纹信息
      delete all fingerprint information
      Returns:
        0表示操作成功，其他值表示操作失败
        0 means operation success, others means operation failed

    - #### getFingersCount

          public int getFingersCount()

      获取模块中采集的指纹数量
      Acquire collected fingerprint amounts in module.
      Returns:
        指纹数量,返回-1为获取失败
        return fingerprint amounts, return -1 means acquire failed

    - #### responseCancel

          public int responseCancel()

      取消当前操作
      Cancel current operation
      Returns:
        0表示操作成功，其他值表示操作失败
        return 0 means operation success, others means operation failed

    - #### responseContinue

          public byte[] responseContinue()

      继续当前操作
      Continue current operation
      Returns:
        索引0~4 是状态，4~8是后面数据的长度，8~12是指纹ID；如果是采集指纹，后面的数据就是指纹特征数据
        return index 0 to 4 means status, 4 to 8 means back data length, 8 to 12 means fingerprint ID, if it is acquired fingerprint, back data means fingerprint characteristic data.

    - #### grab

          public int grab()

      采集图像
      Acquire image
      Returns:
        0表示操作成功，其他值表示操作失败
        return 0 means operation success, others means operation failed

    - #### ptCapture

          public int ptCapture()

      获取指纹模版
      Acquire fingerprint template
      Returns:
        0表示操作成功，其他值表示操作失败
        return 0 means operation success, others means operation failed

    - #### ptConvertTemplateEx

          public byte[] ptConvertTemplateEx(FingerprintWithFIPS.DataFormat jtarget_type,
                                            byte[] srcbuf,
                                            int jsrclen)

      Parameters:
        `jtarget_type` - 转换后的格式类型
        param jtarget_type data format after transformed
        `srcbuf` - 转换之前的数据
        param srcbuf before transformed
        `jsrclen` - 转换之前的数据长度
        param jsrclen data length before transformed
      Returns:
        返回转换后的数据
        return transfered data

    - #### getPTInfo

          public FingerprintWithFIPS.FingerprintInfo getPTInfo()

      获取模块信息
      Acquire module information
      Returns:
        返回fips指纹模块信息
        return fips fingerprint module information

    - #### generateImg

          public boolean generateImg(byte[] data,
                                     java.lang.String filePath)

      生成bmp图片
      Generate bmp
      Parameters:
        `data` - 数据
        parame data
        `filePath` - 生成后图片保存的文件路径
        param filePath file indirectory after picture generated
      Returns:
        true 成功，false 失败
        return ture means success, false means failed

    - #### setID

          public boolean setID(java.lang.String hexID)

      设置指纹模块ID
      Setup fingerprint module ID
      Returns:
        设置成功返回ture，设置失败返回false
        setup success return ture, setup failed return false

    - #### getID

          public java.lang.String getID()

      获取指纹ID
      Acquire fingerprint ID
      Returns:
        返回指纹ID
        return fingerprint ID

    - #### startPtCapture

          public void startPtCapture()

      开始获取指纹模版,注意:请调用
      Start acquire fingerprint template, attention: call up
      `setPtCaptureCallBack(PtCaptureCallBack callBack)` 方法设置接收回调数据
      `setPtCaptureCallBack(PtCaptureCallBack callBack)` method to setup received call-back data.

    - #### startGRAB

          public void startGRAB()

      开始获取图片,注意:请调用
      start acquire picture, attention: call out
      `setGrabCallBack(GRABCallBack callBack)` 方法设置接收回调数据
      `setGrabCallBack(GRABCallBack callBack)`method to setup received call-back data.

    - #### startTemplateVerify

          public void startTemplateVerify(char[] template)

      开始模版验证,注意:请调用
      start template verification, attention: call out
      `setTemplateVerifyCallBack(TemplateVerifyCallBack callBack)` 方法设置接收回调数据
      `setTemplateVerifyCallBack(TemplateVerifyCallBack callBack)`method to setup received call-back data.

    - #### startEnroll

          public void startEnroll()

      开始采集指纹,注意:请调用
      start acquire fingerprint, attention: call out
      `setEnrollCallBack(EnrollCallBack callBack)` 方法设置接收回调数据
      `setEnrollCallBack(EnrollCallBack callBack)`setup receviced call-back data

    - #### startIdentification

          public void startIdentification()

      开始验证指纹,注意:请调用
      start verify finerprint, attention: call out
      `setIdentificationCallBack(IdentificationCallBack callBack)` 方法设置接收回调数据
      `setIdentificationCallBack(IdentificationCallBack callBack)` setup receviced call-back data

    - #### stopGRAB

          public void stopGRAB()

      停止获取图片
      stop acquiring picture

    - #### stopEnroll

          public void stopEnroll()

      停止采集指纹
      Stop acquiring fingerprint

    - #### stopPtCapture

          public void stopPtCapture()

      停止获取指纹模版
      Stop acquiring fingerprint template

    - #### stopTemplateVerify

          public void stopTemplateVerify()

      停止模版比对
      Stop template comparison

    - #### stopIdentification

          public void stopIdentification()

      停止指纹验证
      Stop fingerprint verification

    - #### setGrabCallBack

          public void setGrabCallBack(FingerprintWithFIPS.GRABCallBack callBack)

      设置获取图片回调接口
      Setup call-back contact for acquiring picture
      Parameters:
        `callBack` - 回调方法
        callBack call-back method

    - #### setEnrollCallBack

          public void setEnrollCallBack(FingerprintWithFIPS.EnrollCallBack callBack)

      设置采集指纹回调接口
      Setup call-back contact for acquiring fingerprint
      Parameters:
        `callBack` - 回调方法
        callBack call-back method

    - #### setPtCaptureCallBack

          public void setPtCaptureCallBack(FingerprintWithFIPS.PtCaptureCallBack callBack)

      设置获取指纹模版回调接口
      Setup call-back contact for acquiring fingerprint template
      Parameters:
        `callBack` - 回调方法
        callBack call-back method

    - #### setIdentificationCallBack

          public void setIdentificationCallBack(FingerprintWithFIPS.IdentificationCallBack callBack)

      设置指纹验证回调接口
      Setup fingerprint verification
      Parameters:
        `callBack` - 回调方法
        callBack call-back method

    - #### setTemplateVerifyCallBack

          public void setTemplateVerifyCallBack(FingerprintWithFIPS.TemplateVerifyCallBack callBack)

      设置模版比对回调接口
      Setup call-back contact for template comparison
      Parameters:
        `callBack` - 回调方法
        callBack call-back method

    - #### Encryption

          @Deprecated
          public byte[] Encryption(byte[] originalBuf,
                                                int jdlen)

      Deprecated.
      目前不支持
      Not support
      Parameters:
        `originalBuf` - 加密之前的数据
        data before encrypted
        `jdlen` - 数据长度
        data length
      Returns:
        返回加密后的数据
        return encypted data

    - #### Encryption

          @Deprecated
          public byte[] Encryption(byte[] originalBuf,
                                                int jdlen,
                                                java.lang.String key)

      Deprecated.
      目前不支持
      Not support
      Parameters:
        `originalBuf` - 加密之前的数据
        data before encrypted
        `jdlen` - 数据长度
        data length
        `key` - 秘钥
        key
      Returns:
        返回加密后的数据
        return encypted data

    - #### decryption

          @Deprecated
          public byte[] decryption(byte[] originalBuf,
                                                int jdlen)

      Deprecated.
      目前不支持
      Not supported
      Parameters:
        `originalBuf` -
        `jdlen` -
      Returns:

    - #### decryption

          @Deprecated
          public byte[] decryption(byte[] originalBuf,
                                                int jdlen,
                                                java.lang.String key)

      Deprecated.
      目前不支持
      Not supported
      Parameters:
        `originalBuf` - 要解密的原始数据
        original data that need to be decoded
        `jdlen` - 数据长度
        data length
        `key` - 秘钥
        key
      Returns:
        返回解密后的数据
        return decoded data

    - #### decryption

          @Deprecated
          public byte[] decryption(byte[] originalBuf,
                                                int jdlen,
                                                byte[] key)

      Deprecated.
      目前不支持
      Not support
      Parameters:
        `originalBuf` -
        `jdlen` -
        `key` -
      Returns:

    - #### isPowerOn

          public boolean isPowerOn()

      判断设备是否上电
      Judge the device is powered on or not.
      Returns: