Browse Source

Z991239-5625 #comment 外部接口移除

80374374 1 year ago
parent
commit
9cfc5a01b6

+ 0 - 27
Module/mod_gpio/Gpio.xml

@@ -1,33 +1,6 @@
 <?xml version="1.0" encoding="gb2312" ?>
 <entity name="Gpio">
 	<class name="GpioService" overlap="true" exclusive="false">
-		<oneway name="Set" overlap="true">
-				<!-- 灯模块的序号标识,实体内部定义-->
-				<param name="devseq" type="int" />
-        <!--目前只有打印盖章有用到-->
-				<param name="mode" type="int" />
-				<!--目前只有 1 时才会处理,表明关灯-->
-				<param name="close" type="int" />
-		</oneway>
-		<twoway name="GetStatus" overlap="true">
-			<req>
-				<param name="devseq" type="int" />
-			</req>
-			<res>
-				<param name="status" type="int" />
-			</res>			
-		</twoway>
-		<twoway name="QueryCurrSet" overlap="true">
-			<req>
-				<param name="devseq" type="int" />
-			</req>
-			<res>
-				<param name="dir" type="int" />
-				<param name="output" type="int" />
-				<param name="reserved1" type="int" />
-				<param name="reserved2" type="string" />
-			</res>			
-		</twoway>
 		<twoway name="GetDevInfo" overlap="true" method_id="65535">
 			<req>
 			</req>

+ 1 - 113
Module/mod_gpio/Gpio_client_g.h

@@ -32,6 +32,7 @@ public:
 	}
 	void OnClose(ErrorCodeEnum)
 	{
+		Dbg("session closed.");
 		bSessionClosed = true;
 	}
 	bool QuerySessionClosed()
@@ -58,119 +59,6 @@ public:
 		return Error;
 	}
 
