|
@@ -1265,13 +1265,10 @@ ErrorCodeEnum CPinPadFSM::GetCheckCode(SpReqAnsContext<PinPadService_GetCheckCod
|
|
|
ctx->Answer(Error_Succeed);
|
|
|
return Error_Succeed;
|
|
|
}
|
|
|
-bool CPinPadFSM::GetDevInfo(DevCategoryInfo &devInfo)
|
|
|
+ErrorCodeEnum CPinPadFSM::GetDevInfo(DevCategoryInfo &devInfo)
|
|
|
{
|
|
|
if (!m_bOpened)
|
|
|
- {
|
|
|
- devInfo.eState = m_eDevState;
|
|
|
- return false;
|
|
|
- }
|
|
|
+ return Error_DevNotAvailable;
|
|
|
DevCategoryInfo info;
|
|
|
ZeroMemory(info.szModel, MAX_DEV_MODEL_LEN);
|
|
|
ZeroMemory(info.szType, MAX_DEV_TYPE_LEN);
|
|
@@ -1279,6 +1276,7 @@ bool CPinPadFSM::GetDevInfo(DevCategoryInfo &devInfo)
|
|
|
m_ullBeginTime = SP::Module::Comm::RVCGetTickCount();
|
|
|
ErrorCodeEnum eErrDev = m_hDevHelper->GetDevCategory(info);
|
|
|
m_ullEndTime = SP::Module::Comm::RVCGetTickCount();
|
|
|
+
|
|
|
if (eErrDev == Error_Succeed)
|
|
|
{
|
|
|
m_szModel = info.szModel;
|
|
@@ -1286,6 +1284,16 @@ bool CPinPadFSM::GetDevInfo(DevCategoryInfo &devInfo)
|
|
|
m_szVendor = info.szVendor;
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("DevAdapter::GetDevCategory").setCostTime(m_ullEndTime - m_ullBeginTime)
|
|
|
("model,%d,%s;type,%d,%s;vendor,%d,%s", strlen(devInfo.szModel), m_szModel.GetData(), strlen(devInfo.szType), m_szType.GetData(), strlen(devInfo.szVendor), m_szVendor.GetData());
|
|
|
+ ZeroMemory(devInfo.szModel, MAX_DEV_MODEL_LEN);//CM=V2.0#PM=V1.0#MID=75500001#PID=12345678#FWID=V1234567#Vendor=nantian
|
|
|
+ ZeroMemory(devInfo.szType, MAX_DEV_TYPE_LEN);
|
|
|
+ ZeroMemory(devInfo.szVendor, MAX_DEV_VENDOR_LEN);
|
|
|
+ CSimpleStringA tmpModel("");
|
|
|
+ if (m_szModel.GetLength() > 1)
|
|
|
+ strncpy(devInfo.szModel, m_szModel.GetData(), m_szModel.GetLength());
|
|
|
+ if (m_szType.GetLength() > 1)
|
|
|
+ strncpy(devInfo.szType, m_szType.GetData(), m_szType.GetLength());
|
|
|
+ if (m_szVendor.GetLength() > 1)
|
|
|
+ strncpy(devInfo.szVendor, m_szVendor.GetData(), m_szVendor.GetLength());
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -1295,26 +1303,8 @@ bool CPinPadFSM::GetDevInfo(DevCategoryInfo &devInfo)
|
|
|
m_szVendor = "";
|
|
|
m_eDevState = DEVICE_STATUS_NOT_READY;
|
|
|
}
|
|
|
- ZeroMemory(devInfo.szModel,MAX_DEV_MODEL_LEN);//CM=V2.0#PM=V1.0#MID=75500001#PID=12345678#FWID=V1234567#Vendor=nantian
|
|
|
- ZeroMemory(devInfo.szType,MAX_DEV_TYPE_LEN);
|
|
|
- ZeroMemory(devInfo.szVendor,MAX_DEV_VENDOR_LEN);
|
|
|
- CSimpleStringA tmpModel("");
|
|
|
- if (m_szModel.GetLength() > 1)
|
|
|
- {
|
|
|
- CSimpleStringA tmpAddStr("");
|
|
|
- tmpAddStr = tmpAddStr + "Vendor=" + m_szVendor;
|
|
|
- if (m_szModel[m_szModel.GetLength() - 1] == '#')
|
|
|
- tmpModel = m_szModel + tmpAddStr;
|
|
|
- else
|
|
|
- tmpModel = m_szModel + "#" + tmpAddStr;
|
|
|
- strncpy(devInfo.szModel, (const char*)tmpModel, tmpModel.GetLength());
|
|
|
- }
|
|
|
- if (m_szType.GetLength() > 1)
|
|
|
- strncpy(devInfo.szType, (const char*)m_szType, m_szType.GetLength());
|
|
|
- if (m_szVendor.GetLength() > 1)
|
|
|
- strncpy(devInfo.szVendor, (const char*)m_szVendor, m_szVendor.GetLength());
|
|
|
- devInfo.eState = m_eDevState;
|
|
|
- return true;
|
|
|
+
|
|
|
+ return eErrDev;
|
|
|
}
|
|
|
void CPinPadFSM::SetInWhatPage(int iPageType)
|
|
|
{
|