本页内容

QLowEnergyAdvertisingParameters::AddressInfo Class

class QLowEnergyAdvertisingParameters::AddressInfo

QLowEnergyAdvertisingParameters::AddressInfo 定义了白名单的元素。更多内容...

公共函数

AddressInfo()
AddressInfo(const QBluetoothAddress &addr, QLowEnergyController::RemoteAddressType type)

公共变量

QBluetoothAddress address
QLowEnergyController::RemoteAddressType type
bool operator!=(const QLowEnergyAdvertisingParameters::AddressInfo &a, const QLowEnergyAdvertisingParameters::AddressInfo &b)
bool operator==(const QLowEnergyAdvertisingParameters::AddressInfo &a, const QLowEnergyAdvertisingParameters::AddressInfo &b)

详细说明

将QLowEnergyAdvertisingParameters::AddressInfo 实例的列表传递给QLowEnergyAdvertisingParameters::setWhiteList()。白名单用于限制哪些设备有权与外设交互。允许的交互类型由QLowEnergyAdvertisingParameters::FilterPolicy 定义。

另请参阅 QLowEnergyAdvertisingParameters::whiteList()。

成员函数文档

AddressInfo::AddressInfo()

构建一个默认构造的 AddressInfo 实例。

默认情况下,AddressInfo::type 成员的值为QLowEnergyController::PublicAddress ,而AddressInfo::address 成员的地址为null。

AddressInfo::AddressInfo(const QBluetoothAddress &addr, QLowEnergyController::RemoteAddressType type)

创建一个新的 AddressInfo 实例。addr 表示远程设备的蓝牙地址,type 表示该地址的类型。

成员变量文档

QBluetoothAddress AddressInfo::address

这是远程设备的蓝牙地址。

QLowEnergyController::RemoteAddressType AddressInfo::type

地址的类型(公共或私有)。AddressInfo 的默认构造函数将此值初始化为QLowEnergyController::PublicAddress 。

相关的非成员

bool operator!=(const QLowEnergyAdvertisingParameters::AddressInfo &a, const QLowEnergyAdvertisingParameters::AddressInfo &b)

如果 `a ` 和 `b ` 的公共状态不相同,则返回 `true `;否则返回 `false`。

bool operator==(const QLowEnergyAdvertisingParameters::AddressInfo &a, const QLowEnergyAdvertisingParameters::AddressInfo &b)

如果 `a ` 和 `b ` 的公共状态相等,则返回 `true `;否则返回 `false`。

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