mod_pinpad.cpp 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. // mod_pinpad.cpp : Defines the exported functions for the DLL application.
  2. //
  3. #include "stdafx.h"
  4. #include "mod_PinPad.h"
  5. void PinPadServerSession::Handle_GetInput(SpReqAnsContext<PinPadService_GetInput_Req, PinPadService_GetInput_Ans>::Pointer ctx)
  6. {
  7. LOG_FUNCTION();
  8. m_pEntity->GetInput(ctx);
  9. }
  10. void PinPadServerSession::Handle_InputWaitMore(SpOnewayCallContext<PinPadService_InputWaitMore_Info>::Pointer ctx)
  11. {
  12. LOG_FUNCTION();
  13. m_pEntity->InputWaitMore(ctx);
  14. }
  15. void PinPadServerSession::Handle_InputCancel(SpOnewayCallContext<PinPadService_InputCancel_Info>::Pointer ctx)
  16. {
  17. LOG_FUNCTION();
  18. m_pEntity->InputCancel(ctx);
  19. Dbg("handle front cancel");
  20. }
  21. void PinPadServerSession::Handle_Exit(SpOnewayCallContext<PinPadService_Exit_Info>::Pointer ctx)
  22. {
  23. //LOG_FUNCTION();
  24. m_pEntity->Exit(ctx);
  25. }
  26. void PinPadServerSession::Handle_LoadKeys(SpReqAnsContext<PinPadService_LoadKeys_Req, PinPadService_LoadKeys_Ans>::Pointer ctx)
  27. {
  28. LOG_FUNCTION();
  29. m_pEntity->LoadKeys(ctx);
  30. }
  31. void PinPadServerSession::Handle_EncryptData(SpReqAnsContext<PinPadService_EncryptData_Req, PinPadService_EncryptData_Ans>::Pointer ctx)
  32. {
  33. LOG_FUNCTION();
  34. m_pEntity->EncryptData(ctx);
  35. }
  36. void PinPadServerSession::Handle_GetInputSM(SpReqAnsContext<PinPadService_GetInputSM_Req, PinPadService_GetInputSM_Ans>::Pointer ctx)
  37. {
  38. LOG_FUNCTION();
  39. m_pEntity->GetInputSM(ctx);
  40. }
  41. void PinPadServerSession::Handle_LoadKeysSM(SpReqAnsContext<PinPadService_LoadKeysSM_Req, PinPadService_LoadKeysSM_Ans>::Pointer ctx)
  42. {
  43. LOG_FUNCTION();
  44. m_pEntity->LoadKeysSM(ctx);
  45. }
  46. void PinPadServerSession::Handle_EncryptDataSM(SpReqAnsContext<PinPadService_EncryptDataSM_Req, PinPadService_EncryptDataSM_Ans>::Pointer ctx)
  47. {
  48. LOG_FUNCTION();
  49. m_pEntity->EncryptDataSM(ctx);
  50. }
  51. void PinPadServerSession::Handle_QueryFunc(SpReqAnsContext<PinPadService_QueryFunc_Req, PinPadService_QueryFunc_Ans>::Pointer ctx)
  52. {
  53. LOG_FUNCTION();
  54. m_pEntity->QueryFunc(ctx);
  55. }
  56. void PinPadServerSession::Handle_GetCheckCode(SpReqAnsContext<PinPadService_GetCheckCode_Req, PinPadService_GetCheckCode_Ans>::Pointer ctx)
  57. {
  58. LOG_FUNCTION();
  59. m_pEntity->GetCheckCode(ctx);
  60. }
  61. void PinPadServerSession::Handle_CrossTermCall(SpReqAnsContext<PinPadService_CrossTermCall_Req, PinPadService_CrossTermCall_Ans>::Pointer ctx)
  62. {
  63. LOG_FUNCTION();
  64. m_pEntity->CrossTermCall(ctx);
  65. }
  66. void PinPadServerSession::Handle_CrossTermInvokeInfo(SpOnewayCallContext<PinPadService_CrossTermInvokeInfo_Info>::Pointer ctx)
  67. {
  68. LOG_FUNCTION();
  69. m_pEntity->CrossTermInvokeInfo(ctx);
  70. }
  71. void PinPadServerSession::Handle_GetDevInfo(SpReqAnsContext<PinPadService_GetDevInfo_Req, PinPadService_GetDevInfo_Ans>::Pointer ctx)
  72. {
  73. LOG_FUNCTION();
  74. m_pEntity->GetDevInfo(ctx);
  75. }
  76. void CPinPadEntity::OnSysVarEvent(const char *pszKey,
  77. const char *pszValue, const char *pszOldValue, const char *pszEntityName)
  78. {
  79. if ((_strnicmp(pszKey, "UIState", strlen("UIState")) == 0))
  80. {
  81. if (_strnicmp(pszValue, "M", strlen("M")) == 0)
  82. {
  83. Dbg("enter main page");
  84. m_fsm.SetEnterMainPage(true);
  85. }
  86. else
  87. {
  88. Dbg("not main page[%s]", pszValue);
  89. m_fsm.SetEnterMainPage(false);
  90. }
  91. }
  92. }
  93. SP_BEGIN_ENTITY_MAP()
  94. SP_ENTITY(CPinPadEntity)
  95. SP_END_ENTITY_MAP()