123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- // mod_ContactlessCard.cpp : Defines the exported functions for the DLL application.
- //
- #include "stdafx.h"
- #include "mod_ContactlessCard.h"
- //oiltest
- #include "ContactlessCard_msg_g.h"
- bool bCard = false;
- void ContactlessCardServerSession::Handle_Insert(SpReqAnsContext<ContactlessCardService_Insert_Req, ContactlessCardService_Insert_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke Insert");
- m_pEntity->Insert(ctx);
- }
- void ContactlessCardServerSession::Handle_CancelInsert(SpOnewayCallContext<ContactlessCardService_CancelInsert_Info>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke CancelInsert");
- m_pEntity->CancelInsert(ctx);
- }
- void ContactlessCardServerSession::Handle_InsertWaitMore(SpOnewayCallContext<ContactlessCardService_InsertWaitMore_Info>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke InsertWaitMore");
- m_pEntity->InsertWaitMore(ctx);
- }
- void ContactlessCardServerSession::Handle_PreOnline(SpReqAnsContext<ContactlessCardService_PreOnline_Req, ContactlessCardService_PreOnline_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke PreOnline");
- m_pEntity->PreOnline(ctx);
- }
- void ContactlessCardServerSession::Handle_PostOnline(SpReqAnsContext<ContactlessCardService_PostOnline_Req, ContactlessCardService_PostOnline_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke PostOnline");
- m_pEntity->PostOnline(ctx);
- }
- void ContactlessCardServerSession::Handle_Eject(SpReqAnsContext<ContactlessCardService_Eject_Req, ContactlessCardService_Eject_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke Eject");
- m_pEntity->Eject(ctx);
- }
- void ContactlessCardServerSession::Handle_Exit(SpOnewayCallContext<ContactlessCardService_Exit_Info>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke Exit");
- m_pEntity->Exit(ctx);
- }
- void ContactlessCardServerSession::Handle_QueryCardInfo(SpReqAnsContext<ContactlessCardService_QueryCardInfo_Req, ContactlessCardService_QueryCardInfo_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke QueryCardInfo");
- m_pEntity->QueryCardInfo(ctx);
- }
- void ContactlessCardServerSession::Handle_GetDevInfo(SpReqAnsContext<ContactlessCardService_GetDevInfo_Req, ContactlessCardService_GetDevInfo_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke GetDevInfo");
- m_pEntity->GetDevInfo(ctx);
- }
- //new interface
- void ContactlessCardServerSession::Handle_CancelReadJS(SpOnewayCallContext<ContactlessCardService_CancelReadJS_Info>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke CancelReadJS");
- m_pEntity->CancelReadJS(ctx);
- }
- void ContactlessCardServerSession::Handle_ReadJS(SpReqAnsContext<ContactlessCardService_ReadJS_Req, ContactlessCardService_ReadJS_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke ReadJS");
- m_pEntity->ReadJS(ctx);
- }
- void ContactlessCardServerSession::Handle_PostOnlineJS(SpReqAnsContext<ContactlessCardService_PostOnlineJS_Req, ContactlessCardService_PostOnlineJS_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke PostOnlineJS");
- m_pEntity->PostOnlineJS(ctx);
- }
- void ContactlessCardServerSession::Handle_EjectJS(SpReqAnsContext<ContactlessCardService_EjectJS_Req, ContactlessCardService_EjectJS_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke EjectJS");
- m_pEntity->EjectJS(ctx);
- }
- void ContactlessCardServerSession::Handle_QueryHasCardJS(SpReqAnsContext<ContactlessCardService_QueryHasCardJS_Req, ContactlessCardService_QueryHasCardJS_Ans>::Pointer ctx)
- {
- LOG_FUNCTION();
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI(__FUNCTION__)("Invoke QueryHasCardJS");
- m_pEntity->QueryHasCardJS(ctx);
- }
- void CContactlessCardEntity::OnSysVarEvent(const char* pszKey, const char* pszValue, const char* pszOldValue, const char* pszEntityName)
- {
- if ((_strnicmp(pszKey, "UIState", strlen("UIState")) == 0))
- {
- m_fsm.OnUIState4SetWhatPage(pszValue);
- if (_strnicmp(pszValue, "M", strlen("M")) == 0) {
- m_fsm.ExitToMainPage();
- }
- }
- }
- SP_BEGIN_ENTITY_MAP()
- SP_ENTITY(CContactlessCardEntity)
- SP_END_ENTITY_MAP()
|