浏览代码

Z991239-5384 #comment 调整JS接口,完善xml方便自动生成md文件

oilyang 1 年之前
父节点
当前提交
d14576a403
共有 4 个文件被更改,包括 76 次插入99 次删除
  1. 38 43
      Module/mod_pinpad/PinPad_UserErrorCode.h
  2. 2 15
      Module/mod_pinpad/PinPad_def_g.h
  3. 0 15
      Module/mod_pinpad/PinPad_msg_g.h
  4. 36 26
      Module/mod_pinpad/pinpad.xml

+ 38 - 43
Module/mod_pinpad/PinPad_UserErrorCode.h

@@ -2,47 +2,42 @@
 #define _PINPAD_USER_ERROR_CODE_H
 #pragma once
 
-#define PinPad_UserErrorCode_Start 0x20600200
-#define PinPad_UserErrorCode_GetEncryptedText_Failed				(PinPad_UserErrorCode_Start + 1)	//获取密文输入失败
-#define PinPad_UserErrorCode_Open_RunCfgFile_Failed					(PinPad_UserErrorCode_Start + 2)	//打开运行时配置失败
-#define PinPad_UserErrorCode_Write_RunCfgFile_Failed				(PinPad_UserErrorCode_Start + 3)	//写运行时配置失败
-#define PinPad_UserErrorCode_PinPad_Instance_Is_Null				(PinPad_UserErrorCode_Start + 4)	//pinpad 实例为null
-#define PinPad_UserErrorCode_Create_PinPad_Instance_Failed			(PinPad_UserErrorCode_Start + 5)	//创建pinpad实例失败
-#define PinPad_UserErrorCode_Get_DevAdapter_Path_Failed				(PinPad_UserErrorCode_Start + 6)	//获取dll适配器路径失败
-#define PinPad_UserErrorCode_LogInfoAboutTerm						(PinPad_UserErrorCode_Start + 7)	//告警上送终端模块信息
-//#define PinPad_UserErrorCode_RootInfo								(PinPad_UserErrorCode_Start + 8)	//root信息
-#define PinPad_UserErrorCode_Release_Object_Failed					(PinPad_UserErrorCode_Start + 9)	//
-
-#define PinPad_UserErrorCode_KEY_LOST_SM							(PinPad_UserErrorCode_Start + 10)	//
-#define PinPad_UserErrorCode_PINPAD_KEY_LOST						(PinPad_UserErrorCode_Start + 11)	//
-
-#define PinPad_UserErrorCode_Create_Event_Failed					(PinPad_UserErrorCode_Start + 12)
-#define PinPad_UserErrorCode_Open_Root_File_Failed					(PinPad_UserErrorCode_Start + 13)
-#define PinPad_UserErrorCode_Load_Dll_File_Failed					(PinPad_UserErrorCode_Start + 14)
-#define PinPad_UserErrorCode_GET_CDC_ADDR_Failed					(PinPad_UserErrorCode_Start + 15)
-#define PinPad_UserErrorCode_GET_RDC_ADDR_Failed					(PinPad_UserErrorCode_Start + 16)
-#define PinPad_UserErrorCode_Create_Object_Failed					(PinPad_UserErrorCode_Start + 17)
-#define PinPad_UserErrorCode_Get_SoftWare_Pointer_Failed			(PinPad_UserErrorCode_Start + 18)
-
-#define PinPad_UserErrorCode_PinPad_Not_SM							(PinPad_UserErrorCode_Start + 19)
-#define PinPad_UserErrorCode_PinPad_Use_TestKey						(PinPad_UserErrorCode_Start + 20)
-#define PinPad_UserErrorCode_PinPad_SM_First						(PinPad_UserErrorCode_Start + 21)
-#define PinPad_UserErrorCode_PinPad_LoadKey_SMSN					(PinPad_UserErrorCode_Start + 22)
-#define PinPad_UserErrorCode_PinPad_LoadKey_Clear_SMSN				(PinPad_UserErrorCode_Start + 23)
-//#define PinPad_UserErrorCode_PinPad_LoadKey_3DesSN					(PinPad_UserErrorCode_Start + 24)
-#define PinPad_UserErrorCode_PinPad_InfoAboutKey_Onboot				(PinPad_UserErrorCode_Start + 25)
-#define PinPad_UserErrorCode_PinPad_CheckCode_Changed				(PinPad_UserErrorCode_Start + 26)
-
-//GetEncryptText Error
-#define PinPad_UserErrorCode_PinPad_GetEncryptText_Get12Account_Error		(PinPad_UserErrorCode_Start + 27)
-#define PinPad_UserErrorCode_PinPad_DevOpenFailed					(PinPad_UserErrorCode_Start + 28)
-#define PinPad_UserErrorCode_PinPad_CkCode_While_Load_SM			(PinPad_UserErrorCode_Start + 29)
-
-//LogWarn real root config
-#define PinPad_UserErrorCode_PinPad_Real_Root_Config				(PinPad_UserErrorCode_Start + 31)
-#define PinPad_UserErrorCode_PinPad_GetPinBlock_Call				(PinPad_UserErrorCode_Start + 32)
-#define PinPad_UserErrorCode_Unexpected_Exit						(PinPad_UserErrorCode_Start + 33)
-#define PinPad_UserErrorCode_UnknownSMFlag							(PinPad_UserErrorCode_Start + 34)
-#define PinPad_UserErrorCode_DevConnect_CostTime					(PinPad_UserErrorCode_Start + 35)
-#define PinPad_UserErrorCode_NoPlainInput							(PinPad_UserErrorCode_Start + 36)
+enum PinPad_UserErrorCode {
+	PinPad_UserErrorCode_GetEncryptedText_Failed = 0x20600201,	//获取密文输入失败
+	PinPad_UserErrorCode_Open_RunCfgFile_Failed = 0x20600202,	//打开运行时配置失败
+	PinPad_UserErrorCode_Write_RunCfgFile_Failed = 0x20600203,	//写运行时配置失败
+	PinPad_UserErrorCode_PinPad_Instance_Is_Null = 0x20600204,	//pinpad 实例为null
+	PinPad_UserErrorCode_Create_PinPad_Instance_Failed = 0x20600205,	//创建pinpad实例失败
+	PinPad_UserErrorCode_Get_DevAdapter_Path_Failed = 0x20600206,	//获取dll适配器路径失败
+	PinPad_UserErrorCode_LogInfoAboutTerm = 0x20600207,	//告警上送终端模块信息
+	PinPad_UserErrorCode_WhileInGetInputReceivedAnotherGetInput = 0x20600208,	//在获取输入时收到了新的获取输入请求
+	PinPad_UserErrorCode_Release_Object_Failed = 0x20600209,	
+	PinPad_UserErrorCode_KEY_LOST_SM = 0x2060020A,
+	PinPad_UserErrorCode_PINPAD_KEY_LOST = 0x2060020B,
+	PinPad_UserErrorCode_Create_Event_Failed = 0x2060020C,
+	PinPad_UserErrorCode_Open_Root_File_Failed = 0x2060020D,
+	PinPad_UserErrorCode_Load_Dll_File_Failed = 0x2060020E,
+	PinPad_UserErrorCode_GET_CDC_ADDR_Failed = 0x2060020F,
+	PinPad_UserErrorCode_GET_RDC_ADDR_Failed = 0x20600210,
+	PinPad_UserErrorCode_Create_Object_Failed = 0x20600211,
+	PinPad_UserErrorCode_Get_SoftWare_Pointer_Failed = 0x20600212,	
+	PinPad_UserErrorCode_PinPad_Not_SM = 0x20600213,
+	PinPad_UserErrorCode_PinPad_Use_TestKey = 0x20600214,
+	PinPad_UserErrorCode_PinPad_SM_First = 0x20600215,
+	PinPad_UserErrorCode_PinPad_LoadKey_SMSN = 0x20600216,
+	PinPad_UserErrorCode_PinPad_LoadKey_Clear_SMSN = 0x20600217,
+	PinPad_UserErrorCode_NotInGetInput = 0x20600218,
+	PinPad_UserErrorCode_PinPad_InfoAboutKey_Onboot = 0x20600219,
+	PinPad_UserErrorCode_PinPad_CheckCode_Changed = 0x2060021A,
+	PinPad_UserErrorCode_PinPad_GetEncryptText_Get12Account_Error = 0x2060021B,
+	PinPad_UserErrorCode_PinPad_DevOpenFailed = 0x2060021C,
+	PinPad_UserErrorCode_PinPad_CkCode_While_Load_SM = 0x2060021D,
+		
+	PinPad_UserErrorCode_PinPad_Real_Root_Config = 0x2060021F,
+	PinPad_UserErrorCode_PinPad_GetPinBlock_Call = 0x20600220,
+	PinPad_UserErrorCode_Unexpected_Exit = 0x20600221,
+	PinPad_UserErrorCode_UnknownSMFlag = 0x20600222,
+	PinPad_UserErrorCode_DevConnect_CostTime = 0x20600223,
+	PinPad_UserErrorCode_NoPlainInput = 0x20600224,
+};
 #endif //_PINPAD_USER_ERROR_CODE_H

