浏览代码

Z991239-6089 #comment 优化健康握手前置条件判断2

oilyang 7 月之前
父节点
当前提交
3426df2903

+ 11 - 0
Module/mod_healthmanager/HealthManagerFSM.cpp

@@ -1333,4 +1333,15 @@ void CHealthManagerFSM::CheckIfPinPadOK()
 	m_ullWaitForPinPad = ullWaitEnd - ullWaitStart;
 	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR0402501A3").setCostTime(m_ullWaitForPinPad)("finish (or time out) check  PinPad");
 	return;
+}
+bool CHealthManagerFSM::CheckIfAccessAuthSuc() 
+{
+	if (m_iAccessAuth == VtmLoad_AccessAuth_Suc)
+		return true;
+	CSimpleStringA csTmpTS("");
+	GetEntityBase()->GetFunction()->GetSysVar("TerminalStage", csTmpTS);
+	if (csTmpTS.Compare("A") == 0)
+		return true;
+	else
+		return false;
 }

+ 2 - 1
Module/mod_healthmanager/HealthManagerFSM.h

@@ -161,9 +161,10 @@ public:
 
 	int AccessAuthDoWork();
 	void SetVtmLoadResult(int bResult);
-	bool GetAccessAuthFlag(){return m_iAccessAuth == VtmLoad_AccessAuth_Suc;}
+	bool CheckIfAccessAuthSuc();
 	int GetFSMState(){return m_fsmState;}
 	void ToReAccessAuth(bool bEver=false);
+	//oilyang@20250313 这个函数只有GetNetworkState,用来干嘛?而且在健康lost之后失效
 	int QueryAccessAuthStatus()
 	{
 		if (m_iAccessAuth == VtmLoad_AccessAuth_Suc)

+ 3 - 3
Module/mod_healthmanager/mod_healthmanager.cpp

@@ -299,13 +299,13 @@ void CHealthManagerEntity::OnCheckTimeTimeout()
 		//1、AccessAuth ok
 		//2、have ever enter main page OR 
 		if (!m_bSayIdle)
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_fsm.GetAccessAuthFlag():%d, m_bEnterMainPageEver:%d, m_bInMainPage:%d", m_fsm.GetAccessAuthFlag()
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("m_fsm.GetAccessAuthFlag():%d, m_bEnterMainPageEver:%d, m_bInMainPage:%d", m_fsm.CheckIfAccessAuthSuc()
 				, m_bEnterMainPageEver, CheckUIStateIsM());
 		//oilyang@20241230 check accessauth flag AND if in Main page ever
 		//oilyang@20250313 "Main page ever" has two scenes
 		//1. have enter main page ever,that is "m_bEnterMainPageEver is true"
 		//2. healthmanager have been lost at some point in the past,we check the "UIState" value if 'M'
-		if (m_fsm.GetAccessAuthFlag() && (m_bEnterMainPageEver || (!m_bEnterMainPageEver && CheckUIStateIsM())))
+		if (m_fsm.CheckIfAccessAuthSuc() && (m_bEnterMainPageEver || (!m_bEnterMainPageEver && CheckUIStateIsM())))
 		{
 			iCheckGuardian = CheckGuardianIsRun(true);
 			if (!m_bSayIdle)
@@ -379,7 +379,7 @@ void CHealthManagerEntity::OnCheckTimeTimeout()
 		else
 		{
 			//oilyang@20190905 add if auth suc,tell guardian,for upgrade
-			if (m_fsm.GetAccessAuthFlag())
+			if (m_fsm.CheckIfAccessAuthSuc())
 			{
 				if (CheckGuardianIsRun(true) > 0)
 				{

+ 1 - 1
Module/mod_healthmanager/mod_healthmanager.h

@@ -213,7 +213,7 @@ public:
 	{
 		ctx->Ans.netDeviceState = m_netState;
 		ctx->Ans.reserved1 = m_fsm.QueryAccessAuthStatus();
-		Dbg("current net state %s,auth state:%d", (LPCTSTR)m_netState, ctx->Ans.reserved1);
+		DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_USER).setLogCode(HealthManagerService_LogCode_GetNetworkState)("current net state %s,auth state:%d", (LPCTSTR)m_netState, ctx->Ans.reserved1);
 		ctx->Answer(Error_Succeed);
 	}