Qt Bluetooth C++ Classes

启用基本蓝牙操作,如扫描设备和连接设备。更多

命名空间

QBluetooth

与蓝牙相关的类和函数

QBluetoothAddress

为蓝牙设备分配地址

QBluetoothDeviceDiscoveryAgent

发现附近的蓝牙设备

QBluetoothDeviceInfo

存储有关蓝牙设备的信息

QBluetoothHostInfo

封装本地 QB 蓝牙设备的详细信息

QBluetoothLocalDevice

允许访问本地蓝牙设备

QBluetoothServer

使用 RFCOMM 或 L2cap 协议与蓝牙设备通信

QBluetoothServiceDiscoveryAgent

可查询蓝牙服务

QBluetoothServiceInfo

可访问蓝牙服务的属性

QBluetoothServiceInfo::Alternative

存储蓝牙数据元素替代方案的属性

QBluetoothServiceInfo::Sequence

存储蓝牙数据元素序列的属性

QBluetoothSocket

可连接到运行蓝牙服务器的蓝牙设备

QBluetoothUuid

为每个蓝牙服务生成一个 UUID

QLowEnergyAdvertisingData

代表蓝牙低功耗广告中要广播的数据

QLowEnergyAdvertisingParameters

代表用于蓝牙低能耗广告的参数

QLowEnergyAdvertisingParameters::AddressInfo

QLowEnergyAdvertisingParameters::AddressInfo 定义了白名单的元素

QLowEnergyCharacteristic

存储有关蓝牙低功耗服务特性的信息

QLowEnergyCharacteristicData

用于设置 GATT 服务数据

QLowEnergyConnectionParameters

请求或报告蓝牙 LE 连接参数更新时使用

QLowEnergyController

访问蓝牙低功耗设备

QLowEnergyDescriptor

存储有关蓝牙低功耗描述符的信息

QLowEnergyDescriptorData

用于创建 GATT 服务数据

QLowEnergyService

代表蓝牙低功耗设备上的单个服务

QLowEnergyServiceData

用于设置 GATT 服务数据

详细说明

低功耗蓝牙 Qt BluetoothC++ API 可使应用程序以更灵活的方式扫描设备、连接设备并与之交互。

要在应用程序中使用 C++ 库,请在.pro 文件中添加以下配置选项:

QT += bluetooth

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