HRESULT CMsgContainerCAN::GetInterPretedSignalList(STCAN_MSG& ouMsg, SSignalInfoArray& ouSSignalInfoArray, bool isHexMode) { if (nullptr == mBmNetwork) { return S_FALSE; } IFrame* pouFrame = nullptr; ERRORCODE eResult = mBmNetwork->GetFrame(CAN, 0, ouMsg.m_unMsgID, nullptr, &pouFrame); ouSSignalInfoArray.RemoveAll(); if (EC_SUCCESS == eResult && nullptr != pouFrame) { std::list<InterpreteSignals> ouSignal; std::string strName; pouFrame->GetName(strName); pouFrame->InterpretSignals(ouMsg.m_ucData, ouMsg.m_ucDataLen, ouSignal, isHexMode, true); for (auto ouSignalInfo : ouSignal) //Only C++11; { SSignalInfo ouSignal; ouSignal.m_omEnggValue = ouSignalInfo.m_omEnggValue.c_str(); ouSignal.m_omRawValue = ouSignalInfo.m_omRawValue.c_str(); ouSignal.m_omSigName = ouSignalInfo.m_omSigName.c_str(); ouSignal.m_omUnit = ouSignalInfo.m_omUnit.c_str(); ouSignal.m_msgName = strName.c_str(); ouSSignalInfoArray.Add(ouSignal); } return S_OK; } return S_FALSE; }
HRESULT CMsgContainerJ1939::GetInterPretedSignalList(STJ1939_MSG& ouMsg, SSignalInfoArray& ouSSignalInfoArray, bool isHexMode) { if (nullptr == mBmNetwork) { return S_FALSE; } IFrame* pouFrame = nullptr; ERRORCODE eResult = mBmNetwork->GetFrame(J1939, 0, ouMsg.m_sMsgProperties.m_uExtendedID.m_s29BitId.unGetPGN(), nullptr, &pouFrame); ouSSignalInfoArray.RemoveAll(); if (EC_SUCCESS == eResult && nullptr != pouFrame) { std::list<InterpreteSignals> ouSignal; std::string strName; pouFrame->GetName(strName); pouFrame->InterpretSignals(ouMsg.m_pbyData, ouMsg.m_unDLC, ouSignal, isHexMode, true); for (auto ouSignalInfo : ouSignal) //Only C++11; { SSignalInfo ouSignal; ouSignal.m_omEnggValue = ouSignalInfo.m_omEnggValue.c_str(); ouSignal.m_omRawValue = ouSignalInfo.m_omRawValue.c_str(); ouSignal.m_omSigName = ouSignalInfo.m_omSigName.c_str(); ouSignal.m_omUnit = ouSignalInfo.m_omUnit.c_str(); ouSignal.m_msgName = strName.c_str(); ouSSignalInfoArray.Add(ouSignal); } } return S_OK; }