فهرست منبع

Z991239-6228 #comment feat: 指纹扫描增加扫描超时字段功能

Signed-Off-By: commit-hook
刘文涛80174520 5 ماه پیش
والد
کامیت
3ffbe27f49

+ 11 - 6
Module/mod_FingerPrint/FingerPrint.xml

@@ -94,12 +94,15 @@
 		<!--3、指纹扫描超时, errorCode为Error_Unexpect(2147483646),rtaCode为RTA2411-->
 		<!--4、指纹仪扫描失败,获取dep路径失败, errorCode为Error_Unexpect(2147483646),rtaCode为RTA2424-->
 		<!--5、指纹仪扫描失败,未生成指纹信息文件, errorCode为Error_Unexpect(2147483646),rtaCode为RTA2416-->
-		<!--6、指纹仪扫描失败,获取指纹特征值长度不对, errorCode为Error_Unexpect(2147483646),rtaCode为RTA2414-->
-		<!--7、指纹仪扫描失败,获取指纹特征值为空, errorCode为Error_Unexpect(2147483646),rtaCode为RTA2413-->	
+		<!--6、指纹仪扫描失败,获取指纹特征值长度不对, errorCode为Error_Unexpect(2147483646),rtaCode为RTA2413-->
+		<!--7、指纹仪扫描失败,获取指纹特征值为空, errorCode为Error_Unexpect(2147483646),rtaCode为RTA2414-->
+		<!--8、指纹扫描失败,获取指纹图片内容失败, errorCode为Error_Unexpect(2147483646),rtaCode为RTA242A-->
 		<twoway name="GetFingerPrintJS" overlap="true" method_id="9" jsflag="true">
 			<req>
 				<!--指纹序号 0:授权扫描使用 1、2、3...等注册扫描使用-->
 				<param name="fingerSN" type="int"/>
+				<!--指纹扫描超时时间 单位秒-->
+				<param name="scanTimeOut" type="int"/>
 				<param name="reserved1" type="array_int" />
 				<param name="reserved2" type="array_string" />
 			</req>
@@ -116,10 +119,11 @@
 		
 		<!--生成指纹模版接口 -->
 		<!--1、指纹仪打开失败, errorCode为Error_DevNotAvailable(2050),rtaCode为RTA2425-->
-		<!--2、指纹仪注册取消, errorCode为Error_Unexpect(2147483646),rtaCode为RTA2427-->
-		<!--3、合成特征模版失败,获取模版特征值长度不对 errorCode为Error_Unexpect(2147483646),rtaCode为RTA2428-->
-		<!--4、合成特征模板失败 errorCode为Error_Unexpect(2147483646),rtaCode为RTA2419-->
-		<!--5、合成特征模版的指纹图片不存在 errorCode为Error_Unexpect(2147483646),rtaCode为RTA242a-->
+		<!--2、指纹扫描已被取消, errorCode为Error_Unexpect(2147483646),rtaCode为RTA2427-->
+		<!--3、指纹模版生成失败,模版特征值长度不正确 errorCode为Error_Unexpect(2147483646),rtaCode为RTA2428-->	
+		<!--4、指纹模版生成失败,指纹文件不存在 errorCode为Error_Unexpect(2147483646),rtaCode为RTA242C-->
+		<!--5、指纹模版生成失败,输入参数错误 errorCode为Error_Unexpect(2147483646),rtaCode为RTA242B-->
+		<!--6、指纹模版生成失败,errorCode为Error_Unexpect(2147483646),rtaCode为RTA2418-->
 		<twoway name="GenerateTemplateJS" overlap="true" method_id="10" jsflag="true">
 			<req>
 				<!-- 指纹序号集合,合成模版的指纹序号 -->
@@ -135,6 +139,7 @@
 			</res>			
 		</twoway>
 		<!--取消扫描接口 -->
+		<!--1、指纹仪打开失败, errorCode为Error_DevNotAvailable(2050),rtaCode为RTA242D-->
 		<twoway name="CancelScanJS" overlap="true" method_id="11" jsflag="true">	
 			<req>
 				<param name="reserved1" type="array_int" />

+ 12 - 1
Module/mod_FingerPrint/FingerPrintFSM.cpp

