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; 018 019import com.pax.dal.entity.FingerprintResult; 020import com.pax.dal.exceptions.FingerprintDevException; 021 022public interface IFingerprintReader { 023 024 public interface FingerprintListener { 025 /** 026 * <div class="zh">指纹获取失败时,通过errorCode通知调用者,对应的失败的原因 </div> <div class="en">When fingerprint acquisition fails, 027 * the caller is notified through errorCode of the corresponding failure reason. </div> 028 * 029 * @param errCode 030 * <div class="zh"> 031 * <ul> 032 * <li>-1 模块未开启</li> 033 * <li>-2 设备忙</li> 034 * <li>-3 采集失败</li> 035 * </ul> 036 * </div> <div class="en"><ul> 037 * <li>-1 FINGER_RETVAL_NOT_OPEN</li> 038 * <li>-2 FINGER_RETVAL_DEVICE_BUSY</li> 039 * <li>-3 FINGER_RETVAL_CAPETURE_ERR</li> 040 * </ul> 041 * </div> 042 */ 043 void onError(int errCode); 044 045 /** 046 * <div class="zh">指纹获取成功后,通过{@link FingerprintResult}获取结果 </div> <div class="en">After successful fingerprint acquisition, the result is obtained through {@link FingerprintResult}</div> 047 * @param result 048 * <div class="zh">{@link FingerprintResult} </div> <div class="en">{@link FingerprintResult}</div> 049 */ 050 void onSuccess(FingerprintResult result); 051 } 052 053 /** 054 * <div class="zh">打开指纹采集模块</div> <div class="en">Open fingerprint acquisition module</div> 055 * 056 * @throws FingerprintDevException 057 */ 058 void open() throws FingerprintDevException; 059 060 /** 061 * @deprecated 062 * <div class="zh">开始获取指纹</div> <div class="en">Start getting fingerprints </div> 063 * 064 * @param listener 065 * <div class="zh">{@link FingerprintListener} </div> <div class="en">{@link FingerprintListener}</div> 066 * @throws FingerprintDevException 067 */ 068 void start(FingerprintListener listener) throws FingerprintDevException; 069 070 /** 071 * <div class="zh">停止获取指纹</div> <div class="en">Stop getting fingerprints</div> 072 * 073 * @throws FingerprintDevException 074 */ 075 void stop() throws FingerprintDevException; 076 077 /** 078 * <div class="zh">关闭指纹采集模块</div> <div class="en">Close fingerprint acquisition module</div> 079 * 080 * @throws FingerprintDevException 081 */ 082 void close() throws FingerprintDevException; 083 084 /** 085 * <div class="zh">设置获取指纹超时时间.如果设置了{@link FingerprintListener},超时后{@link FingerprintListener#onError(int)}将会被调用 </div> <div class="en">Set the time-out for getting fingerprints. If {@link FingerprintListener} is set, after the time-out {@link FingerprintListener#onError (int)} will be invoked.</div> 086 * 087 * @param timeout 088 * <div class="zh">超时 </div> <div class="en">timeout</div> 089 * @throws FingerprintDevException 090 */ 091 void setTimeout(int timeout) throws FingerprintDevException; 092 093 /** 094 * <div class="zh">提取指纹特征。</div> <div class="en">Fingerprint extraction.</div> 095 * 096 * @param format <div class="zh">指纹特征格式。 097 * <ul> 098 * <li>1:FEATURE_ANSI_INCITS_378_2004</li> 099 * <li>2:FEATURE_ISO_IEC_19794_2_2005</li> 100 * <li>3:FEATURE_ARATEK_BIONE</li> 101 * </ul></div> 102 * <div class="en">Fingerprint feature format. 103 * <ul> 104 * <li>1:FEATURE_ANSI_INCITS_378_2004</li> 105 * <li>2:FEATURE_ISO_IEC_19794_2_2005</li> 106 * <li>3:FEATURE_ARATEK_BIONE</li> 107 * </ul></div> 108 * 109 * @param listener {@link FingerprintListener} 110 * 111 * @throws FingerprintDevException 112 * @since V3.09.00 113 */ 114 void extractFeature(int format, FingerprintListener listener) throws FingerprintDevException; 115 116 /** 117 * <div class="zh">提取指纹图像。</div> <div class="en">Extract fingerprint image.</div> 118 * 119 * @param format <div class="zh">指纹图像格式。 120 * <ul> 121 * <li>1:IMAGE_TYPE_RAW</li> 122 * <li>2:IMAGE_TYPE_BMP</li> 123 * <li>3:IMAGE_TYPEWSQ</li> 124 * <li>4:IMAGE_ANSI_INCITS_381_2004</li> 125 * <li>5:IMAGE_ISO_IEC_19794_4_2005</li> 126 * </ul> 127 * </div> <div class="en">Fingerprint image format. 128 * <ul> 129 * <li>1:IMAGE_TYPE_RAW</li> 130 * <li>2:IMAGE_TYPE_BMP</li> 131 * <li>3:IMAGE_TYPEWSQ</li> 132 * <li>4:IMAGE_ANSI_INCITS_381_2004</li> 133 * <li>5:IMAGE_ISO_IEC_19794_4_2005</li> 134 * </ul> 135 * </div> 136 * 137 * @param compress <div class="zh">图像压缩率。当format=IMAGE_TYPEWSQ有效,范围为5~15(值越大,压缩率越高)。</div> 138 * <div class="en">Image compression. When format=IMAGE_TYPEWSQ is valid, the range is 5~15 (the larger the value, the higher the compression ratio).</div> 139 * 140 * @param listener {@link FingerprintListener} 141 * 142 * @throws FingerprintDevException 143 * @since V3.09.00 144 */ 145 void extractImage(int format, int compress, FingerprintListener listener) throws FingerprintDevException; 146 147 /** 148 * <div class="zh">指纹特征对比。特征格式需要相同。</div> <div class="en">Compare fingerprint feature. The feature format needs to be the same.</div> 149 * 150 * @param securityLevel <div class="zh">安全等级。范围为1~5(值越大,安全性越好。推荐4)。</div> <div class="en">Safety level. The range is 1~5 (the larger the value, the better the safety.Recommendation 4).</div> 151 * 152 * @param feature1 <div class="zh">指纹特征。</div> <div class="en">Finger feature.</div> 153 * 154 * @param feature2 <div class="zh">指纹特征。</div> <div class="en">Finger feature.</div> 155 * 156 * @return <div class="zh">相似度。负值表示对比失败。正数为相似度,范围是1-100。</div> 157 * <div class="en">Similarity. A negative value indicates that the comparison failed. A positive value is the similarity, and the range is 1-100.</div> 158 * 159 * @throws FingerprintDevException 160 * @since V3.09.00 161 */ 162 int compareFeature(int securityLevel, byte[] feature1, byte[] feature2) throws FingerprintDevException; 163 164 /** 165 * <div class="zh">设置图像大小。需在{@link#open()}后调用,在调用{@link#close()}后会重置。</div> 166 * <div class="en">Set the image size. It needs to be called after {@link#open()} and reset after {@link#close()} is called.</div> 167 * 168 * @param width <div class="zh">宽。</div> <div class="en">Width.</div> 169 * @param height <div class="zh">高</div> <div class="en">Height.</div> 170 * @return <div class="zh">true:成功; false:失败。</div> <div class="en">true: success; false: failure.</div> 171 * @throws FingerprintDevException 172 * @since V3.17.00 173 */ 174 void setImageSize(int width, int height) throws FingerprintDevException; 175 176 /** 177 * <div class="zh">指纹上下电接口</div> 178 * <div class="en">Fingerprint power-on and power-off interface</div> 179 * 180 * @param on <div class="zh">true 上电,false 下电 </div> <div class="en">true Powers on, false powers off</div> 181 * 182 * @return <div class="zh">成功或失败</div> <div class="en">Success or failure</div> 183 * @throws FingerprintDevException 184 * @since V4.08.00 185 */ 186 boolean controlPower(boolean on) throws FingerprintDevException; 187}