mod_pinpad.cpp 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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_InputWaitMore(SpOnewayCallContext<PinPadService_InputWaitMore_Info>::Pointer ctx)
  6. {
  7. DbgToBeidou(ctx->link, __FUNCTION__)();
  8. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI(__FUNCTION__)("InputWaitMore something u want to know...");
  9. m_pEntity->InputWaitMore(ctx);
  10. }
  11. void PinPadServerSession::Handle_InputCancel(SpOnewayCallContext<PinPadService_InputCancel_Info>::Pointer ctx)
  12. {
  13. DbgToBeidou(ctx->link, __FUNCTION__)();
  14. m_pEntity->InputCancel(ctx);
  15. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI(__FUNCTION__)("handle front cancel");
  16. }
  17. void PinPadServerSession::Handle_Exit(SpOnewayCallContext<PinPadService_Exit_Info>::Pointer ctx)
  18. {
  19. DbgToBeidou(ctx->link, __FUNCTION__)();
  20. m_pEntity->Exit(ctx);
  21. }
  22. void PinPadServerSession::Handle_GetInputSM(SpReqAnsContext<PinPadService_GetInputSM_Req, PinPadService_GetInputSM_Ans>::Pointer ctx)
  23. {
  24. DbgToBeidou(ctx->link, __FUNCTION__)();
  25. m_pEntity->GetInputSM(ctx);
  26. }
  27. void PinPadServerSession::Handle_LoadKeysSM(SpReqAnsContext<PinPadService_LoadKeysSM_Req, PinPadService_LoadKeysSM_Ans>::Pointer ctx)
  28. {
  29. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI(__FUNCTION__)("LoadKeysSM,initializeflag:%d,smflag:%d", ctx->Req.initializeflag, ctx->Req.smflag);
  30. DbgToBeidou(ctx->link, __FUNCTION__)();
  31. m_pEntity->LoadKeysSM(ctx);
  32. }
  33. void PinPadServerSession::Handle_EncryptDataSM(SpReqAnsContext<PinPadService_EncryptDataSM_Req, PinPadService_EncryptDataSM_Ans>::Pointer ctx)
  34. {
  35. DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI(__FUNCTION__)("EncryptDataSM,smflag:%d", ctx->Req.smflag);
  36. DbgToBeidou(ctx->link, __FUNCTION__)();
  37. m_pEntity->EncryptDataSM(ctx);
  38. }
  39. void PinPadServerSession::Handle_QueryFunc(SpReqAnsContext<PinPadService_QueryFunc_Req, PinPadService_QueryFunc_Ans>::Pointer ctx)
  40. {
  41. m_pEntity->QueryFunc(ctx);
  42. }
  43. void PinPadServerSession::Handle_GetCheckCode(SpReqAnsContext<PinPadService_GetCheckCode_Req, PinPadService_GetCheckCode_Ans>::Pointer ctx)
  44. {
  45. DbgToBeidou(ctx->link, __FUNCTION__)();
  46. m_pEntity->GetCheckCode(ctx);
  47. }
  48. void PinPadServerSession::Handle_GetDevInfo(SpReqAnsContext<PinPadService_GetDevInfo_Req, PinPadService_GetDevInfo_Ans>::Pointer ctx)
  49. {
  50. m_pEntity->GetDevInfo(ctx);
  51. }
  52. void CPinPadEntity::OnSysVarEvent(const char *pszKey,
  53. const char *pszValue, const char *pszOldValue, const char *pszEntityName)
  54. {
  55. if ((_strnicmp(pszKey, "UIState", strlen("UIState")) == 0))
  56. {
  57. if (_strnicmp(pszValue, "M", strlen("M")) == 0)
  58. m_fsm.SetInWhatPage(PageType_MainPage);
  59. else if (_strnicmp(pszValue, "U", strlen("U")) == 0)
  60. m_fsm.SetInWhatPage(PageType_UserDesktop);
  61. else
  62. m_fsm.SetInWhatPage(PageType_Other);
  63. }
  64. }
  65. SP_BEGIN_ENTITY_MAP()
  66. SP_ENTITY(CPinPadEntity)
  67. SP_END_ENTITY_MAP()