浏览代码

Z991239-4900 #comment 同步指纹仪实体代码

Signed-Off-By: commit-hook
刘文涛80174520 2 年之前
父节点
当前提交
a0bc6153d7

文件差异内容过多而无法显示
+ 462 - 563
Module/mod_FingerPrint/FingerPrintFSM.cpp


+ 118 - 84
Module/mod_FingerPrint/FingerPrintFSM.h

@@ -1,50 +1,51 @@
 #ifndef FINGERPRINT_FSM_H
 #define FINGERPRINT_FSM_H
 
-#include "CommEntityUtil.hpp"
+
+#include "SpFSM.h"
 #include "DevFSMCommBase.hpp"
 #include "FingerPrintClass.h"
 #include "FingerPrint_UserErrorCode.h"
 
-#include "DeviceBaseHelper.h"
-
-#include "fileutil.h"
-#include <ctime>
-
-
-
-struct ScanParam
-{
-	CSimpleStringA m_DepPath;
-	CSimpleStringA m_FullFilePath;
-	CSimpleStringA m_BmpFileName;
-
-	ULLINT m_TimeStart;
-	ULLINT m_TimeEnd;
-	ULLINT m_TimeLeft;
-
-	LPBYTE m_Feature;
-	LPBYTE m_Template;
-	int m_FeatureLen;
-
-	bool m_ScanSuc;
-	bool m_GetTemplateSuc;
-	bool m_NotFindImage;
-	bool m_FeatureIsNull;
-	bool m_bLenIsNotRight;
-	bool m_bGetFingerPrintSuc;
-	bool m_Quit;
-};
-
-enum OperateType
-{
-	RegisterType = 1,
-	MatchType
-};
+#include "CommEntityUtil.hpp"
+//#include "DeviceBaseHelper.h"
+
+using namespace std;
+
+//struct ScanParam
+//{
+//	CSimpleStringA m_DepPath;
+//	CSimpleStringA m_FullFilePath;
+//	CSimpleStringA m_BmpFileName;
+//
+//	ULLINT m_TimeStart;
+//	ULLINT m_TimeEnd;
+//	ULLINT m_TimeLeft;
+//
+//	LPBYTE m_Feature;
+//	LPBYTE m_Template;
+//	int m_FeatureLen;
+//
+//	bool m_ScanSuc;
+//	bool m_GetTemplateSuc;
+//	bool m_NotFindImage;
+//	bool m_FeatureIsNull;
+//	bool m_bLenIsNotRight;
+//	bool m_bGetFingerPrintSuc;
+//	bool m_Quit;
+//};
+//
+//enum OperateType
+//{
+//	RegisterType = 1,
+//	MatchType
+//};
 
 enum EvtType
 {
 	USER_EVT_TEST = EVT_USER + 1,
+	USER_EVT_INIT,
+	USER_EVT_INIT_FINISHED,
 	USER_EVT_GET_DEVINFO,
 	USER_EVT_SCAN,
 	USER_EVT_SCAN_FINISHED,
@@ -56,12 +57,16 @@ enum EvtType
 	USER_EVT_GETFINGER_FINISHED,
 	USER_EVT_GENERATE_TEMPLATE,
 	USER_EVT_GENERATE_TEMPLATE_FINISHED,
+	USER_EVT_MATCH_FINGERPRINT,
+	USER_EVT_MATCH_FINGERPRINT_FINISHED,
 	USER_EVT_CANCEL_SCAN,
 	USER_EVT_CANCEL_MATCH,
 	USER_EVT_CANCEL_SCAN_FINISHED,
 	USER_EVT_QUIT,
 	USER_EVT_ERROR,
-	USER_EVT_EXIT
+	USER_EVT_EXIT,
+	USER_EVT_FWB_OPEN_SUC,
+	USER_EVT_FWB_OPEN_SUC_FINISHED,
 };
 
 enum BmpType
