|
|
@@ -110,45 +110,11 @@ void CCardReadAdapterFSM::s2_on_entry()
|
|
|
{
|
|
|
LOG_FUNCTION();
|
|
|
GetEntityBase()->GetFunction()->SetUserDefineState(USER_CARDISSUER_IDLE);
|
|
|
- Dbg("set reset times 0.");
|
|
|
m_resetTimes = 0;
|
|
|
m_testResult = Error_Succeed;
|
|
|
m_bIssuingExit = false;
|
|
|
m_bCancelAccept = false;
|
|
|
m_lastS2Event = m_lastS2EvtParam1 = 0;
|
|
|
- //oiltmp 测试便携厂商发卡
|
|
|
- //m_pCardIssuer->SetIssuerCounter(0, 1);
|
|
|
- //m_pCardIssuer->MoveCard(CI_MOVECARD_FROM_HOPPER);
|
|
|
- //MagTracks magTracks;
|
|
|
- //magTracks.eRange = CI_TRACK_RANGE_2_3;
|
|
|
- //m_pCardIssuer->MagRead(magTracks);
|
|
|
- //Dbg("%s,%d,%d", magTracks.track[1].data, magTracks.track[1].dwSize, magTracks.track[1].eStatus);
|
|
|
- //m_pCardIssuer->MoveCard(CI_MOVECARD_FRONT_GATE);
|
|
|
-
|
|
|
-
|
|
|
- //ErrorCodeEnum err = m_pIDCard->SetCardInType(CARD_IN_TYPE_ALL);
|
|
|
- //Dbg("accept[%d]",err);
|
|
|
- //Sleep(WAIT_INTERVAL*10);
|
|
|
- //LPCardAccount* ppCardAccount;
|
|
|
- ////err = m_pIDCard->GetCardAccount(IDC_TRACK_1|IDC_TRACK_2|IDC_TRACK_3,&ppCardAccount);
|
|
|
- ////Dbg("read[%d]",err);
|
|
|
- ////Dbg("%d,%d,%d",ppCardAccount[0]->dataStatus,(ppCardAccount[1])->dataStatus,(ppCardAccount[2])->dataStatus);//,pCardAccount->data);
|
|
|
- ////Dbg("%d,%d,%d",ppCardAccount[0]->length,(ppCardAccount[1])->length,(ppCardAccount[2])->length);//,pCardAccount->data);
|
|
|
- ////Dbg("read data[%s][%s][%s]",(char*)(ppCardAccount[0]->data),(char*)(ppCardAccount[1]->data),(char*)(ppCardAccount[2]->data));
|
|
|
-
|
|
|
- //err = m_pIDCard->DectectCardType(m_cardType);
|
|
|
- //Dbg("detectcardtyp[%d][%d]",err,m_cardType);
|
|
|
- //err = m_pIDCard->ActiveCard();
|
|
|
- //Dbg("activecard[%d]",err);
|
|
|
- //vector<AIDData> vAIDs;
|
|
|
- //MessageBoxA(0,0,0,0);
|
|
|
- //if (m_cardType == CARDTYPE_CPU_T0 || m_cardType == CARDTYPE_CPU_T1)
|
|
|
- //{
|
|
|
- // BuildSupportedAppList(vAIDs);
|
|
|
- // Dbg("[%s]",testIC);
|
|
|
- // AppSelected(m_vADFRec.at(0).name,m_vADFRec.at(0).nameLen);
|
|
|
- //}
|
|
|
-
|
|
|
}
|
|
|
void CCardReadAdapterFSM::s2_on_exit()
|
|
|
{
|
|
|
@@ -188,7 +154,7 @@ unsigned int CCardReadAdapterFSM::s2_on_event(FSMEvent* pEvt)
|
|
|
{
|
|
|
bContactlessCard = true;
|
|
|
GetEntityBase()->GetFunction()->PostThreadPoolTask(cTask);
|
|
|
- Dbg("to ContactlessCard");
|
|
|
+ Dbg("ReadTask to ContactlessCard");
|
|
|
}
|
|
|
}
|
|
|
//oilyang@20200730 according to meeting with Ratail/Test/Hangzhou
|
|
|
@@ -205,7 +171,7 @@ unsigned int CCardReadAdapterFSM::s2_on_event(FSMEvent* pEvt)
|
|
|
{
|
|
|
bCardSwiper = true;
|
|
|
GetEntityBase()->GetFunction()->PostThreadPoolTask(sTask);
|
|
|
- Dbg("to CardSwiper");
|
|
|
+ Dbg("ReadTask to CardSwiper");
|
|
|
}
|
|
|
}
|
|
|
//oilyang@20200426 暂时未发现这行代码的用处,可能简版?后来废弃。暂时保留,后续考虑去掉
|
|
|
@@ -217,13 +183,13 @@ unsigned int CCardReadAdapterFSM::s2_on_event(FSMEvent* pEvt)
|
|
|
{
|
|
|
bCardIssuer = true;
|
|
|
GetEntityBase()->GetFunction()->PostThreadPoolTask(iTask);
|
|
|
- Dbg("to CardIssuer");
|
|
|
+ Dbg("ReadTask to CardIssuer");
|
|
|
}
|
|
|
if (bCardIssuer || bCardSwiper || bContactlessCard)
|
|
|
- Dbg("bCardIssuer,bCardSwiper,bContactlessCard:%d,%d,%d", bCardIssuer, bCardSwiper, bContactlessCard);
|
|
|
+ Dbg("ReadTask, bCardIssuer,bCardSwiper,bContactlessCard:%d,%d,%d", bCardIssuer, bCardSwiper, bContactlessCard);
|
|
|
else
|
|
|
{
|
|
|
- Dbg("can't find the right entity.");
|
|
|
+ Dbg("ReadTask: can't find the right entity.");
|
|
|
ret = 1;//no need to change to "Working" state
|
|
|
cre->ctx->Answer(Error_Unexpect);
|
|
|
}
|
|
|
@@ -816,7 +782,7 @@ int CCardReadAdapterFSM::CardIssuerRead(SpReqAnsContext<CardReadAdapterService_R
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
- Dbg("CardIssuer QueryCardInfo return:", eErr);
|
|
|
+ Dbg("CardIssuer QueryCardInfo failed return:", eErr);
|
|
|
return 1;//oilyang@20190709
|
|
|
}
|
|
|
if (bHasCard && bNeedPreOnline)
|
|
|
@@ -839,10 +805,13 @@ int CCardReadAdapterFSM::CardIssuerRead(SpReqAnsContext<CardReadAdapterService_R
|
|
|
eErr = m_pCardIssuer->SetSomeFlag(ssfReq, ssfAns, 5000, dwUsrErrCode);
|
|
|
if (eErr == Error_Succeed)
|
|
|
ctx->Ans.ICCardNo = ssfAns.reserved2[0];
|
|
|
+ else
|
|
|
+ Dbg("CardIssuer SetSomeFlag failed return:%d", eErr);
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ Dbg("CardIssuer PreOnline failed return:%d", eErr);
|
|
|
ctx->Ans.result = "";
|
|
|
ctx->Ans.status = -1;
|
|
|
}
|
|
|
@@ -851,7 +820,7 @@ int CCardReadAdapterFSM::CardIssuerRead(SpReqAnsContext<CardReadAdapterService_R
|
|
|
}
|
|
|
if (bHasCard)
|
|
|
{
|
|
|
- Dbg("%d", eErr);
|
|
|
+ Dbg("ReadCard, the final errCode:%d", eErr);
|
|
|
ctx->Answer(eErr, dwUsrErrCode);
|
|
|
}
|
|
|
return 0;
|
|
|
@@ -924,7 +893,7 @@ int CCardReadAdapterFSM::ContactlessCardRead(SpReqAnsContext<CardReadAdapterServ
|
|
|
else if (eErr == Error_Unexpect)
|
|
|
{
|
|
|
ctx->Answer(eErr);
|
|
|
- Dbg("read failed.");
|
|
|
+ Dbg("ContactlessCard read failed.");
|
|
|
return 2;
|
|
|
}
|
|
|
// }
|
|
|
@@ -938,7 +907,7 @@ int CCardReadAdapterFSM::ContactlessCardRead(SpReqAnsContext<CardReadAdapterServ
|
|
|
req.businessData = ctx->Req.businessData;
|
|
|
BroadcastReadICing(0);
|
|
|
eErr = m_pContactless->PreOnline(req, ans, 50000);
|
|
|
- Dbg("PreOnline result:%d", eErr);
|
|
|
+ Dbg("ContacelssCard PreOnline result:%d", eErr);
|
|
|
if (eErr == Error_Succeed)
|
|
|
{
|
|
|
ctx->Ans.result = ans.result;
|
|
|
@@ -991,6 +960,9 @@ int CCardReadAdapterFSM::IssueCard(SpReqAnsContext<CardReadAdapterService_Issue_
|
|
|
Dbg("req.hopper:%d Deem that CardIssuer has card after issuing succ. Set busCtx:findCard:%d,cardPos:%d"
|
|
|
, req.hopper, ans.reserved1[0], ans.reserved1[1]);
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("CardIssuer IssueCard failed return:%d", eErr);
|
|
|
+ }
|
|
|
ctx->Answer(eErr, dwUsrErrCode);
|
|
|
return 0;
|
|
|
}
|
|
|
@@ -1026,9 +998,8 @@ int CCardReadAdapterFSM::CardSwiperRead(SpReqAnsContext<CardReadAdapterService_R
|
|
|
req.LightPos += 2;
|
|
|
if ((ctx->Req.lightPos&LightPos_CardSwiper_RFIC) == LightPos_CardSwiper_RFIC)
|
|
|
req.LightPos += 4;
|
|
|
- Dbg("aid:%s,lightPos:%d",(const char*)req.aid,req.LightPos);
|
|
|
+ Dbg("CardSwiperRead, aid:%s,lightPos:%d",(const char*)req.aid,req.LightPos);
|
|
|
eErr = m_pCardSwiper->Read(req, ans, 61000);
|
|
|
- Dbg("eErr:%d", eErr);
|
|
|
eRetErr = eErr;
|
|
|
if (eErr == Error_Succeed)
|
|
|
{
|
|
|
@@ -1060,7 +1031,7 @@ int CCardReadAdapterFSM::CardSwiperRead(SpReqAnsContext<CardReadAdapterService_R
|
|
|
ctx->Ans.t2CardSerial = ans.t2CardSerial;
|
|
|
ctx->Ans.t2CVC = ans.t2CVC;
|
|
|
ctx->Ans.t2ExpireDate = ans.t2ExpireDate;
|
|
|
- Dbg("ICType:%d,%d,%s****%s", ctx->Ans.ICType, ans.ICType,(const char*)ctx->Ans.t2Account.SubString(0, 4), (const char*)ctx->Ans.t2Account.SubString(ctx->Ans.t2Account.GetLength() - 4, 4));
|
|
|
+ Dbg("ICType:%d,%d, accountNo:%s****%s", ctx->Ans.ICType, ans.ICType,(const char*)ctx->Ans.t2Account.SubString(0, 4), (const char*)ctx->Ans.t2Account.SubString(ctx->Ans.t2Account.GetLength() - 4, 4));
|
|
|
if (ans.ICType == 3 || ans.ICType == 4)
|
|
|
{
|
|
|
CardSwiperService_PreOnline_Req req;
|
|
|
@@ -1072,10 +1043,15 @@ int CCardReadAdapterFSM::CardSwiperRead(SpReqAnsContext<CardReadAdapterService_R
|
|
|
{
|
|
|
ctx->Ans.result = ans.result;
|
|
|
}
|
|
|
- else
|
|
|
+ else {
|
|
|
+ Dbg("CardSwiper PreOnline failed return:%d", eErr);
|
|
|
ctx->Ans.result = "";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("CardSwiper Read failed return:%d", eErr);
|
|
|
+ }
|
|
|
if (eErr == Error_TimeOut)
|
|
|
{
|
|
|
Dbg("CardSwiper timeout.");
|
|
|
@@ -1190,6 +1166,9 @@ int CCardReadAdapterFSM::PreOnline(SpReqAnsContext<CardReadAdapterService_PreOnl
|
|
|
{
|
|
|
ctx->Ans.result = ans.result;
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("PreOnline, CardIssuer PreOnline failed return:%d", eErr);
|
|
|
+ }
|
|
|
ctx->Answer(eErr, dwUsrErrCode);
|
|
|
}
|
|
|
else if (IsTheEntity(ctx->Req.module, Module_ContactlessCard) && IsContactlessCardSessionOK() && m_busCtx.eCardFromWhich == Card_In_ContactlessCard)
|
|
|
@@ -1204,6 +1183,9 @@ int CCardReadAdapterFSM::PreOnline(SpReqAnsContext<CardReadAdapterService_PreOnl
|
|
|
{
|
|
|
ctx->Ans.result = ans.result;
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg(CSimpleStringA::Format("PreOnline, ContactlessCard PreOnline failed return:%d", eErr));
|
|
|
+ }
|
|
|
ctx->Answer(eErr, dwUsrErrCode);
|
|
|
}
|
|
|
else if (IsTheEntity(ctx->Req.module, Module_CardSwiper) && IsCardSwiperSessionOK())
|
|
|
@@ -1218,6 +1200,9 @@ int CCardReadAdapterFSM::PreOnline(SpReqAnsContext<CardReadAdapterService_PreOnl
|
|
|
{
|
|
|
ctx->Ans.result = ans.result;
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("PreOnline, CardSwiper PreOnline failed return:%d", eErr);
|
|
|
+ }
|
|
|
ctx->Answer(eErr, dwUsrErrCode);
|
|
|
}
|
|
|
return 0;
|
|
|
@@ -1225,7 +1210,7 @@ int CCardReadAdapterFSM::PreOnline(SpReqAnsContext<CardReadAdapterService_PreOnl
|
|
|
int CCardReadAdapterFSM::PostOnline(SpReqAnsContext<CardReadAdapterService_PostOnline_Req, CardReadAdapterService_PostOnline_Ans>::Pointer ctx)
|
|
|
{
|
|
|
LOG_FUNCTION();
|
|
|
- Dbg("ctx->Req.module:%d,cardIn(Iss 1,RF 2):%d",ctx->Req.module, m_busCtx.eCardFromWhich);
|
|
|
+ Dbg("<PostOnline>, ctx->Req.module:%d,cardIn(Iss 1,RF 2):%d", ctx->Req.module, m_busCtx.eCardFromWhich);
|
|
|
ErrorCodeEnum eErr = Error_Unexpect;
|
|
|
DWORD dwUsrErrCode = 0;
|
|
|
if (IsTheEntity(ctx->Req.module, Module_CardIssuer) && IsCardIssuerSessionOK() && m_busCtx.eCardFromWhich == Card_In_CardIssuer)
|
|
|
@@ -1238,6 +1223,9 @@ int CCardReadAdapterFSM::PostOnline(SpReqAnsContext<CardReadAdapterService_PostO
|
|
|
{
|
|
|
ctx->Ans.result = ans.result;
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("PostOnline, CardIssuer PostOnline failed return:%d", eErr);
|
|
|
+ }
|
|
|
ctx->Answer(eErr, dwUsrErrCode);
|
|
|
}
|
|
|
else if (IsTheEntity(ctx->Req.module, Module_ContactlessCard) && IsContactlessCardSessionOK() && m_busCtx.eCardFromWhich == Card_In_ContactlessCard)
|
|
|
@@ -1250,6 +1238,9 @@ int CCardReadAdapterFSM::PostOnline(SpReqAnsContext<CardReadAdapterService_PostO
|
|
|
{
|
|
|
ctx->Ans.result = ans.result;
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("PostOnline, ContactlessCard PostOnline failed return:%d", eErr);
|
|
|
+ }
|
|
|
ctx->Answer(eErr, dwUsrErrCode);
|
|
|
}
|
|
|
else if (IsTheEntity(ctx->Req.module, Module_CardSwiper) && IsCardSwiperSessionOK())
|
|
|
@@ -1262,6 +1253,9 @@ int CCardReadAdapterFSM::PostOnline(SpReqAnsContext<CardReadAdapterService_PostO
|
|
|
{
|
|
|
ctx->Ans.result = ans.result;
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("PostOnline, CardSwiper PostOnline failed return:%d", eErr);
|
|
|
+ }
|
|
|
ctx->Answer(eErr, dwUsrErrCode);
|
|
|
}
|
|
|
return 0;
|
|
|
@@ -1282,6 +1276,9 @@ int CCardReadAdapterFSM::EjectCard(SpReqAnsContext<CardReadAdapterService_Eject_
|
|
|
m_busCtx.eCardFromWhich = Card_In_No_Where;
|
|
|
Dbg("CardIssuer EjectCard suc.");
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("EjectCard, CardIssuer EjectCard failed return:%d", eErr);
|
|
|
+ }
|
|
|
ctx->Answer(eErr, dwUsrErrCode);
|
|
|
}
|
|
|
else if (IsTheEntity(ctx->Req.module, Module_ContactlessCard) && IsContactlessCardSessionOK() && m_busCtx.eCardFromWhich == Card_In_ContactlessCard)
|
|
|
@@ -1294,6 +1291,9 @@ int CCardReadAdapterFSM::EjectCard(SpReqAnsContext<CardReadAdapterService_Eject_
|
|
|
m_busCtx.eCardFromWhich = Card_In_No_Where;
|
|
|
Dbg("ContactlessCard EjectCard suc.");
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("EjectCard, ContactlessCard EjectCard failed return:%d", eErr);
|
|
|
+ }
|
|
|
ctx->Answer(eErr, dwUsrErrCode);
|
|
|
}
|
|
|
else if (IsTheEntity(ctx->Req.module, Module_CardSwiper) && IsCardSwiperSessionOK())
|
|
|
@@ -1306,11 +1306,14 @@ int CCardReadAdapterFSM::EjectCard(SpReqAnsContext<CardReadAdapterService_Eject_
|
|
|
m_busCtx.eCardFromWhich = Card_In_No_Where;
|
|
|
Dbg("CardSwiper EjectCard suc.");
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("EjectCard, CardSwiper EjectCard failed return:%d", eErr);
|
|
|
+ }
|
|
|
ctx->Answer(eErr, dwUsrErrCode);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- Dbg("nothing to do.");
|
|
|
+ Dbg("EjectCard, nothing to do.");
|
|
|
ctx->Answer(Error_NotExist);
|
|
|
}
|
|
|
return 0;
|
|
|
@@ -1327,14 +1330,17 @@ int CCardReadAdapterFSM::CaptureCard(SpReqAnsContext<CardReadAdapterService_Capt
|
|
|
eErr = m_pCardIssuer->Capture(req, ans, 15000, dwUsrErrCode);
|
|
|
if (eErr == Error_Succeed)
|
|
|
{
|
|
|
- Dbg("Capture card suc.");
|
|
|
+ Dbg("CardIssuer Capture card suc.");
|
|
|
m_busCtx.eCardFromWhich = Card_In_No_Where;
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("CaptureCard, CardIssuer Capture failed return:%d", eErr);
|
|
|
+ }
|
|
|
ctx->Answer(eErr, dwUsrErrCode);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- Dbg("Something wrong.the module(%d),cardinwhere(%d)", ctx->Req.module, m_busCtx.eCardFromWhich);
|
|
|
+ Dbg("CaptureCard, Something wrong.the module(%d),cardinwhere(%d)", ctx->Req.module, m_busCtx.eCardFromWhich);
|
|
|
ctx->Answer(eErr);
|
|
|
}
|
|
|
return 0;
|
|
|
@@ -1363,6 +1369,9 @@ int CCardReadAdapterFSM::QueryCardInfo(SpReqAnsContext<CardReadAdapterService_Qu
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("QueryCardInfo, CardIssuer QueryCardInfo failed return:%d", eErr);
|
|
|
+ }
|
|
|
}
|
|
|
if (IsTheEntity(ctx->Req.module, Module_ContactlessCard) && IsContactlessCardSessionOK() && m_busCtx.eCardFromWhich == Card_In_ContactlessCard)
|
|
|
{
|
|
|
@@ -1384,8 +1393,10 @@ int CCardReadAdapterFSM::QueryCardInfo(SpReqAnsContext<CardReadAdapterService_Qu
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
+ else {
|
|
|
+ Dbg("QueryCardInfo, ContactlessCard QueryCardInfo failed return:%d", eErr);
|
|
|
ctx->Ans.ContactlessCardPos = -1;
|
|
|
+ }
|
|
|
}
|
|
|
if (IsTheEntity(ctx->Req.module, Module_CardSwiper) && IsCardSwiperSessionOK())
|
|
|
{
|
|
|
@@ -1412,11 +1423,14 @@ int CCardReadAdapterFSM::QueryCardInfo(SpReqAnsContext<CardReadAdapterService_Qu
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
+ else {
|
|
|
+ Dbg("QueryCardInfo, CardSwiper QueryCardInfo failed return:%d", eErr);
|
|
|
ctx->Ans.CardSwiperPos = -1;
|
|
|
+ }
|
|
|
}
|
|
|
ctx->Answer(Error_Succeed);
|
|
|
- Dbg("%d,position(CI,CC,CS) %d,%d,%d", m_busCtx.eCardFromWhich, ctx->Ans.CardIssuerPos, ctx->Ans.ContactlessCardPos, ctx->Ans.CardSwiperPos);
|
|
|
+ Dbg("<QueryCardInfo>, CardFromWhich:%d, position(CI,CC,CS) %d,%d,%d",
|
|
|
+ m_busCtx.eCardFromWhich, ctx->Ans.CardIssuerPos, ctx->Ans.ContactlessCardPos, ctx->Ans.CardSwiperPos);
|
|
|
return 0;
|
|
|
}
|
|
|
void CCardReadAdapterFSM::CheckAndReconnectSession()
|
|
|
@@ -1617,6 +1631,9 @@ int CCardReadAdapterFSM::GetDevInfo(SpReqAnsContext<CardReadAdapterService_GetDe
|
|
|
csCIVersion = ans.version;
|
|
|
ciState = ans.state;
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("GetDevInfo, CardIssuer GetDevInfo failed return:%d", eErr);
|
|
|
+ }
|
|
|
}
|
|
|
if (IsTheEntity(ctx->Req.module, Module_ContactlessCard) && IsContactlessCardSessionOK())
|
|
|
{
|
|
|
@@ -1632,6 +1649,9 @@ int CCardReadAdapterFSM::GetDevInfo(SpReqAnsContext<CardReadAdapterService_GetDe
|
|
|
csCCVersion = ans.version;
|
|
|
ccState = ans.state;
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("GetDevInfo, ContactlessCard GetDevInfo failed return:%d", eErr);
|
|
|
+ }
|
|
|
}
|
|
|
if (IsTheEntity(ctx->Req.module, Module_CardSwiper) && IsCardSwiperSessionOK())
|
|
|
{
|
|
|
@@ -1648,6 +1668,9 @@ int CCardReadAdapterFSM::GetDevInfo(SpReqAnsContext<CardReadAdapterService_GetDe
|
|
|
csState = ans.state;
|
|
|
}
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("GetDevInfo, CardSwiper GetDevInfo failed return:%d", eErr);
|
|
|
+ }
|
|
|
ctx->Ans.ModuleNum = count;
|
|
|
ctx->Ans.ModuleSN.Init(count);
|
|
|
ctx->Ans.type.Init(count);
|
|
|
@@ -1723,8 +1746,10 @@ int CCardReadAdapterFSM::GetMaterialCount(SpReqAnsContext<CardReadAdapterService
|
|
|
ctx->Ans.reserved2.Copy(ans.reserved2);
|
|
|
ctx->Answer(Error_Succeed);
|
|
|
}
|
|
|
- else
|
|
|
+ else {
|
|
|
+ Dbg("GetMaterialCount, CardIssuer GetMaterialCountEx failed return:%d", eErr);
|
|
|
ctx->Answer(Error_Unexpect, dwUsrErrCode);
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -1763,8 +1788,10 @@ int CCardReadAdapterFSM::SetMaterialCount(SpReqAnsContext<CardReadAdapterService
|
|
|
ctx->Ans.reserved2.Copy(ans.reserved2);
|
|
|
ctx->Answer(Error_Succeed);
|
|
|
}
|
|
|
- else
|
|
|
+ else {
|
|
|
+ Dbg("SetMaterialCount, CardIssuer SetMaterialCountEx failed return:%d", eErr);
|
|
|
ctx->Answer(Error_Unexpect, dwUsrErrCode);
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -1788,6 +1815,9 @@ int CCardReadAdapterFSM::GetSCIInfo(SpReqAnsContext<CardReadAdapterService_GetSC
|
|
|
ctx->Ans.reserved1.Copy(ans.reserved1);
|
|
|
ctx->Ans.reserved2.Copy(ans.reserved2);
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("GetSCIInfo, CardIssuer GetSCIInfo failed return:%d", eErr);
|
|
|
+ }
|
|
|
ctx->Answer(eErr);
|
|
|
}
|
|
|
else
|
|
|
@@ -1813,6 +1843,9 @@ int CCardReadAdapterFSM::OpenSafeLock(SpReqAnsContext<CardReadAdapterService_Ope
|
|
|
ctx->Ans.reserved1.Copy(ans.reserved1);
|
|
|
ctx->Ans.reserved2.Copy(ans.reserved2);
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("OpenSafeLock, CardIssuer OpenSafeLock failed return:%d", eErr);
|
|
|
+ }
|
|
|
ctx->Answer(eErr);
|
|
|
}
|
|
|
else
|
|
|
@@ -1837,6 +1870,9 @@ int CCardReadAdapterFSM::MagTransferInit(SpReqAnsContext<CardReadAdapterService_
|
|
|
ctx->Ans.ex = ans.ex;
|
|
|
ctx->Ans.result = ans.result;
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("MagTransferInit, CardSwiper MagTransferInit failed return:%d", eErr);
|
|
|
+ }
|
|
|
ctx->Answer(eErr);
|
|
|
}
|
|
|
else
|
|
|
@@ -1860,6 +1896,9 @@ int CCardReadAdapterFSM::QueryConnInfo(SpReqAnsContext<CardReadAdapterService_Qu
|
|
|
ctx->Ans.reserved1 = ans.reserved1;
|
|
|
ctx->Ans.reserved2 = ans.reserved2;
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("QueryConnInfo, CardSwiper QueryConnInfo failed return:%d", eErr);
|
|
|
+ }
|
|
|
ctx->Answer(eErr);
|
|
|
}
|
|
|
else
|
|
|
@@ -1889,6 +1928,7 @@ void CCardReadAdapterFSM::BroadcastReadICing(int status)
|
|
|
{
|
|
|
ReadICing evt;
|
|
|
evt.status = status;
|
|
|
+ Dbg("BroadcastReadICing, status:%d", status);
|
|
|
SpSendBroadcast(GetEntityBase()->GetFunction(), SP_MSG_OF(ReadICing), SP_MSG_SIG_OF(ReadICing), evt);
|
|
|
}
|
|
|
int CCardReadAdapterFSM::SAMICCommand(SpReqAnsContext<CardReadAdapterService_SAMICCommand_Req, CardReadAdapterService_SAMICCommand_Ans>::Pointer ctx)
|
|
|
@@ -1911,6 +1951,10 @@ int CCardReadAdapterFSM::SAMICCommand(SpReqAnsContext<CardReadAdapterService_SAM
|
|
|
ctx->Ans.reserved1.Copy(ans.reserved1);
|
|
|
ctx->Ans.reserved2.Copy(ans.reserved2);
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("SAMICCommand, CardIssuer SAMICCommand failed return:%d", eErr);
|
|
|
+
|
|
|
+ }
|
|
|
ctx->Answer(eErr);
|
|
|
return 0;
|
|
|
}
|
|
|
@@ -1941,6 +1985,9 @@ int CCardReadAdapterFSM::QueryPrinterStatus(SpReqAnsContext<CardReadAdapterServi
|
|
|
ctx->Ans.reserved1.Copy(ans.reserved1);
|
|
|
ctx->Ans.reserved2.Copy(ans.reserved2);
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("QueryPrinterStatus, CardIssuer QueryPrinterStatus failed return:%d", eErr);
|
|
|
+ }
|
|
|
ctx->Answer(eErr);
|
|
|
return 0;
|
|
|
}
|
|
|
@@ -1973,6 +2020,9 @@ int CCardReadAdapterFSM::Print(SpReqAnsContext<CardReadAdapterService_Print_Req,
|
|
|
ctx->Ans.reserved1.Copy(ans.reserved1);
|
|
|
ctx->Ans.reserved2.Copy(ans.reserved2);
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("Print, CardIssuer Print failed return:%d", eErr);
|
|
|
+ }
|
|
|
ctx->Answer(eErr);
|
|
|
return 0;
|
|
|
}
|
|
|
@@ -2014,6 +2064,9 @@ int CCardReadAdapterFSM::QuerySCIList(SpReqAnsContext<CardReadAdapterService_Que
|
|
|
ctx->Ans.reserved1.Copy(ans.reserved1);
|
|
|
ctx->Ans.reserved2.Copy(ans.reserved2);
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("QuerySCIList, CardIssuer QuerySCIList failed return:%d", eErr);
|
|
|
+ }
|
|
|
ctx->Answer(eErr, dwUsrErrCode);
|
|
|
return 0;
|
|
|
}
|
|
|
@@ -2043,6 +2096,9 @@ int CCardReadAdapterFSM::BindSCI(SpReqAnsContext<CardReadAdapterService_BindSCI_
|
|
|
ctx->Ans.reserved1.Copy(ans.reserved1);
|
|
|
ctx->Ans.reserved2.Copy(ans.reserved2);
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("BindSCI, CardIssuer BindSCI failed return:%d", eErr);
|
|
|
+ }
|
|
|
ctx->Answer(eErr, dwUsrErrCode);
|
|
|
return 0;
|
|
|
}
|
|
|
@@ -2069,6 +2125,18 @@ int CCardReadAdapterFSM::PreOnlineOnStore(SpReqAnsContext<CardReadAdapterService
|
|
|
req.reserved2.Copy(ctx->Req.reserved2);
|
|
|
req.reserved3.Copy(ctx->Req.reserved3);
|
|
|
req.reserved4.Copy(ctx->Req.reserved4);
|
|
|
+ CSimpleStringA inParam("");
|
|
|
+ if (!req.account.IsNullOrEmpty() && req.account.GetLength() > 10)
|
|
|
+ {
|
|
|
+ inParam = CSimpleStringA::Format("account:%s****%s, bussinessDataLen:%d, slot:%d, termNo:%s",
|
|
|
+ req.account.SubString(0, 6).GetData(), req.account.SubString(req.account.GetLength() - 4, 4).GetData(), req.businessData.GetLength(), req.slot, req.termNo.GetData());
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ inParam = CSimpleStringA::Format("accountLen:%d, bussinessDataLen:%d, slot:%d, termNo:%s",
|
|
|
+ req.account.GetLength(), req.businessData.GetLength(), req.slot, req.termNo.GetData());
|
|
|
+ }
|
|
|
+ LogWarn(Severity_Low, Error_Unexpect, CardReadAdapter_UserErrorCode_PreOnline_Invoke, inParam.GetData());
|
|
|
+
|
|
|
eErr = m_pCardIssuer->PreOnlineOnStore(req, ans, 63000);
|
|
|
if (eErr == Error_Succeed)
|
|
|
{
|
|
|
@@ -2079,12 +2147,18 @@ int CCardReadAdapterFSM::PreOnlineOnStore(SpReqAnsContext<CardReadAdapterService
|
|
|
ctx->Ans.reserved2.Copy(ans.reserved2);
|
|
|
ctx->Ans.reserved3.Copy(ans.reserved3);
|
|
|
ctx->Ans.reserved4.Copy(ans.reserved4);
|
|
|
+ CSimpleStringA outParam = CSimpleStringA::Format("cardPos:%d, findCard:%d, resultLen:%d",
|
|
|
+ ctx->Ans.cardPos, ctx->Ans.findCard, ctx->Ans.result.GetLength());
|
|
|
+ LogWarn(Severity_Low, Error_Unexpect, CardReadAdapter_UserErrorCode_PreOnline_Result, outParam.GetData());
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ Dbg("PreOnlineOnStore, CardIssuer PreOnlineOnStore failed return:%d", eErr);
|
|
|
}
|
|
|
ctx->Answer(eErr);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- Dbg("Entity CardIssuer is not ok.");
|
|
|
+ LogError(Severity_High, Error_Unexpect, CardReadAdapter_UserErrorCode_PreOnline_CardIssuer_Not_Ok, "Entity CardIssuer is not ok.");
|
|
|
ctx->Answer(Error_Unexpect);
|
|
|
}
|
|
|
return 0;
|
|
|
@@ -2115,6 +2189,9 @@ int CCardReadAdapterFSM::NotifyPreonline(SpReqAnsContext<CardReadAdapterService_
|
|
|
ctx->Ans.reserved3.Copy(ans.reserved3);
|
|
|
ctx->Ans.reserved4.Copy(ans.reserved4);
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("NotifyPreonline, CardIssuer NotifyPreonline failed return:%d", eErr);
|
|
|
+ }
|
|
|
ctx->Answer(eErr);
|
|
|
}
|
|
|
else
|
|
|
@@ -2147,6 +2224,9 @@ int CCardReadAdapterFSM::QueryCardInfoOnStore(SpReqAnsContext<CardReadAdapterSer
|
|
|
ctx->Ans.reserved3.Copy(ans.reserved3);
|
|
|
ctx->Ans.reserved4.Copy(ans.reserved4);
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("QueryCardInfoOnStore, CardIssuer QueryCardInfoOnStore failed return:%d", eErr);
|
|
|
+ }
|
|
|
ctx->Answer(eErr);
|
|
|
}
|
|
|
else
|
|
|
@@ -2181,6 +2261,9 @@ int CCardReadAdapterFSM::GetAddCardInfo(SpReqAnsContext<CardReadAdapterService_G
|
|
|
ctx->Ans.reserved3.Copy(ans.reserved3);
|
|
|
ctx->Ans.reserved4.Copy(ans.reserved4);
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("GetAddCardInfo, CardIssuer GetAddCardInfo failed return:%d", eErr);
|
|
|
+ }
|
|
|
ctx->Answer(eErr);
|
|
|
}
|
|
|
else
|
|
|
@@ -2347,7 +2430,7 @@ int CCardReadAdapterFSM::PrintCardIm(SpReqAnsContext<CardReadAdapterService_Prin
|
|
|
int timeout = 60000;
|
|
|
if (ctx->Req.reserved1.GetCount() > 0 && ctx->Req.reserved1[0] > 50000 && ctx->Req.reserved1[0] < 200000)
|
|
|
timeout = ctx->Req.reserved1[0];
|
|
|
- Dbg("timeout:%d",timeout);
|
|
|
+ Dbg("PrintCardIm, timeout:%d",timeout);
|
|
|
eErr = m_pCardIssuer->PrintCardImmediately(req, ans, timeout);
|
|
|
if (eErr == Error_Succeed)
|
|
|
{
|
|
|
@@ -2357,6 +2440,9 @@ int CCardReadAdapterFSM::PrintCardIm(SpReqAnsContext<CardReadAdapterService_Prin
|
|
|
ctx->Ans.reserved3.Copy(ans.reserved3);
|
|
|
ctx->Ans.reserved4.Copy(ans.reserved4);
|
|
|
}
|
|
|
+ else {
|
|
|
+ Dbg("PrintCardImmediately, CardIssuer PrintCardImmediately failed return:%d", eErr);
|
|
|
+ }
|
|
|
ctx->Answer(eErr);
|
|
|
return 0;
|
|
|
}
|