public class Fingerprint
extends java.lang.Object
注意:
1、使用前请确认您的机器已安装此模块。
2、要正常使用模块需要在\libs\armeabi\目录放置libDeviceAPI.so文件
3、在操作设备前需要调用 init()
打开设备,使用完后调用 free()
关闭设备
Note:
?* 1, Please confirm that your machine has installed this module before use.
?* 2, For the normal use of the module need to place the libDeviceAPI.so file under below path :\ libs \ armeabi \ directory.
?* 3, in the operation of the device before the need to call b> open the device, use the call b> /> to close the device.
Modifier and Type | Class and Description |
---|---|
static class |
Fingerprint.BufferEnum
模块缓冲区枚举
Buffer number |
Modifier and Type | Method and Description |
---|---|
int |
autoEnroll(int count,
int userID)
刷指定次数指纹,模块自动完成注册功能
Auto enroll register once place designated count of fingerprint. |
int[] |
autoMatch(int count,
int startPage,
int pageNum)
刷指定次数指纹,自动完成比对功能
Auto match once place designated count of fingerprint |
boolean |
deletChar(int pageID,
int num)
删除库中特征值
Delete character value |
boolean |
downChar(Fingerprint.BufferEnum buffer,
java.lang.String hexStr)
下载特征数据到指定缓存区
Download character data to designated buffer. |
boolean |
empty()
清空模块中保存的指纹数据
Clean fingerprint data stored in module. |
boolean |
free()
释放指纹模块
Relase fignerprint module |
boolean |
genChar(Fingerprint.BufferEnum buffer)
生成特征值(存于指定缓存区)
Generate character,store in designated buffer. |
boolean |
getImage()
获取指纹图像(存于模块图像缓存区)
Get fingerprint image,stored in image buffer of module |
static Fingerprint |
getInstance()
获取指纹模块操作实例
Get fingerprint module entity |
java.lang.String |
getRandomData()
获取随机数,检测模块是否正常
Get random,to detect module is normal or not |
java.lang.String |
getVersion()
获取模块版本
Get module version |
boolean |
init()
初始化指纹模块,默认波特率为57600
Initialize fingerprint moudule, default baudrate 57600 |
boolean |
init(int baudrate)
初始化指纹模块
Initialize fingerprint module |
boolean |
initMorpho()
初始化指纹模块,仅用于Morpho模块
Initialize the fingerprint module,valid only for Morpho module. |
boolean |
isPowerOn()
判断设备是否上电
Detect whether device is powered on or not. |
boolean |
loadChar(Fingerprint.BufferEnum buffer,
int pageID)
加载指定ID页到特征值缓存区
Load designated ID page to charcater buffer. |
int |
match()
对比模板缓冲区1与模板缓冲区2的指纹模板文件
Match the fingerprint template between buffer 1 and buffer 2. |
boolean |
morphoEnroll(int id,
java.lang.String firstName,
java.lang.String lastName)
采集指纹,仅用于Morpho模块
Fingerprint enrollment, valid for morpho module. |
java.lang.String[] |
morphoIdentify()
验证指纹,仅用于Morpho模块
Identify fingerprint , valid only for Morpho module |
java.lang.String |
readChipSN()
获取芯片序列号
Get chip SN. |
java.lang.String |
readSysPara()
获取系统参数,仅返回版本号
Get device parameter. |
java.lang.String[] |
readSysParaMore()
获取系统参数
Get system parameter. |
boolean |
regModel()
合并特征文件。将模板缓冲区1与模板缓冲区2中的模板文件合并生成模板,结果存于模板缓冲区1。
Merge character file, use the template file from buffer 1 and buffer 2, store result in buffer 1. |
int[] |
search(Fingerprint.BufferEnum buffer,
int startPage,
int pageNum)
检索指纹库
search fingerprint database |
boolean |
setDeviceName(java.lang.String name)
设置设备名称
Set device name |
boolean |
setManuFacture(java.lang.String name)
设置厂商名称
Set manufacture name |
boolean |
setPWD(java.lang.String passWord)
设置密码
Set password |
boolean |
setReg(int regID,
int value)
设置寄存器值,修改模块参数
Set register value, modify module parameter. |
boolean |
storChar(Fingerprint.BufferEnum buffer,
int pageID)
存储模板文件。将模板缓冲区buffer中的模板文件存到 PageID号所对应的指纹库位置
Store the template file, store the template file in buffer to the fingerprint database whichPageID pointing to. |
java.lang.String |
upChar(Fingerprint.BufferEnum buffer)
上传指定缓冲区中的指纹特征数据
Upload fignerprint character data from designated buffer. |
int |
upImage(int mode,
java.lang.String fileName)
上传指纹图像文件
Upload fingerprint image file |
boolean |
validPWD(java.lang.String passWord)
验证密码
Verify password |
int |
validTempleteNum()
获取模块中已保存的指纹特征数据个数
Get the number of fingerprint character data stored in the module |
public static Fingerprint getInstance() throws ConfigurationException
ConfigurationException
- 配置错误异常 public boolean init()
public boolean init(int baudrate)
baudrate
- 波特率(57600或115200) public boolean free()
public java.lang.String getRandomData()
public boolean getImage()
public boolean genChar(Fingerprint.BufferEnum buffer)
buffer
- 缓冲区编号枚举 public int[] search(Fingerprint.BufferEnum buffer, int startPage, int pageNum)
buffer
- 缓存区 startPage
- 页开始ID pageNum
- 从startPage开始的num个 public int match()
public boolean regModel()
public boolean storChar(Fingerprint.BufferEnum buffer, int pageID)
buffer
- 缓冲区 pageID
- 页ID,值为0~254 public boolean loadChar(Fingerprint.BufferEnum buffer, int pageID)
buffer
- 缓存区 pageID
- 页ID public java.lang.String upChar(Fingerprint.BufferEnum buffer)
buffer
- 缓存区 public boolean downChar(Fingerprint.BufferEnum buffer, java.lang.String hexStr)
buffer
- 缓存区 hexStr
- 十六进制特征数据 public boolean deletChar(int pageID, int num)
pageID
- 页ID num
- 从PageID开始的num个 public boolean empty()
public boolean setReg(int regID, int value)
regID
- 寄存器ID value
- 需要修改的值 public int autoEnroll(int count, int userID)
count
- 次数 userID
- 注册ID public int[] autoMatch(int count, int startPage, int pageNum)
count
- 次数 startPage
- 起始页 pageNum
- 页数 public int validTempleteNum()
public java.lang.String readChipSN()
public boolean setManuFacture(java.lang.String name)
name
- 名称,缓存 8字节 public boolean setDeviceName(java.lang.String name)
name
- 设备名称,缓存 8字节 public java.lang.String readSysPara()
public java.lang.String getVersion()
public int upImage(int mode, java.lang.String fileName)
mode
- 是否带bmp格式头文件 0表示不带 大于0表示带。默认为1 fileName
- 文件路径,包括文件名,函数根据该参数生成图像文件 public boolean initMorpho()
public boolean morphoEnroll(int id, java.lang.String firstName, java.lang.String lastName) throws FingerprintAlreadyEnrolledException, FingerprintInvalidIDException
id
- 存储idfirstName
- 名lastName
- 姓FingerprintAlreadyEnrolledException
- 抛出此异常说明指纹已经存在 FingerprintInvalidIDException
- 抛出此异常说明ID已被占用 public java.lang.String[] morphoIdentify()
public boolean setPWD(java.lang.String passWord)
passWord
- 密码public boolean validPWD(java.lang.String passWord)
passWord
- 密码 public java.lang.String[] readSysParaMore()
public boolean isPowerOn()