|
@@ -711,13 +711,13 @@ void CVtmLoaderFSM::s4_on_entry()
|
|
|
LOG_FUNCTION();
|
|
|
LogWarn(Severity_Low, Error_Succeed, VtmLoader_BootInfoPrint, "Operating 阶段实体加载完成");
|
|
|
//oiltmp wait for analyse progress, then change to app log format
|
|
|
- LogWarn(Severity_Low, Error_Succeed, VtmLoader_NetCard_Cost, CSimpleStringA::Format("%d", m_ullNetCardCost));
|
|
|
- LogWarn(Severity_Low, Error_Succeed, VtmLoader_NetworkDetect_Cost, CSimpleStringA::Format("%d", m_ullNetDetectCost));
|
|
|
- LogWarn(Severity_Low, Error_Succeed, VtmLoader_GetConfig_Cost, CSimpleStringA::Format("%d", m_ullGetConfigCost));
|
|
|
+ LogWarn(Severity_Low, Error_Succeed, VtmLoader_NetCard_Cost, CSimpleStringA::Format("%d", m_ullNetCardCost).GetData());
|
|
|
+ LogWarn(Severity_Low, Error_Succeed, VtmLoader_NetworkDetect_Cost, CSimpleStringA::Format("%d", m_ullNetDetectCost).GetData());
|
|
|
+ LogWarn(Severity_Low, Error_Succeed, VtmLoader_GetConfig_Cost, CSimpleStringA::Format("%d", m_ullGetConfigCost).GetData());
|
|
|
+ LogWarn(Severity_Low, Error_Succeed, VtmLoader_EntityLoad_Cost, CSimpleStringA::Format("%d", (SP::Module::Comm::RVCGetTickCount() - m_ullEntityLoadStart)/1000).GetData());
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR040210F16")("Stage Operating have done.");
|
|
|
NoticeEntityLoadTask* pTask = new NoticeEntityLoadTask(this,Event_VtmLoader_EntityLoad_Finished);
|
|
|
GetEntityBase()->GetFunction()->PostThreadPoolTask(pTask);
|
|
|
- //LogEvent(Severity_Middle, Event_VtmLoader_EntityLoad_Finished, "实体启动完成");
|
|
|
}
|
|
|
void CVtmLoaderFSM::s4_on_exit()
|
|
|
{
|
|
@@ -858,10 +858,9 @@ int CVtmLoaderFSM::NetWorkCheckAndGetSetting()
|
|
|
while (true)
|
|
|
{
|
|
|
if (!DetectNetworkLegality(strMsg)) {
|
|
|
- //LogWarn(Severity_High, Error_Unexpect, VtmLoader_UserCode_NetCard_UnAvaible, strMsg.GetData());
|
|
|
- //LogWarn(Severity_High, Error_Unexpect, VtmLoader_BootInfoPrint, strMsg.GetData());
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040210F10").setResultCode("RTA1F00")("can't find valid network interface");
|
|
|
LogWarn(Severity_High, Error_Unexpect, VtmLoader_BootInfoPrint, CSimpleStringA::Format("%s。%d 秒后自动重试(第%d次重试)。请检查网线是否插好、网络是否正常"
|
|
|
- , strMsg.GetData(), m_iDetectInterval / 1000, netcheckCount));
|
|
|
+ , strMsg.GetData(), m_iDetectInterval / 1000, netcheckCount).GetData());
|
|
|
//if (tmpTS.Compare("E") != 0)
|
|
|
//{
|
|
|
// GetEntityBase()->GetFunction()->SetSysVar("TerminalStage", "E");
|
|
@@ -887,6 +886,7 @@ int CVtmLoaderFSM::NetWorkCheckAndGetSetting()
|
|
|
return -1;
|
|
|
}
|
|
|
}
|
|
|
+ DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setLogCode("QLR040210F11")("connect to http(s) service ok.");
|
|
|
m_ullNetDetectCost = (SP::Module::Comm::RVCGetTickCount() - ullTmpStart) / 1000;//second
|
|
|
ullTmpStart = SP::Module::Comm::RVCGetTickCount();
|
|
|
//拉取配置并通知提前启动的实体(Chromium)
|
|
@@ -915,6 +915,7 @@ int CVtmLoaderFSM::EntityLoad()
|
|
|
{
|
|
|
//前提:收到了配置拉取完成的指令,才会进入到这里
|
|
|
//为了测试,假装已经拿到了集中配置
|
|
|
+ m_ullEntityLoadStart = SP::Module::Comm::RVCGetTickCount();
|
|
|
LogWarn(Severity_Low, Error_Succeed, VtmLoader_BootInfoPrint, "开始加载实体");
|
|
|
CSmartPointer<IConfigInfo> spConfigCen,spRunCfg;
|
|
|
GetEntityBase()->GetFunction()->OpenConfig(Config_CenterSetting, spConfigCen);
|
|
@@ -941,7 +942,7 @@ int CVtmLoaderFSM::EntityLoad()
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LogWarn(Severity_High, Error_Unexpect, VtmLoader_BootInfoPrint, CSimpleStringA::Format("CoreBoot配置异常,请联系总行开发人员检查(%s)", csCoreBootList.GetData()));
|
|
|
+ LogWarn(Severity_High, Error_Unexpect, VtmLoader_BootInfoPrint, CSimpleStringA::Format("CoreBoot配置异常,请联系总行开发人员检查(%s)", csCoreBootList.GetData()).GetData());
|
|
|
DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_SYSTEM).setLogCode("QLR040210F14").setResultCode("RTA1F05")(CSimpleStringA::Format("CoreBoot配置异常,请联系总行开发人员检查(%s)", csCoreBootList.GetData()));
|
|
|
}
|
|
|
//if have PinPad module
|
|
@@ -1245,8 +1246,9 @@ void CVtmLoaderFSM::NoticeEntityLoad(int evtCode)
|
|
|
break;
|
|
|
}
|
|
|
DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("Notice HealthManager failed,eErrConn:%d,eErrCall:%d", eErrConn, eErrCall);
|
|
|
+ Sleep(2000);
|
|
|
count++;
|
|
|
- } while (count < 3);
|
|
|
+ } while (count < 100);
|
|
|
}
|
|
|
bool CVtmLoaderFSM::DetectHttpActive()
|
|
|
{
|
|
@@ -1394,7 +1396,7 @@ bool CVtmLoaderFSM::GetConfig()
|
|
|
LogWarn(Severity_Low, Error_Succeed, VtmLoader_BootInfoPrint, "开始拉取配置");
|
|
|
if (Error_Succeed != (eErr = GetEntityBase()->GetFunction()->GetPrivilegeFunction()->InitCfgUrl(channelId, tokenSecret, CommonLaunchUrl, CenterConfigTotal)))
|
|
|
{
|
|
|
- LogWarn(Severity_High, Error_Unexpect, VtmLoader_BootInfoPrint, CSimpleStringA::Format("拉取配置,初始化配置地址失败:0x%x(%s)", eErr, SpStrError(eErr)));
|
|
|
+ LogWarn(Severity_High, Error_Unexpect, VtmLoader_BootInfoPrint, CSimpleStringA::Format("拉取配置,初始化配置地址失败:0x%x(%s)", eErr, SpStrError(eErr)).GetData());
|
|
|
DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040210F13").setResultCode("RTA1F01")("Get config,InitCfgUrl failed.");
|
|
|
LogEvent(Severity_High, Event_VtmLoader_GetConfig_Fail, "拉取配置,初始化配置地址失败");
|
|
|
return false;
|
|
@@ -1407,13 +1409,13 @@ bool CVtmLoaderFSM::GetConfig()
|
|
|
//if token update failed,we can also update cfg suc
|
|
|
if (Error_Succeed != (eErr = GetEntityBase()->GetFunction()->GetPrivilegeFunction()->TryUpdateCfg()))
|
|
|
{
|
|
|
- LogWarn(Severity_High, Error_Unexpect, VtmLoader_BootInfoPrint, CSimpleStringA::Format("拉取配置失败:0x%x(%s)", eErr, SpStrError(eErr)));
|
|
|
+ LogWarn(Severity_High, Error_Unexpect, VtmLoader_BootInfoPrint, CSimpleStringA::Format("拉取配置失败:0x%x(%s)", eErr, SpStrError(eErr)).GetData());
|
|
|
DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040210F13").setResultCode("RTA1F03")("Get config, TryUpdateCfg failed:0x%x", eErr);
|
|
|
LogEvent(Severity_High, Event_VtmLoader_GetConfig_Fail, "拉取配置失败");
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ refreshLogLevel();
|
|
|
|
|
|
|
|
|
|
|
@@ -1520,7 +1522,8 @@ int CVtmLoaderFSM::HttpConnCheck(CSimpleStringA csHttAddr, HttpAddrType eType)
|
|
|
#endif
|
|
|
if (!bCheckOK)
|
|
|
{
|
|
|
- LogWarn(Severity_Middle, Error_Unexpect, VtmLoader_BootInfoPrint, CSimpleStringA::Format("尝试连接总行服务失败(%s),%d 秒后自动重试(第%d次重试)。请确认终端到总行服务网络是否正常", csHttAddr.GetData(), m_iDetectInterval/1000, httpcheckCount));
|
|
|
+ LogWarn(Severity_Middle, Error_Unexpect, VtmLoader_BootInfoPrint, CSimpleStringA::Format("尝试连接总行服务失败(%s),%d 秒后自动重试(第%d次重试)。请确认终端到总行服务网络是否正常", csHttAddr.GetData(), m_iDetectInterval/1000, httpcheckCount).GetData());
|
|
|
+ DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode("QLR040210F11").setResultCode("RTA1F06")("connect to http(s) service(%s) failed.", csHttAddr.GetData());
|
|
|
m_httpCheckResult[eType] = HttpConnResult_Failed;
|
|
|
Sleep(m_iDetectInterval);
|
|
|
httpcheckCount++;
|
|
@@ -1531,7 +1534,7 @@ int CVtmLoaderFSM::HttpConnCheck(CSimpleStringA csHttAddr, HttpAddrType eType)
|
|
|
GetDns(tmpDns);
|
|
|
for (int i = 0; i < netList.GetCount(); i++) {
|
|
|
LogWarn(Severity_Middle, Error_Unexpect, VtmLoader_BootInfoPrint, CSimpleStringA::Format("(%d)interface:%s; ip:%s; mac:%s; %s", i, netList[i].description.c_str()
|
|
|
- , netList[i].ip.c_str(), netList[i].mac.c_str(), tmpDns.c_str()));
|
|
|
+ , netList[i].ip.c_str(), netList[i].mac.c_str(), tmpDns.c_str()).GetData());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1541,9 +1544,9 @@ int CVtmLoaderFSM::HttpConnCheck(CSimpleStringA csHttAddr, HttpAddrType eType)
|
|
|
if ((SP::Module::Comm::RVCGetTickCount() - beginTick) > 3000)
|
|
|
{
|
|
|
LogWarn(Severity_Low, Error_Unexpect, VtmLoader_BootInfoPrint, CSimpleStringA::Format("第(%d)次尝试连接总行服务成功(%s),但是网络偏慢,连接花了(%d)秒,请检查网络!"
|
|
|
- , httpcheckCount, csHttAddr.GetData(), (SP::Module::Comm::RVCGetTickCount() - beginTick)/1000));
|
|
|
+ , httpcheckCount, csHttAddr.GetData(), (SP::Module::Comm::RVCGetTickCount() - beginTick)/1000).GetData());
|
|
|
}
|
|
|
- LogWarn(Severity_Low, Error_Succeed, VtmLoader_BootInfoPrint, CSimpleStringA::Format("尝试连接总行服务成功(%s)", csHttAddr.GetData()));
|
|
|
+ LogWarn(Severity_Low, Error_Succeed, VtmLoader_BootInfoPrint, CSimpleStringA::Format("尝试连接总行服务成功(%s)", csHttAddr.GetData()).GetData());
|
|
|
return 0;
|
|
|
}
|
|
|
}
|