#include "stdafx.h" #include "mod_gpio.h" void CGpioServiceSession::Handle_GetDevInfo(SpReqAnsContext::Pointer ctx) { DbgToBeidou(ctx->link, __FUNCTION__)(); m_pEntity->GetDevInfo(ctx); } void CGpioServiceSession::Handle_Exit(SpOnewayCallContext::Pointer ctx) { DbgToBeidou(ctx->link, __FUNCTION__)(); m_pEntity->Exit(ctx); } void CGpioEntity::OnPreStart(CAutoArray strArgs, CSmartPointer pTransactionContext) { ErrorCodeEnum erroCode = m_fsm.Init(this); GetFunction()->RegistSysVarEvent("UIState", this); if (erroCode == Error_Succeed) { DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Gpio open succeeded."); DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("subscribelog..."); //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_uuidDD, this, Log_Event, Severity_Middle, Error_IgnoreAll, -1, "DeviceControl"); 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"); DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("sub ok..."); m_fsm.AfterInit(); } else { DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("gpio open failed: %s.", SpStrError(erroCode)); } pTransactionContext->SendAnswer(Error_Succeed); } void CGpioEntity::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, 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()