|
@@ -1094,9 +1094,10 @@ bool CAccessAuthEntity::GetTerminalPublicKey(BYTE* pBuf, int& nBufLen, string& p
|
|
|
|
|
|
//oilyang@20210510 嵌入"bool CAccessAuthEntity::HasPinPad()"的逻辑
|
|
|
// 返回1:只有PinPadID;2:只有DeviceID;3:两者都有;0:没有;-1表示失败
|
|
|
-int CAccessAuthEntity::GetPinPadIDAndDeviceID(CSimpleStringA &strPinPadID, CSimpleStringA &strDeviceID, bool& bHasPinPad)
|
|
|
+int CAccessAuthEntity::GetPinPadIDAndDeviceID(CSimpleStringA &strPinPadID, CSimpleStringA &strDeviceID, bool& isPinPadMac, bool& bPinPadOnline)
|
|
|
{
|
|
|
- bHasPinPad = false;
|
|
|
+ isPinPadMac = false;
|
|
|
+ bPinPadOnline = false;
|
|
|
m_bNewSMFWB = false;
|
|
|
CSimpleStringA strErrMsg;
|
|
|
CSmartPointer<IEntityFunction> spFunction = this->GetFunction();
|
|
@@ -1115,7 +1116,7 @@ int CAccessAuthEntity::GetPinPadIDAndDeviceID(CSimpleStringA &strPinPadID, CSimp
|
|
|
CSimpleStringA strBluetoothID;
|
|
|
CSimpleStringA strPID;
|
|
|
CSimpleStringA strMID;
|
|
|
- bHasPinPad = true;
|
|
|
+ isPinPadMac = true;
|
|
|
auto rc = 0;
|
|
|
if ((rc = pPinPadClient->Connect()) == Error_Succeed)
|
|
|
{
|
|
@@ -1127,6 +1128,7 @@ int CAccessAuthEntity::GetPinPadIDAndDeviceID(CSimpleStringA &strPinPadID, CSimp
|
|
|
{
|
|
|
if (ans.state == DEVICE_STATUS_NORMAL)
|
|
|
{
|
|
|
+ bPinPadOnline = true;
|
|
|
nRet = 0;
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("pinpad model: %s", (const char*)ans.model);
|
|
|
|
|
@@ -1191,7 +1193,7 @@ int CAccessAuthEntity::GetPinPadIDAndDeviceID(CSimpleStringA &strPinPadID, CSimp
|
|
|
else
|
|
|
{
|
|
|
if (m_info.strMachineType.IsStartWith("RVC.PAD", true))
|
|
|
- bHasPinPad = false;
|
|
|
+ isPinPadMac = false;
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("pinpad not exist, state: %d", ans.state);
|
|
|
|
|
|
return nRet; //此时nRet = -1, pinpad调用失败
|
|
@@ -1200,7 +1202,7 @@ int CAccessAuthEntity::GetPinPadIDAndDeviceID(CSimpleStringA &strPinPadID, CSimp
|
|
|
else
|
|
|
{
|
|
|
if (m_info.strMachineType.IsStartWith("RVC.PAD", true))
|
|
|
- bHasPinPad = false;
|
|
|
+ isPinPadMac = false;
|
|
|
strErrMsg = "调用PinPad实体的GetDevInfo方法失败";
|
|
|
SetAuthErrMsg((const char*)strErrMsg);
|
|
|
m_FSM.doWarnMsg(ERR_ACCESSAUTH_FROM_PINPAD,
|
|
@@ -1216,7 +1218,7 @@ int CAccessAuthEntity::GetPinPadIDAndDeviceID(CSimpleStringA &strPinPadID, CSimp
|
|
|
else
|
|
|
{
|
|
|
if (m_info.strMachineType.IsStartWith("RVC.PAD", true))
|
|
|
- bHasPinPad = false;
|
|
|
+ isPinPadMac = false;
|
|
|
strErrMsg = "连接PinPad实体失败";
|
|
|
SetAuthErrMsg((const char*)strErrMsg);
|
|
|
|
|
@@ -1524,8 +1526,8 @@ bool CAccessAuthEntity::SendInitMKReqACS(CInitlizerMKReq& initMKReq)
|
|
|
#endif // RVC_OS_LINUX
|
|
|
|
|
|
CSimpleStringA strPinPadID = "", strDeviceID = "";
|
|
|
- bool hasPinPad;
|
|
|
- int nRet = GetPinPadIDAndDeviceID(strPinPadID, strDeviceID, hasPinPad);
|
|
|
+ bool isPinPadMac, bPinPadOnline;
|
|
|
+ int nRet = GetPinPadIDAndDeviceID(strPinPadID, strDeviceID, isPinPadMac, bPinPadOnline);
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("GetPinPadIDAndDeviceID ret: %d, PinPadID: %s, DeviceID: %s", nRet, (const char*)strPinPadID, (const char*)strDeviceID);
|
|
|
|
|
|
if (nRet < 0)
|