|
@@ -1,7 +1,6 @@
|
|
|
#include "stdafx.h"
|
|
|
#define WIN32_LEAN_AND_MEAN
|
|
|
#include "SelfCheckerFSM.h"
|
|
|
-#include "SpHelper.h"
|
|
|
#include "EventCode.h"
|
|
|
#pragma comment(lib,"user32.lib")
|
|
|
class CSelfCheckerEntity;
|
|
@@ -74,17 +73,6 @@ DWORD CodeStrToInt(const char* pCode)
|
|
|
}
|
|
|
return dwRet;
|
|
|
}
|
|
|
-unsigned long long GetTickCountRVC() {
|
|
|
-#ifdef RVC_OS_WIN
|
|
|
- return GetTickCount64();
|
|
|
-#else
|
|
|
- struct timespec ts;
|
|
|
-
|
|
|
- clock_gettime(CLOCK_MONOTONIC, &ts);
|
|
|
-
|
|
|
- return (ts.tv_sec * 1000 + ts.tv_nsec / 1000000);
|
|
|
-#endif //RVC_OS_WIN
|
|
|
-}
|
|
|
ErrorCodeEnum CSelfCheckerFSM::OnInit()
|
|
|
{
|
|
|
m_xIdlePre = m_xKernelPre = m_xUserPre = 0;
|
|
@@ -266,7 +254,7 @@ ErrorCodeEnum CSelfCheckerFSM::Initial()
|
|
|
ifstream is;
|
|
|
CSimpleStringA cfgPath(""), cfgXml("");
|
|
|
err = GetEntityBase()->GetFunction()->GetPath("cfg", cfgPath);
|
|
|
- cfgXml = cfgPath + "/SelfCheckerProc.xml";
|
|
|
+ cfgXml = cfgPath + SPLIT_SLASH_STR + "SelfCheckerProc.xml";
|
|
|
ReadXmlFile(cfgXml);
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("cfgxml[%s]", cfgXml);
|
|
|
//auto list = m_csKeyEntity.Split(',');
|
|
@@ -468,8 +456,29 @@ ErrorCodeEnum CSelfCheckerFSM::ExceptionErrorProcess(const char* pszEntityName,
|
|
|
|
|
|
return eErrCode;
|
|
|
}
|
|
|
-ErrorCodeEnum CSelfCheckerFSM::CheckEntity(const char *pszEntityName,EntityTestEnum eTestType)
|
|
|
+ErrorCodeEnum CSelfCheckerFSM::CheckEntity(const char* pszEntityName, EntityTestEnum eTestType, bool bNormalCheck)
|
|
|
{
|
|
|
+ if (bNormalCheck)
|
|
|
+ {
|
|
|
+ //oilyang@20230426 ,常规自检时,针对"TerminalStage"做对应处理(自检分常规自检和即时自检)
|
|
|
+ //"S":准入服务告知准入不过,不再进行实体自检
|
|
|
+ //非"A":其他启动失败导致进关门页,不再对硬件以及其他没必要自检的实体进行自检
|
|
|
+ CSimpleStringA tmpTerminalStage("");
|
|
|
+ GetEntityBase()->GetFunction()->GetSysVar("TerminalStage", tmpTerminalStage);
|
|
|
+ if (tmpTerminalStage.Compare("S") == 0)
|
|
|
+ return Error_Succeed;
|
|
|
+ else if (tmpTerminalStage.Compare("A") != 0)
|
|
|
+ {
|
|
|
+ //the hardward entity and some other entity no need to test
|
|
|
+ if (_strnicmp("PinPad", pszEntityName, strlen("PinPad")) == 0 || _strnicmp("CardIssuer", pszEntityName, strlen("CardIssuer")) == 0
|
|
|
+ || _strnicmp("CardSwiper", pszEntityName, strlen("CardSwiper")) == 0 || _strnicmp("ContactlessCard", pszEntityName, strlen("ContactlessCard")) == 0
|
|
|
+ || _strnicmp("IDCertificate", pszEntityName, strlen("IDCertificate")) == 0 || _strnicmp("ups", pszEntityName, strlen("ups")) == 0
|
|
|
+ || _strnicmp("gpio", pszEntityName, strlen("gpio")) == 0 || _strnicmp("HSPScanner", pszEntityName, strlen("HSPScanner")) == 0
|
|
|
+ || _strnicmp("FingerPrint", pszEntityName, strlen("FingerPrint")) == 0
|
|
|
+ )
|
|
|
+ return Error_Succeed;
|
|
|
+ }
|
|
|
+ }
|
|
|
//oilyang@20170926 no need to check by self.Let the HealthManager entity to do it.
|
|
|
if (pszEntityName != NULL && strnicmp(pszEntityName, GetEntityBase()->GetEntityName(), strlen(GetEntityBase()->GetEntityName())) == 0)
|
|
|
return Error_Succeed;
|
|
@@ -492,8 +501,19 @@ ErrorCodeEnum CSelfCheckerFSM::CheckEntity(const char *pszEntityName,EntityTestE
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Test %s,%d", pszEntityName, errCode);
|
|
|
return errCode;
|
|
|
}
|
|
|
-void CSelfCheckerFSM::OnNormalWorkTimerout(void *pData)
|
|
|
+void CSelfCheckerFSM::OnNormalWorkTimerout(void* pData)
|
|
|
{
|
|
|
+ if (!m_bFWBEntityAdd)
|
|
|
+ {
|
|
|
+ //oilyang@20220415 special process of RVC.PAD with FWB
|
|
|
+ CSimpleStringA tmpFWBDevSN("");
|
|
|
+ GetEntityBase()->GetFunction()->GetSysVar("FWBDevSN", tmpFWBDevSN);
|
|
|
+ if (m_sysInfo.strMachineType.Compare("RVC.PAD", true) == 0 && !tmpFWBDevSN.IsNullOrEmpty())
|
|
|
+ {
|
|
|
+ AddFWBEntityToList();
|
|
|
+ m_bFWBEntityAdd = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
CSmartPointer<IEntityFunction> pFunc = GetEntityBase()->GetFunction();
|
|
|
CSmartPointer<IEntityFunctionPrivilege> pFuncPrivilege = pFunc.ConvertCase<IEntityFunctionPrivilege>();
|
|
|
CSmartPointer<IAsynWaitSp> spWait;
|
|
@@ -1223,4 +1243,42 @@ void CSelfCheckerFSM::SetEverEnterMainPageFlag(bool bValue)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
+void CSelfCheckerFSM::AddFWBEntityToList()
|
|
|
+{
|
|
|
+ vector<CSimpleStringA>::iterator it, itAct;
|
|
|
+ bool bPinPadFound(false),bIDCertFound(false),bFingerPrintFound(false)
|
|
|
+ ,bActPinPadFound(false), bActIDCertFound(false), bActFingerPrintFound(false);
|
|
|
+ //template ?
|
|
|
+ for (it = m_allEntity.begin(); it != m_allEntity.end(); ++it)
|
|
|
+ {
|
|
|
+ if (!strnicmp("PinPad", *it, it->GetLength()))
|
|
|
+ bPinPadFound = true;
|
|
|
+ else if (!strnicmp("IDCertificate", *it, it->GetLength()))
|
|
|
+ bIDCertFound = true;
|
|
|
+ else if (!strnicmp("FingerPrint", *it, it->GetLength()))
|
|
|
+ bFingerPrintFound = true;
|
|
|
+ }
|
|
|
+ if (!bPinPadFound)
|
|
|
+ m_allEntity.push_back("PinPad");
|
|
|
+ if (!bIDCertFound)
|
|
|
+ m_allEntity.push_back("IDCertificate");
|
|
|
+ if (!bPinPadFound)
|
|
|
+ m_allEntity.push_back("FingerPrint");
|
|
|
+
|
|
|
+ for (itAct = m_activeEntity.begin(); itAct != m_activeEntity.end(); ++itAct)
|
|
|
+ {
|
|
|
+ if (!strnicmp("PinPad", *itAct, itAct->GetLength()))
|
|
|
+ bActPinPadFound = true;
|
|
|
+ else if (!strnicmp("IDCertificate", *itAct, itAct->GetLength()))
|
|
|
+ bActIDCertFound = true;
|
|
|
+ else if (!strnicmp("FingerPrint", *itAct, itAct->GetLength()))
|
|
|
+ bActFingerPrintFound = true;
|
|
|
+ }
|
|
|
+ if (!bActPinPadFound)
|
|
|
+ m_activeEntity.push_back("PinPad");
|
|
|
+ if (!bActIDCertFound)
|
|
|
+ m_activeEntity.push_back("IDCertificate");
|
|
|
+ if (!bActFingerPrintFound)
|
|
|
+ m_activeEntity.push_back("FingerPrint");
|
|
|
}
|