123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- // mod_pinpad.cpp : Defines the exported functions for the DLL application.
- //
- #include "stdafx.h"
- #include "mod_PinPad.h"
- void PinPadServerSession::Handle_InputWaitMore(SpOnewayCallContext<PinPadService_InputWaitMore_Info>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI(__FUNCTION__)("InputWaitMore something u want to know...");
- m_pEntity->InputWaitMore(ctx);
- }
- void PinPadServerSession::Handle_InputCancel(SpOnewayCallContext<PinPadService_InputCancel_Info>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->InputCancel(ctx);
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI(__FUNCTION__)("handle front cancel");
- }
- void PinPadServerSession::Handle_Exit(SpOnewayCallContext<PinPadService_Exit_Info>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->Exit(ctx);
- }
- void PinPadServerSession::Handle_GetInputJS(SpReqAnsContext<PinPadService_GetInputJS_Req, PinPadService_GetInputJS_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->GetInputJS(ctx);
- }
- void PinPadServerSession::Handle_InputCancelJS(SpReqAnsContext<PinPadService_InputCancelJS_Req, PinPadService_InputCancelJS_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->InputCancelJS(ctx);
- }
- void PinPadServerSession::Handle_GetInputSM(SpReqAnsContext<PinPadService_GetInputSM_Req, PinPadService_GetInputSM_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->GetInputSM(ctx);
- }
- void PinPadServerSession::Handle_LoadKeysSM(SpReqAnsContext<PinPadService_LoadKeysSM_Req, PinPadService_LoadKeysSM_Ans>::Pointer ctx)
- {
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI(__FUNCTION__)("LoadKeysSM,initializeflag:%d,smflag:%d", ctx->Req.initializeflag, ctx->Req.smflag);
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->LoadKeysSM(ctx);
- }
- void PinPadServerSession::Handle_EncryptDataSM(SpReqAnsContext<PinPadService_EncryptDataSM_Req, PinPadService_EncryptDataSM_Ans>::Pointer ctx)
- {
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER).setAPI(__FUNCTION__)("EncryptDataSM,smflag:%d", ctx->Req.smflag);
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->EncryptDataSM(ctx);
- }
- void PinPadServerSession::Handle_QueryFunc(SpReqAnsContext<PinPadService_QueryFunc_Req, PinPadService_QueryFunc_Ans>::Pointer ctx)
- {
- m_pEntity->QueryFunc(ctx);
- }
- void PinPadServerSession::Handle_GetCheckCode(SpReqAnsContext<PinPadService_GetCheckCode_Req, PinPadService_GetCheckCode_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->GetCheckCode(ctx);
- }
- void PinPadServerSession::Handle_GetDevInfo(SpReqAnsContext<PinPadService_GetDevInfo_Req, PinPadService_GetDevInfo_Ans>::Pointer ctx)
- {
- m_pEntity->GetDevInfo(ctx);
- }
- void CPinPadEntity::DoInputCancelJS(SpReqAnsContext<PinPadService_InputCancelJS_Req, PinPadService_InputCancelJS_Ans>::Pointer ctx)
- {
- ULLINT ullBeginTime = SP::Module::Comm::RVCGetTickCount();
- ULLINT ullEndTime = SP::Module::Comm::RVCGetTickCount();
- while ((ullEndTime - ullBeginTime) < 5000)
- {
- if (_stricmp(m_fsm.GetCurrStateName(), "Input") != 0)
- {
- ctx->Answer(Error_Succeed);
- break;
- }
- Sleep(500);
- ullEndTime = SP::Module::Comm::RVCGetTickCount();
- }
- }
- void CPinPadEntity::OnSysVarEvent(const char *pszKey,
- const char *pszValue, const char *pszOldValue, const char *pszEntityName)
- {
- if ((_strnicmp(pszKey, "UIState", strlen("UIState")) == 0))
- {
- m_fsm.OnUIState4SetWhatPage(pszValue);
- }
- }
- SP_BEGIN_ENTITY_MAP()
- SP_ENTITY(CPinPadEntity)
- SP_END_ENTITY_MAP()
|