12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- #include "stdafx.h"
- #include "mod_IDCertificate.h"
- void IDCertServerSession::Handle_CancelRead(SpOnewayCallContext<IDCert_CancelRead_Info>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("CancelRead")("Handle_CancelRead");
- m_pEntity->CancelRead(ctx);
- }
- void IDCertServerSession::Handle_ReadWaitMore(SpOnewayCallContext<IDCert_ReadWaitMore_Info>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("ReadWaitMore")("Handle_ReadWaitMore");
- m_pEntity->ReadWaitMore(ctx);
- }
- void IDCertServerSession::Handle_GetDevInfo(SpReqAnsContext<IDCert_GetDevInfo_Req, IDCert_GetDevInfo_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("GetDevInfo")("Handle_GetDevInfo");
- m_pEntity->GetDevInfo(ctx);
- }
- void IDCertServerSession::Handle_Exit(SpOnewayCallContext<IDCert_Exit_Info>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("Exit")("Handle_Exit");
- m_pEntity->Exit(ctx);
- }
- void IDCertServerSession::Handle_Eject(SpReqAnsContext<IDCert_Eject_Req, IDCert_Eject_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("Eject")("Handle_Eject");
- m_pEntity->Eject(ctx);
- }
- void IDCertServerSession::Handle_ReadAndScan(SpReqAnsContext<IDCert_ReadAndScan_Req, IDCert_ReadAndScan_Ans>::Pointer ctx)
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- LOG_FUNCTION();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("ReadAndScan")("Handle_ReadAndScan");
- m_pEntity->ReadAndScan(ctx);
- }
- void IDCertServerSession::Handle_ReadAndScanUTF8(SpReqAnsContext<IDCert_ReadAndScanUTF8_Req, IDCert_ReadAndScanUTF8_Ans>::Pointer ctx) //ex1
- {
- DbgToBeidou(ctx->link, __FUNCTION__)();
- LOG_FUNCTION();
- DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setAPI("ReadAndScanUTF8")("Handle_ReadAndScanUTF8");
- m_pEntity->ReadAndScanUTF8(ctx);
- }
- #ifdef RVC_OS_WIN
- void CIDCertEntity::OnSysVarEvent(const char* pszKey,
- const char* pszValue, const char* pszOldValue, const char* pszEntityName)
- {
- if ((_strnicmp(pszKey, "FWBReConn", strlen("FWBReConn")) == 0))
- {
- DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("OnSysVarEvent FWBReConn:%s", pszValue);
- //"Y":open suc "U":unbind
- if (_strnicmp(pszValue, "Y", strlen("Y")) == 0 || _strnicmp(pszValue, "U", strlen("U")) == 0)
- {
- FSMEvent* e = new FSMEvent(USER_EVT_TODO_INIT);
- m_fsm.PostEventFIFO(e);
- }
- else if (_strnicmp(pszValue, "D", strlen("D")) == 0)
- {
- if (m_fsm.GetReadFlag())
- {
- DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_USER).setLogCode("QLR040220106").setResultCode("RTA2103")("FWB disconnected while reading IDCard.");
- CSimpleStringA xTmpDevNo("");
- GetFunction()->GetSysVar("FWBDevSN", xTmpDevNo);
- LogError(Severity_Middle, Error_Unexpect, IDCertificate_UserErrorCode_Reading_Disconnected, CSimpleStringA::Format("%s disconnected while reading IDCard.",xTmpDevNo.GetData()));
- }
- m_fsm.ResetDevInitFlag();
- }
- }
- }
- #endif // !RVC_OS_WIN
- SP_BEGIN_ENTITY_MAP()
- SP_ENTITY(CIDCertEntity)
- SP_END_ENTITY_MAP()
|