mod_ContactlessCard.cpp 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // mod_ContactlessCard.cpp : Defines the exported functions for the DLL application.
  2. //
  3. #include "stdafx.h"
  4. #include "mod_ContactlessCard.h"
  5. //oiltest
  6. #include "ContactlessCard_msg_g.h"
  7. bool bCard = false;
  8. void ContactlessCardServerSession::Handle_Insert(SpReqAnsContext<ContactlessCardService_Insert_Req, ContactlessCardService_Insert_Ans>::Pointer ctx)
  9. {
  10. LOG_FUNCTION();
  11. m_pEntity->Insert(ctx);
  12. }
  13. void ContactlessCardServerSession::Handle_CancelInsert(SpOnewayCallContext<ContactlessCardService_CancelInsert_Info>::Pointer ctx)
  14. {
  15. LOG_FUNCTION();
  16. m_pEntity->CancelInsert(ctx);
  17. }
  18. void ContactlessCardServerSession::Handle_InsertWaitMore(SpOnewayCallContext<ContactlessCardService_InsertWaitMore_Info>::Pointer ctx)
  19. {
  20. LOG_FUNCTION();
  21. m_pEntity->InsertWaitMore(ctx);
  22. }
  23. void ContactlessCardServerSession::Handle_PreOnline(SpReqAnsContext<ContactlessCardService_PreOnline_Req, ContactlessCardService_PreOnline_Ans>::Pointer ctx)
  24. {
  25. LOG_FUNCTION();
  26. //ctx->Ans.result = "ACTION,|ATCCODE,000C|ARQCCODE,586EFDCCD5385856|MAC,07010103A0B000010A01000000000075EB2B20|ARQCSIZE,37|ARQCDATA,00000000000000000000000001560000000000015614102270046E69797C00000C03A0B000|EXPIREDATE,240731|T2ACCOUNT,6214838818741003|T2CARDSERIAL,0|T2CVC,838125|T2TRACK2,6214838818741003D24072202453300838125|CARDCAT,0";
  27. //ctx->Answer(Error_Succeed);
  28. m_pEntity->PreOnline(ctx);
  29. }
  30. void ContactlessCardServerSession::Handle_PostOnline(SpReqAnsContext<ContactlessCardService_PostOnline_Req, ContactlessCardService_PostOnline_Ans>::Pointer ctx)
  31. {
  32. LOG_FUNCTION();
  33. //ctx->Ans.result = "";
  34. //ctx->Answer(Error_Succeed);
  35. m_pEntity->PostOnline(ctx);
  36. }
  37. void ContactlessCardServerSession::Handle_Eject(SpReqAnsContext<ContactlessCardService_Eject_Req, ContactlessCardService_Eject_Ans>::Pointer ctx)
  38. {
  39. LOG_FUNCTION();
  40. //bCard = false;
  41. //ctx->Answer(Error_Succeed);
  42. //FetchCard evt;
  43. //evt.status = 0;
  44. //SpSendBroadcast(m_pEntity->GetFunction(),SP_MSG_OF(FetchCard),SP_MSG_SIG_OF(FetchCard),evt);
  45. //Dbg("客户取走卡片msg发送");
  46. m_pEntity->Eject(ctx);
  47. }
  48. void ContactlessCardServerSession::Handle_Exit(SpOnewayCallContext<ContactlessCardService_Exit_Info>::Pointer ctx)
  49. {
  50. LOG_FUNCTION();
  51. m_pEntity->Exit(ctx);
  52. }
  53. void ContactlessCardServerSession::Handle_QueryCardInfo(SpReqAnsContext<ContactlessCardService_QueryCardInfo_Req, ContactlessCardService_QueryCardInfo_Ans>::Pointer ctx)
  54. {
  55. LOG_FUNCTION();
  56. //if (bCard)
  57. // ctx->Ans.position = 4;
  58. //else
  59. // ctx->Ans.position = 0;
  60. //ctx->Answer(Error_Succeed);
  61. m_pEntity->QueryCardInfo(ctx);
  62. }
  63. void ContactlessCardServerSession::Handle_GetDevInfo(SpReqAnsContext<ContactlessCardService_GetDevInfo_Req, ContactlessCardService_GetDevInfo_Ans>::Pointer ctx)
  64. {
  65. LOG_FUNCTION();
  66. m_pEntity->GetDevInfo(ctx);
  67. }
  68. SP_BEGIN_ENTITY_MAP()
  69. SP_ENTITY(CContactlessCardEntity)
  70. SP_END_ENTITY_MAP()