devices modbus rtu 1.0

This commit is contained in:
flower_linux
2026-04-07 14:20:04 +08:00
parent 28b5082742
commit 51175ffd18
38 changed files with 1006 additions and 745 deletions

View File

@@ -1,3 +1,14 @@
# Placeholder for modbus_rtu plugin
add_library(modbus_rtu SHARED plugin_stub.cpp)
set_target_properties(modbus_rtu PROPERTIES OUTPUT_NAME "modbus_rtu")
# Runtime-loadable Modbus RTU parser + framer plugin
add_library(modbus_rtu SHARED
plugin_stub.cpp
../modbusrtu/parser/ModbusRtuProtocolPlugin.cpp
../modbusrtu/codec/ModbusRtuCodec.cpp
../modbusrtu/framer/ModbusRtuFramerPlugin.cpp
../modbusrtu/framer/ModbusRtuFraming.cpp
)
target_include_directories(modbus_rtu PRIVATE
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src
)
target_link_libraries(modbus_rtu PRIVATE Qt6::Core)
set_target_properties(modbus_rtu PROPERTIES OUTPUT_NAME "modbus_rtu")

View File

@@ -1,2 +1,17 @@
extern "C" void
softbus_modbus_rtu_plugin_stub() {}
#include "plugins/protocols/modbusrtu/framer/ModbusRtuFramerPlugin.h"
#include "plugins/protocols/modbusrtu/parser/ModbusRtuProtocolPlugin.h"
extern "C" int softbus_plugin_abi_version()
{
return 1;
}
extern "C" softbus::core::plugin_system::IProtocolPlugin* softbus_create_protocol_plugin()
{
return softbus::core::plugin_system::createModbusRtuProtocolPluginRaw();
}
extern "C" softbus::core::plugin_system::IProtocolFramerPlugin* softbus_create_framer_plugin()
{
return softbus::message_bus::pipeline::protocol::modbusrtu::createModbusRtuFramerPluginRaw();
}