|
@@ -4,6 +4,7 @@
|
|
|
#include <regex>
|
|
|
#include "json/json.h"
|
|
|
#include <string.h>
|
|
|
+#include <winpr/crt.h>
|
|
|
|
|
|
using namespace CardReadAdapter;
|
|
|
#include "EventCode.h"
|
|
@@ -683,12 +684,7 @@ void CHeartBeatFSM::LocalPreOnline(int slot, CSimpleStringA fromTermNo,CSimpleSt
|
|
|
req.businessData = data;
|
|
|
char buf[16];
|
|
|
ZeroMemory(buf, sizeof(buf));
|
|
|
- //TODO: CrossPlaform [Gifur@2025729]
|
|
|
-#ifdef RVC_OS_WIN
|
|
|
- itoa(slot, buf, 10);
|
|
|
-#else
|
|
|
_itoa(slot, buf, 10);
|
|
|
-#endif
|
|
|
CSimpleStringA kaku("kaku#");
|
|
|
req.module = 1;
|
|
|
req.reserved2.Init(2);
|
|
@@ -1190,6 +1186,7 @@ void HeartBeatConnection::SendCardActive(const int type,const int slot,unsigned
|
|
|
CSimpleStringA inParm = CSimpleStringA::Format("SendCardActive,type:%d, slot:%d, errCode:%d, fromTerm:%s, termNo:%s, findCard:%d, cardPos:%d, dataSize:%d,errCSCode:%d",
|
|
|
type, slot, errCode, m_TerminalNo.GetData(), termNo, findCard, cardPos, dataSize, errCSCode);
|
|
|
LogWarn(Severity_Low, Error_Unexpect, HeartBeat_UserErrorCode_SendCardActive_InParam, inParm.GetData());
|
|
|
+ //TODO: 下面这两部分,绝大部分逻辑类似,为什么不把相同的部分抽出来??? [Gifur@2025821]
|
|
|
//发起跨机调用包
|
|
|
if (type == 0||type==10)
|
|
|
{
|
|
@@ -1198,19 +1195,12 @@ void HeartBeatConnection::SendCardActive(const int type,const int slot,unsigned
|
|
|
m_pEntity->GetFunction()->GetSystemStaticInfo(sysSInfo);
|
|
|
req.type = type;
|
|
|
req.slot = slot;
|
|
|
+
|
|
|
+ strncpy_s(req.FromTerminalNo, sizeof(req.FromTerminalNo), m_TerminalNo.GetData(), m_TerminalNo.GetLength());
|
|
|
+ strncpy_s(req.Account, sizeof(req.Account), account, accSize);
|
|
|
+ strncpy_s(req.TerminalNo, sizeof(req.TerminalNo), termNo, strlen(termNo));
|
|
|
+ strncpy_s(req.Param2, sizeof(req.Param2), data, dataSize);
|
|
|
|
|
|
- //TODO: CrossPlaform [Gifur@2025730]
|
|
|
-#ifdef RVC_OS_WIN
|
|
|
- strncpy_s(req.FromTerminalNo, m_TerminalNo.GetData(), m_TerminalNo.GetLength());
|
|
|
- strncpy_s(req.Account, account, accSize);
|
|
|
- strncpy_s(req.TerminalNo, termNo, strlen(termNo));
|
|
|
- strncpy_s(req.Param2, data, dataSize);
|
|
|
-#else
|
|
|
- strcpy_s(req.FromTerminalNo, sizeof(req.FromTerminalNo), m_TerminalNo.GetData());
|
|
|
- strcpy_s(req.Account, accSize, account);
|
|
|
- strcpy_s(req.TerminalNo, sizeof(req.TerminalNo), termNo);
|
|
|
- strcpy_s(req.Param2, dataSize, data);
|
|
|
-#endif //RVC_OS_WIN
|
|
|
CSmartPointer<IPackage> pkt = CreateNewPackage("CARDACT");
|
|
|
pkt->AddStruct("INSREQX", false, false, (LPBYTE)&req, sizeof(CardActiveReq));
|
|
|
|
|
@@ -1228,18 +1218,11 @@ void HeartBeatConnection::SendCardActive(const int type,const int slot,unsigned
|
|
|
req.cardPos = cardPos;
|
|
|
req.reserved1 = errCSCode;
|
|
|
|
|
|
- //TODO: CrossPlaform [Gifur@2025730]
|
|
|
-#ifdef RVC_OS_WIN
|
|
|
- strncpy_s(req.FromTerminalNo, m_TerminalNo.GetData(), m_TerminalNo.GetLength());
|
|
|
- strncpy_s(req.Account, account, accSize);
|
|
|
- strncpy_s(req.TerminalNo, termNo, strlen(termNo));
|
|
|
- strncpy_s(req.Param2, data, dataSize);
|
|
|
-#else
|
|
|
- strcpy_s(req.FromTerminalNo, sizeof(req.FromTerminalNo), m_TerminalNo.GetData());
|
|
|
- strcpy_s(req.Account, accSize, account);
|
|
|
- strcpy_s(req.TerminalNo, sizeof(req.TerminalNo), termNo);
|
|
|
- strcpy_s(req.Param2, dataSize, data);
|
|
|
-#endif //RVC_OS_WIN
|
|
|
+ strncpy_s(req.FromTerminalNo, sizeof(req.FromTerminalNo), m_TerminalNo.GetData(), m_TerminalNo.GetLength());
|
|
|
+ strncpy_s(req.Account, sizeof(req.Account), account, accSize);
|
|
|
+ strncpy_s(req.TerminalNo, sizeof(req.TerminalNo), termNo, strlen(termNo));
|
|
|
+ strncpy_s(req.Param2, sizeof(req.Param2), data, dataSize);
|
|
|
+
|
|
|
CSmartPointer<IPackage> pkt = CreateNewPackage("CARDACT");
|
|
|
pkt->AddStruct("INSREQX", false, false, (LPBYTE)&req, sizeof(CardActiveReq));
|
|
|
|