@@ -228,16 +233,19 @@ public:
 		FSM_STATE_ENTRY(s1, "Scan", s1_on_entry,s1_on_exit,s1_on_event)
 		FSM_STATE_ENTRY(s2, "Fail", s2_on_entry,s2_on_exit,s2_on_event)
 		FSM_STATE_ENTRY(s3, "Match", s3_on_entry,s3_on_exit,s3_on_event)//废弃的状态
+		FSM_STATE_ENTRY(s4, "Init", s4_on_entry,s4_on_exit,s4_on_event)
 	END_FSM_STATE()
 
-	BEGIN_FSM_RULE(CFingerPrintFSM, s0)
+	BEGIN_FSM_RULE(CFingerPrintFSM, s4)
 		FSM_RULE_ENTRY(s0, FSM_STATE_EXIT, USER_EVT_QUIT, 0)
 		FSM_RULE_ENTRY(s0, s1, USER_EVT_SCAN, 0)
 		FSM_RULE_ENTRY(s0, s1, USER_EVT_SCANEX, 0)
 		FSM_RULE_ENTRY(s0, s1, USER_EVT_GETFINGER, 0)
 		FSM_RULE_ENTRY(s0, s1, USER_EVT_GENERATE_TEMPLATE, 0)
+		FSM_RULE_ENTRY(s0, s1, USER_EVT_SCANEX, 0)
 		FSM_RULE_ENTRY(s0, s2, USER_EVT_ERROR, 0)
 		FSM_RULE_ENTRY(s0, s3, USER_EVT_MATCH, 0)
+		FSM_RULE_ENTRY(s0, s4, USER_EVT_FWB_OPEN_SUC_FINISHED, 0)
 		FSM_RULE_ENTRY(s1, FSM_STATE_EXIT, USER_EVT_QUIT, 0)
 		FSM_RULE_ENTRY(s1, s0, USER_EVT_SCAN_FINISHED, 0)
 		FSM_RULE_ENTRY(s1, s2, USER_EVT_SCAN_FINISHED, 2)
@@ -247,18 +255,22 @@ public:
 		FSM_RULE_ENTRY(s1, s2, USER_EVT_GETFINGER_FINISHED, 2)
 		FSM_RULE_ENTRY(s1, s0, USER_EVT_GENERATE_TEMPLATE_FINISHED, 0)
 		FSM_RULE_ENTRY(s1, s2, USER_EVT_GENERATE_TEMPLATE_FINISHED, 2)
+		FSM_RULE_ENTRY(s2, s4, USER_EVT_FWB_OPEN_SUC_FINISHED, 0)
 		FSM_RULE_ENTRY(s3, FSM_STATE_EXIT, USER_EVT_QUIT, 0)
 		FSM_RULE_ENTRY(s3, s0, USER_EVT_MATCH_FINISHED, 0)
 		FSM_RULE_ENTRY(s3, s2, USER_EVT_MATCH_FINISHED, 2)
+		FSM_RULE_ENTRY(s4, s0, USER_EVT_INIT_FINISHED, 0)
+		FSM_RULE_ENTRY(s4, s2, USER_EVT_INIT_FINISHED, 2)
 	END_FSM_RULE()
 
 	CFingerPrintFSM(): m_bCancelRegister(false), m_bCancelMatch(false), m_bExit(false),
-					   m_testResult(Error_Succeed), m_csDevSN(""), m_devInit(false)
-	{
-		HARDWARE_ENTITY_RESET_ENTITYID(m_entCode, 0x204);
-		m_FirstStart = TRUE;
-		ZeroMemory(&m_adapterInfo, sizeof(m_adapterInfo));
-	};
+					  m_testResult(Error_Succeed), m_csDevSN(""), m_iInWhatPage(PageType_Other),
+					  m_csMachineType(""), m_terminalNo(""),m_fwbSN(""), m_version(""), m_machineVersion("")
+					{	
+						HARDWARE_ENTITY_RESET_ENTITYID(m_entCode, 0x204); 
+						//m_FirstStart = TRUE;
+						//ZeroMemory(&m_adapterInfo, sizeof(m_adapterInfo));
+					}
 
 	virtual ErrorCodeEnum OnInit();
 	virtual ErrorCodeEnum OnExit();
