|
|
@@ -10,7 +10,7 @@
|
|
|
using namespace std;
|
|
|
//CSimpleStringA<T> ambigulous
|
|
|
#define _ATL_NO_AUTOMATIC_NAMESPACE
|
|
|
-#include <atltime.h>
|
|
|
+//#include <atltime.h>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -165,6 +165,8 @@ unsigned int CCardReadAdapterFSM::s2_on_event(FSMEvent* pEvt)
|
|
|
// --RVC.Stand2S, RVC.Desk2S(all MachineVersion), RVC.Desk1S(all MachineVersion)
|
|
|
// CardSwiper:
|
|
|
// --except for RVC.Stand2S,RVC.CardStore
|
|
|
+ // --oilyang@20200730 according to meeting with Ratail/Test/Hangzhou
|
|
|
+ // Desk2S 2.1 have no CardSwiper,so no need call it
|
|
|
// CardIssuer:
|
|
|
// --no matter what MachineType is,just call it ,except for "RVC.Desk2S 2.0"
|
|
|
// -- see the following "except for cross call" ,what the f**king line means?
|
|
|
@@ -184,7 +186,12 @@ unsigned int CCardReadAdapterFSM::s2_on_event(FSMEvent* pEvt)
|
|
|
Dbg("to ContactlessCard");
|
|
|
}
|
|
|
}
|
|
|
- if (!(m_eMachineType == MachineType_RVC_Stand2S || m_eMachineType == MachineType_RVC_CardStore))
|
|
|
+ //oilyang@20200730 according to meeting with Ratail/Test/Hangzhou
|
|
|
+ //Desk2S 2.1 have no CardSwiper,so no need call it
|
|
|
+ if (!(m_eMachineType == MachineType_RVC_Stand2S
|
|
|
+ || m_eMachineType == MachineType_RVC_CardStore
|
|
|
+ || m_eMachineType == MachineType_RVC_DESK1S
|
|
|
+ || (m_eMachineType == MachineType_RVC_DESK2S && m_majorVerion == 2 && m_minorVerion == 1)))
|
|
|
{
|
|
|
CardSwiperReadTask* sTask = new CardSwiperReadTask(this);
|
|
|
sTask->ctx = cre->ctx;
|
|
|
@@ -472,19 +479,29 @@ unsigned int CCardReadAdapterFSM::s3_on_event(FSMEvent* pEvt)
|
|
|
switch (pEvt->iEvt)
|
|
|
{
|
|
|
case USER_EVT_READ_FINISHED:
|
|
|
+ {
|
|
|
pEvt->SetHandled();
|
|
|
ret = pEvt->param1;
|
|
|
//if (pEvt->param1 == 0)
|
|
|
+ CardReadFinishedEvent* crfe = dynamic_cast<CardReadFinishedEvent*>(pEvt);
|
|
|
{
|
|
|
if (m_bCancelAccept)
|
|
|
{
|
|
|
- CardReadFinishedEvent *crfe = dynamic_cast<CardReadFinishedEvent*>(pEvt);
|
|
|
+
|
|
|
|
|
|
Dbg("front cancel");
|
|
|
crfe->ctx->Answer(Error_Cancel);
|
|
|
ret = 0;
|
|
|
}
|
|
|
}
|
|
|
+ if (pEvt->param1 == 7)//CardIssuer Timeout,need to cancel ContactlessCard insert
|
|
|
+ {
|
|
|
+ Dbg("CardIssuer Timeout,need to cancel ContactlessCard insert");
|
|
|
+ if (IsContactlessCardSessionOK())
|
|
|
+ m_pContactless->CancelInsert();
|
|
|
+ crfe->ctx->Answer(Error_TimeOut);
|
|
|
+ ret = 0;
|
|
|
+ }
|
|
|
if (m_busCtx.eCardFromWhich == Card_In_ContactlessCard)
|
|
|
{
|
|
|
Dbg("as card in ContactlessCard,to cancel others");
|
|
|
@@ -510,6 +527,7 @@ unsigned int CCardReadAdapterFSM::s3_on_event(FSMEvent* pEvt)
|
|
|
m_pContactless->CancelInsert();
|
|
|
}
|
|
|
return ret;
|
|
|
+ }
|
|
|
case USER_EVT_PREONLINE_FINISHED:
|
|
|
pEvt->SetHandled();
|
|
|
return 0;
|
|
|
@@ -685,14 +703,16 @@ int CCardReadAdapterFSM::CardIssuerRead(SpReqAnsContext<CardReadAdapterService_R
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ //oilyang@20200730 according to meeting with Ratail/Test/Hangzhou
|
|
|
+ //Desk2S 2.1 can insert into CardIssuer,so comment the following line
|
|
|
//oilyang@20200426 if "RVC.Desk2S 2.1" ,call insert is forbidden
|
|
|
- if (!(m_eMachineType == MachineType_RVC_DESK2S && m_majorVerion == 2 && m_minorVerion == 1))
|
|
|
+ //if (!(m_eMachineType == MachineType_RVC_DESK2S && m_majorVerion == 2 && m_minorVerion == 1))
|
|
|
{
|
|
|
CardIssuerService_Insert_Req req;
|
|
|
CardIssuerService_Insert_Ans ans;
|
|
|
req.aid = ctx->Req.aid;
|
|
|
Dbg("to call cardissuer insert..");
|
|
|
- eErr = m_pCardIssuer->Insert(req, ans, 50000, dwUsrErrCode);
|
|
|
+ eErr = m_pCardIssuer->Insert(req, ans, 59000, dwUsrErrCode);
|
|
|
if (eErr == Error_Succeed)
|
|
|
{
|
|
|
Dbg("Card insert into CardIssuer.");
|
|
|
@@ -702,8 +722,15 @@ int CCardReadAdapterFSM::CardIssuerRead(SpReqAnsContext<CardReadAdapterService_R
|
|
|
m_pContactless->CancelInsert();
|
|
|
}
|
|
|
else {
|
|
|
- Dbg("CardIssuer Insert return:", eErr);
|
|
|
- return 1;//oilyang@20190709
|
|
|
+ Dbg("CardIssuer Insert return:%d", eErr);
|
|
|
+ //oilyang@20200827 if time out, we must told front caller
|
|
|
+ //AND set returned value of 0 to change FSM state
|
|
|
+ if (eErr == Error_TimeOut)
|
|
|
+ {
|
|
|
+ return 7;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ return 1;//oilyang@20190709
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -807,7 +834,7 @@ int CCardReadAdapterFSM::ContactlessCardRead(SpReqAnsContext<CardReadAdapterServ
|
|
|
ContactlessCardService_Insert_Ans ans;
|
|
|
req.aid = ctx->Req.aid;
|
|
|
Dbg("to call contactless insert...");
|
|
|
- eErr = m_pContactless->Insert(req, ans, 50000);
|
|
|
+ eErr = m_pContactless->Insert(req, ans, 56000);
|
|
|
if (eErr == Error_Succeed)
|
|
|
{
|
|
|
ctx->Ans.track1 = ans.track1;
|
|
|
@@ -1066,11 +1093,11 @@ int CCardReadAdapterFSM::PreOnline(SpReqAnsContext<CardReadAdapterService_PreOnl
|
|
|
CardIssuerService_PreOnline_Req req;
|
|
|
CardIssuerService_PreOnline_Ans ans;
|
|
|
req.businessData = ctx->Req.businessData;
|
|
|
- if (ctx->Req.reserved2[0] != NULL)
|
|
|
+ if (!ctx->Req.reserved2[0].IsNullOrEmpty())
|
|
|
req.reserved1 = ctx->Req.reserved2[0];
|
|
|
else
|
|
|
req.reserved1 = "";
|
|
|
- if (ctx->Req.reserved2[1] != NULL)
|
|
|
+ if (!ctx->Req.reserved2[1].IsNullOrEmpty())
|
|
|
req.reserved2 = ctx->Req.reserved2[1];
|
|
|
else
|
|
|
req.reserved2 = "";
|
|
|
@@ -1428,14 +1455,18 @@ bool CCardReadAdapterFSM::IsTheEntity(int module,ModuleType eModule)
|
|
|
else if (module == 99)
|
|
|
{
|
|
|
Dbg("req.module is 99,machineType is:%s",(const char*)m_csMachineType);
|
|
|
+ //oilyang@20200730 according to meeting with Ratail/Test/Hangzhou
|
|
|
+ //Desk2S 2.1 can insert into CardIssuer
|
|
|
+ //oilyang@20200612 if "RVC.Desk2S" ,no need to call CardIssuer(insert card)
|
|
|
//from guodan 20180905
|
|
|
//99:进卡读卡,功能集向除蓝牙发卡机之外的读卡实体发出进卡读卡指令。
|
|
|
- //oilyang@20200612 if "RVC.Desk2S" ,no need to call CardIssuer(insert card)
|
|
|
+
|
|
|
if (eModule == Module_CardIssuer)
|
|
|
{
|
|
|
if (m_eMachineType == MachineType_RVC_Stand2S
|
|
|
|| m_eMachineType == MachineType_RVC_CardStore
|
|
|
- || m_eMachineType == MachineType_RVC_DESK1S)
|
|
|
+ || m_eMachineType == MachineType_RVC_DESK1S
|
|
|
+ || m_eMachineType == MachineType_RVC_DESK2S && m_majorVerion == 2 && m_minorVerion == 1)
|
|
|
return true;
|
|
|
else
|
|
|
return false;
|