123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- #include "stdafx.h"
- #include "mod_gpio.h"
- void CGpioServiceSession::Handle_GetDevInfo(SpReqAnsContext<GpioService_GetDevInfo_Req,
- GpioService_GetDevInfo_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- m_pEntity->GetDevInfo(ctx);
- }
- void CGpioServiceSession::Handle_Exit(SpOnewayCallContext<GpioService_Exit_Info>::Pointer ctx)
- {
- m_pEntity->Exit(ctx);
- }
- void CGpioEntity::OnPreStart(CAutoArray<CSimpleStringA> strArgs, CSmartPointer<ITransactionContext> pTransactionContext)
- {
- ErrorCodeEnum erroCode = m_fsm.Init(this);
- GetFunction()->RegistSysVarEvent("UIState", this);
- if (erroCode == Error_Succeed) {
- DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("Gpio open succeeded.");
- //oiltmp the subscribelog should distinct machine type?
- GetFunction()->SubscribeLog(m_uuidHealth, this, Log_Event, Severity_Middle, Error_IgnoreAll, -1, "HealthManager");
- GetFunction()->SubscribeLog(m_uuidIDC, this, Log_Event, Severity_Middle, Error_IgnoreAll, -1, "IDCertificate");
- GetFunction()->SubscribeLog(m_uuidFP, this, Log_Event, Severity_Middle, Error_IgnoreAll, -1, "FingerPrint");
- GetFunction()->SubscribeLog(m_uuidKB, this, Log_Event, Severity_Middle, Error_IgnoreAll, -1, "PinPad");
- GetFunction()->SubscribeLog(m_uuidCR, this, Log_Event, Severity_Middle, Error_IgnoreAll, -1, "CardIssuerStand");
- GetFunction()->SubscribeLog(m_uuidCA, this, Log_Event, Severity_Middle, Error_IgnoreAll, -1, "CustomerAware");
- GetFunction()->SubscribeLog(m_uuidCC, this, Log_Event, Severity_Middle, Error_IgnoreAll, -1, "ContactlessCard");
- GetFunction()->SubscribeLog(m_uuidCS, this, Log_Event, Severity_Middle, Error_IgnoreAll, -1, "CardIssuerStore");
- GetFunction()->SubscribeLog(m_uuidHSPscanner, this, Log_Event, Severity_Middle, Error_IgnoreAll, -1, "HSPScanner");
- m_fsm.AfterInit();
- }
- else
- {
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("init gpio failed: %s", SpStrError(erroCode));
- }
- pTransactionContext->SendAnswer(Error_Succeed);
- }
- void CGpioEntity::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)
- {
- m_fsm.OnLogEvent(dwUserCode);
- }
- void CGpioEntity::OnSysVarEvent(const char* pszKey, const char* pszValue, const char* pszOldValue, const char* pszEntityName)
- {
- if ((_strnicmp(pszKey, "UIState", strlen("UIState")) == 0))
- {
- m_fsm.OnUIState4SetWhatPage(pszValue);
- }
- }
- SP_BEGIN_ENTITY_MAP()
- SP_ENTITY(CGpioEntity)
- SP_END_ENTITY_MAP()
|