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

Method processMultiSourcePayload

app/src/IO/ConnectionManager.cpp:555–579  ·  view source on GitHub ↗

* @brief Injects per-source payloads for multi-source playback. */

Source from the content-addressed store, hash-verified

553 * @brief Injects per-source payloads for multi-source playback.
554 */
555void IO::ConnectionManager::processMultiSourcePayload(const QByteArray& fullPayload,
556 const QMap<int, QByteArray>& sourcePayloads)
557{
558 Q_ASSERT(!fullPayload.isEmpty());
559 Q_ASSERT(!sourcePayloads.isEmpty());
560
561 if (fullPayload.isEmpty())
562 return;
563
564 static auto& console = Console::Handler::instance();
565 static auto& server = API::Server::instance();
566 static auto& frameBuilder = DataModel::FrameBuilder::instance();
567
568 const auto captured = makeCapturedData(fullPayload);
569 server.hotpathTxData(captured->data);
570 console.hotpathRxData(captured->data);
571
572 for (auto it = sourcePayloads.constBegin(); it != sourcePayloads.constEnd(); ++it)
573 frameBuilder.hotpathRxSourceFrame(it.key(), makeCapturedData(it.value(), captured->timestamp));
574
575#ifdef ENABLE_GRPC
576 static auto& grpcServer = API::GRPC::GRPCServer::instance();
577 grpcServer.hotpathTxData(captured->data);
578#endif
579}
580
581/**
582 * @brief Writes @p data to device 0.

Callers 3

injectFrameMethod · 0.80
injectFrameMethod · 0.80
injectFrameMethod · 0.80

Calls 7

makeCapturedDataFunction · 0.85
isEmptyMethod · 0.80
hotpathRxDataMethod · 0.80
hotpathRxSourceFrameMethod · 0.80
keyMethod · 0.80
hotpathTxDataMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected