From d5c8d6545efe0ab2026a4127fde0fa2bad659ccd Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期三, 06 八月 2025 14:45:52 +0800
Subject: [PATCH] 1.实现EAP中ProceedWithCarrier和CarrierRelease的功能模拟及测试;

---
 SourceCode/Bond/Servo/HsmsPassive.cpp |   54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 54 insertions(+), 0 deletions(-)

diff --git a/SourceCode/Bond/Servo/HsmsPassive.cpp b/SourceCode/Bond/Servo/HsmsPassive.cpp
index 9dca68a..76bb93a 100644
--- a/SourceCode/Bond/Servo/HsmsPassive.cpp
+++ b/SourceCode/Bond/Servo/HsmsPassive.cpp
@@ -542,6 +542,9 @@
 		else if (nStream == 2 && pHeader->function == 43) {
 			replyConfigureSpooling(pMessage);
 		}
+		else if (nStream == 3 && pHeader->function == 17) {
+			replyCarrierAction(pMessage);
+		}
 		else if (nStream == 5 && pHeader->function == 3) {
 			replyEanbleDisableAlarmReport(pMessage);
 		}
@@ -1234,6 +1237,57 @@
 	return 0;
 }
 
+// S3F17
+int CHsmsPassive::replyCarrierAction(IMessage* pRecv)
+{
+	if (m_pPassive == NULL || STATE::SELECTED != m_pPassive->getState()) {
+		return ER_NOTSELECT;
+	}
+
+	unsigned char CAACK = CAACK_0;
+	unsigned int ERRCODE = 0;
+	std::string strError = "no error";
+	if (m_listener.onCarrierAction == nullptr) {
+		CAACK = 5;
+		ERRCODE = CAACK_5;
+		strError = "Not supported";
+		goto MYREPLY;
+	}
+
+
+	ISECS2Item* pBody = pRecv->getBody();
+	if (pBody == nullptr || pBody->getType() != SITYPE::L) ER_PARAM_ERROR;
+
+	unsigned int DATAID;
+	unsigned char PTN;
+	const char* pszCarrierAction, *pszCarrierId;
+	pBody->getSubItemU4(0, DATAID);
+	pBody->getSubItemString(1, pszCarrierAction);
+	pBody->getSubItemString(2, pszCarrierId);
+	pBody->getSubItemU1(3, PTN);
+	ERRCODE = m_listener.onCarrierAction(this,
+		DATAID, 
+		pszCarrierAction,
+		pszCarrierId, 
+		PTN,
+		strError);
+	CAACK = ERRCODE;
+
+	// 鍥炲
+MYREPLY:
+	IMessage* pMessage = NULL;
+	HSMS_Create1Message(pMessage, m_nSessionId, 3, 18, pRecv->getHeader()->systemBytes);
+	pMessage->getBody()->addU1Item(CAACK, "CAACK");
+	ISECS2Item* pErrItem = pMessage->getBody()->addItem();
+	pErrItem->addU4Item(ERRCODE, "ERRCODE");
+	pErrItem->addItem(strError.c_str(), "ERRTEXT");
+	m_pPassive->sendMessage(pMessage);
+	LOGI("<HSMS>[SECS Msg SEND]S3F18 (SysByte=%u)", pMessage->getHeader()->systemBytes);
+	HSMS_Destroy1Message(pMessage);
+	
+	return 0;
+}
+
 // S5F3
 int CHsmsPassive::replyEanbleDisableAlarmReport(IMessage* pRecv)
 {

--
Gitblit v1.9.3