PySide6.QtBluetooth.QLowEnergyDescriptorData¶
- class QLowEnergyDescriptorData¶
QLowEnergyDescriptorData
类用于创建 GATT 服务数据。更多…概要¶
方法¶
def
__init__()
def
isReadable()
def
isValid()
def
isWritable()
def
__ne__()
def
__eq__()
def
setUuid()
def
setValue()
def
swap()
def
uuid()
def
value()
注意
本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。
详细描述¶
此类的对象提供了一个描述符,可以通过
addDescriptor()
添加到QLowEnergyCharacteristicData
对象中。注意
与访问权限相关的成员函数仅适用于那些蓝牙规范未规定其值是否可以访问以及如何访问的描述符类型。
- __init__()¶
创建此类的新无效对象。
- __init__(other)
- Parameters:
构造此类的新对象,该对象是
other
的副本。- __init__(uuid, value)
- Parameters:
uuid –
QBluetoothUuid
value –
QByteArray
使用由
uuid
和value
分别提供的UUID和值创建此类的新对象。- isReadable()¶
- Return type:
布尔
如果此描述符的值可读,则返回
true
,否则返回false
。- isValid()¶
- Return type:
布尔
当且仅当此对象具有非空UUID时返回true。
- isWritable()¶
- Return type:
布尔
如果此描述符的值是可写的,则返回
true
,否则返回false
。- __ne__(b)¶
- Parameters:
- Return type:
布尔
如果
a
和b
的公共状态不相等,则返回true
,否则返回false
。- __eq__(b)¶
- Parameters:
- Return type:
布尔
如果
a
和b
的公共状态相等,则返回true
,否则返回false
。- readConstraints()¶
- Return type:
返回可以读取此描述符值的约束条件。此值仅在
isReadable()
返回true
时相关。- setReadPermissions(readable[, constraints=QBluetooth.AttAccessConstraints()])¶
- Parameters:
readable – 布尔值
constraints –
AttAccessConstraint
的组合
指定此描述符的值是否
可读
,如果是,则在哪些约束
下。- setUuid(uuid)¶
- Parameters:
uuid –
QBluetoothUuid
将此描述符的UUID设置为
uuid
。另请参阅
- setValue(value)¶
- Parameters:
值 –
QByteArray
将此描述符的值设置为
value
。它将按照此处提供的方式发送到对等设备,因此调用者需要注意诸如字节序之类的事项。另请参阅
- setWritePermissions(writable[, constraints=QBluetooth.AttAccessConstraints()])¶
- Parameters:
writable – 布尔值
constraints –
AttAccessConstraint
的组合
指定此描述符的值是否为
writable
,如果是,则在哪些constraints
下。另请参阅
- swap(other)¶
- Parameters:
将此对象与
other
交换。- uuid()¶
- Return type:
返回此描述符的UUID。
另请参阅
- value()¶
- Return type:
返回此描述符的值。
另请参阅
- writeConstraints()¶
- Return type:
返回可以写入此描述符值的约束条件。此值仅在
isWritable()
返回true
时相关。