瀏覽代碼

Z991239-5251 #comment feat: 去除行外pad状态的订阅和功能

陈纪林80310970 1 年之前
父節點
當前提交
57d01f2da8

+ 13 - 75
Module/mod_IDCertificate/IDCertFSM.cpp

@@ -173,10 +173,7 @@ void CIDCertFSM::s0_on_entry()
 		ToLogWarnInfoAboutTerm();
 	}
 #else
-	//oilyang@20220413 except RVC.PAD without FWB
-	CSimpleStringA tmpFWBDevSN("");
-	GetEntityBase()->GetFunction()->GetSysVar("FWBDevSN", tmpFWBDevSN);
-	if (!m_logBefore && !(m_csMachineType.Compare("RVC.PAD", true) == 0 && tmpFWBDevSN.IsNullOrEmpty())) {
+	if (!m_logBefore) {
 		ToLogWarnInfoAboutTermCustom();
 		m_logBefore = true;
 	}
@@ -221,8 +218,6 @@ unsigned int CIDCertFSM::s0_on_event(FSMEvent* pEvt)
 		case USER_EVT_TODO_INIT:
 		{
 			pEvt->SetHandled();
-			ProcFWBReConnTask* task = new ProcFWBReConnTask(this);
-			GetEntityBase()->GetFunction()->PostThreadPoolTask(task);
 		}
 		break;
 		case USER_EVT_TODO_INIT_FINISHED:
@@ -286,8 +281,6 @@ unsigned int CIDCertFSM::s1_on_event(FSMEvent *pEvt)
 	case USER_EVT_TODO_INIT:
 		{
 			pEvt->SetHandled();
-			ProcFWBReConnTask* task = new ProcFWBReConnTask(this);
-			GetEntityBase()->GetFunction()->PostThreadPoolTask(task);
 		}
 		break;
 	case USER_EVT_TODO_INIT_FINISHED:
@@ -396,8 +389,6 @@ unsigned int CIDCertFSM::s5_on_event(FSMEvent* pEvt)
 	case USER_EVT_TODO_INIT:
 	{
 		pEvt->SetHandled();
-		ProcFWBReConnTask* task = new ProcFWBReConnTask(this);
-		GetEntityBase()->GetFunction()->PostThreadPoolTask(task);
 	}
 	break;
 	case USER_EVT_TODO_INIT_FINISHED:
@@ -1990,12 +1981,6 @@ int CIDCertFSM::Initial() //windows ver
 	m_csMachineType = sysInfo.strMachineType;
 	m_terminalNo = sysInfo.strTerminalID;
 	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("machineType:%s,terminalNo:%s", (const char*)m_csMachineType, (const char*)m_terminalNo);
-	//oilyang@20220413 except RVC.PAD without FWB
-	CSimpleStringA tmpFWBDevSN("");
-	GetEntityBase()->GetFunction()->GetSysVar("FWBDevSN", tmpFWBDevSN);
-	if (m_csMachineType.Compare("RVC.PAD", true) == 0 && tmpFWBDevSN.IsNullOrEmpty()) {
-		return 0;
-	}
 	m_devState = DEVICE_STATUS_NOT_READY;
 	auto pEntity = GET_DEV_ENTITY_BASE_POINTER();
 
@@ -2013,36 +1998,13 @@ int CIDCertFSM::Initial() //windows ver
 		return 2;
 	}
 
