123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- // mod_cardswiper.cpp : Defines the exported functions for the DLL application.
- #pragma once
- #include "stdafx.h"
- #include "SpBase.h"
- #include "mod_cardswiper.h"
- #include "CardSwiperClass.h"
- #include "EventCode.h"
- void CardSwiperServerSession::Handle_Read(SpReqAnsContext<CardSwiperService_Read_Req, CardSwiperService_Read_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("Read")("Invoke Read");
- m_pEntity->Read(ctx);
- }
- void CardSwiperServerSession::Handle_PreOnline(SpReqAnsContext<CardSwiperService_PreOnline_Req, CardSwiperService_PreOnline_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("PreOnline")("Invoke PreOnline");
- m_pEntity->PreOnline(ctx);
- }
- void CardSwiperServerSession::Handle_PostOnline(SpReqAnsContext<CardSwiperService_PostOnline_Req, CardSwiperService_PostOnline_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("PostOnline")("Invoke PostOnline");
- m_pEntity->PostOnline(ctx);
- }
- void CardSwiperServerSession::Handle_Exit(SpOnewayCallContext<CardSwiperService_Exit_Info>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("Exit")("Invoke Exit");
- m_pEntity->Exit(ctx);
- }
- void CardSwiperServerSession::Handle_GetDevInfo(SpReqAnsContext<CardSwiperService_GetDevInfo_Req, CardSwiperService_GetDevInfo_Ans>::Pointer ctx)
- {
- //oilyang@20220418 通道型信息查询,如有必要,应该在发起端记录
- //DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("GetDevInfo")("Invoke GetDevInfo");
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->GetDevInfo(ctx);
- }
- void CardSwiperServerSession::Handle_CancelInsert(SpOnewayCallContext<CardSwiperService_CancelInsert_Info>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("CancelInsert")("Invoke CancelInsert");
- m_pEntity->CancelInsert(ctx);
- }
- void CardSwiperServerSession::Handle_Eject(SpReqAnsContext<CardSwiperService_Eject_Req, CardSwiperService_Eject_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("Eject")("Invoke Eject");
- m_pEntity->Eject(ctx);
- }
- void CardSwiperServerSession::Handle_QueryCardInfo(SpReqAnsContext<CardSwiperService_QueryCardInfo_Req, CardSwiperService_QueryCardInfo_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("QueryCardInfo")("Invoke QueryCardInfo");
- m_pEntity->QueryCardInfo(ctx);
- }
- void CardSwiperServerSession::Handle_QueryConnInfo(SpReqAnsContext<CardSwiperService_QueryConnInfo_Req, CardSwiperService_QueryConnInfo_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("QueryConnInfo")("Invoke QueryConnInfo");
- m_pEntity->QueryConnInfo(ctx);
- }
- void CardSwiperServerSession::Handle_InsertWaitMore(SpOnewayCallContext<CardSwiperService_InsertWaitMore_Info>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("InsertWaitMore")("Invoke InsertWaitMore");
- m_pEntity->InsertWaitMore(ctx);
- }
- void CardSwiperServerSession::Handle_QueryFWBList(SpReqAnsContext<CardSwiperService_QueryFWBList_Req, CardSwiperService_QueryFWBList_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("QueryFWBList")("Invoke QueryFWBList");
- m_pEntity->QueryFWBList(ctx);
- }
- void CardSwiperServerSession::Handle_BindFWB(SpReqAnsContext<CardSwiperService_BindFWB_Req, CardSwiperService_BindFWB_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("BindFWB")("Invoke BindFWB");
- m_pEntity->BindFWB(ctx);
- }
- void CCardSwiperEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID, const LogTypeEnum eLogType, const SeverityLevelEnum eLevel,
- const DWORD dwSysError, const DWORD dwUserCode, const DWORD dwEntityInstanceID, const WORD wEntityDevelID,
- const CAutoArray<DWORD> &Param, const char *pszEntityName, const char *pszModuleName,const char *pszMessage, const linkContext &pLinkInfo)
- {
- switch (dwUserCode)
- {
- case EVENT_ACCESSAUTH_SUCCEED:
- {
- m_fsm.SetAAState(0);
- }
- break;
- case EVENT_ACCESSAUTH_FAILED:
- case EVENT_ACCESSAUTH_TIMEOUT:
- DbgWarn("access auth failed.");
- m_fsm.SetAAState(1);
- break;
- default:
- break;
- }
- }
- void CCardSwiperEntity::OnSysVarEvent(const char* pszKey, const char* pszValue, const char* pszOldValue, const char* pszEntityName)
- {
- if ((_strnicmp(pszKey, "UIState", strlen("UIState")) == 0))
- {
- if (_strnicmp(pszValue, "M", strlen("M")) == 0)
- {
- m_fsm.SetMainPageFlag(true);
- }
- else
- m_fsm.SetMainPageFlag(false);
- }
- }
- SP_BEGIN_ENTITY_MAP()
- SP_ENTITY(CCardSwiperEntity)
- SP_END_ENTITY_MAP()
|