-	ErrorCodeEnum Set(GpioService_Set_Info &Info)
-	{
-		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
-		if (m_context.checkEmpty())
-		{
-			m_context.AutoGenerate();
-			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
-			m_context = m_context.upgradeLink();
-		}
-		CAutoBuffer Buf = SpObject2Buffer(Info);
-		auto ret = pFunc->OnewayCall(GpioService_Method_Set, GpioService_MethodSignature_Set, Buf, m_context);
-		m_context.clear();
-		return ret;
-	}
-
-	ErrorCodeEnum GetStatus(GpioService_GetStatus_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(GpioService_Method_GetStatus, GpioService_MethodSignature_GetStatus, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum GetStatus(GpioService_GetStatus_Req &Req, GpioService_GetStatus_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetStatus(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum GetStatus(GpioService_GetStatus_Req &Req, GpioService_GetStatus_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetStatus(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 GetStatus(GpioService_GetStatus_Req &Req, GpioService_GetStatus_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = GetStatus(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 QueryCurrSet(GpioService_QueryCurrSet_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(GpioService_Method_QueryCurrSet, GpioService_MethodSignature_QueryCurrSet, Buf, spAsyncWait, m_context, dwTimeout);
-		m_context.clear();
-		return ret;
-	}
-	ErrorCodeEnum QueryCurrSet(GpioService_QueryCurrSet_Req &Req, GpioService_QueryCurrSet_Ans &Ans, DWORD dwTimeout)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QueryCurrSet(Req, spAsyncWait, dwTimeout);
-		if (Error == Error_Succeed) {
-			bool bEnd = false;
-			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
-			LOG_ASSERT(Error || bEnd);
-		}
-		return Error;
-	}
-	ErrorCodeEnum QueryCurrSet(GpioService_QueryCurrSet_Req &Req, GpioService_QueryCurrSet_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QueryCurrSet(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 QueryCurrSet(GpioService_QueryCurrSet_Req &Req, GpioService_QueryCurrSet_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
-	{
-		CSmartPointer<IAsynWaitSp> spAsyncWait;
-		ErrorCodeEnum Error = QueryCurrSet(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 GetDevInfo(GpioService_GetDevInfo_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
 	{
 		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();

+ 2 - 71
Module/mod_gpio/Gpio_def_g.h

@@ -12,83 +12,14 @@ namespace Gpio {
 // const goes here
 //
 
-#define GpioService_Method_Set 0
-#define GpioService_Method_GetStatus 1
-#define GpioService_Method_QueryCurrSet 2
 #define GpioService_Method_GetDevInfo 65535
-#define GpioService_Method_Exit 3
+#define GpioService_Method_Exit 0
 
-#define GpioService_MethodSignature_Set 1228126872
-#define GpioService_MethodSignature_GetStatus 1783612278
-#define GpioService_MethodSignature_QueryCurrSet -1281718647
 #define GpioService_MethodSignature_GetDevInfo -70806533
 #define GpioService_MethodSignature_Exit -736432874
 
-#define GpioService_LogCode_Set "QLR040220900"
-#define GpioService_LogCode_GetStatus "QLR040220901"
-#define GpioService_LogCode_QueryCurrSet "QLR040220902"
 #define GpioService_LogCode_GetDevInfo "QLR040220999"
-#define GpioService_LogCode_Exit "QLR040220903"
-
-struct GpioService_Set_Info
-{
-	int devseq;
-	int mode;
-	int close;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & devseq & mode & close;
-	}
-
-};
-
-struct GpioService_GetStatus_Req
-{
-	int devseq;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & devseq;
-	}
-
-};
-
-struct GpioService_GetStatus_Ans
-{
-	int status;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & status;
-	}
-
-};
-
-struct GpioService_QueryCurrSet_Req
-{
-	int devseq;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & devseq;
-	}
-
-};
-
-struct GpioService_QueryCurrSet_Ans
-{
-	int dir;
-	int output;
-	int reserved1;
-	CSimpleStringA reserved2;
-
-	void Serialize(SpBuffer &Buf)
-	{
-		auto & buf = Buf & dir & output & reserved1 & reserved2;
-	}
-
-};
+#define GpioService_LogCode_Exit "QLR040220900"
 
 struct GpioService_GetDevInfo_Req
 {

+ 0 - 81
Module/mod_gpio/Gpio_server_g.h

@@ -30,27 +30,6 @@ public:
 	{
 		ErrorCodeEnum Error = Error_Succeed;
 		switch (dwMessageID) {
-		case GpioService_Method_Set:
-			if (dwSignature == GpioService_MethodSignature_Set) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case GpioService_Method_GetStatus:
-			if (dwSignature == GpioService_MethodSignature_GetStatus) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case GpioService_Method_QueryCurrSet:
-			if (dwSignature == GpioService_MethodSignature_QueryCurrSet) {
-				bOverlap = true;
-			} else {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
 		case GpioService_Method_GetDevInfo:
 			if (dwSignature == GpioService_MethodSignature_GetDevInfo) {
 				bOverlap = true;
@@ -76,21 +55,6 @@ public:
 	{
 		ErrorCodeEnum Error = Error_Succeed;
 		switch (dwMessageID) {
-		case GpioService_Method_Set:
-			if (dwSignature != GpioService_MethodSignature_Set) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case GpioService_Method_GetStatus:
-			if (dwSignature != GpioService_MethodSignature_GetStatus) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
-		case GpioService_Method_QueryCurrSet:
-			if (dwSignature != GpioService_MethodSignature_QueryCurrSet) {
-				Error = Error_MethodSignatureFailed;
-			}
-			break;
 		case GpioService_Method_GetDevInfo:
 			if (dwSignature != GpioService_MethodSignature_GetDevInfo) {
 				Error = Error_MethodSignatureFailed;
@@ -108,21 +72,6 @@ public:
 		return Error;
 	}
 
-	virtual void Handle_Set(SpOnewayCallContext<GpioService_Set_Info>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_GetStatus(SpReqAnsContext<GpioService_GetStatus_Req, GpioService_GetStatus_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
-	virtual void Handle_QueryCurrSet(SpReqAnsContext<GpioService_QueryCurrSet_Req, GpioService_QueryCurrSet_Ans>::Pointer ctx)
-	{
-	/// override by user
-	}
-
 	virtual void Handle_GetDevInfo(SpReqAnsContext<GpioService_GetDevInfo_Req, GpioService_GetDevInfo_Ans>::Pointer ctx)
 	{
 	/// override by user
@@ -149,36 +98,6 @@ public:
 			}
 #endif
 			switch (dwMessageID) {
-				case GpioService_Method_Set:
-					{
-						SpOnewayCallContext<GpioService_Set_Info>::Pointer ctx;
-						ctx.Attach(new SpOnewayCallContext<GpioService_Set_Info>());
-						SpBuffer2Object(Buf, ctx->Info);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_Set(ctx);
-					}
-					break;
-				case GpioService_Method_GetStatus:
-					{
-						SpReqAnsContext<GpioService_GetStatus_Req,GpioService_GetStatus_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<GpioService_GetStatus_Req,GpioService_GetStatus_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_GetStatus(ctx);
-					}
-					break;
-				case GpioService_Method_QueryCurrSet:
-					{
-						SpReqAnsContext<GpioService_QueryCurrSet_Req,GpioService_QueryCurrSet_Ans>::Pointer ctx;
-						ctx.Attach(new SpReqAnsContext<GpioService_QueryCurrSet_Req,GpioService_QueryCurrSet_Ans>(pTransactionContext));
-						SpBuffer2Object(Buf, ctx->Req);
-						pTransactionContext->GetLinkContext(ctx->link);
-						EntityResource::setLink(ctx->link);
-						Handle_QueryCurrSet(ctx);
-					}
-					break;
 				case GpioService_Method_GetDevInfo:
 					{
 						SpReqAnsContext<GpioService_GetDevInfo_Req,GpioService_GetDevInfo_Ans>::Pointer ctx;

+ 2 - 21
Module/mod_gpio/mod_gpio.cpp

@@ -153,22 +153,6 @@ static const char* GetLightSeqString(int seq)
 
 #undef LIGHT_STRING_CONVERT
 
-void CGpioServiceSession::Handle_Set(SpOnewayCallContext<GpioService_Set_Info>::Pointer ctx)
-{
-
-}
-
-void CGpioServiceSession::Handle_GetStatus(SpReqAnsContext<GpioService_GetStatus_Req, GpioService_GetStatus_Ans>::Pointer ctx)
-{
-    DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)(__FUNCTION__);
-    ctx->Answer(Error_NotSupport);
-}
-
-void CGpioServiceSession::Handle_QueryCurrSet(SpReqAnsContext<GpioService_QueryCurrSet_Req, GpioService_QueryCurrSet_Ans>::Pointer ctx)
-{
-    DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)(__FUNCTION__);
-    ctx->Answer(Error_NotSupport);
-}
 
 void CGpioServiceSession::Handle_GetDevInfo(SpReqAnsContext<GpioService_GetDevInfo_Req,
     GpioService_GetDevInfo_Ans>::Pointer ctx)
@@ -245,7 +229,7 @@ struct GpioInitTask : public ITaskSp {
 		{
             DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Gpio open succeeded.");
 			//oiltest 20130118 for audiodg handle
-			m_entity->GetStatus(PHONEPICKUP, NULL);
+			m_entity->GetStatus(PHONEPICKUP);
 
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("subscribelog...");
             //oiltmp the subscribelog should distinct machine type?
@@ -853,7 +837,7 @@ void CGpioEntity::Set(GpioService_Set_Info req)
 }
 
 //仅仅获取挂机的状态,但远远没有这么简单,这点只调用了一次,开了一个监听线程,用于监听震动、开关门等事件
-void CGpioEntity::GetStatus(int deviceSeq, SpReqAnsContext<GpioService_GetStatus_Req, GpioService_GetStatus_Ans>::Pointer ctx)
+void CGpioEntity::GetStatus(int deviceSeq)
 {
     /** 注意设备序号是实体内定义的逻辑,不是设备端口号,用作于计时器的ID去了*/
     DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("GetStatus with devseq %d", deviceSeq);
@@ -994,8 +978,6 @@ bool CGpioEntity::SetOutDriving(GpioService_Set_Info req, OutDrivingInfo od, ULO
             WritePin(pinSeq, true);
 
             SetContextInfo* pSci = new SetContextInfo();;
-            pSci->ctx = NULL;
-
             pSci->timerID = req.devseq;
             pSci->timeout = od.TimeOut;
             pSci->index = iIndex;
@@ -1021,7 +1003,6 @@ bool CGpioEntity::SetOutDriving(GpioService_Set_Info req, OutDrivingInfo od, ULO
         case SM_CYCLE:
         {
             SetContextInfo* pSci = new SetContextInfo();
-            pSci->ctx = NULL;
             pSci->index = iIndex;
             pSci->pinSeq = pinSeq;
             pSci->timerID = req.devseq;

+ 22 - 30
Module/mod_gpio/mod_gpio.h

@@ -68,48 +68,43 @@ struct ReceivingInfo
 	int ContinuousTriggerTime;
 };
 
-enum PrintSealType{
-	PRINTERSEAL_UNKNOWN = 0,
-	PRINTER_LIGHT_GREEN,
-	PRINTER_LIGHT_RED,
-	PRINTER_LIGHT_OFF,
-	PAPER_LIGHT_GREEN,
-	PAPER_LIGHT_RED,
-	PAPER_LIGHT_OFF
-};
-
-
+/** 添加注释:对应规格说明书中的引脚信号  [Gifur@202494]*/
 enum DevicePinSeq
 {
 	PIN_CARD_READER_LIGHT,
-	PIN_USB_CONTROL_SWITCH,
+	PIN_USB_CONTROL_SWITCH, //已下线
 	PIN_IDCERTIFICATE_LIGHT,
 	PIN_PINPAD_LIGHT,
 	PIN_HEAD_LIGHT,
 	PIN_TROUBLE_LIGHT,
 	PIN_CARD_ISSUE_MAINTAIN_LIGHT,
-	PIN_USB_CONTROL_LIGHT,
+	PIN_USB_CONTROL_LIGHT,//已下线
 	PIN_CONTACELESS_LIGHT,
-	PIN_QR_LIGHT,
+	PIN_RESERVED1, //RESERVED未使用,下同
 	PIN_FINGERPRINT_LIGHT,
-	PIN_THERMPRINT_LIGHT,
+	PIN_RESERVED2,
 	PIN_HSPSCANNER_PREVIEW_LIGHT,
-	PIN_PRINTERSEAL_GREEN_LIGHT,
-	PIN_PAPER_SLOT_GREEN_LIGHT,
-	PIN_PAPER_SHORTAGE_RED_LIGHT,
-	PIN_PRINTERSEAL_RED_LIGHT = 24,
-	PIN_HSPSCANNER_LIGHT
+	PIN_RESERVED3,
+	PIN_RESERVED4,
+	PIN_RESERVED5,
+	PIN_HSPSCANNER_LIGHT = 25
+};
+
+//TODO: 临时  [Gifur@202494]
+struct GpioService_Set_Info
+{
+	int devseq;
+	int mode;
+	int close;
 };
 
+
 class CGpioEntity;
 
 class CGpioServiceSession : public GpioService_ServerSessionBase
 {
 public:
 	CGpioServiceSession(CGpioEntity* pEntity):m_pEntity(pEntity){};
-	virtual void Handle_Set(SpOnewayCallContext<GpioService_Set_Info>::Pointer ctx);
-	virtual void Handle_GetStatus(SpReqAnsContext<GpioService_GetStatus_Req, GpioService_GetStatus_Ans>::Pointer ctx);
-	virtual void Handle_QueryCurrSet(SpReqAnsContext<GpioService_QueryCurrSet_Req, GpioService_QueryCurrSet_Ans>::Pointer ctx);
 	virtual void Handle_GetDevInfo(SpReqAnsContext<GpioService_GetDevInfo_Req,
 		GpioService_GetDevInfo_Ans>::Pointer ctx);
 	virtual void Handle_Exit(SpOnewayCallContext<GpioService_Exit_Info>::Pointer ctx);
@@ -123,7 +118,6 @@ struct DevOutputInfo
 };
 struct SetContextInfo
 {
-	SpOnewayCallContext<GpioService_Set_Info>::Pointer ctx;
 	ULONG timerID;
 	BYTE index;
 	ULONG pinSeq;
@@ -134,11 +128,9 @@ struct SetContextInfo
 struct GetContextInfo
 {
 	int Port;
-	SpReqAnsContext<GpioService_GetStatus_Req, GpioService_GetStatus_Ans>::Pointer ctx;
 	ULONG timerID;
 	ULONG index;
 	int CttPhone,CttMove,CttShake,CttSwitch,CttCard;
-
 	//ContinuousTriggerTime get from configure file
 	int InitCTT;
 };
@@ -185,7 +177,7 @@ public:
 	virtual void OnPreClose(EntityCloseCauseEnum eCloseCause,CSmartPointer<ITransactionContext> pTransactionContext)
 	{
 		LOG_FUNCTION();
-		m_hDevHelper.TearDown();
+		if(m_hDevHelper != nullptr) m_hDevHelper.TearDown();
 		pTransactionContext->SendAnswer(Error_Succeed);
 	}
 
@@ -194,6 +186,8 @@ public:
 		return new CGpioServiceSession(this);
 	}
 
+	bool SetOutDriving(GpioService_Set_Info req, OutDrivingInfo od, ULONG iIndex, ULONG devSeq);
+
 	void OnSelfTest(EntityTestEnum eTestType, CSmartPointer<ITransactionContext> pTransactionContext);
 
 	void Exit(SpOnewayCallContext<GpioService_Exit_Info>::Pointer ctx) {}
@@ -201,8 +195,6 @@ public:
 	void GetDevInfo(SpReqAnsContext<GpioService_GetDevInfo_Req,
 		GpioService_GetDevInfo_Ans>::Pointer ctx);
 
-	bool SetOutDriving(GpioService_Set_Info req,OutDrivingInfo od, ULONG iIndex,ULONG devSeq);
-
 	bool GetReceiving(int deviceSeq,ReceivingInfo ri, ULONG iIndex);
 
 	DevOutputInfo GetCurrDevStatus()const {return currDevStatus;}
@@ -226,7 +218,7 @@ public:
 	void OnPositiveLevelTimerOut(void* pData);
 	void GetOutDrivingModInfo(CSimpleStringA modName, OutDrivingInfo& odi);
 	void GetReceivingModInfo(CSimpleStringA modName, ReceivingInfo& ri);
-	void GetStatus(int deviceSeq,SpReqAnsContext<GpioService_GetStatus_Req, GpioService_GetStatus_Ans>::Pointer ctx);
+	void GetStatus(int deviceSeq);
 	void Set(GpioService_Set_Info info);
 	void SetEx(GpioService_Set_Info info);
 	void WritePin(DWORD dwPinSeq,bool bHighLevel);