PySide6.QtBluetooth.QBluetoothServiceInfo¶
- class QBluetoothServiceInfo¶
QBluetoothServiceInfo
类允许访问蓝牙服务的属性。More_…概要¶
方法¶
def
__init__()
def
attribute()
def
attributes()
def
contains()
def
device()
def
isComplete()
def
isRegistered()
def
isValid()
def
serverChannel()
def
serviceName()
def
serviceUuid()
def
setAttribute()
def
setDevice()
def
setServiceName()
def
setServiceUuid()
def
socketProtocol()
注意
本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。
详细描述¶
QBluetoothServiceInfo
提供了关于蓝牙设备提供的服务的信息。此外,它还可以用于在本地设备上注册新服务。请注意,这种注册仅影响蓝牙SDP条目。任何监听传入连接的服务器(例如RFCOMM服务器)必须在调用registerService()
之前启动。注销必须按相反的顺序进行。QBluetoothServiceInfo
不是传统意义上的值类型。所有相同服务信息对象的副本共享相同的数据,因为它们在更改时不会分离。这确保了两个副本可以(取消)注册相同的蓝牙服务。在iOS上,这个类无法使用,因为该平台没有公开可能允许访问
QBluetoothServiceInfo
相关功能的API。- class AttributeId¶
蓝牙服务属性。请查阅蓝牙核心规范以获取这些属性的更详细描述。
常量
描述
QBluetoothServiceInfo.ServiceRecordHandle
指定一个可以从中检索属性的服务记录。
QBluetoothServiceInfo.ServiceClassIds
服务所符合的服务类的UUID。最常见的服务类在 (
ServiceClassUuid
) 中定义。QBluetoothServiceInfo.ServiceRecordState
当任何其他服务属性被添加、删除或修改时,属性会发生变化。
QBluetoothServiceInfo.ServiceId
唯一标识服务的UUID。
QBluetoothServiceInfo.ProtocolDescriptorList
服务使用的协议列表。最常见的协议Uuids在
ProtocolUuid
中定义QBluetoothServiceInfo.BrowseGroupList
服务所在的浏览组列表。
QBluetoothServiceInfo.LanguageBaseAttributeIdList
支持人类可读属性的语言基础属性ID列表。
QBluetoothServiceInfo.ServiceInfoTimeToLive
服务记录预计保持有效和不变的秒数。
QBluetoothServiceInfo.ServiceAvailability
表示服务可用性的值。
QBluetoothServiceInfo.BluetoothProfileDescriptorList
服务符合的配置文件列表。
QBluetoothServiceInfo.DocumentationUrl
指向服务文档的URL。
QBluetoothServiceInfo.ClientExecutableUrl
指向可用于利用服务的应用程序位置的URL。
QBluetoothServiceInfo.IconUrl
表示服务的图标位置的URL。
QBluetoothServiceInfo.AdditionalProtocolDescriptorList
服务使用的附加协议。此属性扩展了
ProtocolDescriptorList
。QBluetoothServiceInfo.PrimaryLanguageBase
主要语言文本描述符的基础索引。
QBluetoothServiceInfo.ServiceName
蓝牙服务的主要语言名称。
QBluetoothServiceInfo.ServiceDescription
蓝牙服务的主要语言描述。
QBluetoothServiceInfo.ServiceProvider
提供蓝牙服务主要语言的公司/实体的名称。
注意
在Windows上,当创建服务时,ServiceClassIds和ProtocolDescriptorList会自动设置为默认值。手动设置这些属性的值将不起作用,并可能在此平台上导致意外结果。
- class Protocol¶
此枚举描述了服务使用的套接字协议。
常量
描述
QBluetoothServiceInfo.UnknownProtocol
该服务使用未知的套接字协议。
QBluetoothServiceInfo.L2capProtocol
该服务使用L2CAP套接字协议。此协议在Android上不支持直接套接字连接。
QBluetoothServiceInfo.RfcommProtocol
该服务使用RFCOMM套接字协议。
- __init__()¶
构造一个新的无效的
QBluetoothServiceInfo
;- __init__(other)
- Parameters:
构造一个新的
QBluetoothServiceInfo
,它是other
的副本。两个副本继续共享相同的基础数据,这些数据在写入时不会分离。
- attribute(attributeId)¶
- Parameters:
attributeId – int
- Return type:
对象
返回属性
attributeId
的值。另请参阅
- attributes()¶
- Return type:
.quint16的列表
返回
QBluetoothServiceInfo
对象拥有的所有属性ID的列表。- contains(attributeId)¶
- Parameters:
attributeId – int
- Return type:
布尔
如果
QBluetoothServiceInfo
对象包含属性attributeId
,则返回 true,否则返回 false。- device()¶
- Return type:
返回提供此服务的蓝牙设备的地址。
另请参阅
- isComplete()¶
- Return type:
布尔
如果
QBluetoothServiceInfo
对象被认为是完整的,则返回true,否则返回false。一个完整的
QBluetoothServiceInfo
对象包含一个ProtocolDescriptorList
属性。- isRegistered()¶
- Return type:
布尔
如果服务信息已注册到平台的Service Discovery Protocol (SDP)实现中,则返回true,否则返回false。
- isValid()¶
- Return type:
布尔
如果
QBluetoothServiceInfo
对象有效,则返回 true,否则返回 false。一个无效的
QBluetoothServiceInfo
对象将没有任何属性。- protocolDescriptor(protocol)¶
- Parameters:
协议 –
ProtocolUuid
- Return type:
返回协议
protocol
的参数作为Sequence
。如果
protocol
不被支持,则返回一个空的Sequence
。- protocolServiceMultiplexer()¶
- Return type:
整数
这是一个便捷函数。返回支持L2CAP协议的服务协议/服务多路复用器,否则返回-1。
此函数等同于从
attribute
(ProtocolDescriptorList
)返回的Sequence
中提取信息。- registerService([localAdapter=QBluetoothAddress()])¶
- Parameters:
localAdapter –
QBluetoothAddress
- Return type:
布尔
将此服务注册到平台的服务发现协议(SDP)实现中,使其在其他设备执行服务发现时可被发现。如果服务成功注册,则返回true,否则返回false。一旦注册,记录将无法更改。必须取消注册并重新注册服务以进行更改。
localAdapter
参数决定了服务应注册的本地蓝牙适配器。如果localAdapter
是null
,则将使用默认的蓝牙适配器。如果此服务信息对象已通过本地适配器注册,并且此函数使用不同的本地适配器调用,则先前的注册将被移除,并使用新的适配器重新注册服务。- removeAttribute(attributeId)¶
- Parameters:
attributeId – int
从
QBluetoothServiceInfo
对象中移除属性attributeId
。如果服务信息已经注册到平台的SDP数据库中,数据库条目将不会更新,直到再次调用
registerService()
。- serverChannel()¶
- Return type:
整数
这是一个便捷函数。返回支持RFCOMM协议的服务的服务器通道,否则返回-1。
此函数等同于从
attribute
(QBluetootherServiceInfo::ProtocolDescriptorList)返回的Sequence
中提取信息。- serviceAvailability()¶
- Return type:
整数
这是一个便捷函数。它等同于调用 attribute(
ServiceAvailability
).toUInt()。返回服务的可用性。
- serviceClassUuids()¶
- Return type:
返回描述此服务符合的服务类别的UUID列表。
这是一个便捷函数。它等同于调用 attribute(
ServiceClassIds
).value<Sequence
>() 然后遍历其QBluetoothUuid
条目。另请参阅
- serviceDescription()¶
- Return type:
字符串
这是一个便捷函数。它等同于调用 attribute(
ServiceDescription
).toString()。返回主要语言的服务描述。
- serviceName()¶
- Return type:
字符串
这是一个便捷函数。它等同于调用 attribute(
ServiceName
).toString()。返回主要语言中的服务名称。
- serviceProvider()¶
- Return type:
字符串
这是一个便捷函数。它等同于调用 attribute(
ServiceProvider
).toString()。返回主要语言的服务提供商。
- serviceUuid()¶
- Return type:
这是一个便捷函数。它等同于调用 attribute(
ServiceId
).value<QBluetoothUuid
>()。返回服务的自定义UUID。此UUID可能为空。基于Bluetooth SIG标准的UUID应通过
serviceClassUuids()
获取。这是一个方便的函数。
将
attributeId
标识的属性设置为value
。如果服务信息已经注册到平台的SDP数据库中,数据库条目将不会更新,直到再次调用
registerService()
。另请参阅
- setAttribute(attributeId, value)
- Parameters:
attributeId – int
value –
Sequence
这是一个方便的函数。
将
attributeId
标识的属性设置为value
。如果服务信息已经注册到平台的SDP数据库中,数据库条目将不会更新,直到再次调用
registerService()
。- setAttribute(attributeId, value)
- Parameters:
attributeId – int
value –
QBluetoothUuid
这是一个方便的函数。
将
attributeId
标识的属性设置为value
。如果服务信息已经注册到平台的SDP数据库中,数据库条目将不会更新,直到再次调用
registerService()
。- setAttribute(attributeId, value)
- Parameters:
attributeId – int
value – 对象
将
attributeId
标识的属性设置为value
。如果服务信息已经注册到平台的SDP数据库中,数据库条目将不会更新,直到再次调用
registerService()
。- setDevice(info)¶
- Parameters:
信息 –
QBluetoothDeviceInfo
将提供此服务的蓝牙设备设置为
device
。另请参阅
- setServiceAvailability(availability)¶
- Parameters:
可用性 – int
这是一个便捷函数。它等同于调用
setAttribute
(ServiceAvailability
, availability)。设置服务的可用性为
availability
。- setServiceDescription(description)¶
- Parameters:
描述 – str
这是一个便捷函数。它等同于调用
setAttribute
(ServiceDescription
, description)。将主要语言中的服务描述设置为
description
。- setServiceName(name)¶
- Parameters:
name – str
这是一个便捷函数。它等同于调用
setAttribute
(ServiceName
, name)。将主要语言中的服务名称设置为
name
。- setServiceProvider(provider)¶
- Parameters:
provider – str
这是一个便捷函数。它等同于调用
setAttribute
(ServiceProvider
, provider)。将主要语言中的服务提供商设置为
provider
。- setServiceUuid(uuid)¶
- Parameters:
uuid –
QBluetoothUuid
这是一个便捷函数。它等同于调用
setAttribute
(ServiceId
, uuid)。设置自定义服务UUID为
uuid
。此函数不应用于设置标准化服务UUID。返回
QBluetoothServiceInfo
对象使用的协议。- unregisterService()¶
- Return type:
布尔
取消在平台的Service Discovery Protocol (SDP)实现中注册此服务。此后,其他设备将无法通过服务发现找到该服务。
如果服务成功注销,则返回 true,否则返回 false。
- class Sequence¶
Sequence 类存储蓝牙数据元素序列的属性。More_…
概要¶
方法¶
def
__init__()
def
append()
def
at()
def
back()
def
capacity()
def
clear()
def
constData()
def
constFirst()
def
constLast()
def
count()
def
data()
def
empty()
def
first()
def
front()
def
insert()
def
isEmpty()
def
isSharedWith()
def
last()
def
length()
def
max_size()
def
mid()
def
move()
def
__add__()
def
__iadd__()
def
__lshift__()
def
operator[]()
def
pop_back()
def
pop_front()
def
prepend()
def
push_back()
def
push_front()
def
remove()
def
removeAll()
def
removeAt()
def
removeFirst()
def
removeLast()
def
removeOne()
def
reserve()
def
resize()
def
shrink_to_fit()
def
size()
def
sliced()
def
squeeze()
def
swap()
def
swapItemsAt()
def
takeAt()
def
toList()
def
toVector()
def
value()
静态函数¶
def
fromList()
def
fromVector()
def
maxSize()
注意
本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。
详细描述¶
- __init__()¶
构造一个新的空序列。
- __init__(list)
- Parameters:
list – QVariant 的列表
构造一个新的序列,它是
list
的副本。- append(arg__1)¶
- Parameters:
arg__1 – 对象
- append(l)
- Parameters:
l – QVariant 的列表
- at(i)¶
- Parameters:
i – 整数
- Return type:
对象
- back()¶
- Return type:
对象
- capacity()¶
- Return type:
整数
- clear()¶
- constData()¶
- Return type:
对象
- constFirst()¶
- Return type:
对象
- constLast()¶
- Return type:
对象
- count()¶
- Return type:
整数
- data()¶
- Return type:
对象
- empty()¶
- Return type:
布尔
- first()¶
- Return type:
对象
- first(n)
- Parameters:
n – 整数
- Return type:
.QVariant 列表
- static fromList(list)¶
- Parameters:
list – QVariant 的列表
- Return type:
.QVariant 列表
- static fromVector(vector)¶
- Parameters:
vector – QVariant 的列表
- Return type:
.QVariant 列表
- front()¶
- Return type:
对象
- insert(arg__1, arg__2)¶
- Parameters:
arg__1 – 整数
arg__2 – 对象
- isEmpty()¶
- Return type:
布尔
- Parameters:
其他 – .list of QVariant
- Return type:
布尔
- last()¶
- Return type:
对象
- last(n)
- Parameters:
n – 整数
- Return type:
.QVariant 列表
- length()¶
- Return type:
整数
- static maxSize()¶
- Return type:
整数
- max_size()¶
- Return type:
整数
- mid(pos[, len=-1])¶
- Parameters:
pos – 整数
len – int
- Return type:
.QVariant 列表
- move(from, to)¶
- Parameters:
from – 整数
to – int
- __add__(l)¶
- Parameters:
l – QVariant 的列表
- Return type:
.QVariant 列表
- __iadd__(l)¶
- Parameters:
l – QVariant 的列表
- Return type:
.QVariant 列表
- __lshift__(l)¶
- Parameters:
l – QVariant 的列表
- Return type:
.QVariant 列表
- operator(i)¶
- Parameters:
i – 整数
- Return type:
对象
- pop_back()¶
- pop_front()¶
- prepend(arg__1)¶
- Parameters:
arg__1 – 对象
- push_back(arg__1)¶
- Parameters:
arg__1 – 对象
- push_front(arg__1)¶
- Parameters:
arg__1 – 对象
- remove(i[, n=1])¶
- Parameters:
i – 整数
n – 整数
- removeAll(arg__1)¶
- Parameters:
arg__1 – 对象
- removeAt(i)¶
- Parameters:
i – 整数
- removeFirst()¶
- removeLast()¶
- removeOne(arg__1)¶
- Parameters:
arg__1 – 对象
- reserve(size)¶
- Parameters:
size – int
- resize(size)¶
- Parameters:
size – int
- resizeForOverwrite(size)¶
- Parameters:
size – int
- shrink_to_fit()¶
- size()¶
- Return type:
整数
- sliced(pos)¶
- Parameters:
pos – 整数
- Return type:
.QVariant 列表
- sliced(pos, n)
- Parameters:
pos – 整数
n – 整数
- Return type:
.QVariant 列表
- squeeze()¶
- swap(other)¶
- Parameters:
其他 – .QVariant 列表
- swapItemsAt(i, j)¶
- Parameters:
i – 整数
j – int
- takeAt(i)¶
- Parameters:
i – 整数
- Return type:
对象
- toList()¶
- Return type:
.QVariant 列表
- toVector()¶
- Return type:
.QVariant 列表
- value(i)¶
- Parameters:
i – 整数
- Return type:
对象
- class Alternative¶
Alternative 类存储蓝牙数据元素替代方案的属性。More_…
概要¶
方法¶
def
__init__()
def
append()
def
at()
def
back()
def
capacity()
def
clear()
def
constData()
def
constFirst()
def
constLast()
def
count()
def
data()
def
empty()
def
first()
def
front()
def
insert()
def
isEmpty()
def
isSharedWith()
def
last()
def
length()
def
max_size()
def
mid()
def
move()
def
__add__()
def
__iadd__()
def
__lshift__()
def
operator[]()
def
pop_back()
def
pop_front()
def
prepend()
def
push_back()
def
push_front()
def
remove()
def
removeAll()
def
removeAt()
def
removeFirst()
def
removeLast()
def
removeOne()
def
reserve()
def
resize()
def
shrink_to_fit()
def
size()
def
sliced()
def
squeeze()
def
swap()
def
swapItemsAt()
def
takeAt()
def
toList()
def
toVector()
def
value()
静态函数¶
def
fromList()
def
fromVector()
def
maxSize()
注意
本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。
详细描述¶
- __init__()¶
构造一个新的空替代项。
- __init__(list)
- Parameters:
list – QVariant 的列表
构造一个新的替代方案,它是
list
的副本。- append(arg__1)¶
- Parameters:
arg__1 – 对象
- append(l)
- Parameters:
l – QVariant 的列表
- at(i)¶
- Parameters:
i – 整数
- Return type:
对象
- back()¶
- Return type:
对象
- capacity()¶
- Return type:
整数
- clear()¶
- constData()¶
- Return type:
对象
- constFirst()¶
- Return type:
对象
- constLast()¶
- Return type:
对象
- count()¶
- Return type:
整数
- data()¶
- Return type:
对象
- empty()¶
- Return type:
布尔
- first()¶
- Return type:
对象
- first(n)
- Parameters:
n – 整数
- Return type:
.QVariant 列表
- static fromList(list)¶
- Parameters:
list – QVariant 的列表
- Return type:
.QVariant 列表
- static fromVector(vector)¶
- Parameters:
vector – QVariant 的列表
- Return type:
.QVariant 列表
- front()¶
- Return type:
对象
- insert(arg__1, arg__2)¶
- Parameters:
arg__1 – 整数
arg__2 – 对象
- isEmpty()¶
- Return type:
布尔
- Parameters:
其他 – .list of QVariant
- Return type:
布尔
- last()¶
- Return type:
对象
- last(n)
- Parameters:
n – 整数
- Return type:
.QVariant 列表
- length()¶
- Return type:
整数
- static maxSize()¶
- Return type:
整数
- max_size()¶
- Return type:
整数
- mid(pos[, len=-1])¶
- Parameters:
pos – 整数
len – int
- Return type:
.QVariant 列表
- move(from, to)¶
- Parameters:
from – 整数
to – int
- __add__(l)¶
- Parameters:
l – QVariant 的列表
- Return type:
.QVariant 列表
- __iadd__(l)¶
- Parameters:
l – QVariant 的列表
- Return type:
.QVariant 列表
- __lshift__(l)¶
- Parameters:
l – QVariant 的列表
- Return type:
.QVariant 列表
- operator(i)¶
- Parameters:
i – 整数
- Return type:
对象
- pop_back()¶
- pop_front()¶
- prepend(arg__1)¶
- Parameters:
arg__1 – 对象
- push_back(arg__1)¶
- Parameters:
arg__1 – 对象
- push_front(arg__1)¶
- Parameters:
arg__1 – 对象
- remove(i[, n=1])¶
- Parameters:
i – 整数
n – 整数
- removeAll(arg__1)¶
- Parameters:
arg__1 – 对象
- removeAt(i)¶
- Parameters:
i – 整数
- removeFirst()¶
- removeLast()¶
- removeOne(arg__1)¶
- Parameters:
arg__1 – 对象
- reserve(size)¶
- Parameters:
size – int
- resize(size)¶
- Parameters:
size – int
- resizeForOverwrite(size)¶
- Parameters:
size – int
- shrink_to_fit()¶
- size()¶
- Return type:
整数
- sliced(pos)¶
- Parameters:
pos – 整数
- Return type:
.QVariant 列表
- sliced(pos, n)
- Parameters:
pos – 整数
n – 整数
- Return type:
.QVariant 列表
- squeeze()¶
- swap(other)¶
- Parameters:
其他 – .list of QVariant
- swapItemsAt(i, j)¶
- Parameters:
i – 整数
j – int
- takeAt(i)¶
- Parameters:
i – 整数
- Return type:
对象
- toList()¶
- Return type:
.QVariant 列表
- toVector()¶
- Return type:
.QVariant 列表
- value(i)¶
- Parameters:
i – 整数
- Return type:
对象