-	GetEntityBase()->GetFunction()->GetSysVar("FWBDevSN", tmpDevSN);
-	GetEntityBase()->GetFunction()->GetSysVar("FWBVendor", tmpVendor);
-	GetEntityBase()->GetFunction()->GetSysVar("FWBVersion", tmpDLLVersion);
-	if (tmpDLLVersion.GetLength() < 2)//如果忘记配置,则直接使用默认值8.1
-		tmpDLLVersion = "8.1";
-	if (tmpDevSN.GetLength() > 12 && tmpDevSN.IndexOf("FWB") > 2)
-	{
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("This is fwb device.");
-		m_devSN = tmpDevSN;
-		VendorLibInfo tmpVendorLibInfo(GetEntityBase()->GetEntityName());
-		tmpVendorLibInfo.strVendor = tmpVendor;
-		CAutoArray<CSimpleStringA> dllVersions = tmpDLLVersion.Split('.');
-		if (dllVersions.GetCount() >= 2) {
-			tmpVendorLibInfo.strVersion = dllVersions[0];
-			tmpVendorLibInfo.strBatch = dllVersions[1];
-		} else {
-			tmpVendorLibInfo.strVersion = tmpDLLVersion;
-		}
-		pEntity->vendorLibInfo = tmpVendorLibInfo;
+	m_devSN = "";
+	eErrDev = pEntity->LoadVendorLibName();
+	if (eErrDev != Error_Succeed) {
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("get vendor dll(%s)name failed.", pEntity->GetVendorLibName().GetData());
+		return 2;
 	}
-	else
-	{
-		m_devSN = "";
-		eErrDev = pEntity->LoadVendorLibName();
-		if (eErrDev != Error_Succeed) {
-			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("get vendor dll(%s)name failed.", pEntity->GetVendorLibName().GetData());
-			return 2;
-		}
 
-	}
 	FulfillAdapterInfoFrom(pEntity->vendorLibInfo);
 	HARDWARE_ENTITY_SET_VENDOR_NAME(m_entCode, m_adapterInfo.strVendor);
 
@@ -2178,30 +2140,13 @@ int CIDCertFSM::Initial() //linux ver
 	
 	CSimpleStringA dllName, tmpVendor(""), tmpDevSN(""), tmpDLLVersion, csDepPath("");
 
-	GetEntityBase()->GetFunction()->GetSysVar("FWBVendor", tmpVendor);
-	GetEntityBase()->GetFunction()->GetSysVar("FWBDevSN", tmpDevSN);
-	GetEntityBase()->GetFunction()->GetSysVar("FWBVersion", tmpDLLVersion);
-	if (tmpDLLVersion.GetLength() < 2)//如果忘记配置,则直接使用默认值8.1
-		tmpDLLVersion = "8.1";
-	if (tmpDevSN.GetLength() > 12 && tmpDevSN.IndexOf("FWB") > 2)
-	{
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("This is fwb device.");
-		m_devSN = tmpDevSN;
-		GetEntityBase()->GetFunction()->GetPath("Dep", csDepPath);
-		dllName = csDepPath + SPLIT_SLASH_STR + "IDCertificate." + tmpVendor + "." + tmpDLLVersion + ".dll";//oiltmp
-		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s", (const char*)dllName);
-		HARDWARE_ENTITY_SET_VENDOR_NAME(m_entCode, tmpVendor);
-	}
-	else
-	{
-		dllName = pEntity->GetVendorLibName();
-		CSmartPointer<IConfigInfo> pConfig;
-		ErrorCodeEnum rc = GetEntityBase()->GetFunction()->OpenConfig(Config_Root, pConfig);
-		CSimpleStringA strSection = CSimpleStringA("Device.") + GetEntityBase()->GetEntityName();
-		CSimpleStringA str;
-		pConfig->ReadConfigValue(strSection, "Vendor", str);
-		HARDWARE_ENTITY_SET_VENDOR_NAME(m_entCode, str);
-	}
+	dllName = pEntity->GetVendorLibName();
+	CSmartPointer<IConfigInfo> pConfig;
+	ErrorCodeEnum rc = GetEntityBase()->GetFunction()->OpenConfig(Config_Root, pConfig);
+	CSimpleStringA strSection = CSimpleStringA("Device.") + GetEntityBase()->GetEntityName();
+	CSimpleStringA str;
+	pConfig->ReadConfigValue(strSection, "Vendor", str);
+	HARDWARE_ENTITY_SET_VENDOR_NAME(m_entCode, str);
 
 	bool bOpenFlag = false;
 	do {
@@ -2345,13 +2290,6 @@ void CIDCertFSM::ToLogWarnInfoAboutTermCustom()
 		}
 	}
 }
-int CIDCertFSM::ProcFWBReConn()
-{
-	if (m_hDevHelper != nullptr) {
-		m_hDevHelper.TearDown();
-	}
-	return 0;
-}
 #endif
 
 BOOL CIDCertFSM::UCS2_to_UTF8(UINT16* ucs2_code, UINT8* utf8_code)

+ 0 - 12
Module/mod_IDCertificate/IDCertFSM.h

@@ -307,7 +307,6 @@ public:
 	}
 	int Initial();
 	void SelfTest(EntityTestEnum eTestType,CSmartPointer<ITransactionContext> pTransactionContext);
-	int ProcFWBReConn();
 	bool IsRVCPAD() { return !m_csMachineType.Compare("RVC.PAD", true); }
 
 	static void HttpsLogCallBack(const char* logtxt);
@@ -423,15 +422,4 @@ struct InitTask : public ITaskSp
 		fsm->PostEventFIFO(e);
 	}
 };
-struct ProcFWBReConnTask : public ITaskSp
-{
-	CIDCertFSM* fsm;
-	ProcFWBReConnTask(CIDCertFSM* f) : fsm(f) {}
-	void Process()
-	{
-		FSMEvent* e = new FSMEvent(USER_EVT_TODO_INIT_FINISHED);
-		e->param1 = fsm->ProcFWBReConn();
-		fsm->PostEventFIFO(e);
-	}
-};
 #endif //IDCERTFSM_H

+ 0 - 32
Module/mod_IDCertificate/mod_IDCertificate.cpp

@@ -51,35 +51,3 @@ void IDCertServerSession::Handle_ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndS
 	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Handle_ReadAndScanUTF8");
 	m_pEntity->ReadAndScanUTF8(ctx);
 }
