From 9a637512b223f44699f1b04953a1c627dc4c2d8e Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期五, 17 一月 2025 11:53:09 +0800
Subject: [PATCH] 1.SESC模块,增加S7F19的回复(查询PPID列表),目前填充固定数据测试通讯,后期PPID列表数据从CC-Link中获取;
---
SourceCode/Bond/Servo/HsmsPassive.cpp | 37 +++++++++++++++++++++++++++++++------
1 files changed, 31 insertions(+), 6 deletions(-)
diff --git a/SourceCode/Bond/Servo/HsmsPassive.cpp b/SourceCode/Bond/Servo/HsmsPassive.cpp
index 5a62733..0362da8 100644
--- a/SourceCode/Bond/Servo/HsmsPassive.cpp
+++ b/SourceCode/Bond/Servo/HsmsPassive.cpp
@@ -177,10 +177,10 @@
LOGI("<HSMS>收到消息 S%dF%d", nStream, pHeader->function);
if (nStream == 1 && pHeader->function == 1) {
// S1F1
- replyAreYouThere(pHeader->systemBytes);
+ replyAreYouThere(pMessage);
}
else if (nStream == 1 && pHeader->function == 13) {
- replyEstablishCommunications(pHeader->systemBytes);
+ replyEstablishCommunications(pMessage);
}
else if (nStream == 2 && pHeader->function == 31) {
replyDatetime(pMessage);
@@ -190,6 +190,9 @@
}
else if (nStream == 5 && pHeader->function == 3) {
replyEanbleDisableAlarmReport(pMessage);
+ }
+ else if (nStream == 7 && pHeader->function == 19) {
+ replyQueryPPIDList(pMessage);
}
else if (nStream == 10 && pHeader->function == 3) {
replyTerminalDisplay(pMessage);
@@ -330,14 +333,14 @@
}
// S1F2
-int CHsmsPassive::replyAreYouThere(unsigned int systemBytes)
+int CHsmsPassive::replyAreYouThere(IMessage* pRecv)
{
if (m_pPassive == NULL || STATE::SELECTED != m_pPassive->getState()) {
return ER_NOTSELECT;
}
IMessage* pMessage = NULL;
- HSMS_Create1Message(pMessage, m_nSessionId, 1, 2, systemBytes);
+ HSMS_Create1Message(pMessage, m_nSessionId, 1, 2, pRecv->getHeader()->systemBytes);
ASSERT(pMessage);
ISECS2Item* pItem = pMessage->getBody();
@@ -351,14 +354,14 @@
}
// S1F14
-int CHsmsPassive::replyEstablishCommunications(unsigned int systemBytes)
+int CHsmsPassive::replyEstablishCommunications(IMessage* pRecv)
{
if (m_pPassive == NULL || STATE::SELECTED != m_pPassive->getState()) {
return ER_NOTSELECT;
}
IMessage* pMessage = NULL;
- HSMS_Create1Message(pMessage, m_nSessionId, 1, 14, systemBytes);
+ HSMS_Create1Message(pMessage, m_nSessionId, 1, 14, pRecv->getHeader()->systemBytes);
ASSERT(pMessage);
ISECS2Item* pItem = pMessage->getBody();
@@ -476,6 +479,28 @@
return 0;
}
+// S7F19
+int CHsmsPassive::replyQueryPPIDList(IMessage* pRecv)
+{
+ if (m_pPassive == NULL || STATE::SELECTED != m_pPassive->getState()) {
+ return ER_NOTSELECT;
+ }
+
+
+ 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");
+ m_pPassive->sendMessage(pMessage);
+ LOGI("<HSMS>[SECS Msg SEND]S7F20 (SysByte=%u)", pMessage->getHeader()->systemBytes);
+ HSMS_Destroy1Message(pMessage);
+
+ return 0;
+}
+
// S10F3
int CHsmsPassive::replyTerminalDisplay(IMessage* pRecv)
{
--
Gitblit v1.9.3