+ 2 - 15
Module/mod_pinpad/PinPad_def_g.h

@@ -78,19 +78,11 @@ struct PinPadService_Exit_Info
 struct PinPadService_GetInputJS_Req
 {
 	int timeout;
-	int length;
-	bool encrypt;
-	bool confirm;
-	int smflag;
 	CSimpleStringA account;
-	int reserved1;
-	int reserved2;
-	CSimpleStringA reserved3;
-	CSimpleStringA reserved4;
 
 	void Serialize(SpBuffer &Buf)
 	{
-		auto & buf = Buf & timeout & length & encrypt & confirm & smflag & account & reserved1 & reserved2 & reserved3 & reserved4;
+		auto & buf = Buf & timeout & account;
 	}
 
 };
@@ -101,15 +93,10 @@ struct PinPadService_GetInputJS_Ans
 	CSimpleStringA deviceno;
 	CSimpleStringA keyseq;
 	CSimpleStringA checkcode;
-	bool enter;
-	int reserved1;
-	int reserved2;
-	CSimpleStringA reserved3;
-	CSimpleStringA reserved4;
 
 	void Serialize(SpBuffer &Buf)
 	{
-		auto & buf = Buf & data & deviceno & keyseq & checkcode & enter & reserved1 & reserved2 & reserved3 & reserved4;
+		auto & buf = Buf & data & deviceno & keyseq & checkcode;
 	}
 
 };

