LAPTOP-SNT8I5JK\Boounion
2025-07-28 e20a6e96aacc90667b7bed764a92f75993c20045
1.暂存
已修改2个文件
76 ■■■■■ 文件已修改
SourceCode/Bond/Servo/HsmsPassive.cpp 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/HsmsPassive.h 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/Servo/HsmsPassive.cpp
@@ -521,6 +521,9 @@
        else if (nStream == 2 && pHeader->function == 41) {
            replyCommand(pMessage);
        }
        else if (nStream == 2 && pHeader->function == 43) {
            replyConfigureSpooling(pMessage);
        }
        else if (nStream == 5 && pHeader->function == 3) {
            replyEanbleDisableAlarmReport(pMessage);
        }
@@ -1067,6 +1070,74 @@
    return 0;
}
// S2F43
int CHsmsPassive::replyConfigureSpooling(IMessage* pRecv)
{
    if (m_pPassive == NULL || STATE::SELECTED != m_pPassive->getState()) {
        return ER_NOTSELECT;
    }
    ISECS2Item* pBody = pRecv->getBody();
    if (pBody == nullptr || pBody->getType() != SITYPE::L) ER_PARAM_ERROR;
    // 清空所有
    if (pBody->getSubItemSize() == 0) {
        m_spoolingConfig.clear();
        goto MYREPLY;
    }
    // 依次配置Stream
    for (int i = 0; i < pBody->getSubItemSize(); i++) {
        ISECS2Item* pStreamItem = pBody->getSubItem(i);
        ASSERT(pStreamItem);
        unsigned char STRID;
        pStreamItem->getSubItemU1(0, STRID);
        ISECS2Item* pFcnItem = pStreamItem->getSubItem(1);
        for (int j = 0; j < pFcnItem->getSubItemSize(); j++) {
        }
    }
    BOOL bCheckData = FALSE;
    const char* pszCmdName;
    std::vector<CommandParameter> params;
    {
        ISECS2Item* pItemParams, * pItemParam;
        ISECS2Item* pItem = pRecv->getBody();
        if (pItem->getSubItemSize() < 2) goto MYREPLY;
        if (!pItem->getSubItemString(0, pszCmdName)) goto MYREPLY;
        pItemParams = pItem->getSubItem(1);
        if (pItemParams == nullptr || pItemParams->getType() != SITYPE::L) goto MYREPLY;
        for (int i = 0; i < pItemParams->getSubItemSize(); i++) {
            const char* pszParamName, * pszParamValue;
            pItemParam = pItemParams->getSubItem(i);
            if (pItemParam != nullptr
                && pItemParam->getSubItemString(0, pszParamName)
                && pItemParam->getSubItemString(1, pszParamValue)) {
                CommandParameter cp;
                strcpy_s(cp.szName, COMMAND_NAME_MAX, pszParamName);
                strcpy_s(cp.szValue, COMMAND_VALUE_MAX, pszParamValue);
                params.push_back(cp);
            }
        }
        bCheckData = TRUE;
    }
    // 回调到应用层
    if (bCheckData) {
        if (m_listener.onCommand != nullptr) {
            m_listener.onCommand(this, pszCmdName, params);
        }
    }
MYREPLY:
    replyAck(2, 42, pRecv->getHeader()->systemBytes, BYTE(0), "ERACK");
    return 0;
}
// S5F3
int CHsmsPassive::replyEanbleDisableAlarmReport(IMessage* pRecv)
{
SourceCode/Bond/Servo/HsmsPassive.h
@@ -5,6 +5,7 @@
#include <functional>
#include <vector>
#include <map>
#include <set>
#include "CCollectionEvent.h"
@@ -164,6 +165,7 @@
    int replyLinkEventReport(IMessage* pRecv);
    int replyEanbleDisableEventReport(IMessage* pRecv);
    int replyCommand(IMessage* pRecv);
    int replyConfigureSpooling(IMessage* pRecv);
    int replyEanbleDisableAlarmReport(IMessage* pRecv);
    int replyQueryPPIDList(IMessage* pRecv);
    int replyTerminalDisplay(IMessage* pRecv);
@@ -204,5 +206,8 @@
    // CollectionEvent vector
    std::vector<SERVO::CCollectionEvent*> m_collectionEvents;
    // Spooling Config
    std::map<uint16_t, std::set<uint16_t>> m_spoolingConfig;
};