// mod_cardswiper.cpp : Defines the exported functions for the DLL application. #include "stdafx.h" #pragma once #include "SpBase.h" #include "mod_cardswiper.h" #include "CardSwiperClass.h" #include "EventCode.h" void CardSwiperServerSession::Handle_Read(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); m_pEntity->Read(ctx); } void CardSwiperServerSession::Handle_PreOnline(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); m_pEntity->PreOnline(ctx); } void CardSwiperServerSession::Handle_PostOnline(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); m_pEntity->PostOnline(ctx); } void CardSwiperServerSession::Handle_Exit(SpOnewayCallContext::Pointer ctx) { LOG_FUNCTION(); m_pEntity->Exit(ctx); } void CardSwiperServerSession::Handle_GetDevInfo(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); m_pEntity->GetDevInfo(ctx); } void CardSwiperServerSession::Handle_CancelInsert(SpOnewayCallContext::Pointer ctx) { LOG_FUNCTION(); m_pEntity->CancelInsert(ctx); } void CardSwiperServerSession::Handle_Eject(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); m_pEntity->Eject(ctx); } void CardSwiperServerSession::Handle_QueryCardInfo(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); m_pEntity->QueryCardInfo(ctx); } void CardSwiperServerSession::Handle_MagTransferInit(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); m_pEntity->MagTransferInit(ctx); } void CardSwiperServerSession::Handle_QueryConnInfo(SpReqAnsContext::Pointer ctx) { m_pEntity->QueryConnInfo(ctx); } void CardSwiperServerSession::Handle_InsertWaitMore(SpOnewayCallContext::Pointer ctx) { LOG_FUNCTION(); m_pEntity->InsertWaitMore(ctx); } void CardSwiperServerSession::Handle_QueryFWBList(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); m_pEntity->QueryFWBList(ctx); } void CardSwiperServerSession::Handle_BindFWB(SpReqAnsContext::Pointer ctx) { LOG_FUNCTION(); m_pEntity->BindFWB(ctx); } void CCardSwiperEntity::OnLog(const CAutoArray &SubIDs, const CUUID nLogID, const LogTypeEnum eLogType, const SeverityLevelEnum eLevel, const DWORD dwSysError, const DWORD dwUserCode, const DWORD dwEntityInstanceID, const WORD wEntityDevelID, const CAutoArray &Param, const char *pszEntityName, const char *pszModuleName, const char *pszMessage) { switch (dwUserCode) { case EVENT_ACCESSAUTH_SUCCEED: { //Dbg("access auth succeed."); //FSMEvent *pEvt = new FSMEvent(USER_EVT_MAGDATA_TRANSFER_INIT_V2); //m_fsm.PostEventFIFO(pEvt); m_fsm.SetAAState(0); } break; case EVENT_ACCESSAUTH_FAILED: case EVENT_ACCESSAUTH_TIMEOUT: Dbg("access auth failed."); m_fsm.SetAAState(1); 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()