本页内容

Qt Serial Bus C++ Classes

提供用于读写串行总线数据的类。更多内容...

命名空间

QtCanBus

QtSerialPort 模块中 CAN 总线处理部分使用的一些常用枚举

类

QCanBus

负责总线插件的注册和创建

QCanBusDevice

CAN总线的接口类

QCanBusDevice::Filter

QCanBusDevice::Filter 结构体定义了 CAN 总线帧的过滤器

QCanBusDeviceInfo

关于 CAN 总线接口的信息

QCanBusFactory

用作 CAN 总线插件接口的工厂类

QCanBusFrame

表示单个 CAN 帧的容器类

QCanBusFrame::TimeStamp

精度为微秒的时间戳信息

QCanDbcFileParser

可用于解析 DBC 文件

QCanFrameProcessor

可用于解码 QCanBusFrame,或将输入数据转换为可直接发送至接收端的 QCanBusFrame

QCanFrameProcessor::ParseResult

该结构体用作 QCanFrameProcessor::parseFrame() 方法的返回值

QCanMessageDescription

描述了处理 CAN 消息并将其表示为应用程序定义格式的规则

QCanSignalDescription

描述了从 CAN 帧中提取一个值并将其表示为应用程序定义格式的规则

QCanSignalDescription::MultiplexValueRange

定义多路复用器信号的值范围

QCanUniqueIdDescription

描述了访问 QCanBusFrame 中唯一标识符的规则

QModbusClient

用于发送 Modbus 请求的接口

QModbusDataUnit

表示 Modbus 寄存器中单比特和 16 位字条目的容器类

QModbusDevice

Modbus 类、QModbusServer 和 QModbusClient 的基类

QModbusDeviceIdentification

表示 Modbus 服务器物理和功能描述的容器类

QModbusExceptionResponse

包含 Modbus ADU 内部功能代码和错误代码的容器类

QModbusPdu

包含 Modbus ADU 内部存储的功能代码和有效载荷的抽象容器类

QModbusReply

包含由 QModbusClient 派生类发送的请求的数据

QModbusRequest

包含存储在 Modbus ADU 中的功能代码和有效载荷的容器类

QModbusResponse

包含 Modbus ADU 内部存储的功能码和有效载荷的容器类

QModbusRtuSerialClient

表示一个使用串行总线与 Modbus 服务器进行通信的 Modbus 客户端

QModbusRtuSerialServer

表示一个使用串行端口与 Modbus 客户端进行通信的 Modbus 服务器

QModbusServer

用于接收和处理 Modbus 请求的接口

QModbusTcpClient

Modbus TCP 客户端设备的接口类

QModbusTcpConnectionObserver

表示可传递给 QModbusTcpServer::installConnectionObserver 的对象的接口

QModbusTcpServer

表示一个使用 TCP 服务器与 Modbus 客户端进行通信的 Modbus 服务器

详细说明

提供用于访问各种串行总线的类。

对于 C++ 项目,请包含适用于当前用例的头文件,例如,使用 CAN 总线设备的应用程序可以使用

#include <QCanBusDevice>

若要在 CMake 中使用该模块,请使用find_package() 命令在Qt6 软件包中定位所需的模块组件:

find_package(Qt6 COMPONENTS SerialBus REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::SerialBus)

若要使用该模块进行 qmake 构建,请在项目的 .pro 文件中将该模块作为QT 变量的值添加:

QT += serialbus

更多详情请参阅Qt Serial Bus 概述。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.