PySide6.QtBluetooth.QBluetooth

class QBluetooth

QBluetooth 命名空间提供了与蓝牙相关的类和函数。更多

注意

本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。

详细描述

class Security

(继承 enum.Flag) 此枚举描述了蓝牙服务的安全要求。

常量

描述

QBluetooth.Security.NoSecurity

该服务不需要任何安全措施。

QBluetooth.Security.Authorization

服务需要用户授权,除非设备已授权配对。

QBluetooth.Security.Authentication

该服务需要认证。设备必须配对,除非设备已授权配对,否则在连接时会提示用户。

QBluetooth.Security.Encryption

该服务要求通信链路进行加密。这需要设备进行配对。

QBluetooth.Security.Secure

该服务要求通信链路是安全的。需要蓝牙2.1或更高版本的简单配对。不允许使用传统配对。

class AttAccessConstraint

(继承自 enum.Flag) 此枚举描述了读取或写入 ATT 属性的可能要求。

常量

描述

QBluetooth.AttAccessConstraint.AttAuthorizationRequired

客户端需要从ATT服务器获得授权才能访问该属性。

QBluetooth.AttAccessConstraint.AttAuthenticationRequired

客户端需要经过身份验证才能访问该属性。

QBluetooth.AttAccessConstraint.AttEncryptionRequired

只有在连接加密的情况下才能访问该属性。