@@ -267,6 +279,10 @@ public:
 	void s0_on_exit();
 	unsigned int s0_on_event(FSMEvent* e);
 
+	void s4_on_entry();
+	void s4_on_exit();
+	unsigned int s4_on_event(FSMEvent* e);
+
 	void s1_on_entry();
 	void s1_on_exit();
 	unsigned int s1_on_event(FSMEvent* e);
@@ -281,37 +297,29 @@ public:
 
 	int GetFingerPrint(SpReqAnsContext<FingerPrintService_GetFingerPrint_Req, FingerPrintService_GetFingerPrint_Ans>::Pointer ctx);
 	int GenerateTemplate(SpReqAnsContext<FingerPrintService_GenerateTemplate_Req, FingerPrintService_GenerateTemplate_Ans>::Pointer ctx);
-	void CollectProcess(ScanParam* pScanParam, SpReqAnsContext<FingerPrintService_GetFingerPrint_Req, FingerPrintService_GetFingerPrint_Ans>::Pointer& ctx);
-	void ProcessAfterCollect(ScanParam* pScanParam, SpReqAnsContext<FingerPrintService_GetFingerPrint_Req, FingerPrintService_GetFingerPrint_Ans>::Pointer& ctx);
+	//void CollectProcess(ScanParam* pScanParam, SpReqAnsContext<FingerPrintService_GetFingerPrint_Req, FingerPrintService_GetFingerPrint_Ans>::Pointer& ctx);
+	//void ProcessAfterCollect(ScanParam* pScanParam, SpReqAnsContext<FingerPrintService_GetFingerPrint_Req, FingerPrintService_GetFingerPrint_Ans>::Pointer& ctx);
 
 	void DeleteBmp(int type);
 	ErrorCodeEnum DeleteFileIfExisted(const char* fileName);
 
-	int GetImageAndFeature(SpReqAnsContext<FingerPrintService_GetImageAndFeature_Req, FingerPrintService_GetImageAndFeature_Ans>::Pointer ctx);//废弃
-	int GetImageAndFeatureEx(SpReqAnsContext<FingerPrintService_GetImageAndFeatureEx_Req, FingerPrintService_GetImageAndFeatureEx_Ans>::Pointer ctx);//废弃
-	ErrorCodeEnum Match(SpReqAnsContext<FingerPrintService_Match_Req, FingerPrintService_Match_Ans>::Pointer ctx);//废弃
 	ErrorCodeEnum GetDevCatInfo(DevCategoryInfo& devInfo);//废弃
 	ErrorCodeEnum GetDevState(int &state);//废弃
 
+	int Initial();
+	//ErrorCodeEnum DoDevOpen(CSmartPointer<IConfigInfo> spConfig);
+	//ErrorCodeEnum DoGetDevInfo();
+	//ErrorCodeEnum QueryRootConfigObj(CSmartPointer<IConfigInfo>& spConfig);
+	//ErrorCodeEnum InitCommParam(ScanParam* initParam, int type, int scanTime, int templateNum = -1);
+	//ErrorCodeEnum ExtractVendorLib(CSimpleStringA& strLibFullPath);
+	int ProcFWBReConn();
+	bool GetDevInitFlag() { return m_bOpened; }
+	void ResetDevInitFlag() { m_bOpened = false; }//蓝牙多合一使用
+//	bool GetDevInitFlag() { return m_devInit; }
+	void SetInWhatPage(int bValue) { m_iInWhatPage = bValue; }
+//	bool IsFWBDevice(CSimpleString& vendorName);//废弃 蓝牙多合一判断
+
 
