1.EAP模拟端,已增加发送Link Event Report功能接口并正确发送数据,待Master解释和逻辑处理。
| | |
| | | return m_reports; |
| | | } |
| | | |
| | | std::vector<unsigned int>& CCollectionEvent::getReportIds() |
| | | { |
| | | return m_rptids; |
| | | } |
| | | |
| | | std::string CCollectionEvent::getReportIdsText() |
| | | { |
| | | std::string strResult, strName; |
| | |
| | | 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); |
| | |
| | | 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; |
| | |
| | | #include <string> |
| | | #include <vector> |
| | | #include <map> |
| | | #include "CCollectionEvent.h" |
| | | |
| | | |
| | | typedef std::function<void(void* pFrom, ACTIVESTATE state)> STATECHANGED; |
| | | typedef struct _ACTIVEListener |
| | |
| | | // 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); |
| | | |
| | |
| | | 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() |