* @brief Forwards raw bytes from device @p deviceId to Console and API Server. */
| 1383 | * @brief Forwards raw bytes from device @p deviceId to Console and API Server. |
| 1384 | */ |
| 1385 | void IO::ConnectionManager::onRawDataReceived(int deviceId, const IO::CapturedDataPtr& data) |
| 1386 | { |
| 1387 | Q_ASSERT(data); |
| 1388 | Q_ASSERT(!data->data.isEmpty()); |
| 1389 | Q_ASSERT(deviceId >= 0); |
| 1390 | |
| 1391 | if (m_paused) |
| 1392 | return; |
| 1393 | |
| 1394 | if (m_replyCaptureArmed.load(std::memory_order_acquire)) [[unlikely]] { |
| 1395 | QMutexLocker locker(&m_replyMutex); |
| 1396 | auto it = m_replyBuffers.find(deviceId); |
| 1397 | if (it != m_replyBuffers.end()) |
| 1398 | it->append(data->data); |
| 1399 | } |
| 1400 | |
| 1401 | static auto& console = Console::Handler::instance(); |
| 1402 | static auto& server = API::Server::instance(); |
| 1403 | static auto& fileTx = IO::FileTransmission::instance(); |
| 1404 | |
| 1405 | server.hotpathTxData(data->data); |
| 1406 | console.hotpathRxDeviceData(deviceId, data->data); |
| 1407 | |
| 1408 | if (fileTx.active()) [[unlikely]] |
| 1409 | fileTx.onRawDataReceived(data->data); |
| 1410 | |
| 1411 | #ifdef BUILD_COMMERCIAL |
| 1412 | static auto& sqliteExport = Sessions::Export::instance(); |
| 1413 | sqliteExport.hotpathTxRawBytes(deviceId, data); |
| 1414 | |
| 1415 | static auto& mqttPublisher = MQTT::Publisher::instance(); |
| 1416 | mqttPublisher.hotpathTxRawBytes(deviceId, data); |
| 1417 | #endif |
| 1418 | |
| 1419 | #ifdef ENABLE_GRPC |
| 1420 | static auto& grpcServer = API::GRPC::GRPCServer::instance(); |
| 1421 | grpcServer.hotpathTxData(data->data); |
| 1422 | #endif |
| 1423 | } |
| 1424 | |
| 1425 | //-------------------------------------------------------------------------------------------------- |
| 1426 | // Private helpers |
nothing calls this directly
no test coverage detected