mod_CardReadAdapter.cpp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  1. // mod_CardReadAdapter.cpp : Defines the exported functions for the DLL application.
  2. //
  3. #include "stdafx.h"
  4. #pragma once
  5. #include "SpBase.h"
  6. #include "mod_CardReadAdapter.h"
  7. void CardReadAdapterServerSession::Handle_Read(SpReqAnsContext<CardReadAdapterService_Read_Req, CardReadAdapterService_Read_Ans>::Pointer ctx)
  8. {
  9. LOG_FUNCTION();
  10. DbgToBeidou(ctx->link, __FUNCTION__)();
  11. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("Read")("Invoke Read");
  12. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER)("Module:%d,lightPos:%d,bus data size:%d",ctx->Req.module,ctx->Req.lightPos,ctx->Req.businessData.GetLength());
  13. if (ctx->Req.reserved1.GetCount() > 0)
  14. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER)("reserved1[0]:%d",ctx->Req.reserved1[0]);
  15. m_pEntity->Read(ctx);
  16. }
  17. void CardReadAdapterServerSession::Handle_Capture(SpReqAnsContext<CardReadAdapterService_Capture_Req, CardReadAdapterService_Capture_Ans>::Pointer ctx)
  18. {
  19. LOG_FUNCTION();
  20. DbgToBeidou(ctx->link, __FUNCTION__)();
  21. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("Capture")("Invoke Capture");
  22. m_pEntity->Capture(ctx);
  23. }
  24. void CardReadAdapterServerSession::Handle_Eject(SpReqAnsContext<CardReadAdapterService_Eject_Req, CardReadAdapterService_Eject_Ans>::Pointer ctx)
  25. {
  26. LOG_FUNCTION();
  27. DbgToBeidou(ctx->link, __FUNCTION__)();
  28. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("Eject")("Invoke Eject");
  29. m_pEntity->Eject(ctx);
  30. }
  31. void CardReadAdapterServerSession::Handle_CancelRead(SpOnewayCallContext<CardReadAdapterService_CancelRead_Info>::Pointer ctx)
  32. {
  33. LOG_FUNCTION();
  34. DbgToBeidou(ctx->link, __FUNCTION__)();
  35. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("CancelRead")("Invoke CancelRead");
  36. m_pEntity->CancelRead(ctx);
  37. }
  38. void CardReadAdapterServerSession::Handle_ReadWaitMore(SpOnewayCallContext<CardReadAdapterService_ReadWaitMore_Info>::Pointer ctx)
  39. {
  40. LOG_FUNCTION();
  41. DbgToBeidou(ctx->link, __FUNCTION__)();
  42. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("ReadWaitMore")("Invoke ReadWaitMore");
  43. m_pEntity->ReadWaitMore(ctx);
  44. }
  45. void CardReadAdapterServerSession::Handle_Issue(SpReqAnsContext<CardReadAdapterService_Issue_Req, CardReadAdapterService_Issue_Ans>::Pointer ctx)
  46. {
  47. LOG_FUNCTION();
  48. DbgToBeidou(ctx->link, __FUNCTION__)();
  49. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("Issue")("Invoke Issue");
  50. m_pEntity->Issue(ctx);
  51. }
  52. void CardReadAdapterServerSession::Handle_PreOnline(SpReqAnsContext<CardReadAdapterService_PreOnline_Req, CardReadAdapterService_PreOnline_Ans>::Pointer ctx)
  53. {
  54. LOG_FUNCTION();
  55. DbgToBeidou(ctx->link, __FUNCTION__)();
  56. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("PreOnline")("Invoke PreOnline");
  57. if (ctx->Req.reserved2.GetCount() > 0 && !ctx->Req.reserved2[0].IsNullOrEmpty() && _strnicmp("kaku#", (const char*)ctx->Req.reserved2[0], 5) == 0)
  58. m_pEntity->PreOnline(ctx);
  59. else
  60. {
  61. DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("except for kaku,other can't use preonline directly.");
  62. ctx->Answer(Error_Unexpect);
  63. }
  64. }
  65. void CardReadAdapterServerSession::Handle_PostOnline(SpReqAnsContext<CardReadAdapterService_PostOnline_Req, CardReadAdapterService_PostOnline_Ans>::Pointer ctx)
  66. {
  67. LOG_FUNCTION();
  68. DbgToBeidou(ctx->link, __FUNCTION__)();
  69. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("PostOnline")("Invoke PostOnline");
  70. m_pEntity->PostOnline(ctx);
  71. }
  72. void CardReadAdapterServerSession::Handle_Exit(SpOnewayCallContext<CardReadAdapterService_Exit_Info>::Pointer ctx)
  73. {
  74. LOG_FUNCTION();
  75. DbgToBeidou(ctx->link, __FUNCTION__)();
  76. m_pEntity->Exit(ctx);
  77. }
  78. void CardReadAdapterServerSession::Handle_QueryCardInfo(SpReqAnsContext<CardReadAdapterService_QueryCardInfo_Req, CardReadAdapterService_QueryCardInfo_Ans>::Pointer ctx)
  79. {
  80. LOG_FUNCTION();
  81. DbgToBeidou(ctx->link, __FUNCTION__)();
  82. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("QueryCardInfo")("Invoke QueryCardInfo");
  83. m_pEntity->QueryCardInfo(ctx);
  84. }
  85. void CardReadAdapterServerSession::Handle_WriteTrack(SpReqAnsContext<CardReadAdapterService_WriteTrack_Req, CardReadAdapterService_WriteTrack_Ans>::Pointer ctx)
  86. {
  87. LOG_FUNCTION();
  88. DbgToBeidou(ctx->link, __FUNCTION__)();
  89. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("WriteTrack")("Invoke WriteTrack");
  90. //Dbg("oiltest %d,%d,t1[%S],t2[%S],t3[%S],[%S]",ctx->Req.co,ctx->Req.mode,(const wchar_t *)ctx->Req.track1,(const wchar_t *)ctx->Req.track2,(const wchar_t *)ctx->Req.track3,(const wchar_t *)ctx->Req.reserved);
  91. m_pEntity->WriteTrack(ctx);
  92. }
  93. void CardReadAdapterServerSession::Handle_SetSomeFlag(SpReqAnsContext<CardReadAdapterService_SetSomeFlag_Req, CardReadAdapterService_SetSomeFlag_Ans>::Pointer ctx)
  94. {
  95. LOG_FUNCTION();
  96. DbgToBeidou(ctx->link, __FUNCTION__)();
  97. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("SetSomeFlag")("Invoke SetSomeFlag");
  98. m_pEntity->SetSomeFlag(ctx);
  99. }
  100. void CardReadAdapterServerSession::Handle_GetMaterialCount(SpReqAnsContext<CardReadAdapterService_GetMaterialCount_Req, CardReadAdapterService_GetMaterialCount_Ans>::Pointer ctx)
  101. {
  102. LOG_FUNCTION();
  103. DbgToBeidou(ctx->link, __FUNCTION__)();
  104. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("GetMaterialCount")("Invoke GetMaterialCount");
  105. m_pEntity->GetMaterialCount(ctx);
  106. }
  107. void CardReadAdapterServerSession::Handle_SetMaterialCount(SpReqAnsContext<CardReadAdapterService_SetMaterialCount_Req, CardReadAdapterService_SetMaterialCount_Ans>::Pointer ctx)
  108. {
  109. LOG_FUNCTION();
  110. DbgToBeidou(ctx->link, __FUNCTION__)();
  111. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("SetMaterialCount")("Invoke SetMaterialCount");
  112. m_pEntity->SetMaterialCount(ctx);
  113. }
  114. void CardReadAdapterServerSession::Handle_GetSCIInfo(SpReqAnsContext<CardReadAdapterService_GetSCIInfo_Req, CardReadAdapterService_GetSCIInfo_Ans>::Pointer ctx)
  115. {
  116. LOG_FUNCTION();
  117. DbgToBeidou(ctx->link, __FUNCTION__)();
  118. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("GetSCIInfo")("Invoke GetSCIInfo");
  119. m_pEntity->GetSCIInfo(ctx);
  120. }
  121. void CardReadAdapterServerSession::Handle_OpenSafeLock(SpReqAnsContext<CardReadAdapterService_OpenSafeLock_Req, CardReadAdapterService_OpenSafeLock_Ans>::Pointer ctx)
  122. {
  123. LOG_FUNCTION();
  124. DbgToBeidou(ctx->link, __FUNCTION__)();
  125. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("OpenSafeLock")("Invoke OpenSafeLock");
  126. m_pEntity->OpenSafeLock(ctx);
  127. }
  128. void CardReadAdapterServerSession::Handle_MagTransferInit(SpReqAnsContext<CardReadAdapterService_MagTransferInit_Req, CardReadAdapterService_MagTransferInit_Ans>::Pointer ctx)
  129. {
  130. LOG_FUNCTION();
  131. DbgToBeidou(ctx->link, __FUNCTION__)();
  132. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("MagTransferInit")("Invoke MagTransferInit");
  133. m_pEntity->MagTransferInit(ctx);
  134. }
  135. void CardReadAdapterServerSession::Handle_QueryConnInfo(SpReqAnsContext<CardReadAdapterService_QueryConnInfo_Req, CardReadAdapterService_QueryConnInfo_Ans>::Pointer ctx)
  136. {
  137. LOG_FUNCTION();
  138. DbgToBeidou(ctx->link, __FUNCTION__)();
  139. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("QueryConnInfo")("Invoke QueryConnInfo");
  140. m_pEntity->QueryConnInfo(ctx);
  141. }
  142. void CardReadAdapterServerSession::Handle_GetDevInfo(SpReqAnsContext<CardReadAdapterService_GetDevInfo_Req, CardReadAdapterService_GetDevInfo_Ans>::Pointer ctx)
  143. {
  144. LOG_FUNCTION();
  145. DbgToBeidou(ctx->link, __FUNCTION__)();
  146. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("GetDevInfo")("Invoke GetDevInfo");
  147. m_pEntity->GetDevInfo(ctx);
  148. }
  149. void CardReadAdapterServerSession::Handle_SAMICCommand(SpReqAnsContext<CardReadAdapterService_SAMICCommand_Req, CardReadAdapterService_SAMICCommand_Ans>::Pointer ctx)
  150. {
  151. DbgToBeidou(ctx->link, __FUNCTION__)();
  152. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("SAMICCommand")("Invoke SAMICCommand");
  153. m_pEntity->SAMICCommand(ctx);
  154. }
  155. void CardReadAdapterServerSession::Handle_QueryPrinterStatus(SpReqAnsContext<CardReadAdapterService_QueryPrinterStatus_Req, CardReadAdapterService_QueryPrinterStatus_Ans>::Pointer ctx)
  156. {
  157. LOG_FUNCTION();
  158. DbgToBeidou(ctx->link, __FUNCTION__)();
  159. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("QueryPrinterStatus")("Invoke QueryPrinterStatus");
  160. m_pEntity->QueryPrinterStatus(ctx);
  161. }
  162. void CardReadAdapterServerSession::Handle_Print(SpReqAnsContext<CardReadAdapterService_Print_Req, CardReadAdapterService_Print_Ans>::Pointer ctx)
  163. {
  164. LOG_FUNCTION();
  165. DbgToBeidou(ctx->link, __FUNCTION__)();
  166. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("Print")("Invoke Print");
  167. m_pEntity->Print(ctx);
  168. }
  169. void CardReadAdapterServerSession::Handle_QuerySCIList(SpReqAnsContext<CardReadAdapterService_QuerySCIList_Req, CardReadAdapterService_QuerySCIList_Ans>::Pointer ctx)
  170. {
  171. LOG_FUNCTION();
  172. DbgToBeidou(ctx->link, __FUNCTION__)();
  173. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("QuerySCIList")("Invoke QuerySCIList");
  174. m_pEntity->QuerySCIList(ctx);
  175. }
  176. void CardReadAdapterServerSession::Handle_BindSCI(SpReqAnsContext<CardReadAdapterService_BindSCI_Req, CardReadAdapterService_BindSCI_Ans>::Pointer ctx)
  177. {
  178. LOG_FUNCTION();
  179. DbgToBeidou(ctx->link, __FUNCTION__)();
  180. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("BindSCI")("Invoke BindSCI");
  181. m_pEntity->BindSCI(ctx);
  182. }
  183. void CardReadAdapterServerSession::Handle_PreOnlineOnStore(SpReqAnsContext<CardReadAdapterService_PreOnlineOnStore_Req, CardReadAdapterService_PreOnlineOnStore_Ans>::Pointer ctx)
  184. {
  185. LOG_FUNCTION();
  186. DbgToBeidou(ctx->link, __FUNCTION__)();
  187. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("PreOnlineOnStore")("Invoke PreOnlineOnStore");
  188. m_pEntity->PreOnlineOnStore(ctx);
  189. }
  190. void CardReadAdapterServerSession::Handle_NotifyPreonline(SpReqAnsContext<CardReadAdapterService_NotifyPreonline_Req, CardReadAdapterService_NotifyPreonline_Ans>::Pointer ctx)
  191. {
  192. LOG_FUNCTION();
  193. DbgToBeidou(ctx->link, __FUNCTION__)();
  194. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("NotifyPreonline")("Invoke NotifyPreonline");
  195. m_pEntity->NotifyPreonline(ctx);
  196. }
  197. void CardReadAdapterServerSession::Handle_QueryCardInfoOnStore(SpReqAnsContext<CardReadAdapterService_QueryCardInfoOnStore_Req, CardReadAdapterService_QueryCardInfoOnStore_Ans>::Pointer ctx)
  198. {
  199. LOG_FUNCTION();
  200. DbgToBeidou(ctx->link, __FUNCTION__)();
  201. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("QueryCardInfoOnStore")("Invoke QueryCardInfoOnStore");
  202. m_pEntity->QueryCardInfoOnStore(ctx);
  203. }
  204. void CardReadAdapterServerSession::Handle_GetAddCardInfo(SpReqAnsContext<CardReadAdapterService_GetAddCardInfo_Req, CardReadAdapterService_GetAddCardInfo_Ans>::Pointer ctx)
  205. {
  206. LOG_FUNCTION();
  207. DbgToBeidou(ctx->link, __FUNCTION__)();
  208. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("GetAddCardInfo")("Invoke GetAddCardInfo");
  209. m_pEntity->GetAddCardInfo(ctx);
  210. }
  211. void CardReadAdapterServerSession::Handle_Test1(SpReqAnsContext<CardReadAdapterService_Test1_Req, CardReadAdapterService_Test1_Ans>::Pointer ctx)
  212. {
  213. LOG_FUNCTION();
  214. DbgToBeidou(ctx->link, __FUNCTION__)();
  215. //m_pEntity->Test1(ctx);
  216. }
  217. void CardReadAdapterServerSession::Handle_Test2(SpReqAnsContext<CardReadAdapterService_Test2_Req, CardReadAdapterService_Test2_Ans>::Pointer ctx)
  218. {
  219. LOG_FUNCTION();
  220. DbgToBeidou(ctx->link, __FUNCTION__)();
  221. //m_pEntity->Test2(ctx);
  222. }
  223. void CardReadAdapterServerSession::Handle_CrossTermCall(SpReqAnsContext<CardReadAdapterService_CrossTermCall_Req, CardReadAdapterService_CrossTermCall_Ans>::Pointer ctx)
  224. {
  225. LOG_FUNCTION();
  226. DbgToBeidou(ctx->link, __FUNCTION__)();
  227. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("CrossTermCall")("Invoke CrossTermCall");
  228. m_pEntity->CrossTermCall(ctx);
  229. }
  230. void CardReadAdapterServerSession::Handle_CrossTermInvokeInfo(SpOnewayCallContext<CardReadAdapterService_CrossTermInvokeInfo_Info>::Pointer ctx)
  231. {
  232. LOG_FUNCTION();
  233. DbgToBeidou(ctx->link, __FUNCTION__)();
  234. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("CrossTermInvokeInfo")("Invoke CrossTermInvokeInfo");
  235. m_pEntity->CrossTermInvokeInfo(ctx);
  236. }
  237. void CardReadAdapterServerSession::Handle_PrintCardImmediately(SpReqAnsContext<CardReadAdapterService_PrintCardImmediately_Req, CardReadAdapterService_PrintCardImmediately_Ans>::Pointer ctx)
  238. {
  239. LOG_FUNCTION();
  240. DbgToBeidou(ctx->link, __FUNCTION__)();
  241. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("PrintCardImmediately")("Invoke PrintCardImmediately");
  242. m_pEntity->PrintCardImmediately(ctx);
  243. }
  244. void CardReadAdapterServerSession::Handle_QueryCIStatus(SpReqAnsContext<CardReadAdapterService_QueryCIStatus_Req, CardReadAdapterService_QueryCIStatus_Ans>::Pointer ctx)
  245. {
  246. LOG_FUNCTION();
  247. DbgToBeidou(ctx->link, __FUNCTION__)();
  248. DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("QueryCIStatus")("Invoke QueryCIStatus");
  249. m_pEntity->QueryCIStatus(ctx);
  250. }
  251. void CCardReadAdapterEntity::OnBroadcastEvent(CUUID SubID, const char *pszEntityName, DWORD dwMessageId, DWORD dwMessageSignature, CAutoBuffer Buffer)
  252. {
  253. if (dwMessageSignature != eMsgSig_FetchCard && dwMessageSignature != eMsgSig_SCIConnect)
  254. return;
  255. DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("OnBroadcastEvent,msg:%s,%d,%d",pszEntityName,dwMessageId,dwMessageSignature);
  256. if (_strnicmp(pszEntityName, "CardIssuerStand", strlen("CardIssuerStand")) == 0)
  257. {
  258. if (dwMessageSignature == eMsgSig_FetchCard)
  259. {
  260. CardIssuerStand::FetchCard fc;
  261. SpBuffer2Object(Buffer, fc);
  262. CardIsserFetchCard evt;
  263. evt.status = fc.status;
  264. SpSendBroadcast(GetFunction(), SP_MSG_OF(CardIsserFetchCard), SP_MSG_SIG_OF(CardIsserFetchCard), evt);
  265. }
  266. else if (dwMessageSignature == eMsgSig_SCIConnect)
  267. {
  268. CardIssuerStand::SCIConnect scic;
  269. SpBuffer2Object(Buffer, scic);
  270. CardIssuerSCIConnect evt;
  271. evt.status = scic.status;
  272. SpSendBroadcast(GetFunction(), SP_MSG_OF(CardIssuerSCIConnect), SP_MSG_SIG_OF(CardIssuerSCIConnect), evt);
  273. }
  274. }
  275. else if (_strnicmp(pszEntityName, "CardIssuerStore", strlen("CardIssuerStore")) == 0)
  276. {
  277. if (dwMessageSignature == eMsgSig_FetchCard)
  278. {
  279. CardIssuerStore::FetchCard fc;
  280. SpBuffer2Object(Buffer, fc);
  281. CardIsserFetchCard evt;
  282. evt.status = fc.status;
  283. SpSendBroadcast(GetFunction(), SP_MSG_OF(CardIsserFetchCard), SP_MSG_SIG_OF(CardIsserFetchCard), evt);
  284. }
  285. else if (dwMessageSignature == eMsgSig_SCIConnect)
  286. {
  287. CardIssuerStore::SCIConnect scic;
  288. SpBuffer2Object(Buffer, scic);
  289. CardIssuerSCIConnect evt;
  290. evt.status = scic.status;
  291. SpSendBroadcast(GetFunction(), SP_MSG_OF(CardIssuerSCIConnect), SP_MSG_SIG_OF(CardIssuerSCIConnect), evt);
  292. }
  293. }
  294. else if (_strnicmp(pszEntityName, "ContactlessCard", strlen("ContactlessCard")) == 0)
  295. {
  296. if (dwMessageSignature == eMsgSig_FetchCard)
  297. {
  298. ContactlessCard::FetchCard fc;
  299. SpBuffer2Object(Buffer, fc);
  300. if (fc.status == 3){//oilyang@20181210 cancel read as have detect card in ContactlessCard
  301. if(m_fsm.GetMachineType() == SP::Module::Comm::RVC_Desk2S)
  302. m_fsm.CancelReadForEntity(Module_CardSwiper);
  303. else{
  304. m_fsm.CancelReadForEntity(Module_CardIssuer);
  305. }
  306. }
  307. else
  308. {
  309. ContactlessCardFetchCard evt;
  310. evt.status = fc.status;
  311. SpSendBroadcast(GetFunction(), SP_MSG_OF(ContactlessCardFetchCard), SP_MSG_SIG_OF(ContactlessCardFetchCard), evt);
  312. }
  313. }
  314. }
  315. }
  316. SP_BEGIN_ENTITY_MAP()
  317. SP_ENTITY(CCardReadAdapterEntity)
  318. SP_END_ENTITY_MAP()