123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393 |
- #include "CardReadAdapter_server_g.h"
- #include "CardReadAdapter_def_g.h"
- #include "CardReadAdapterFSM.h"
- using namespace CardReadAdapter;
- class CCardReadAdapterEntity;
- class CardReadAdapterServerSession : public CardReadAdapterService_ServerSessionBase
- {
- public:
- CardReadAdapterServerSession(CCardReadAdapterEntity* pEntity):m_pEntity(pEntity){}
- virtual ~CardReadAdapterServerSession(){}
- virtual void Handle_Read(SpReqAnsContext<CardReadAdapterService_Read_Req, CardReadAdapterService_Read_Ans>::Pointer ctx);
- virtual void Handle_CancelRead(SpOnewayCallContext<CardReadAdapterService_CancelRead_Info>::Pointer ctx);
- virtual void Handle_ReadWaitMore(SpOnewayCallContext<CardReadAdapterService_ReadWaitMore_Info>::Pointer ctx);
- virtual void Handle_Capture(SpReqAnsContext<CardReadAdapterService_Capture_Req, CardReadAdapterService_Capture_Ans>::Pointer ctx);
- virtual void Handle_Eject(SpReqAnsContext<CardReadAdapterService_Eject_Req, CardReadAdapterService_Eject_Ans>::Pointer ctx);
- virtual void Handle_PreOnline(SpReqAnsContext<CardReadAdapterService_PreOnline_Req, CardReadAdapterService_PreOnline_Ans>::Pointer ctx);
- virtual void Handle_PostOnline(SpReqAnsContext<CardReadAdapterService_PostOnline_Req, CardReadAdapterService_PostOnline_Ans>::Pointer ctx);
- virtual void Handle_Exit(SpOnewayCallContext<CardReadAdapterService_Exit_Info>::Pointer ctx);
- virtual void Handle_QueryCardInfo(SpReqAnsContext<CardReadAdapterService_QueryCardInfo_Req, CardReadAdapterService_QueryCardInfo_Ans>::Pointer ctx);
- virtual void Handle_WriteTrack(SpReqAnsContext<CardReadAdapterService_WriteTrack_Req, CardReadAdapterService_WriteTrack_Ans>::Pointer ctx);
- virtual void Handle_SetSomeFlag(SpReqAnsContext<CardReadAdapterService_SetSomeFlag_Req, CardReadAdapterService_SetSomeFlag_Ans>::Pointer ctx);
- virtual void Handle_Issue(SpReqAnsContext<CardReadAdapterService_Issue_Req, CardReadAdapterService_Issue_Ans>::Pointer ctx);
- virtual void Handle_GetDevInfo(SpReqAnsContext<CardReadAdapterService_GetDevInfo_Req, CardReadAdapterService_GetDevInfo_Ans>::Pointer ctx);
- virtual void Handle_GetMaterialCount(SpReqAnsContext<CardReadAdapterService_GetMaterialCount_Req, CardReadAdapterService_GetMaterialCount_Ans>::Pointer ctx);
- virtual void Handle_SetMaterialCount(SpReqAnsContext<CardReadAdapterService_SetMaterialCount_Req, CardReadAdapterService_SetMaterialCount_Ans>::Pointer ctx);
- virtual void Handle_GetSCIInfo(SpReqAnsContext<CardReadAdapterService_GetSCIInfo_Req, CardReadAdapterService_GetSCIInfo_Ans>::Pointer ctx);
- virtual void Handle_OpenSafeLock(SpReqAnsContext<CardReadAdapterService_OpenSafeLock_Req, CardReadAdapterService_OpenSafeLock_Ans>::Pointer ctx);
- virtual void Handle_MagTransferInit(SpReqAnsContext<CardReadAdapterService_MagTransferInit_Req, CardReadAdapterService_MagTransferInit_Ans>::Pointer ctx);
- virtual void Handle_QueryConnInfo(SpReqAnsContext<CardReadAdapterService_QueryConnInfo_Req, CardReadAdapterService_QueryConnInfo_Ans>::Pointer ctx);
- virtual void Handle_SAMICCommand(SpReqAnsContext<CardReadAdapterService_SAMICCommand_Req, CardReadAdapterService_SAMICCommand_Ans>::Pointer ctx);
- virtual void Handle_QueryPrinterStatus(SpReqAnsContext<CardReadAdapterService_QueryPrinterStatus_Req, CardReadAdapterService_QueryPrinterStatus_Ans>::Pointer ctx);
- virtual void Handle_Print(SpReqAnsContext<CardReadAdapterService_Print_Req, CardReadAdapterService_Print_Ans>::Pointer ctx);
- virtual void Handle_QuerySCIList(SpReqAnsContext<CardReadAdapterService_QuerySCIList_Req, CardReadAdapterService_QuerySCIList_Ans>::Pointer ctx);
- virtual void Handle_BindSCI(SpReqAnsContext<CardReadAdapterService_BindSCI_Req, CardReadAdapterService_BindSCI_Ans>::Pointer ctx);
- virtual void Handle_PreOnlineOnStore(SpReqAnsContext<CardReadAdapterService_PreOnlineOnStore_Req, CardReadAdapterService_PreOnlineOnStore_Ans>::Pointer ctx);
- virtual void Handle_NotifyPreonline(SpReqAnsContext<CardReadAdapterService_NotifyPreonline_Req, CardReadAdapterService_NotifyPreonline_Ans>::Pointer ctx);
- virtual void Handle_QueryCardInfoOnStore(SpReqAnsContext<CardReadAdapterService_QueryCardInfoOnStore_Req, CardReadAdapterService_QueryCardInfoOnStore_Ans>::Pointer ctx);
- virtual void Handle_GetAddCardInfo(SpReqAnsContext<CardReadAdapterService_GetAddCardInfo_Req, CardReadAdapterService_GetAddCardInfo_Ans>::Pointer ctx);
- virtual void Handle_Test1(SpReqAnsContext<CardReadAdapterService_Test1_Req, CardReadAdapterService_Test1_Ans>::Pointer ctx);
- virtual void Handle_Test2(SpReqAnsContext<CardReadAdapterService_Test2_Req, CardReadAdapterService_Test2_Ans>::Pointer ctx);
- virtual void Handle_CrossTermCall(SpReqAnsContext<CardReadAdapterService_CrossTermCall_Req, CardReadAdapterService_CrossTermCall_Ans>::Pointer ctx);
- virtual void Handle_CrossTermInvokeInfo(SpOnewayCallContext<CardReadAdapterService_CrossTermInvokeInfo_Info>::Pointer ctx);
- virtual void Handle_PrintCardImmediately(SpReqAnsContext<CardReadAdapterService_PrintCardImmediately_Req, CardReadAdapterService_PrintCardImmediately_Ans>::Pointer ctx);
- virtual void Handle_QueryCIStatus(SpReqAnsContext<CardReadAdapterService_QueryCIStatus_Req, CardReadAdapterService_QueryCIStatus_Ans>::Pointer ctx);
- private:
- CCardReadAdapterEntity* m_pEntity;
- };
- class CCardReadAdapterEntity : public CEntityBase,public IBroadcastListener
- {
- public:
- CCardReadAdapterEntity() :bInitialized(false),m_msgMaxInterval(5000)//, m_bCIMsg(false), m_bCCMsg(false), m_bCSMsg(false)
- {
- //MessageBoxA(NULL, "", "", MB_OK);
- }
- virtual ~CCardReadAdapterEntity(){}
- virtual const char *GetEntityName() const { return "CardReadAdapter"; }
- virtual void OnPreStart(CAutoArray<CSimpleStringA> strArgs,CSmartPointer<ITransactionContext> pTransactionContext)
- {
- LOG_FUNCTION();
- //MessageBoxA(0,0,0,0);
- ErrorCodeEnum eStart = m_fsm.Init(this);
- if (eStart == Error_Succeed)
- {
- DoStart();
- GetFunction()->SubscribeBroadcast("CardIssuerStand", "", this, m_uuidCIMsg);
- GetFunction()->SubscribeBroadcast("CardIssuerStore", "", this, m_uuidCISMsg);
- GetFunction()->SubscribeBroadcast("ContactlessCard", "", this, m_uuidCCMsg);
- }
- pTransactionContext->SendAnswer(eStart);
- }
- virtual void OnPreClose(EntityCloseCauseEnum eCloseCause,CSmartPointer<ITransactionContext> pTransactionContext)
- {
- ErrorCodeEnum Error = __OnStart(Error_Succeed);
- pTransactionContext->SendAnswer(Error);
- }
- virtual void OnPrePause(CSmartPointer<ITransactionContext> pTransactionContext)
- {
- ErrorCodeEnum Error = __OnPause(Error_Succeed);
- pTransactionContext->SendAnswer(Error);
- }
- virtual ErrorCodeEnum __OnStart(ErrorCodeEnum preOperationError)
- {
- return Error_Succeed;
- }
- virtual ErrorCodeEnum __OnPause(ErrorCodeEnum preOperationError)
- {
- return Error_Succeed;
- }
- virtual ErrorCodeEnum __OnClose(ErrorCodeEnum preOperationError)
- {
- return Error_Succeed;
- }
- virtual void OnSelfTest(EntityTestEnum eTestType,CSmartPointer<ITransactionContext> pTransactionContext)
- {
- m_fsm.SelfTest(eTestType,pTransactionContext);
- }
- virtual CServerSessionBase* OnNewSession(const char*,const char*)
- {
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("A new connecting request arrived.");
- m_bNewSessionInit = true;
- return new CardReadAdapterServerSession(this);
- }
- bool Init()
- {
- }
- void Read(SpReqAnsContext<CardReadAdapterService_Read_Req, CardReadAdapterService_Read_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- //oilyang@20210125 add:query current FSM state ,then post event
- int xFSM, xS2Evt, xS2EvtParam1;
- xFSM = xS2Evt = xS2EvtParam1 = 0;
- m_fsm.QueryCurrFSMAndLastS2EventInfo(xFSM, xS2Evt, xS2EvtParam1);
- CSimpleStringA msg = CSimpleStringA::Format("While FSM is in state:%d lastS2evt:%d,param1:%d,a new Read req arrived."
- , xFSM, xS2Evt, xS2EvtParam1);
- //3:Working 4:Failed
- if (xFSM == 3)
- {
- ctx->Answer(Error_InvalidState, CardReadAdapter_UserErrorCode_Read_Wrong_In_Working);
- LogWarn(Severity_Middle, Error_InvalidState, CardReadAdapter_UserErrorCode_Read_Wrong_In_Working, (LPCTSTR)msg);
- }
- else if (xFSM == 4)
- {
- ctx->Answer(Error_InvalidState, CardReadAdapter_UserErrorCode_Read_Wrong_In_Failed);
- LogWarn(Severity_Middle, Error_InvalidState, CardReadAdapter_UserErrorCode_Read_Wrong_In_Failed, (LPCTSTR)msg);
- }
- else
- {
- CardReadEvent* e = new CardReadEvent();
- e->ctx = ctx;
- m_fsm.PostEventFIFO(e);
- }
- }
- void Capture(SpReqAnsContext<CardReadAdapterService_Capture_Req, CardReadAdapterService_Capture_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- CardCaptureEvent* e = new CardCaptureEvent();
- e->ctx = ctx;
- m_fsm.PostEventFIFO(e);
- }
- void Eject(SpReqAnsContext<CardReadAdapterService_Eject_Req, CardReadAdapterService_Eject_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- CardEjectEvent* e = new CardEjectEvent();
- e->ctx = ctx;
- m_fsm.PostEventFIFO(e);
- }
- void CancelRead(SpOnewayCallContext<CardReadAdapterService_CancelRead_Info>::Pointer ctx)
- {
- LOG_FUNCTION();
- CancelReadEvent* e = new CancelReadEvent();
- m_fsm.PostEventFIFO(e);
- }
- void ReadWaitMore(SpOnewayCallContext<CardReadAdapterService_ReadWaitMore_Info>::Pointer ctx)
- {
- LOG_FUNCTION();
- ReadWaitMoreEvent* e = new ReadWaitMoreEvent();
- m_fsm.PostEventFIFO(e);
- }
- void Issue(SpReqAnsContext<CardReadAdapterService_Issue_Req, CardReadAdapterService_Issue_Ans>::Pointer ctx)
- {
- m_bNewSessionInit = false;
- CardIssueEvent *pEvt = new CardIssueEvent();
- pEvt->ctx = ctx;
- m_fsm.PostEventFIFO(pEvt);
- }
- void PreOnline(SpReqAnsContext<CardReadAdapterService_PreOnline_Req, CardReadAdapterService_PreOnline_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- if (m_fsm.GetCurrState()->id == 3)
- {
- ctx->Answer(Error_DevNotAvailable, CardReadAdapter_UserErrorCode_CardIssuer_Is_Working);
- LogWarn(Severity_Middle, Error_DevNotAvailable, CardReadAdapter_UserErrorCode_CardIssuer_Is_Working, "CardReadAdapter is working,duplicated call.");
- }
- else
- {
- PreOnlineEvent* e = new PreOnlineEvent();
- e->ctx = ctx;
- m_fsm.PostEventFIFO(e);
- }
- }
- void PostOnline(SpReqAnsContext<CardReadAdapterService_PostOnline_Req, CardReadAdapterService_PostOnline_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- PostOnlineEvent* e = new PostOnlineEvent();
- e->ctx = ctx;
- m_fsm.PostEventFIFO(e);
- }
- void Exit(SpOnewayCallContext<CardReadAdapterService_Exit_Info>::Pointer ctx)
- {
- LOG_FUNCTION();
- m_bNewSessionInit = false;
- FSMEvent* evt = new FSMEvent(USER_EVT_EXIT);
- m_fsm.PostEventFIFO(evt);
- }
- void QueryCardInfo(SpReqAnsContext<CardReadAdapterService_QueryCardInfo_Req, CardReadAdapterService_QueryCardInfo_Ans>::Pointer ctx)
- {
- int xFSM, xS2Evt, xS2EvtParam1;
- xFSM = xS2Evt = xS2EvtParam1 = 0;
- m_fsm.QueryCurrFSMAndLastS2EventInfo(xFSM, xS2Evt, xS2EvtParam1);
- CSimpleStringA msg = CSimpleStringA::Format("While FSM is in state:%d lastS2evt:%d,param1:%d,a new QueryCardInfo req arrived."
- , xFSM, xS2Evt, xS2EvtParam1);
- //3:Working 4:Failed
- if (xFSM == 3)
- {
- ctx->Answer(Error_InvalidState, CardReadAdapter_UserErrorCode_QueryCardInfo_Wrong_In_Working);
- LogWarn(Severity_Middle, Error_InvalidState, CardReadAdapter_UserErrorCode_QueryCardInfo_Wrong_In_Working, (LPCTSTR)msg);
- }
- else if (xFSM == 4)
- {
- ctx->Answer(Error_InvalidState, CardReadAdapter_UserErrorCode_QueryCardInfo_Wrong_In_Failed);
- LogWarn(Severity_Middle, Error_InvalidState, CardReadAdapter_UserErrorCode_QueryCardInfo_Wrong_In_Failed, (LPCTSTR)msg);
- }
- else
- {
- QueryCardInfoEvent* pEvt = new QueryCardInfoEvent();
- pEvt->ctx = ctx;
- m_fsm.PostEventFIFO(pEvt);
- }
- }
- void WriteTrack(SpReqAnsContext<CardReadAdapterService_WriteTrack_Req, CardReadAdapterService_WriteTrack_Ans>::Pointer ctx)
- {
- CardWriteEvent *pEvt = new CardWriteEvent();
- pEvt->ctx = ctx;
- m_fsm.PostEventFIFO(pEvt);
- }
- void SetSomeFlag(SpReqAnsContext<CardReadAdapterService_SetSomeFlag_Req, CardReadAdapterService_SetSomeFlag_Ans>::Pointer ctx)
- {
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER)("set issue flag to %d.", ctx->Req.IssueBusiness);
- if (ctx->Req.reserved1.GetCount() > 0)
- DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER)("hoppernum:%d", ctx->Req.reserved1[0]);
- SetSomeFlagEvent *pEvt = new SetSomeFlagEvent();
- pEvt->ctx = ctx;
- m_fsm.PostEventFIFO(pEvt);
- }
- void GetMaterialCount(SpReqAnsContext<CardReadAdapterService_GetMaterialCount_Req, CardReadAdapterService_GetMaterialCount_Ans>::Pointer ctx)
- {
- GetMaterialEvent *pEvt = new GetMaterialEvent();
- pEvt->ctx = ctx;
- m_fsm.PostEventFIFO(pEvt);
- }
- void SetMaterialCount(SpReqAnsContext<CardReadAdapterService_SetMaterialCount_Req, CardReadAdapterService_SetMaterialCount_Ans>::Pointer ctx)
- {
- SetMaterialEvent *pEvt = new SetMaterialEvent();
- pEvt->ctx = ctx;
- m_fsm.PostEventFIFO(pEvt);
- }
- void GetSCIInfo(SpReqAnsContext<CardReadAdapterService_GetSCIInfo_Req, CardReadAdapterService_GetSCIInfo_Ans>::Pointer ctx)
- {
- GetSCIInfoEvent *pEvt = new GetSCIInfoEvent();
- pEvt->ctx = ctx;
- m_fsm.PostEventFIFO(pEvt);
- }
- void OpenSafeLock(SpReqAnsContext<CardReadAdapterService_OpenSafeLock_Req, CardReadAdapterService_OpenSafeLock_Ans>::Pointer ctx)
- {
- OpenSafeLockEvent *pEvt = new OpenSafeLockEvent();
- pEvt->ctx = ctx;
- m_fsm.PostEventFIFO(pEvt);
- }
- void MagTransferInit(SpReqAnsContext<CardReadAdapterService_MagTransferInit_Req, CardReadAdapterService_MagTransferInit_Ans>::Pointer ctx)
- {
- MagTransferInitEvent *pEvt = new MagTransferInitEvent();
- pEvt->ctx = ctx;
- m_fsm.PostEventFIFO(pEvt);
- }
- void QueryConnInfo(SpReqAnsContext<CardReadAdapterService_QueryConnInfo_Req, CardReadAdapterService_QueryConnInfo_Ans>::Pointer ctx)
- {
- QueryConnInfoEvent *pEvt = new QueryConnInfoEvent();
- pEvt->ctx = ctx;
- m_fsm.PostEventFIFO(pEvt);
- }
- void SAMICCommand(SpReqAnsContext<CardReadAdapterService_SAMICCommand_Req, CardReadAdapterService_SAMICCommand_Ans>::Pointer ctx)
- {
- SAMICCommandEvent *pEvt = new SAMICCommandEvent();
- pEvt->ctx = ctx;
- m_fsm.PostEventFIFO(pEvt);
- }
- void QueryPrinterStatus(SpReqAnsContext<CardReadAdapterService_QueryPrinterStatus_Req, CardReadAdapterService_QueryPrinterStatus_Ans>::Pointer ctx)
- {
- QueryPrinterStatusEvent *pEvt = new QueryPrinterStatusEvent();
- pEvt->ctx = ctx;
- m_fsm.PostEventFIFO(pEvt);
- }
- void Print(SpReqAnsContext<CardReadAdapterService_Print_Req, CardReadAdapterService_Print_Ans>::Pointer ctx)
- {
- PrintEvent *pEvt = new PrintEvent();
- pEvt->ctx = ctx;
- m_fsm.PostEventFIFO(pEvt);
- }
- void QuerySCIList(SpReqAnsContext<CardReadAdapterService_QuerySCIList_Req, CardReadAdapterService_QuerySCIList_Ans>::Pointer ctx)
- {
- QuerySCIListEvent *pEvt = new QuerySCIListEvent();
- pEvt->ctx = ctx;
- m_fsm.PostEventFIFO(pEvt);
- }
- void BindSCI(SpReqAnsContext<CardReadAdapterService_BindSCI_Req, CardReadAdapterService_BindSCI_Ans>::Pointer ctx)
- {
- BindSCIEvent *pEvt = new BindSCIEvent();
- pEvt->ctx = ctx;
- m_fsm.PostEventFIFO(pEvt);
- }
- void PreOnlineOnStore(SpReqAnsContext<CardReadAdapterService_PreOnlineOnStore_Req, CardReadAdapterService_PreOnlineOnStore_Ans>::Pointer ctx)
- {
- PreOnlineOnStoreEvent *pEvt = new PreOnlineOnStoreEvent();
- pEvt->ctx = ctx;
- m_fsm.PostEventFIFO(pEvt);
- }
- void NotifyPreonline(SpReqAnsContext<CardReadAdapterService_NotifyPreonline_Req, CardReadAdapterService_NotifyPreonline_Ans>::Pointer ctx)
- {
- NotifyPreonlineEvent *pEvt = new NotifyPreonlineEvent();
- pEvt->ctx = ctx;
- m_fsm.PostEventFIFO(pEvt);
- }
- void QueryCardInfoOnStore(SpReqAnsContext<CardReadAdapterService_QueryCardInfoOnStore_Req, CardReadAdapterService_QueryCardInfoOnStore_Ans>::Pointer ctx)
- {
- QueryCardInfoOnStoreEvent *pEvt = new QueryCardInfoOnStoreEvent();
- pEvt->ctx = ctx;
- m_fsm.PostEventFIFO(pEvt);
- }
- void GetAddCardInfo(SpReqAnsContext<CardReadAdapterService_GetAddCardInfo_Req, CardReadAdapterService_GetAddCardInfo_Ans>::Pointer ctx)
- {
- GetAddCardInfoEvent *pEvt = new GetAddCardInfoEvent();
- pEvt->ctx = ctx;
- m_fsm.PostEventFIFO(pEvt);
- }
- void CrossTermCall(SpReqAnsContext<CardReadAdapterService_CrossTermCall_Req, CardReadAdapterService_CrossTermCall_Ans>::Pointer ctx)
- {
- CrossTermCallEvent *pEvt = new CrossTermCallEvent();
- pEvt->ctx = ctx;
- m_fsm.PostEventFIFO(pEvt);
- }
- void CrossTermInvokeInfo(SpOnewayCallContext<CardReadAdapterService_CrossTermInvokeInfo_Info>::Pointer ctx)
- {
- m_fsm.CrossTermInvokeInfo(ctx);
- }
- void PrintCardImmediately(SpReqAnsContext<CardReadAdapterService_PrintCardImmediately_Req, CardReadAdapterService_PrintCardImmediately_Ans>::Pointer ctx)
- {
- PrintCardImEvent* pEvt = new PrintCardImEvent();
- pEvt->ctx = ctx;
- m_fsm.PostEventFIFO(pEvt);
- }
- void QueryCIStatus(SpReqAnsContext<CardReadAdapterService_QueryCIStatus_Req, CardReadAdapterService_QueryCIStatus_Ans>::Pointer ctx)
- {
- QueryCIStatusEvent* pEvt = new QueryCIStatusEvent();
- pEvt->ctx = ctx;
- m_fsm.PostEventFIFO(pEvt);
- }
- void GetDevInfo(SpReqAnsContext<CardReadAdapterService_GetDevInfo_Req, CardReadAdapterService_GetDevInfo_Ans>::Pointer ctx)
- {
- GetDevInfoEvent *pEvt = new GetDevInfoEvent();
- pEvt->ctx = ctx;
- m_fsm.PostEventFIFO(pEvt);
- }
-
- virtual bool IsService()const{return true;}
- virtual bool IsMultiThread()const{return true;}
- virtual void OnBroadcastEvent(CUUID SubID, const char *pszEntityName, DWORD dwMessageId, DWORD dwMessageSignature, CAutoBuffer Buffer);
- void DoBroadMsg(int msgType, int status);
- void DoStart();
- protected:
- private:
-
- CCardReadAdapterFSM m_fsm;
- CUUID m_uuidCIMsg, m_uuidCISMsg, m_uuidCSMsg, m_uuidCCMsg;
- bool bInitialized, m_bNewSessionInit;// , m_bCIMsg, m_bCCMsg, m_bCSMsg;
- int m_msgMaxInterval;
- private:
- };
- struct DoBroadMsgTask : public ITaskSp
- {
- CCardReadAdapterEntity* pEntity;
- int m_msgType;
- int m_status;
- DoBroadMsgTask(CCardReadAdapterEntity* f, int msgType, int status) : pEntity(f),m_msgType(msgType),m_status(status) {}
- void Process()
- {
- pEntity->DoBroadMsg(m_msgType, m_status);
- }
- };
|