@@ -477,6 +477,17 @@ int CFingerPrintFSM::GetFingerPrintJS(SpReqAnsContext<FingerPrintService_GetFing
 		return 0;
 	}
 
+	int scanTimeOut = 0;
+	if (ctx->Req.scanTimeOut > 0) {
+		scanTimeOut = ctx->Req.scanTimeOut;
+	}
+	else {
+		LogWarn(Severity_Middle, Error_Unexpect, FingerPrint_UserErrorCode_GET_FINGERPRINT_PARAM_FAIL, "GetFingerPrintJS::Get dep Path is fail");
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode(FingerPrint_Scan_ID).setResultCode(getRTACode(FingerPrint_UserErrorCode_GET_FINGERPRINT_PARAM_FAIL))("GetFingerPrintJS::Param is error,scanTimeOut[%d] is invalid", ctx->Req.scanTimeOut);
+		ctx->Answer(Error_Unexpect, FingerPrint_UserErrorCode_GET_FINGERPRINT_PARAM_FAIL);//RTA242F
+		return 0;
+	}
+
 	bool bIsRegister = false;//判定是否注册
 	bIsRegister = (ctx->Req.fingerSN == 0) ? false : true;
 
@@ -504,7 +515,7 @@ int CFingerPrintFSM::GetFingerPrintJS(SpReqAnsContext<FingerPrintService_GetFing
 
 
 	LogEvent(Severity_Middle, LOG_EVT_FINGERPRINT_GREEN_ON, "FingerPrint warning on");
-	while (elapsed < FINGERPRINT_GETFINGER_TIMEOUT  && !bGetFingerPrintSuc)
+	while (elapsed < scanTimeOut && !bGetFingerPrintSuc)
 	{
 		if (m_bExit) {
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER)("Exit the process.");

+ 1 - 0
Module/mod_FingerPrint/FingerPrint_UserErrorCode.h

@@ -53,6 +53,7 @@
 #define FingerPrint_UserErrorCode_DEVOPENFAILED_CANCELSCAN_FAIL			0x2040022c	//指纹DevOpen失败,业务调用CancelScan时报错
 
 #define FingerPrint_UserErrorCode_FindFile_in_DepBak					0x20400232	//在旧Dep路径下找到文件
+#define FingerPrint_UserErrorCode_GET_FINGERPRINT_PARAM_FAIL			0x20400233	//指纹扫描输入参数错误
 
 //指纹流程状态报错
 #define FingerPrint_UserErrorCode_PROCESS_NORMAL						0x20400401		//当前处于指纹仪空闲状态,无法处理此请求

+ 2 - 1
Module/mod_FingerPrint/FingerPrint_def_g.h

@@ -255,12 +255,13 @@ struct FingerPrintService_GenerateTemplate_Ans
 struct FingerPrintService_GetFingerPrintJS_Req
 {
 	int fingerSN;
+	int scanTimeOut;
 	CAutoArray<int> reserved1;
 	CAutoArray<CSimpleStringA> reserved2;
 
 	void Serialize(SpBuffer &Buf)
 	{
-		auto & buf = Buf & fingerSN & reserved1 & reserved2;
+		auto & buf = Buf & fingerSN & scanTimeOut & reserved1 & reserved2;
 	}
 
 };

+ 1 - 1
Module/mod_FingerPrint/mod_FingerPrint.cpp

@@ -90,7 +90,7 @@ void FingerPrintServerSession::Handle_GetFingerPrintJS(SpReqAnsContext<FingerPri
 {
 	LOG_FUNCTION();
 	DbgToBeidou(ctx->link, __FUNCTION__)();
-	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke GetFingerPrintJS , ctx->Req.fingerSN = %d", ctx->Req.fingerSN);
+	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke GetFingerPrintJS , fingerSN = %d, scanTimeOut = %d", ctx->Req.fingerSN,ctx->Req.scanTimeOut);
 	m_pEntity->GetFingerPrintJS(ctx);
 }
 void FingerPrintServerSession::Handle_GenerateTemplateJS(SpReqAnsContext<FingerPrintService_GenerateTemplateJS_Req, FingerPrintService_GenerateTemplateJS_Ans>::Pointer ctx)