-	ErrorCodeEnum DoDevOpen(CSmartPointer<IConfigInfo> spConfig);
-	ErrorCodeEnum DoGetDevInfo();
-	ErrorCodeEnum QueryRootConfigObj(CSmartPointer<IConfigInfo> &spConfig);
-	ErrorCodeEnum InitCommParam(ScanParam* initParam, int type, int scanTime, int templateNum = -1);
-	ErrorCodeEnum ExtractVendorLib(CSimpleStringA& strLibFullPath);
-//	CSimpleString GenerateAlarmJson(CSimpleString entityName, int cost);
-
-	bool GetDevInitFlag() { return m_devInit; }
-	bool IsFWBDevice(CSimpleString& vendorName);//废弃 蓝牙多合一判断
-	ErrorCodeEnum InitParamBeforeScan(ScanParam *initParam, int scanTime);//废弃 GetImageAndFeature和GetImageAndFeatureEx引用
-	void ScanProcess(ScanParam* pScanParam, SpReqAnsContext<FingerPrintService_GetImageAndFeature_Req, FingerPrintService_GetImageAndFeature_Ans>::Pointer &ctx);//废弃 GetImageAndFeature引用
-	void ScanProcessEx(ScanParam* pScanParam, SpReqAnsContext<FingerPrintService_GetImageAndFeatureEx_Req, FingerPrintService_GetImageAndFeatureEx_Ans>::Pointer& ctx);//废弃 GetImageAndFeatureEx引用
-	void ProcessAfterScan(ScanParam* pScanParam, SpReqAnsContext<FingerPrintService_GetImageAndFeature_Req, FingerPrintService_GetImageAndFeature_Ans>::Pointer& ctx);//废弃 GetImageAndFeature引用
-	void ProcessAfterScanEx(ScanParam* pScanParam, SpReqAnsContext<FingerPrintService_GetImageAndFeatureEx_Req, FingerPrintService_GetImageAndFeatureEx_Ans>::Pointer& ctx);//废弃 GetImageAndFeatureEx引用
-	ErrorCodeEnum InitParamBeforeMatch(ScanParam* initParam, int templateNum);//废弃 Match引用
-	void ScanBeforeMatch(ScanParam* initParam);//废弃 Match引用
-	ErrorCodeEnum MatchProcess(ScanParam* initParam, SpReqAnsContext<FingerPrintService_Match_Req, FingerPrintService_Match_Ans>::Pointer& ctx);//废弃 Match引用
-	
 	void SelfTest(EntityTestEnum eTestType,CSmartPointer<ITransactionContext> pTransactionContext);
 
 private:
@@ -322,13 +330,14 @@ private:
 	bool m_bCancelRegister;
 	bool m_bCancelMatch;
 	bool m_bExit;
+	int m_iInWhatPage/*在哪个页面,区分首页,用户桌面,其他页*/;
 
 	CSimpleStringA m_csDevSN;//蓝牙多合一设备sn
-	bool m_devInit;//和DevFSMCommBase 里面的m_bOpened变量一致
-	CSimpleStringA m_BmpFileFullPath1;//废弃
-	CSimpleStringA m_BmpFileFullPath2;//废弃
-	CSimpleStringA m_BmpFileFullPath3;//废弃
-	
+//	bool m_devInit;//和DevFSMCommBase 里面的m_bOpened变量一致
+	CSimpleStringA m_csMachineType,m_terminalNo;//site,terminalNo只是临时使用,可以去除
+	CSimpleStringA m_fwbSN;//FWBDevSN值
+	CSimpleStringA m_version;//蓝牙多合一pinpad版本
+	CSimpleStringA m_machineVersion;//终端大版本
 };
 //废弃
 struct ScanTask : public ITaskSp   
@@ -338,10 +347,10 @@ struct ScanTask : public ITaskSp
 	ScanTask(CFingerPrintFSM* f) : fsm(f){}
 	void Process()
 	{
-		LOG_FUNCTION();
-		FSMEvent* e = new FSMEvent(USER_EVT_SCAN_FINISHED);
-		e->param1 = fsm->GetImageAndFeature(ctx);
-		fsm->PostEventFIFO(e);
+		//LOG_FUNCTION();
+		//FSMEvent* e = new FSMEvent(USER_EVT_SCAN_FINISHED);
+		//e->param1 = fsm->GetImageAndFeature(ctx);
+		//fsm->PostEventFIFO(e);
 	}
 };
 //废弃
