mod_ContactlessCard.cpp 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. //oiltest
  12. //bCard = true;
  13. //ctx->Ans.t2Account = "6226096550123456";
  14. //ctx->Ans.ActiveCardType = "A";
  15. //ctx->Ans.ICType = 4;
  16. //ctx->Ans.status = 0;
  17. //ctx->Answer(Error_Succeed);
  18. m_pEntity->Insert(ctx);
  19. }
  20. void ContactlessCardServerSession::Handle_CancelInsert(SpOnewayCallContext<ContactlessCardService_CancelInsert_Info>::Pointer ctx)
  21. {
  22. LOG_FUNCTION();
  23. m_pEntity->CancelInsert(ctx);
  24. }
  25. void ContactlessCardServerSession::Handle_InsertWaitMore(SpOnewayCallContext<ContactlessCardService_InsertWaitMore_Info>::Pointer ctx)
  26. {
  27. LOG_FUNCTION();
  28. m_pEntity->InsertWaitMore(ctx);
  29. }
  30. void ContactlessCardServerSession::Handle_PreOnline(SpReqAnsContext<ContactlessCardService_PreOnline_Req, ContactlessCardService_PreOnline_Ans>::Pointer ctx)
  31. {
  32. LOG_FUNCTION();
  33. //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";
  34. //ctx->Answer(Error_Succeed);
  35. m_pEntity->PreOnline(ctx);
  36. }
  37. void ContactlessCardServerSession::Handle_PostOnline(SpReqAnsContext<ContactlessCardService_PostOnline_Req, ContactlessCardService_PostOnline_Ans>::Pointer ctx)
  38. {
  39. LOG_FUNCTION();
  40. //ctx->Ans.result = "";
  41. //ctx->Answer(Error_Succeed);
  42. m_pEntity->PostOnline(ctx);
  43. }
  44. void ContactlessCardServerSession::Handle_Eject(SpReqAnsContext<ContactlessCardService_Eject_Req, ContactlessCardService_Eject_Ans>::Pointer ctx)
  45. {
  46. LOG_FUNCTION();
  47. //bCard = false;
  48. //ctx->Answer(Error_Succeed);
  49. //FetchCard evt;
  50. //evt.status = 0;
  51. //SpSendBroadcast(m_pEntity->GetFunction(),SP_MSG_OF(FetchCard),SP_MSG_SIG_OF(FetchCard),evt);
  52. //Dbg("客户取走卡片msg发送");
  53. m_pEntity->Eject(ctx);
  54. }
  55. void ContactlessCardServerSession::Handle_Exit(SpOnewayCallContext<ContactlessCardService_Exit_Info>::Pointer ctx)
  56. {
  57. LOG_FUNCTION();
  58. m_pEntity->Exit(ctx);
  59. }
  60. void ContactlessCardServerSession::Handle_QueryCardInfo(SpReqAnsContext<ContactlessCardService_QueryCardInfo_Req, ContactlessCardService_QueryCardInfo_Ans>::Pointer ctx)
  61. {
  62. LOG_FUNCTION();
  63. //if (bCard)
  64. // ctx->Ans.position = 4;
  65. //else
  66. // ctx->Ans.position = 0;
  67. //ctx->Answer(Error_Succeed);
  68. m_pEntity->QueryCardInfo(ctx);
  69. }
  70. void ContactlessCardServerSession::Handle_GetDevInfo(SpReqAnsContext<ContactlessCardService_GetDevInfo_Req, ContactlessCardService_GetDevInfo_Ans>::Pointer ctx)
  71. {
  72. LOG_FUNCTION();
  73. m_pEntity->GetDevInfo(ctx);
  74. }
  75. SP_BEGIN_ENTITY_MAP()
  76. SP_ENTITY(CContactlessCardEntity)
  77. SP_END_ENTITY_MAP()