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

包含用 QModbus 客户端派生类发送的请求数据

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 概述

© 2025 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.