LAPTOP-SNT8I5JK\Boounion
2025-07-25 d6d85fd225db353ab5786725d5a2fc777308f276
1.EAP模拟端,已增加发送Link Event Report功能接口并正确发送数据,待Master解释和逻辑处理。
已修改5个文件
43 ■■■■■ 文件已修改
SourceCode/Bond/EAPSimulator/CCollectionEvent.cpp 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/EAPSimulator/CCollectionEvent.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/EAPSimulator/CHsmsActive.cpp 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/EAPSimulator/CHsmsActive.h 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/EAPSimulator/CLinkReportDlg.cpp 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SourceCode/Bond/EAPSimulator/CCollectionEvent.cpp
@@ -87,6 +87,11 @@
        return m_reports;
    }
    std::vector<unsigned int>& CCollectionEvent::getReportIds()
    {
        return m_rptids;
    }
    std::string CCollectionEvent::getReportIdsText()
    {
        std::string strResult, strName;
SourceCode/Bond/EAPSimulator/CCollectionEvent.h
@@ -16,6 +16,7 @@
        std::string& getName();
        std::string& getDescription();
        std::vector<CReport*>& getReports();
        std::vector<unsigned int>& getReportIds();
        std::string getReportIdsText();
        BOOL addReport(CReport* pReport);
        BOOL deleteReport(unsigned int nReportId);
SourceCode/Bond/EAPSimulator/CHsmsActive.cpp
@@ -222,6 +222,29 @@
    return 0;
}
int CHsmsActive::hsmsLinkEventReport(std::map<unsigned int, std::vector<unsigned int>>& mapEvent)
{
    if (mapEvent.empty()) return 0;
    IMessage* pMessage = nullptr;
    int nRet = HSMS_Create1Message(pMessage, m_nSessionId, 2 | REPLY, 35, ++m_nSystemByte);
    ISECS2Item* pItem = pMessage->getBody();
    pItem->addU4Item(1, "DATAID");
    ISECS2Item* pItemEventList = pItem->addItem();
    for (auto item : mapEvent) {
        ISECS2Item* pItemEvent = pItemEventList->addItem();
        pItemEvent->addU4Item(item.first, "CEID");
        ISECS2Item* pItemRptidList = pItemEvent->addItem();
        for (auto vid : item.second) {
            pItemRptidList->addU4Item(vid, "RPTID");
        }
    }
    m_pActive->sendMessage(pMessage);
    HSMS_Destroy1Message(pMessage);
    return 0;
}
int CHsmsActive::replyAck0(IMessage* pMessage)
{
    return 0;
SourceCode/Bond/EAPSimulator/CHsmsActive.h
@@ -2,6 +2,8 @@
#include <string>
#include <vector>
#include <map>
#include "CCollectionEvent.h"
typedef std::function<void(void* pFrom, ACTIVESTATE state)> STATECHANGED;
typedef struct _ACTIVEListener
@@ -48,6 +50,9 @@
    // Define reports
    int hsmsDefineReports(std::map<unsigned int, std::vector<unsigned int>>& mapReport);
    
    // Line Event Report
    int hsmsLinkEventReport(std::map<unsigned int, std::vector<unsigned int>>& mapEvent);
    // 通过的reply函数
    void replyAck(int s, int f, unsigned int systemBytes, BYTE ack, const char* pszAckName);
SourceCode/Bond/EAPSimulator/CLinkReportDlg.cpp
@@ -183,14 +183,19 @@
    CListCtrl* pListCtrl = (CListCtrl*)GetDlgItem(IDC_LIST1);
    POSITION pos = pListCtrl->GetFirstSelectedItemPosition();
    while (pos) {
        int nItem = pListCtrl->GetNextSelectedItem(pos); // 获取选中项索引
        int nItem = pListCtrl->GetNextSelectedItem(pos);
        SERVO::CCollectionEvent* pEvent = (SERVO::CCollectionEvent*)pListCtrl->GetItemData(nItem);
        events.push_back(pEvent);
    }
    std::map<unsigned int, std::vector<unsigned int>> mapEvent;
    for (auto item : events) {
        TRACE("name:%s\n", item->getName().c_str());
        std::vector<unsigned int> RPTIDs = item->getReportIds();
        mapEvent[item->getEventId()] = RPTIDs;
    }
    theApp.m_model.m_pHsmsActive->hsmsLinkEventReport(mapEvent);
}
void CLinkReportDlg::OnDestroy()