devices pipelinecontext

This commit is contained in:
flower_linux
2026-03-31 11:02:36 +08:00
parent 1ab3523ea9
commit 3b7368a2ab
14 changed files with 537 additions and 76 deletions

View File

@@ -10,6 +10,7 @@
#include "message_bus/ingress/DriverIngressAdapter.h"
#include "message_bus/pipeline/PipelineEngine.h"
#include "core/plugin_system/PluginManager.h"
#include "core/plugin_system/builtins/ModbusRtuProtocolPlugin.h"
#include "device_bus/manager/SerialDeviceManager.h"
#include "devices/DeviceTypes.h"
#include "utils/logs/logging.h"
@@ -56,7 +57,10 @@ bool DeviceBusManager::initialize(const QJsonObject& rootConfig)
if (!m_pluginManager) {
m_pluginManager = std::make_shared<softbus::core::plugin_system::PluginManager>();
}
m_pluginManager->registerProtocolPlugin(softbus::core::plugin_system::makeModbusRtuProtocolPlugin());
if (m_pipelineEngine) {
m_pipelineEngine->setMemoryPool(m_memoryPool);
m_pipelineEngine->loadRuntimeConfigFromJson(rootConfig.value(QStringLiteral("pipeline")).toObject());
m_pipelineEngine->setPluginManager(m_pluginManager);
m_pipelineEngine->start();
}

View File

@@ -128,9 +128,10 @@ bool initializeSerialDeviceWithDeps(const QString& endpoint, const QJsonObject&
softbus::devices::DeviceInfo info;
info.id = -1;
info.endpoint = endpoint;
info.type = QStringLiteral("serial");
info.kind = softbus::devices::DeviceKind::Serial;
info.endpoint = endpoint;
info.type = QStringLiteral("serial");
info.kind = softbus::devices::DeviceKind::Serial;
info.protocol = params.value(QStringLiteral("protocol")).toString(QStringLiteral("modbus_rtu"));
softbus::devices::physical::SerialDevice::Config cfg;
cfg.endpoint = endpoint;