@@ -352,10 +361,10 @@ struct ScanExTask : public ITaskSp
 	ScanExTask(CFingerPrintFSM* f) : fsm(f) {}
 	void Process()
 	{
-		LOG_FUNCTION();
-		FSMEvent* e = new FSMEvent(USER_EVT_SCANEX_FINISHED);
-		e->param1 = fsm->GetImageAndFeatureEx(ctx);
-		fsm->PostEventFIFO(e);
+		//LOG_FUNCTION();
+		//FSMEvent* e = new FSMEvent(USER_EVT_SCANEX_FINISHED);
+		//e->param1 = fsm->GetImageAndFeatureEx(ctx);
+		//fsm->PostEventFIFO(e);
 	}
 };
 //有用
@@ -394,10 +403,35 @@ struct MatchTask : public ITaskSp
 	MatchTask(CFingerPrintFSM* f) : fsm(f){}
 	void Process()
 	{
-		LOG_FUNCTION();
-		MatchFinishedEvent* e = new MatchFinishedEvent();
-		e->param1 = fsm->Match(ctx);
-		e->ctx = ctx;
+		//LOG_FUNCTION();
+		//MatchFinishedEvent* e = new MatchFinishedEvent();
+		//e->param1 = fsm->Match(ctx);
+		//e->ctx = ctx;
+		//fsm->PostEventFIFO(e);
+	}
+};
+//有用
+struct InitTask : public ITaskSp
+{
+	CFingerPrintFSM* fsm;
+	InitTask(CFingerPrintFSM* f) : fsm(f) {}
+
+	void Process()
+	{
+		FSMEvent* e = new FSMEvent(USER_EVT_INIT_FINISHED);
+		e->param1 = fsm->Initial();
+		fsm->PostEventFIFO(e);
+	}
+};
+//有用
+struct ProcFWBReConnTask : public ITaskSp
+{
+	CFingerPrintFSM* fsm;
+	ProcFWBReConnTask(CFingerPrintFSM* f) : fsm(f) {}
+	void Process()
+	{
+		FSMEvent* e = new FSMEvent(USER_EVT_FWB_OPEN_SUC_FINISHED);
+		e->param1 = fsm->ProcFWBReConn();
 		fsm->PostEventFIFO(e);
 	}
 };

+ 2 - 0
Module/mod_FingerPrint/FingerPrint_UserErrorCode.h

@@ -6,6 +6,8 @@
 #define FingerPrint_Scan_ID "QLR040220407"
 #define FingerPrint_Generate_Template_ID "QLR040220408"
 
+#define LOG_ERR_FINGERPRINT_REQUEST_REFUSE								0x20400100
+
 #define FingerPrint_UserErrorCode_Start									0x20400200
 #define FingerPrint_UserErrorCode_GET_DLLNAME_FAILED_ONINIT				( FingerPrint_UserErrorCode_Start + 1 )		//指纹仪实体初始化时,获取适配器名称失败 - LogWarn
 #define FingerPrint_UserErrorCode_OPEN_ROOT_FAILED_ONINIT				( FingerPrint_UserErrorCode_Start + 2 )		//指纹仪实体初始化时,打开root.ini文件失败 - LogWarn

+ 11 - 0
Module/mod_FingerPrint/FingerPrint_def_g.h

@@ -34,6 +34,17 @@ namespace FingerPrint {
 #define FingerPrintService_MethodSignature_GetFingerPrint -2051396936
 #define FingerPrintService_MethodSignature_GenerateTemplate 1610871029
 
+#define FingerPrintService_LogCode_GetImageAndFeature "QLR040220400"
+#define FingerPrintService_LogCode_CancelRegister "QLR040220401"
+#define FingerPrintService_LogCode_CancelMatch "QLR040220402"
+#define FingerPrintService_LogCode_Exit "QLR040220403"
+#define FingerPrintService_LogCode_Match "QLR040220404"
+#define FingerPrintService_LogCode_GetDevStatus "QLR040220405"
+#define FingerPrintService_LogCode_GetDevInfo "QLR040220499"
+#define FingerPrintService_LogCode_GetImageAndFeatureEx "QLR040220406"
+#define FingerPrintService_LogCode_GetFingerPrint "QLR040220407"
+#define FingerPrintService_LogCode_GenerateTemplate "QLR040220408"
+
 struct FingerPrintService_GetImageAndFeature_Req
 {
 	int times;

+ 42 - 0
Module/mod_FingerPrint/mod_FingerPrint.cpp

@@ -1,11 +1,13 @@
 // mod_FingerPrint.cpp : 定义 DLL 应用程序的导出函数。
 //
 
+#include "stdafx.h"
 #include "mod_FingerPrint.h"
 
 void FingerPrintServerSession::Handle_GetDevInfo(SpReqAnsContext<FingerPrintService_GetDevInfo_Req, FingerPrintService_GetDevInfo_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
+	DbgToBeidou(ctx->link, __FUNCTION__)();
 	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("GetDevInfo")("Invoke GetDevInfo");
 	m_pEntity->GetDevInfo(ctx);
 }
@@ -13,6 +15,7 @@ void FingerPrintServerSession::Handle_GetDevInfo(SpReqAnsContext<FingerPrintServ
 void FingerPrintServerSession::Handle_GetDevStatus(SpReqAnsContext<FingerPrintService_GetDevStatus_Req, FingerPrintService_GetDevStatus_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
+	DbgToBeidou(ctx->link, __FUNCTION__)();
 	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("GetDevStatus")("Invoke GetDevStatus");
 	m_pEntity->GetDevStatus(ctx);
 }
@@ -20,6 +23,7 @@ void FingerPrintServerSession::Handle_GetDevStatus(SpReqAnsContext<FingerPrintSe
 void FingerPrintServerSession::Handle_GetImageAndFeature(SpReqAnsContext<FingerPrintService_GetImageAndFeature_Req, FingerPrintService_GetImageAndFeature_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
+	DbgToBeidou(ctx->link, __FUNCTION__)();
 	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("GetImageAndFeature")("Invoke GetImageAndFeature");
 	m_pEntity->GetImageAndFeature(ctx);
 }
@@ -27,6 +31,7 @@ void FingerPrintServerSession::Handle_GetImageAndFeature(SpReqAnsContext<FingerP
 void FingerPrintServerSession::Handle_GetImageAndFeatureEx(SpReqAnsContext<FingerPrintService_GetImageAndFeatureEx_Req, FingerPrintService_GetImageAndFeatureEx_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
+	DbgToBeidou(ctx->link, __FUNCTION__)();
 	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("GetImageAndFeatureEx")("Invoke GetImageAndFeatureEx");
 	m_pEntity->GetImageAndFeatureEx(ctx);
 }
@@ -34,6 +39,7 @@ void FingerPrintServerSession::Handle_GetImageAndFeatureEx(SpReqAnsContext<Finge
 void FingerPrintServerSession::Handle_GetFingerPrint(SpReqAnsContext<FingerPrintService_GetFingerPrint_Req, FingerPrintService_GetFingerPrint_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
+	DbgToBeidou(ctx->link, __FUNCTION__)();
 	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("GetFingerPrint")("Invoke GetFingerPrint");
 	m_pEntity->GetFingerPrint(ctx);
 }
@@ -41,6 +47,7 @@ void FingerPrintServerSession::Handle_GetFingerPrint(SpReqAnsContext<FingerPrint
 void FingerPrintServerSession::Handle_GenerateTemplate(SpReqAnsContext<FingerPrintService_GenerateTemplate_Req, FingerPrintService_GenerateTemplate_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
+	DbgToBeidou(ctx->link, __FUNCTION__)();
 	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("GenerateTemplate")("Invoke GenerateTemplate");
 	m_pEntity->GenerateTemplate(ctx);
 }
@@ -48,6 +55,7 @@ void FingerPrintServerSession::Handle_GenerateTemplate(SpReqAnsContext<FingerPri
 void FingerPrintServerSession::Handle_CancelRegister(SpOnewayCallContext<FingerPrintService_CancelRegister_Info>::Pointer ctx)
 {
 	LOG_FUNCTION();
+	DbgToBeidou(ctx->link, __FUNCTION__)();
 	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("CancelRegister")("Invoke CancelRegister");
 	m_pEntity->CancelRegister(ctx);
 }
@@ -55,6 +63,7 @@ void FingerPrintServerSession::Handle_CancelRegister(SpOnewayCallContext<FingerP
 void FingerPrintServerSession::Handle_CancelMatch(SpOnewayCallContext<FingerPrintService_CancelMatch_Info>::Pointer ctx)
 {
 	LOG_FUNCTION();
+	DbgToBeidou(ctx->link, __FUNCTION__)();
 	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("CancelMatch")("Invoke CancelMatch");
 	m_pEntity->CancelMatch(ctx);
 }
@@ -62,6 +71,7 @@ void FingerPrintServerSession::Handle_CancelMatch(SpOnewayCallContext<FingerPrin
 void FingerPrintServerSession::Handle_Match(SpReqAnsContext<FingerPrintService_Match_Req, FingerPrintService_Match_Ans>::Pointer ctx)
 {
 	LOG_FUNCTION();
+	DbgToBeidou(ctx->link, __FUNCTION__)();
 	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("CheckAndMatch")("Invoke CheckAndMatch");
 	m_pEntity->CheckAndMatch(ctx);
 }
@@ -69,10 +79,42 @@ void FingerPrintServerSession::Handle_Match(SpReqAnsContext<FingerPrintService_M
 void FingerPrintServerSession::Handle_Exit(SpOnewayCallContext<FingerPrintService_Exit_Info>::Pointer ctx)
 {
 	LOG_FUNCTION();
+	DbgToBeidou(ctx->link, __FUNCTION__)();
 	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("Exit")("Invoke Exit");
 	m_pEntity->Exit(ctx);
 }
 
+void CFingerPrintEntity::OnSysVarEvent(const char *pszKey,
+	const char *pszValue, const char *pszOldValue, const char *pszEntityName)
+{
+#ifdef RVC_OS_WIN
+	if ((_strnicmp(pszKey, "UIState", strlen("UIState")) == 0))
+	{	//增加页面位置判断
+		if (_strnicmp(pszValue, "M", strlen("M")) == 0) {
+			m_fsm.SetInWhatPage(PageType_MainPage);
+		}
+		else if (_strnicmp(pszValue, "U", strlen("U")) == 0) {
+			m_fsm.SetInWhatPage(PageType_UserDesktop);
+		}
+		else {
+			m_fsm.SetInWhatPage(PageType_Other);
+		}
+	}
+	else if ((_strnicmp(pszKey, "FWBReConn", strlen("FWBReConn")) == 0))
+	{
+		//"Y":open suc "U":unbind
+		if (_strnicmp(pszValue, "Y", strlen("Y")) == 0 || _strnicmp(pszValue, "U", strlen("U")) == 0)
+		{
+			FSMEvent* e = new FSMEvent(USER_EVT_FWB_OPEN_SUC);
+			m_fsm.PostEventFIFO(e);
+		}
+	}else if (_strnicmp(pszValue, "D", strlen("D")) == 0 )
+	{
+		m_fsm.ResetDevInitFlag();
+	}
+#endif	
+}
+
 SP_BEGIN_ENTITY_MAP()
 	SP_ENTITY(CFingerPrintEntity)
 SP_END_ENTITY_MAP()

+ 27 - 10
Module/mod_FingerPrint/mod_FingerPrint.h

@@ -4,7 +4,10 @@
 #include "FingerPrintFSM.h"
 #include "FingerPrint_server_g.h"
 #include "modVer.h"
+#ifdef RVC_OS_WIN
+#else
 #include "SpTest.h"
+#endif
 
 class CFingerPrintEntity;
 
@@ -27,22 +30,27 @@ private:
 	CFingerPrintEntity* m_pEntity;
 };
 
-class CFingerPrintEntity : public CDevAdptEntityBase
+class CFingerPrintEntity : public CDevAdptEntityBase, public ISysVarListener
 {
 public:
 	CFingerPrintEntity(){}
 	virtual ~CFingerPrintEntity(){}
 	virtual const char *GetEntityName() const { return "FingerPrint"; }
 	virtual bool IsService() const {return true;}
+#ifdef RVC_OS_WIN
+#else	
 	virtual const char* GetEntityVersion() const { return MODULE_VERSION_FULL; }
 
 	ON_ENTITYT_TEST()
+#endif	
 
 	virtual void OnPreStart(CAutoArray<CSimpleStringA> strArgs,CSmartPointer<ITransactionContext> pTransactionContext)
 	{
 		LOG_FUNCTION();
 		ErrorCodeEnum ec = m_fsm.Init(this);
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("OnPreStart, Init:%d", ec);
+		GetFunction()->RegistSysVarEvent("FWBReConn", this);
+		GetFunction()->RegistSysVarEvent("UIState", this);
 		pTransactionContext->SendAnswer(ec);
 	}
 
@@ -80,16 +88,20 @@ public:
 	//废弃
 	void GetImageAndFeature(SpReqAnsContext<FingerPrintService_GetImageAndFeature_Req, FingerPrintService_GetImageAndFeature_Ans>::Pointer ctx)
 	{
-		ScanEvent* e = new ScanEvent();
-		e->ctx = ctx;
-		m_fsm.PostEventFIFO(e);
+		//ScanEvent* e = new ScanEvent();
+		//e->ctx = ctx;
+		//m_fsm.PostEventFIFO(e);
+		LogWarn(Severity_Low, Error_Unexpect, LOG_ERR_FINGERPRINT_REQUEST_REFUSE, "web invoke GetImageAndFeature request refuse");
+		ctx->Answer(Error_Exception);
 	}
 	//废弃
 	void GetImageAndFeatureEx(SpReqAnsContext<FingerPrintService_GetImageAndFeatureEx_Req, FingerPrintService_GetImageAndFeatureEx_Ans>::Pointer ctx)
 	{
-		ScanExEvent* e = new ScanExEvent();
-		e->ctx = ctx;
-		m_fsm.PostEventFIFO(e);
+		//ScanExEvent* e = new ScanExEvent();
+		//e->ctx = ctx;
+		//m_fsm.PostEventFIFO(e);
+		LogWarn(Severity_Low, Error_Unexpect, LOG_ERR_FINGERPRINT_REQUEST_REFUSE, "web invoke GetImageAndFeatureEx request refuse");
+		ctx->Answer(Error_Exception);
 	}
 	//有用:扫描指纹(73294)
 	void GetFingerPrint(SpReqAnsContext<FingerPrintService_GetFingerPrint_Req, FingerPrintService_GetFingerPrint_Ans>::Pointer ctx)
@@ -126,9 +138,11 @@ public:
 	//废弃
 	void CheckAndMatch(SpReqAnsContext<FingerPrintService_Match_Req, FingerPrintService_Match_Ans>::Pointer ctx)
 	{
-		MatchEvent* e = new MatchEvent();
-		e->ctx = ctx;
-		m_fsm.PostEventFIFO(e);
+		//MatchEvent* e = new MatchEvent();
+		//e->ctx = ctx;
+		//m_fsm.PostEventFIFO(e);
+		LogWarn(Severity_Low, Error_Unexpect, LOG_ERR_FINGERPRINT_REQUEST_REFUSE, "web invoke CheckAndMatch request refuse");
+		ctx->Answer(Error_Exception);
 	}
 	//废弃
 	void GetDevInfo(SpReqAnsContext<FingerPrintService_GetDevInfo_Req, FingerPrintService_GetDevInfo_Ans>::Pointer ctx)
@@ -155,6 +169,9 @@ public:
 		m_fsm.PostEventFIFO(e);
 	}
 
+	virtual void OnSysVarEvent(const char *pszKey,
+		const char *pszValue, const char *pszOldValue, const char *pszEntityName);
+
 private:
 	CFingerPrintFSM m_fsm;
 

部分文件因为文件数量过多而无法显示