+ 0 - 15
Module/mod_pinpad/PinPad_msg_g.h

@@ -10,10 +10,8 @@
 
 namespace PinPad {
 #define eMsg_InputContent 0
-#define eMsg_InputContentJS 1
 
 #define eMsgSig_InputContent -1171779670
-#define eMsgSig_InputContentJS -1687407804
 
 struct InputContent
 {
@@ -28,18 +26,5 @@ struct InputContent
 
 ///////////////////////////
 
-struct InputContentJS
-{
-	CSimpleStringA data;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & data;
-	}
-
-};
-
-///////////////////////////
-
 } // namespace PinPad
 #endif // __PINPAD_MSG_G_H

+ 36 - 26
Module/mod_pinpad/pinpad.xml

@@ -7,38 +7,45 @@
 		</oneway>
 		<oneway name="Exit" overlap="true" method_id="3">		
 		</oneway>
-		<twoway name="GetInputJS" overlap="true" method_id="4">
+		<!-- 获取密文输入,成功时返回Error_Succeed(0),及相关数据 -->
+		<!-- 1、设备未打开,errorCode为Error_DevNotAvailable(2050),rtaCode为RTA260E -->
+		<!-- 2、正在获取输入流程,errorCode为Error_Busy(776),rtaCode为RTA2615 -->
+		<!-- 3、开启密文输入失败,errorCode为Error_Unexpect(2147483646),rtaCode为RTA2609 -->
+		<!-- 4、设置密钥参数失败,errorCode为Error_Unexpect(2147483646),rtaCode为RTA260B -->
+		<!-- 5、激活工作密钥失败,errorCode为Error_Unexpect(2147483646),rtaCode为RTA260C -->
+		<!-- 6、设置账号失败,errorCode为Error_Unexpect(2147483646),rtaCode为RTA2608 -->
+		<!-- 7、计算密文失败,errorCode为Error_Unexpect(2147483646),rtaCode为RTA260A -->
+		<!-- 8、加密数据失败,errorCode为Error_Unexpect(2147483646),rtaCode为RTA260D -->
+		<!-- 9、获取账号失败,errorCode为Error_Unexpect(2147483646),rtaCode为RTA2607 -->
+		<!-- 10、停止密钥输入失败,errorCode为Error_Unexpect(2147483646),rtaCode为RTA2614 -->
+		<twoway name="GetInputJS" overlap="true" jsflag="true" method_id="4">
 			<req>
