소스 검색

Z991239-4916 #comment pinpad密钥更新同步

oilyang 2 년 전
부모
커밋
dece11ed64
5개의 변경된 파일21개의 추가작업 그리고 359개의 파일을 삭제
  1. 8 1
      Module/mod_pinpad/PinPadFSM.cpp
  2. 0 147
      Module/mod_pinpad/PinPad_client_g.h
  3. 3 87
      Module/mod_pinpad/PinPad_def_g.h
  4. 0 81
      Module/mod_pinpad/PinPad_server_g.h
  5. 10 43
      Module/mod_pinpad/pinpad.xml

+ 8 - 1
Module/mod_pinpad/PinPadFSM.cpp

@@ -1350,7 +1350,12 @@ ErrorCodeEnum CPinPadFSM::GetCheckCode(SpReqAnsContext<PinPadService_GetCheckCod
 		if (ctx->Req.mSN[i] == 1)
 			eErr = m_hDevHelper->SetParam(EPP_PT_SET_ENCRYPT_METHOD, EPP_ALGO_METHOD_SM4);
 		else
-			eErr = m_hDevHelper->SetParam(EPP_PT_SET_ENCRYPT_METHOD, EPP_ALGO_METHOD_3DES);
+		{
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER).setLogCode(PinPadService_LogCode_GetCheckCode).setResultCode("RTA260B")("mSN:%d", ctx->Req.mSN[i]);
+			ctx->Ans.checkcode[i] = "";
+			ctx->Ans.index[i] = "";
+			continue;
+		}
 		if (eErr == Error_Succeed)
 			eErr = m_hDevHelper->SetParam(EPP_PT_SET_ECB_CBC_MODE, EPP_ALGO_MODE_CBC);
 		else
@@ -1391,6 +1396,8 @@ ErrorCodeEnum CPinPadFSM::GetCheckCode(SpReqAnsContext<PinPadService_GetCheckCod
 				return Error_DevCommFailed;
 			}
 			ctx->Ans.checkcode[i] = (const char*)dstInfo.data;
+			if (ctx->Req.wSN[i] == 0)
+				ctx->Ans.index[i] = m_keySNSM;
 		}
 	}
 	DbgWithLink(LOG_LEVEL_INFO, ctx->link.checkEmpty() ? LOG_TYPE_SYSTEM : LOG_TYPE_USER).setLogCode("QLR040220610")("计算校验码成功");

+ 0 - 147
Module/mod_pinpad/PinPad_client_g.h

@@ -59,55 +59,6 @@ public:
 		return Error;
 	}
 
