MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / SaveEthMessage

Method SaveEthMessage

lib/mdflib/mdflib/src/samplequeue.cpp:246–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

244}
245
246void SampleQueue::SaveEthMessage(const IChannelGroup& group, uint64_t time,
247 const EthMessage& msg) {
248 SampleRecord sample = group.GetSampleRecord();
249 sample.timestamp = time;
250 RecalculateTime(group.RecordId(), sample);
251
252 // Convert the LIN message to a sample record. Note that LIN always uses the
253 // MLSD storage type.
254
255 if (group.Name().find( "_Frame") != std::string::npos) {
256 msg.MessageType(EthMessageType::ETH_Frame);
257 msg.ToRaw(EthMessageType::ETH_Frame, sample);
258 } else if (group.Name().find( "_ChecksumError") != std::string::npos) {
259 msg.MessageType(EthMessageType::ETH_ChecksumError);
260 msg.ToRaw(EthMessageType::ETH_ChecksumError, sample);
261 } else if (group.Name().find( "_LengthError") != std::string::npos) {
262 msg.MessageType(EthMessageType::ETH_LengthError);
263 msg.ToRaw(EthMessageType::ETH_LengthError, sample);
264 } else if (group.Name().find("_ReceiveError") != std::string::npos) {
265 msg.MessageType(EthMessageType::ETH_ReceiveError);
266 msg.ToRaw(EthMessageType::ETH_ReceiveError, sample);
267 }
268 AddSample(std::move(sample));
269}
270
271void SampleQueue::SaveMostMessage(const IChannelGroup& group, uint64_t time,
272 const IMostEvent& msg) {

Callers

nothing calls this directly

Calls 6

GetSampleRecordMethod · 0.80
findMethod · 0.80
RecordIdMethod · 0.45
NameMethod · 0.45
MessageTypeMethod · 0.45
ToRawMethod · 0.45

Tested by

no test coverage detected