123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- // 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<CardSwiperService_Read_Req, CardSwiperService_Read_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- m_pEntity->Read(ctx);
- }
- void CardSwiperServerSession::Handle_PreOnline(SpReqAnsContext<CardSwiperService_PreOnline_Req, CardSwiperService_PreOnline_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- m_pEntity->PreOnline(ctx);
- }
- void CardSwiperServerSession::Handle_PostOnline(SpReqAnsContext<CardSwiperService_PostOnline_Req, CardSwiperService_PostOnline_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- m_pEntity->PostOnline(ctx);
- }
- void CardSwiperServerSession::Handle_Exit(SpOnewayCallContext<CardSwiperService_Exit_Info>::Pointer ctx)
- {
- LOG_FUNCTION();
- m_pEntity->Exit(ctx);
- }
- void CardSwiperServerSession::Handle_GetDevInfo(SpReqAnsContext<CardSwiperService_GetDevInfo_Req, CardSwiperService_GetDevInfo_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- m_pEntity->GetDevInfo(ctx);
- }
- void CardSwiperServerSession::Handle_CancelInsert(SpOnewayCallContext<CardSwiperService_CancelInsert_Info>::Pointer ctx)
- {
- LOG_FUNCTION();
- m_pEntity->CancelInsert(ctx);
- }
- void CardSwiperServerSession::Handle_Eject(SpReqAnsContext<CardSwiperService_Eject_Req, CardSwiperService_Eject_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- m_pEntity->Eject(ctx);
- }
- void CardSwiperServerSession::Handle_QueryCardInfo(SpReqAnsContext<CardSwiperService_QueryCardInfo_Req, CardSwiperService_QueryCardInfo_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- m_pEntity->QueryCardInfo(ctx);
- }
- void CardSwiperServerSession::Handle_MagTransferInit(SpReqAnsContext<CardSwiperService_MagTransferInit_Req, CardSwiperService_MagTransferInit_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- m_pEntity->MagTransferInit(ctx);
- }
- void CardSwiperServerSession::Handle_QueryConnInfo(SpReqAnsContext<CardSwiperService_QueryConnInfo_Req, CardSwiperService_QueryConnInfo_Ans>::Pointer ctx)
- {
- m_pEntity->QueryConnInfo(ctx);
- }
- void CardSwiperServerSession::Handle_InsertWaitMore(SpOnewayCallContext<CardSwiperService_InsertWaitMore_Info>::Pointer ctx)
- {
- LOG_FUNCTION();
- m_pEntity->InsertWaitMore(ctx);
- }
- void CardSwiperServerSession::Handle_QueryFWBList(SpReqAnsContext<CardSwiperService_QueryFWBList_Req, CardSwiperService_QueryFWBList_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- m_pEntity->QueryFWBList(ctx);
- }
- void CardSwiperServerSession::Handle_BindFWB(SpReqAnsContext<CardSwiperService_BindFWB_Req, CardSwiperService_BindFWB_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- 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)
- {
- 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()
|