-
-#ifdef RVC_OS_WIN
-void CIDCertEntity::OnSysVarEvent(const char* pszKey,
-	const char* pszValue, const char* pszOldValue, const char* pszEntityName)
-{
-	if ((_strnicmp(pszKey, "FWBReConn", strlen("FWBReConn")) == 0))
-	{
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("OnSysVarEvent FWBReConn:%s", pszValue);
-		//"Y":open suc "U":unbind
-		if (_strnicmp(pszValue, "Y", strlen("Y")) == 0 || _strnicmp(pszValue, "U", strlen("U")) == 0)
-		{
-			FSMEvent* e = new FSMEvent(USER_EVT_TODO_INIT);
-			m_fsm.PostEventFIFO(e);
-		}
-		else if (_strnicmp(pszValue, "D", strlen("D")) == 0)
-		{
-			if (m_fsm.GetReadFlag())
-			{
-				DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setLogCode("QLR040220106").setResultCode("RTA2103")("FWB disconnected while reading IDCard.");
-				CSimpleStringA xTmpDevNo("");
-				GetFunction()->GetSysVar("FWBDevSN", xTmpDevNo);
-				LogError(Severity_Middle, Error_Unexpect, IDCertificate_UserErrorCode_Reading_Disconnected, CSimpleStringA::Format("%s disconnected while reading IDCard.",xTmpDevNo.GetData()));
-			}
-			m_fsm.ResetDevInitFlag();
-		}
-	}
-}
-#endif // !RVC_OS_WIN
-
-SP_BEGIN_ENTITY_MAP()
-	SP_ENTITY(CIDCertEntity)
-SP_END_ENTITY_MAP()

+ 5 - 32
Module/mod_IDCertificate/mod_IDCertificate.h

@@ -43,9 +43,6 @@ public:
 	{
 		LOG_FUNCTION();
 		ErrorCodeEnum rt = m_fsm.Init(this);
-#ifdef RVC_OS_WIN
-		GetFunction()->RegistSysVarEvent("FWBReConn", this);
-#endif
 		pTransactionContext->SendAnswer(rt);
 	}
 
@@ -107,16 +104,8 @@ public:
 #else	//windows
 		if (!m_fsm.GetDevInitFlag())
 		{
-			if (m_fsm.IsRVCPAD())
-			{
-				ctx->Answer(Error_DevNotAvailable, IDCertificate_UserErrorCode_FWB_NotConnected);
-				LogWarn(Severity_Middle, Error_DevNotAvailable, IDCertificate_UserErrorCode_FWB_NotConnected, "fwb not connected.");
-			}
-			else
-			{
-				ctx->Answer(Error_DevNotAvailable, IDCertificate_UserErrorCode_DevOpenFailed);
-				LogWarn(Severity_Middle, Error_DevNotAvailable, IDCertificate_UserErrorCode_DevOpenFailed, "Open Dev failed.");
-			}
+			ctx->Answer(Error_DevNotAvailable, IDCertificate_UserErrorCode_DevOpenFailed);
+			LogWarn(Severity_Middle, Error_DevNotAvailable, IDCertificate_UserErrorCode_DevOpenFailed, "Open Dev failed.");
 
 			return;
 		}
@@ -135,16 +124,8 @@ public:
 #else
 		if (!m_fsm.GetDevInitFlag())
 		{
-			if (m_fsm.IsRVCPAD())
-			{
-				ctx->Answer(Error_DevNotAvailable, IDCertificate_UserErrorCode_FWB_NotConnected);
-				LogWarn(Severity_Middle, Error_DevNotAvailable, IDCertificate_UserErrorCode_FWB_NotConnected, "fwb not connected.");
-			}
-			else
-			{
-				ctx->Answer(Error_DevNotAvailable, IDCertificate_UserErrorCode_DevOpenFailed);
-				LogWarn(Severity_Middle, Error_DevNotAvailable, IDCertificate_UserErrorCode_DevOpenFailed, "Open Dev failed.");
-			}
+			ctx->Answer(Error_DevNotAvailable, IDCertificate_UserErrorCode_DevOpenFailed);
+			LogWarn(Severity_Middle, Error_DevNotAvailable, IDCertificate_UserErrorCode_DevOpenFailed, "Open Dev failed.");
 
 			return;
 		}
@@ -159,10 +140,7 @@ public:
 #ifdef RVC_OS_WIN
 		if (!m_fsm.GetDevInitFlag())
 		{
-			if (m_fsm.IsRVCPAD())
-				ctx->Answer(Error_DevNotAvailable, IDCertificate_UserErrorCode_FWB_NotConnected);
-			else
-				ctx->Answer(Error_DevNotAvailable, IDCertificate_UserErrorCode_DevOpenFailed);
+			ctx->Answer(Error_DevNotAvailable, IDCertificate_UserErrorCode_DevOpenFailed);
 			return;
 		}
 #endif
@@ -198,11 +176,6 @@ public:
 
 	virtual bool IsService()const{return true;}
 	virtual bool IsMultiThread()const{return false;}
-
-#ifdef RVC_OS_WIN
-	virtual void OnSysVarEvent(const char* pszKey,
-		const char* pszValue, const char* pszOldValue, const char* pszEntityName);
-#endif
 private:
 	CIDCertFSM m_fsm;
 };