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 | 69 +++++++++++++++++++++++++++++++---
1 files changed, 62 insertions(+), 7 deletions(-)
diff --git a/SourceCode/Bond/Servo/HsmsPassive.cpp b/SourceCode/Bond/Servo/HsmsPassive.cpp
index d3534c3..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)
{
@@ -1314,19 +1368,20 @@
if (m_pPassive == NULL || STATE::SELECTED != m_pPassive->getState()) {
return ER_NOTSELECT;
}
-
+ if (m_listener.onQueryPPIDList == nullptr) {
+ return ER_NO_PPID_LIST;
+ }
IMessage* pMessage = NULL;
HSMS_Create1Message(pMessage, m_nSessionId, 7, 20, pRecv->getHeader()->systemBytes);
ASSERT(pMessage);
ISECS2Item* pItem = pMessage->getBody();
- pItem->addItem("banana1", "PPID1");
- pItem->addItem("banana2", "PPID2");
- pItem->addF8Item(-123.45, "PPID2");
- pItem->addF4Item(-568.99f, "PPID2");
- pItem->addF8Item(456.456, "PPID2");
- pItem->addF4Item(123.123f, "PPID2");
+ auto ppids = m_listener.onQueryPPIDList(this);
+ for (auto item : ppids) {
+ pItem->addItem(item.c_str(), "PPID");
+ }
+
m_pPassive->sendMessage(pMessage);
LOGI("<HSMS>[SECS Msg SEND]S7F20 (SysByte=%u)", pMessage->getHeader()->systemBytes);
HSMS_Destroy1Message(pMessage);
--
Gitblit v1.9.3