+				<!-- 调用超时时间 -->
 				<param name="timeout" type="int" />
-				<param name="length" type="int" />
-				<param name="encrypt" type="bool" />
-				<param name="confirm" type="bool" />
-				<param name="smflag" type="int" />
+				<!-- 账号(卡号) -->
 				<param name="account" type="string" />
-				<param name="reserved1" type="int" />
-				<param name="reserved2" type="int" />
-				<param name="reserved3" type="string" />
-				<param name="reserved4" 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" />
-				<param name="reserved1" type="int" />
-				<param name="reserved2" type="int" />
-				<param name="reserved3" type="string" />
-				<param name="reserved4" type="string" />
 			</res>			
 		</twoway>
-    <twoway name="InputCancelJS" overlap="true" method_id="5">
-      <req>
-      </req>
-      <res>
-      </res>
-    </twoway>
-    <twoway name="GetInputSM" overlap="true" method_id="6">
+		<!-- 取消密文输入,成功时errorCode为Error_Succeed(0) -->
+		<!-- 1、设备未打开,errorCode为Error_DevNotAvailable(2050),rtaCode为RTA260E -->
+		<!-- 2、当前并未处于获取输入状态,errorCode为Error_Unexpect(2147483646),rtaCode为RTA2616 -->
+		<twoway name="InputCancelJS" overlap="true" jsflag="true" method_id="5">
+			<req>
+			</req>
+			<res>
+			</res>
+		</twoway>
+		<twoway name="GetInputSM" overlap="true" method_id="6">
 			<req>
 				<param name="timeout" type="int" />
 				<param name="length" type="int" />
@@ -126,14 +133,20 @@
 				<!--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">
+		</twoway>			
+		<!-- 获取设备模块信息输入,成功时errorCode为Error_Succeed(0),及相关数据 -->
+		<!-- 1、设备未打开,errorCode为Error_DevNotAvailable(2050),rtaCode为RTA260E -->
+		<twoway name="GetDevInfo" overlap="true" jsflag="true" method_id="65535">
 			<req>
 			</req>
 			<res>
+				<!--设备适配器DevCategoryInfo的szType -->
 				<param name="type" type="string" />
+				<!--设备适配器DevCategoryInfo的szModel -->
 				<param name="model" type="string" />
+				<!--暂未使用 -->
 				<param name="version" type="string" />
+				<!--设备实体的状态,目前可能在用的是DEVICE_STATUS_NORMAL(1)表示正常 -->
 				<param name="state" type="int" />
 			</res>			
 		</twoway>													
@@ -141,7 +154,4 @@
 	<message name="InputContent">
 			<param name="data" type="string"/>
 	</message>
-  <message name="InputContentJS">
-    <param name="data" type="string"/>
-  </message>  
 </entity>