|
@@ -19,9 +19,6 @@
|
|
|
#include <atltime.h>
|
|
|
#endif //RVC_OS_WIN
|
|
|
|
|
|
-char tmpxx[1024];
|
|
|
-char testIC[1024];
|
|
|
-
|
|
|
#include "CardIssuerClass.h"
|
|
|
#include "mod_cardissuer.h"
|
|
|
#include "stdafx.h"
|
|
@@ -30,12 +27,6 @@ char testIC[1024];
|
|
|
//oiltest@20200915 temp for GetTickCount
|
|
|
#ifdef RVC_OS_WIN
|
|
|
#define _ATL_NO_AUTOMATIC_NAMESPACE
|
|
|
-#include <winsock2.h>
|
|
|
-#include <Ws2bth.h>
|
|
|
-// Link to Bthprops.lib
|
|
|
-#include <BluetoothAPIs.h>
|
|
|
-#pragma comment (lib, "Ws2_32.lib")
|
|
|
-#pragma comment (lib, "Bthprops.lib")
|
|
|
#else
|
|
|
#include<sys/time.h>
|
|
|
#include <dlfcn.h>
|
|
@@ -1149,7 +1140,7 @@ ErrorCodeEnum CCardIssuerFSM::OnInit()
|
|
|
DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("create card process failed.");
|
|
|
return Error_Resource;
|
|
|
}
|
|
|
- Load();
|
|
|
+ m_csDevSN = "";
|
|
|
CSystemStaticInfo sysInfo;
|
|
|
//oilyang 20160331
|
|
|
//so many function always return Error_Succeed,so is useless to process it.
|
|
@@ -1163,7 +1154,8 @@ ErrorCodeEnum CCardIssuerFSM::OnInit()
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)(CSimpleStringA::Format("CardIssuer, MachineType:%s, Site:%s, TerminalNo:%s, MachineVersion:%d.%d",
|
|
|
m_csMachineType.GetData(), m_csSite.GetData(), m_terminalNo.GetData(), m_majorVerion, m_minorVerion));
|
|
|
|
|
|
- //因替换实体名,需要兼容把以前旧的运行时文件拷贝成新的实体名运行文件
|
|
|
+ //因替换实体名,需要兼容把以前旧的运行时文件拷贝成新的实体名运行文件,卡机分离后,拷贝旧版运行时文件,后期稳定后直接去除
|
|
|
+ //////////////////////////////////////////////////////////////////////////
|
|
|
CSimpleStringA runinfoPath(true);
|
|
|
CSmartPointer<IConfigInfo> spConfig;
|
|
|
ErrorCodeEnum err = GetEntityBase()->GetFunction()->GetPath("RunInfo", runinfoPath);
|
|
@@ -1176,7 +1168,7 @@ ErrorCodeEnum CCardIssuerFSM::OnInit()
|
|
|
DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("get cfg file failed ");
|
|
|
return err;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
CSimpleStringA runinfoOldFile = runinfoPath + SPLIT_SLASH_STR + "runcfg" + SPLIT_SLASH_STR + "CardIssuer.ini";
|
|
|
CSimpleStringA runinfoNewFile = runinfoPath + SPLIT_SLASH_STR + "runcfg" + SPLIT_SLASH_STR + "CardIssuerStand.ini";
|
|
|
|
|
@@ -1251,7 +1243,7 @@ ErrorCodeEnum CCardIssuerFSM::OnInit()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ //////////////////////////////////////////////////////////////////////////
|
|
|
m_devStatus.eMedia = CI_MEDIA_NOTPRESENT;
|
|
|
m_bHasHopper[0] = false;
|
|
|
m_bHasHopper[1] = false;
|
|
@@ -1541,10 +1533,10 @@ ErrorCodeEnum CCardIssuerFSM::OpenDevice(BYTE btOpenType, const char* pDevSN)
|
|
|
long l_beginTime,l_endTime;
|
|
|
do {
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("CreateDevComponent suc. m_port:%d, m_baudRate:%d, pDevSN:%s",
|
|
|
- m_port, m_baudRate, pDevSN);
|
|
|
+ m_adapterInfo.GetPortInt(), m_adapterInfo.GetBaudrateInt(), pDevSN);
|
|
|
|
|
|
l_beginTime = GetTickCountRVC();
|
|
|
- eErrDev = m_hDevHelper->DevOpenEx(m_port, m_baudRate, btOpenType, pDevSN, m_connectType);
|
|
|
+ eErrDev = m_hDevHelper->DevOpenEx(m_adapterInfo.GetPortInt(), m_adapterInfo.GetBaudrateInt(), btOpenType, pDevSN, m_connectType);
|
|
|
l_endTime = GetTickCountRVC();
|
|
|
|
|
|
if (eErrDev == Error_Succeed)
|
|
@@ -1571,15 +1563,13 @@ ErrorCodeEnum CCardIssuerFSM::OpenDevice(BYTE btOpenType, const char* pDevSN)
|
|
|
else
|
|
|
{
|
|
|
SetErrorAndLog(eErrDev, MEC_DEVAPI_CARDISSUER_GetDevCategory, "DevAdapter::GetDevCategory", __FUNCTION__, false, l_endTime - l_beginTime, "", "");
|
|
|
-
|
|
|
- ///*TODO: need to clear adapter object? (80374374@4/4/2023)*/
|
|
|
return Error_Unexpect;
|
|
|
}
|
|
|
|
|
|
if (!LoadCMBPrint(csBinPath))
|
|
|
{
|
|
|
errMsg = CSimpleStringA::Format("CardIssuer启动失败:Load CMBPrint failed.");
|
|
|
- //LogWarn(Severity_Middle, Error_Unexpect, CardIssuer_UserErrorCode_LoadLibraryA_CMBPrint_Failed, errMsg.GetData());
|
|
|
+ LogWarn(Severity_Middle, Error_Unexpect, CardIssuer_UserErrorCode_LoadLibraryA_CMBPrint_Failed, errMsg.GetData());
|
|
|
return Error_DevLoadFileFailed;
|
|
|
}
|
|
|
initTries = 0;
|
|
@@ -1662,15 +1652,6 @@ ErrorCodeEnum CCardIssuerFSM::OpenDevice(BYTE btOpenType, const char* pDevSN)
|
|
|
}
|
|
|
if (m_hopperNum == 1 && btOpenType == DEV_OPEN_TYPE_COM)//oilyang 如果没有配置,使用原来的配置
|
|
|
{
|
|
|
- //spConfig->ReadConfigValueInt("RunInfo", "CardRemains", m_remainsEx[0]);
|
|
|
- //spConfig->ReadConfigValueInt("RunInfo", "CardIssued", m_issuedEx[0]);
|
|
|
- //spConfig->ReadConfigValueInt("RunInfo", "CardCaptured", m_CardCaptured);
|
|
|
- //spConfig->ReadConfigValueInt("RunInfo", "IsIssue", isIssue);
|
|
|
- //spConfig->ReadConfigValueInt("RunInfo", "CardMixed", m_mixedEx[0]);
|
|
|
- //spConfig->ReadConfigValueInt("RunInfo", "CardInit", m_CardInitEx[0]);
|
|
|
- //spConfig->ReadConfigValueInt("RunInfo", "CardPercent", m_CardPercentEx[0]);
|
|
|
- //DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)(CSimpleStringA::Format("use old record, CardRemains:%d, CardIssued:%d, CardCaptured:%d, IsIssue:%d, CardMixed:%d, CardInit:%d",
|
|
|
- // m_remainsEx[0], m_issuedEx[0], m_CardCaptured, isIssue, m_mixedEx[0], m_CardInitEx[0]));
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)(CSimpleStringA::Format("use new hopper cfg record"));
|
|
|
}
|
|
|
//oilyang 回写卡机配置
|
|
@@ -1753,24 +1734,7 @@ ErrorCodeEnum CCardIssuerFSM::OpenDevice(BYTE btOpenType, const char* pDevSN)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-void CCardIssuerFSM::Load()
|
|
|
-{
|
|
|
- LOG_FUNCTION();
|
|
|
- CSmartPointer<IConfigInfo> spConfig;
|
|
|
- ErrorCodeEnum eErrDev = GetEntityBase()->GetFunction()->OpenConfig(Config_Root, spConfig);
|
|
|
- if (spConfig == NULL)
|
|
|
- {
|
|
|
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("<Load>, open root.ini failed");
|
|
|
- return;
|
|
|
- }
|
|
|
- spConfig->ReadConfigValueInt("Device.CardIssuer", "Baudrate", m_baudRate);
|
|
|
- spConfig->ReadConfigValueInt("Device.CardIssuer", "Port", m_port);
|
|
|
|
|
|
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)(CSimpleStringA::Format("m_baudRate:%d, m_port:%d",
|
|
|
- m_baudRate, m_port));
|
|
|
-
|
|
|
- m_csDevSN = "";
|
|
|
-}
|
|
|
int CCardIssuerFSM::Initial()
|
|
|
{
|
|
|
m_bOpening = true;
|