|
|
@@ -3,13 +3,15 @@
|
|
|
|
|
|
#include "CommEntityUtil.hpp"
|
|
|
#include "DevFSMCommBase.hpp"
|
|
|
-#include "DeviceBaseHelper.h"
|
|
|
#include "FingerPrintClass.h"
|
|
|
-#include "CardSwiper_client_g.h"
|
|
|
+#include "FingerPrint_UserErrorCode.h"
|
|
|
+
|
|
|
+#include "DeviceBaseHelper.h"
|
|
|
+
|
|
|
#include "fileutil.h"
|
|
|
#include <ctime>
|
|
|
|
|
|
-using namespace CardSwiper;
|
|
|
+
|
|
|
|
|
|
struct ScanParam
|
|
|
{
|
|
|
@@ -103,7 +105,7 @@ public:
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-class GetFingerEvent : public FSMEvent
|
|
|
+class GetFingerEvent : public FSMEvent
|
|
|
{
|
|
|
public:
|
|
|
GetFingerEvent() : FSMEvent(USER_EVT_GETFINGER) {}
|
|
|
@@ -142,7 +144,7 @@ public:
|
|
|
virtual ~CancelRegisterEvent(){}
|
|
|
virtual void OnUnhandled()
|
|
|
{
|
|
|
- LOG_TRACE("Cancel scan not handled");
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("Cancel scan not handled");
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -157,7 +159,7 @@ public:
|
|
|
if (ctx != NULL)
|
|
|
{
|
|
|
ctx->Answer(Error_InvalidState);
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("match unhandled.");
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("Match unhandled.");
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
@@ -170,7 +172,10 @@ public:
|
|
|
SpReqAnsContext<FingerPrintService_Match_Req, FingerPrintService_Match_Ans>::Pointer ctx;
|
|
|
virtual void OnUnhandled()
|
|
|
{
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("Match finished unhandled.");
|
|
|
+ if (ctx != NULL)
|
|
|
+ {
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("Match finished unhandled.");
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -183,7 +188,9 @@ public:
|
|
|
virtual void OnUnhandled()
|
|
|
{
|
|
|
if (ctx != NULL)
|
|
|
+ {
|
|
|
DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("GetFingerFinished unhandled.");
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -220,7 +227,7 @@ public:
|
|
|
FSM_STATE_ENTRY(s0, "Normal", s0_on_entry,s0_on_exit,s0_on_event)
|
|
|
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(s3, "Match", s3_on_entry,s3_on_exit,s3_on_event)//废弃的状态
|
|
|
END_FSM_STATE()
|
|
|
|
|
|
BEGIN_FSM_RULE(CFingerPrintFSM, s0)
|
|
|
@@ -272,50 +279,56 @@ public:
|
|
|
void s3_on_exit();
|
|
|
unsigned int s3_on_event(FSMEvent* e);
|
|
|
|
|
|
- int GetImageAndFeature(SpReqAnsContext<FingerPrintService_GetImageAndFeature_Req, FingerPrintService_GetImageAndFeature_Ans>::Pointer ctx);
|
|
|
- int GetImageAndFeatureEx(SpReqAnsContext<FingerPrintService_GetImageAndFeatureEx_Req, FingerPrintService_GetImageAndFeatureEx_Ans>::Pointer ctx);
|
|
|
int GetFingerPrint(SpReqAnsContext<FingerPrintService_GetFingerPrint_Req, FingerPrintService_GetFingerPrint_Ans>::Pointer ctx);
|
|
|
int GenerateTemplate(SpReqAnsContext<FingerPrintService_GenerateTemplate_Req, FingerPrintService_GenerateTemplate_Ans>::Pointer ctx);
|
|
|
- ErrorCodeEnum Match(SpReqAnsContext<FingerPrintService_Match_Req, FingerPrintService_Match_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);
|
|
|
- ErrorCodeEnum GetDevCatInfo(DevCategoryInfo& devInfo);
|
|
|
- ErrorCodeEnum GetDevState(int& state);
|
|
|
- ErrorCodeEnum CheckCardSwiperStatus();
|
|
|
+
|
|
|
+ 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);//废弃
|
|
|
+
|
|
|
CSimpleString GenerateAlarmJson(CSimpleString entityName, int cost);
|
|
|
ErrorCodeEnum DoDevOpen(CSmartPointer<IConfigInfo> spConfig);
|
|
|
ErrorCodeEnum DoGetDevInfo();
|
|
|
ErrorCodeEnum QueryRootConfigObj(CSmartPointer<IConfigInfo> &spConfig);
|
|
|
- bool IsFWBDevice(CSimpleString& vendorName);
|
|
|
ErrorCodeEnum InitCommParam(ScanParam* initParam, int type, int scanTime, int templateNum = -1);
|
|
|
- ErrorCodeEnum InitParamBeforeScan(ScanParam *initParam, int scanTime);
|
|
|
- void ScanProcess(ScanParam* pScanParam, SpReqAnsContext<FingerPrintService_GetImageAndFeature_Req, FingerPrintService_GetImageAndFeature_Ans>::Pointer &ctx);
|
|
|
- void ScanProcessEx(ScanParam* pScanParam, SpReqAnsContext<FingerPrintService_GetImageAndFeatureEx_Req, FingerPrintService_GetImageAndFeatureEx_Ans>::Pointer& ctx);
|
|
|
- void ProcessAfterScan(ScanParam* pScanParam, SpReqAnsContext<FingerPrintService_GetImageAndFeature_Req, FingerPrintService_GetImageAndFeature_Ans>::Pointer& ctx);
|
|
|
- void ProcessAfterScanEx(ScanParam* pScanParam, SpReqAnsContext<FingerPrintService_GetImageAndFeatureEx_Req, FingerPrintService_GetImageAndFeatureEx_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);
|
|
|
- ErrorCodeEnum InitParamBeforeMatch(ScanParam* initParam, int templateNum);
|
|
|
- void ScanBeforeMatch(ScanParam* initParam);
|
|
|
- ErrorCodeEnum MatchProcess(ScanParam* initParam, SpReqAnsContext<FingerPrintService_Match_Req, FingerPrintService_Match_Ans>::Pointer& ctx);
|
|
|
ErrorCodeEnum ExtractVendorLib(CSimpleStringA& strLibFullPath);
|
|
|
|
|
|
+ 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:
|
|
|
ErrorCodeEnum m_testResult;
|
|
|
DevCategoryInfo m_devCatInfo;
|
|
|
DevStateEnum m_devState;
|
|
|
- CSimpleStringA m_BmpFileFullPath1;
|
|
|
- CSimpleStringA m_BmpFileFullPath2;
|
|
|
- CSimpleStringA m_BmpFileFullPath3;
|
|
|
- CSimpleStringA m_csDevSN;
|
|
|
+
|
|
|
bool m_bCancelRegister;
|
|
|
bool m_bCancelMatch;
|
|
|
- bool m_devInit;
|
|
|
bool m_bExit;
|
|
|
-};
|
|
|
|
|
|
+ CSimpleStringA m_csDevSN;//蓝牙多合一设备sn
|
|
|
+ bool m_devInit;
|
|
|
+ CSimpleStringA m_BmpFileFullPath1;
|
|
|
+ CSimpleStringA m_BmpFileFullPath2;
|
|
|
+ CSimpleStringA m_BmpFileFullPath3;
|
|
|
+
|
|
|
+};
|
|
|
+//废弃
|
|
|
struct ScanTask : public ITaskSp
|
|
|
{
|
|
|
CFingerPrintFSM* fsm;
|
|
|
@@ -329,8 +342,8 @@ struct ScanTask : public ITaskSp
|
|
|
fsm->PostEventFIFO(e);
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
-struct ScanExTask : public ITaskSp
|
|
|
+//废弃
|
|
|
+struct ScanExTask : public ITaskSp
|
|
|
{
|
|
|
CFingerPrintFSM* fsm;
|
|
|
SpReqAnsContext<FingerPrintService_GetImageAndFeatureEx_Req, FingerPrintService_GetImageAndFeatureEx_Ans>::Pointer ctx;
|
|
|
@@ -343,8 +356,8 @@ struct ScanExTask : public ITaskSp
|
|
|
fsm->PostEventFIFO(e);
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
-struct GetFingerTask : public ITaskSp
|
|
|
+//有用
|
|
|
+struct GetFingerTask : public ITaskSp
|
|
|
{
|
|
|
CFingerPrintFSM* fsm;
|
|
|
SpReqAnsContext<FingerPrintService_GetFingerPrint_Req, FingerPrintService_GetFingerPrint_Ans>::Pointer ctx;
|
|
|
@@ -357,7 +370,7 @@ struct GetFingerTask : public ITaskSp
|
|
|
fsm->PostEventFIFO(e);
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
+//有用
|
|
|
struct GenerateTemplateTask : public ITaskSp
|
|
|
{
|
|
|
CFingerPrintFSM* fsm;
|
|
|
@@ -371,7 +384,7 @@ struct GenerateTemplateTask : public ITaskSp
|
|
|
fsm->PostEventFIFO(e);
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
+//废弃
|
|
|
struct MatchTask : public ITaskSp
|
|
|
{
|
|
|
CFingerPrintFSM* fsm;
|