浏览代码

Z991239-6033 #comment feat: 修复读卡问题

Signed-Off-By: commit-hook
刘文涛80174520 7 月之前
父节点
当前提交
655d8db379
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      Module/mod_ContactlessCard/mod_ContactlessCard.h

+ 5 - 4
Module/mod_ContactlessCard/mod_ContactlessCard.h

@@ -34,7 +34,7 @@ private:
 	CContactlessCardEntity* m_pEntity;
 };
 
-class CContactlessCardEntity : public CDevAdptEntityBase
+class CContactlessCardEntity : public CDevAdptEntityBase, public ISysVarListener
 {
 public:
 	CContactlessCardEntity()
@@ -47,6 +47,7 @@ public:
 		LOG_FUNCTION();
 
 		ErrorCodeEnum eStart = m_fsm.Init(this);
+		GetFunction()->RegistSysVarEvent("UIState", this);
 		pTransactionContext->SendAnswer(Error_Succeed);
 	}
 
@@ -189,7 +190,7 @@ public:
 		if (!m_fsm.GetDevInitFlag()) {
 			ctx->Answer(Error_DevNotAvailable, ContactlessCard_UserErrorCode_DevOpen_Failed);
 		}
-		else if (_stricmp(m_fsm.GetCurrStateName(), "Hold") != 0) {
+		else if (_stricmp(m_fsm.GetCurrStateName(), "Idle") != 0) {
 			DWORD errCode = m_fsm.GetFsmStateErrCode();
 			int state = m_fsm.GetFSMState();
 			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("ReadJS req is unhandled ,CurrState=%d", state);
@@ -208,7 +209,7 @@ public:
 		if (!m_fsm.GetDevInitFlag()) {
 			ctx->Answer(Error_DevNotAvailable, ContactlessCard_UserErrorCode_DevOpen_Failed);
 		}
-		else if (_stricmp(m_fsm.GetCurrStateName(), "Hold") != 0) {
+		else if (_stricmp(m_fsm.GetCurrStateName(), "Idle") != 0) {
 			DWORD errCode = m_fsm.GetFsmStateErrCode();
 			int state = m_fsm.GetFSMState();
 			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("PostOnlineJS req is unhandled ,CurrState=%d", state);
@@ -227,7 +228,7 @@ public:
 		if (!m_fsm.GetDevInitFlag()) {
 			ctx->Answer(Error_DevNotAvailable, ContactlessCard_UserErrorCode_DevOpen_Failed);
 		}
-		else if (_stricmp(m_fsm.GetCurrStateName(), "Hold") != 0) {
+		else if (_stricmp(m_fsm.GetCurrStateName(), "Idle") != 0) {
 			DWORD errCode = m_fsm.GetFsmStateErrCode();
 			int state = m_fsm.GetFSMState();
 			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("EjectJS req is unhandled ,CurrState=%d", state);