-	ErrorCodeEnum GetInput(PinPadService_GetInput_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(PinPadService_Method_GetInput, PinPadService_MethodSignature_GetInput, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum GetInput(PinPadService_GetInput_Req &Req, PinPadService_GetInput_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetInput(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum GetInput(PinPadService_GetInput_Req &Req, PinPadService_GetInput_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetInput(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum GetInput(PinPadService_GetInput_Req &Req, PinPadService_GetInput_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetInput(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
 	ErrorCodeEnum InputWaitMore()
 	{
 		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
@@ -150,104 +101,6 @@ public:
 		return ret;
 	}
 
-	ErrorCodeEnum LoadKeys(PinPadService_LoadKeys_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(PinPadService_Method_LoadKeys, PinPadService_MethodSignature_LoadKeys, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum LoadKeys(PinPadService_LoadKeys_Req &Req, PinPadService_LoadKeys_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = LoadKeys(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum LoadKeys(PinPadService_LoadKeys_Req &Req, PinPadService_LoadKeys_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = LoadKeys(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum LoadKeys(PinPadService_LoadKeys_Req &Req, PinPadService_LoadKeys_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = LoadKeys(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
-	ErrorCodeEnum EncryptData(PinPadService_EncryptData_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		CAutoBuffer Buf = SpObject2Buffer(Req);
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		auto ret = pFunc->AsyncRequest(PinPadService_Method_EncryptData, PinPadService_MethodSignature_EncryptData, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum EncryptData(PinPadService_EncryptData_Req &Req, PinPadService_EncryptData_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = EncryptData(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum EncryptData(PinPadService_EncryptData_Req &Req, PinPadService_EncryptData_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = EncryptData(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum EncryptData(PinPadService_EncryptData_Req &Req, PinPadService_EncryptData_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = EncryptData(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			CSimpleString str;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-
 	ErrorCodeEnum GetInputSM(PinPadService_GetInputSM_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
 	{
 		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();

+ 3 - 87
Module/mod_pinpad/PinPad_def_g.h

@@ -12,12 +12,9 @@ namespace PinPad {
 // const goes here
 //
 
-#define PinPadService_Method_GetInput 0
 #define PinPadService_Method_InputWaitMore 1
 #define PinPadService_Method_InputCancel 2
 #define PinPadService_Method_Exit 3
-#define PinPadService_Method_LoadKeys 4
-#define PinPadService_Method_EncryptData 5
 #define PinPadService_Method_GetInputSM 6
 #define PinPadService_Method_LoadKeysSM 7
 #define PinPadService_Method_EncryptDataSM 8
@@ -25,12 +22,9 @@ namespace PinPad {
 #define PinPadService_Method_GetCheckCode 10
 #define PinPadService_Method_GetDevInfo 65535
 
-#define PinPadService_MethodSignature_GetInput 90833662
 #define PinPadService_MethodSignature_InputWaitMore -1387532134
 #define PinPadService_MethodSignature_InputCancel 1552926476
 #define PinPadService_MethodSignature_Exit -1158854104
-#define PinPadService_MethodSignature_LoadKeys -99876521
-#define PinPadService_MethodSignature_EncryptData 68188518
 #define PinPadService_MethodSignature_GetInputSM -1531281659
 #define PinPadService_MethodSignature_LoadKeysSM -2091559314
 #define PinPadService_MethodSignature_EncryptDataSM 1251510330
@@ -38,12 +32,10 @@ namespace PinPad {
 #define PinPadService_MethodSignature_GetCheckCode -1480133527
 #define PinPadService_MethodSignature_GetDevInfo 296205965
 
-#define PinPadService_LogCode_GetInput "QLR040220600"
+
 #define PinPadService_LogCode_InputWaitMore "QLR040220601"
 #define PinPadService_LogCode_InputCancel "QLR040220602"
 #define PinPadService_LogCode_Exit "QLR040220603"
-#define PinPadService_LogCode_LoadKeys "QLR040220604"
-#define PinPadService_LogCode_EncryptData "QLR040220605"
 #define PinPadService_LogCode_GetInputSM "QLR040220606"
 #define PinPadService_LogCode_LoadKeysSM "QLR040220607"
 #define PinPadService_LogCode_EncryptDataSM "QLR040220608"
@@ -51,36 +43,6 @@ namespace PinPad {
 #define PinPadService_LogCode_GetCheckCode "QLR040220610"
 #define PinPadService_LogCode_GetDevInfo "QLR040220699"
 
-struct PinPadService_GetInput_Req
-{
-	int timeout;
-	int length;
-	bool encrypt;
-	bool confirm;
-	CSimpleStringA account;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & timeout & length & encrypt & confirm & account;
-	}
-
-};
-
-struct PinPadService_GetInput_Ans
-{
-	CSimpleStringA data;
-	CSimpleStringA deviceno;
-	CSimpleStringA keyseq;
-	CSimpleStringA checkcode;
-	bool enter;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & data & deviceno & keyseq & checkcode & enter;
-	}
-
-};
-
 struct PinPadService_InputWaitMore_Info
 {
 
@@ -108,53 +70,6 @@ struct PinPadService_Exit_Info
 
 };
 
-struct PinPadService_LoadKeys_Req
-{
-	CSimpleStringA masterkey;
-	CSimpleStringA workingkey1;
-	CSimpleStringA workingkey2;
-	bool initializeflag;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & masterkey & workingkey1 & workingkey2 & initializeflag;
-	}
-
-};
-
-struct PinPadService_LoadKeys_Ans
-{
-	int result;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & result;
-	}
-
-};
-
-struct PinPadService_EncryptData_Req
-{
-	CSimpleStringA data;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & data;
-	}
-
-};
-
-struct PinPadService_EncryptData_Ans
-{
-	CSimpleStringA ciphertext;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & ciphertext;
-	}
-
-};
-
 struct PinPadService_GetInputSM_Req
 {
 	int timeout;
@@ -304,10 +219,11 @@ struct PinPadService_GetCheckCode_Req
 struct PinPadService_GetCheckCode_Ans
 {
 	CAutoArray<CSimpleStringA> checkcode;
+	CAutoArray<CSimpleStringA> index;
 
 	void Serialize(SpBuffer &Buf)
 	{
-		auto & buf = Buf & checkcode;
+		auto & buf = Buf & checkcode & index;
 	}
 
 };

+ 0 - 81
Module/mod_pinpad/PinPad_server_g.h

@@ -30,13 +30,6 @@ public:
 	{
 		ErrorCodeEnum Error = Error_Succeed;
 		switch (dwMessageID) {
-		case PinPadService_Method_GetInput:
-			if (dwSignature == PinPadService_MethodSignature_GetInput) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
 		case PinPadService_Method_InputWaitMore:
 			if (dwSignature == PinPadService_MethodSignature_InputWaitMore) {
 				bOverlap = true;
@@ -58,20 +51,6 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
-		case PinPadService_Method_LoadKeys:
-			if (dwSignature == PinPadService_MethodSignature_LoadKeys) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case PinPadService_Method_EncryptData:
-			if (dwSignature == PinPadService_MethodSignature_EncryptData) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
 		case PinPadService_Method_GetInputSM:
 			if (dwSignature == PinPadService_MethodSignature_GetInputSM) {
 				bOverlap = true;
@@ -125,11 +104,6 @@ public:
 	{
 		ErrorCodeEnum Error = Error_Succeed;
 		switch (dwMessageID) {
-		case PinPadService_Method_GetInput:
-			if (dwSignature != PinPadService_MethodSignature_GetInput) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
 		case PinPadService_Method_InputWaitMore:
 			if (dwSignature != PinPadService_MethodSignature_InputWaitMore) {
 				Error = Error_MethodSignatureFailed;
@@ -145,16 +119,6 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
-		case PinPadService_Method_LoadKeys:
-			if (dwSignature != PinPadService_MethodSignature_LoadKeys) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case PinPadService_Method_EncryptData:
-			if (dwSignature != PinPadService_MethodSignature_EncryptData) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
 		case PinPadService_Method_GetInputSM:
 			if (dwSignature != PinPadService_MethodSignature_GetInputSM) {
 				Error = Error_MethodSignatureFailed;
@@ -192,11 +156,6 @@ public:
 		return Error;
 	}
 
-	virtual void Handle_GetInput(SpReqAnsContext<PinPadService_GetInput_Req, PinPadService_GetInput_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
 	virtual void Handle_InputWaitMore(SpOnewayCallContext<PinPadService_InputWaitMore_Info>::Pointer ctx)
 	{
 	/// override by user
@@ -212,16 +171,6 @@ public:
 	/// override by user
 	}
 
-	virtual void Handle_LoadKeys(SpReqAnsContext<PinPadService_LoadKeys_Req, PinPadService_LoadKeys_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_EncryptData(SpReqAnsContext<PinPadService_EncryptData_Req, PinPadService_EncryptData_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
 	virtual void Handle_GetInputSM(SpReqAnsContext<PinPadService_GetInputSM_Req, PinPadService_GetInputSM_Ans>::Pointer ctx)
 	{
 	/// override by user
@@ -268,16 +217,6 @@ public:
 			}
 #endif
 			switch (dwMessageID) {
-				case PinPadService_Method_GetInput:
-					{
-						SpReqAnsContext<PinPadService_GetInput_Req,PinPadService_GetInput_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<PinPadService_GetInput_Req,PinPadService_GetInput_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_GetInput(ctx);
-					}
-					break;
 				case PinPadService_Method_InputWaitMore:
 					{
 						SpOnewayCallContext<PinPadService_InputWaitMore_Info>::Pointer ctx;
@@ -308,26 +247,6 @@ public:
 						Handle_Exit(ctx);
 					}
 					break;
-				case PinPadService_Method_LoadKeys:
-					{
-						SpReqAnsContext<PinPadService_LoadKeys_Req,PinPadService_LoadKeys_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<PinPadService_LoadKeys_Req,PinPadService_LoadKeys_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_LoadKeys(ctx);
-					}
-					break;
-				case PinPadService_Method_EncryptData:
-					{
-						SpReqAnsContext<PinPadService_EncryptData_Req,PinPadService_EncryptData_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<PinPadService_EncryptData_Req,PinPadService_EncryptData_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_EncryptData(ctx);
-					}
-					break;
 				case PinPadService_Method_GetInputSM:
 					{
 						SpReqAnsContext<PinPadService_GetInputSM_Req,PinPadService_GetInputSM_Ans>::Pointer ctx;

+ 10 - 43
Module/mod_pinpad/pinpad.xml

@@ -1,48 +1,13 @@
 <?xml version="1.0" encoding="gb2312" ?>
 <entity name="PinPad">
 	<class name="PinPadService" overlap="true" exclusive="false">
-		<twoway name="GetInput" overlap="true">
-			<req>
-				<param name="timeout" type="int" />
-				<param name="length" type="int" />
-				<param name="encrypt" type="bool" />
-				<param name="confirm" type="bool" />
-				<param name="account" type="string" />
-			</req>
-			<res>
-				<param name="data" type="string" />
-				<param name="deviceno" type="string" />
-				<param name="keyseq" type="string" />
-				<param name="checkcode" type="string" />
-				<param name="enter" type="bool" />
-			</res>			
-		</twoway>		
-		<oneway name="InputWaitMore" overlap="true">		
+		<oneway name="InputWaitMore" overlap="true" method_id="1">		
 		</oneway>
-		<oneway name="InputCancel" overlap="true">		
+		<oneway name="InputCancel" overlap="true" method_id="2">		
 		</oneway>
-		<oneway name="Exit" overlap="true">		
+		<oneway name="Exit" overlap="true" method_id="3">		
 		</oneway>
-		<twoway name="LoadKeys" overlap="true">
-			<req>
-				<param name="masterkey" type="string" />
-				<param name="workingkey1" type="string" />
-				<param name="workingkey2" type="string" />
-				<param name="initializeflag" type="bool" />
-			</req>
-			<res>
-				<param name="result" type="int" />
-			</res>			
-		</twoway>
-		<twoway name="EncryptData" overlap="true">
-			<req>
-				<param name="data" type="string" />
-			</req>
-			<res>
-				<param name="ciphertext" type="string" />
-			</res>			
-		</twoway>
-		<twoway name="GetInputSM" overlap="true">
+		<twoway name="GetInputSM" overlap="true" method_id="6">
 			<req>
 				<param name="timeout" type="int" />
 				<param name="length" type="int" />
@@ -67,7 +32,7 @@
 				<param name="reserved4" type="string" />
 			</res>			
 		</twoway>
-		<twoway name="LoadKeysSM" overlap="true">
+		<twoway name="LoadKeysSM" overlap="true" method_id="7">
 			<req>
 				<param name="smflag" type="int" />
 				<param name="masterkey" type="string" />
@@ -88,7 +53,7 @@
 				<param name="reserved4" type="string" />
 			</res>			
 		</twoway>
-		<twoway name="EncryptDataSM" overlap="true">
+		<twoway name="EncryptDataSM" overlap="true" method_id="8">
 			<req>
 				<param name="smflag" type="int" />
 				<param name="data" type="string" />
@@ -105,7 +70,7 @@
 				<param name="reserved4" type="string" />
 			</res>			
 		</twoway>
-		<twoway name="QueryFunc" overlap="true">
+		<twoway name="QueryFunc" overlap="true" method_id="9">
 			<req>
 				<param name="reserved1" type="int" />
 				<param name="reserved2" type="int" />
@@ -120,13 +85,15 @@
 				<param name="reserved4" type="string" />
 			</res>			
 		</twoway>
-		<twoway name="GetCheckCode" overlap="true">
+		<twoway name="GetCheckCode" overlap="true" method_id="10">
 			<req>
 				<param name="mSN" type="array_int" />
 				<param name="wSN" type="array_int" />
 			</req>
 			<res>
 				<param name="checkcode" type="array_string" />
+				<!--if it is the TPK key, the index is zhe TPK SN-->
+				<param name="index" type="array_string" />
 			</res>			
 		</twoway>										
 		<twoway name="GetDevInfo" overlap="true" method_id="65535">