用于通告、搜索和连接到 BR/EDR 蓝牙配置文件的库。
协议
AudioDirectionExt
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
音频优先级方向扩展。用于将通道置于 A2DP 数据包在来源或接收器方向上优先于其他数据包的模式。
SetPriority
请求
| 名称 | 类型 |
|---|---|
priority |
A2dpDirectionPriority
|
响应
| 名称 | 类型 |
|---|---|
payload |
AudioDirectionExt_SetPriority_Result
|
AudioOffloadController
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
表示控制器正在主动将分流音频编码到此声道或从此声道解码分流音频的协议。 关闭协议将停止编码,如果需要同步,也可以使用 Stop() 来完成。如果控制器无法启动音频分流,则在关闭时会发送墓志铭。
如果控制器不支持音频分流配置,此通道将关闭,并显示 ZX_ERR_NOT_SUPPORTED 墓志铭。
如果控制器发送错误,此通道将关闭并显示 ZX_ERR_UNAVAILABLE 墓志铭。
如果音频分流开始或停止操作已在另一个通道上进行/完成,则此通道将关闭,并显示 ZX_ERR_ALREADY_BOUND 墓志铭。
如果在音频分流未启动时发出命令,此通道将关闭,并显示 ZX_ERR_INTERNAL 墓志铭。
OnStarted
在音频分流成功启动时从服务器发送。 每个协议仅发送一次。
响应
<EMPTY>
停止
请求停止音频分流。 此调用将在服务器端关闭协议之前得到响应。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
payload |
AudioOffloadController_Stop_Result
|
AudioOffloadExt
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
音频分流扩展。用于检索分流功能和支持的功能。
GetSupportedFeatures
返回此芯片组支持的供应商功能
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
payload |
AudioOffloadExt_GetSupportedFeatures_Result
|
StartAudioOffload
开始音频编码硬件分流流程
请求
| 名称 | 类型 |
|---|---|
configuration |
AudioOffloadConfiguration
|
controller |
server_end:AudioOffloadController
|
ConnectionReceiver
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
表示由此配置文件注册的服务。关闭此协议将移除服务注册。
已连接
在对等方连接到此服务时调用。连接的渠道通过 channel 中的参数进行传递。protocol 将包含一个协议列表,其中列出了连接点之前的所有协议(例如,如果 L2CAP 已连接,则该列表将包含 L2CAP 协议并指定已连接的 PSM)
请求
| 名称 | 类型 |
|---|---|
peer_id |
fuchsia.bluetooth/PeerId
|
channel |
Channel
|
protocol |
ProtocolDescriptorList
|
OnRevoke
FIDL 服务器生成的事件,用于指示应撤消已注册的服务并将其从服务发现协议数据库中移除。 预计此协议将在发出此事件后关闭。
响应
<EMPTY>
ConnectionReceiver2
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
表示由此配置文件注册的服务。关闭此协议将移除服务注册。
已连接
在对等方连接到此服务时调用。连接的渠道通过 channel 中的参数进行传递。protocol 将包含一个协议列表,其中列出了连接点之前的所有协议(例如,如果 L2CAP 已连接,则该列表将包含 L2CAP 协议并指定已连接的 PSM)
请求
| 名称 | 类型 |
|---|---|
payload |
ConnectionReceiver2ConnectedRequest
|
响应
| 名称 | 类型 |
|---|---|
payload |
ConnectionReceiver2_Connected_Result
|
OnRevoke
表示应撤消已注册的服务,并将其从服务发现协议数据库中移除。协议关闭后,服务即已移除。
响应
<EMPTY>
L2capParametersExt
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
L2CAP 参数扩展。用于在开放通道上配置 L2CAP 通道参数。
RequestParameters
请求更新 L2CAP 通道参数。request 表示所需的参数,new 表示新参数(如果被拒绝/修改,则可能与请求的参数不同)。
目前,只有以下参数可以更改:
- flush_timeout
请求
| 名称 | 类型 |
|---|---|
request |
ChannelParameters
|
响应
| 名称 | 类型 |
|---|---|
payload |
L2capParametersExt_RequestParameters_Result
|
个人资料
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
该服务为蓝牙 BR/EDR 配置文件提供了一种注册服务定义的方法,使配置文件可被对等设备发现。已注册的服务可以接收与通告记录建立的 L2CAP 连接,并且可以在对等设备上打开新连接。
广告
注册一组服务。
这些服务可通过服务发现协议服务器进行检测。
必须一次性添加通告同一通道的所有服务 - 如果服务已在任何通告的通道上注册,注册将失败,接收器将关闭并返回 ZX_ERR_ALREADY_BOUND,同时返回错误。
ConnectionReceiver 将收到对所通告服务中的 protocol_descriptor 或 alternative_protocol_descriptors 中包含的通道的连接调用。
如果通告出现任何错误,接收器将被关闭。
如有必要,ConnectionReceiver::OnRevoke 事件可用于同步撤消通告。关闭 ConnectionReceiver 协议也会停止通告这些服务。
如果由于任何原因无法进行通告,系统将返回 INVALID_ARGUMENTS 错误,并且接收器将关闭,并显示适当的墓志铭。返回通过服务发现协议服务器注册的服务集。如果任何 L2CAP 协议描述符请求 PSM_DYNAMIC,则返回的服务可能与输入 services 不同。在这种情况下,Profile 服务器应分配一个有效的 PSM,并在返回的服务中包含此值。
请求
| 名称 | 类型 |
|---|---|
payload |
ProfileAdvertiseRequest
|
响应
| 名称 | 类型 |
|---|---|
payload |
Profile_Advertise_Result
|
关联
使用列出的所需 connection 参数,将 L2CAP 或 RFCOMM 通道连接到由 peer_id 标识的已连接对等设备。您可以在 connection 中指定动态 PSM。
返回已建立连接的通道,如果无法连接通道,则返回错误代码。
请求
| 名称 | 类型 |
|---|---|
peer_id |
fuchsia.bluetooth/PeerId
|
connection |
ConnectParameters
|
响应
| 名称 | 类型 |
|---|---|
payload |
Profile_Connect_Result
|
ConnectSco
尝试与使用 params 配置的 peer_id 建立同步连接。
如果 initiator 为 true,系统会发送连接请求。只能指定 1 个参数。
如果 initiator 为 false,主机将尝试使用按顺序给出的参数接受下一个连接请求。系统将按顺序尝试这些参数,直到连接成功、所有参数均被拒绝 (ScoErrorCode.PARAMETERS_REJECTED) 或过程被取消。
连接尝试的结果和用于连接的参数将通过 connection 返回。丢弃connection将取消请求。
请求
| 名称 | 类型 |
|---|---|
payload |
ProfileConnectScoRequest
|
搜索
在新连接的对等设备上注册服务搜索。SearchResults 协议将用于报告此搜索的结果。
service_uuid 或 full_uuid 只能存在一个。任何服务与指定 UUID 匹配的服务结果都将与 attr_ids 中的其他属性一起返回。
如果 service_uuid 和 full_uuid 都存在,则系统会返回 ZX_ERR_INVALID_ARGS。如果 attr_ids 为空或省略,系统将请求所有属性。系统始终会请求额外属性 BLUETOOTH_PROTOCOL_DESCRIPTOR_LIST。请参阅蓝牙规范 v5.2 第 3 卷 B 部分第 5 节以及相关配置文件规范文档。
请求
| 名称 | 类型 |
|---|---|
payload |
ProfileSearchRequest
|
ScoConnection
在 fuchsia.bluetooth.bredr/sco.fidl 中定义
SCO 连接。在 OnConnectionComplete 事件发送之前,连接处于待处理状态,该事件始终会先到达。如果连接失败,协议将在错误传递后关闭。如果在 OnConnectionComplete 事件之前调用方法,这些方法将会失败,协议将会关闭,并且所有连接都会断开。
OnConnectionComplete
在连接成功建立或失败时调用。
响应
| 名称 | 类型 |
|---|---|
payload |
ScoConnectionOnConnectionCompleteRequest
|
读取
读取下一个入站 SCO 载荷。 挂起,直到收到新数据。 一次只能有一个读取请求处于待处理状态。如果再收到请求,协议将被关闭。
请求
<EMPTY>
响应
| 名称 | 类型 |
|---|---|
payload |
ScoConnection_Read_Result
|
RequestDisconnect
请求断开当前连接。底层连接断开后,服务器应关闭协议。这可用于对连接断开后发生的事件进行排序。如果不需要,当客户端关闭此协议时,服务器将始终断开 SCO。
请求
<EMPTY>
写入
将 data 写入 SCO 连接。
如果 Write 尝试发送的数据超过 max_tx_data_size,则协议将关闭。一次只能有一个写入请求处于待处理状态。如果再收到请求,协议将被关闭。
请求
| 名称 | 类型 |
|---|---|
payload |
ScoConnectionWriteRequest
|
响应
| 名称 | 类型 |
|---|---|
payload |
ScoConnection_Write_Result
|
SearchResults
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
表示一项活跃搜索,可在连接到对等设备时生成结果。关闭此协议将导致无法在新连接的对等节点上执行关联的搜索。
ServiceFound
当此客户端添加的搜索在对等设备上找到匹配的服务时调用。
peer_id 是发现服务的对等节点。
protocol 包含服务记录中的 ProtocolDescriptorList(如果存在,attributes 中也包含该列表)。
attributes 包含从搜索中请求的、存在于对等记录中的所有属性。它还可能包含其他属性。
每个 ServiceFound 调用都应通过回复进行确认。
系统会在该通道上发送数量有限的未确认结果。如果在收到结果时有太多结果未确认,则结果可能会被丢弃。
请求
| 名称 | 类型 |
|---|---|
peer_id |
fuchsia.bluetooth/PeerId
|
protocol |
ProtocolDescriptorList
|
attributes |
vector<Attribute>:512
|
响应
| 名称 | 类型 |
|---|---|
payload |
SearchResults_ServiceFound_Result
|
STRUCTS
AudioDirectionExt_SetPriority_Response
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
<EMPTY>
AudioOffloadController_Stop_Response
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
<EMPTY>
ConnectionReceiver2_Connected_Response
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
<EMPTY>
L2capParametersExt_RequestParameters_Response
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
new |
ChannelParameters
|
无默认应用 |
Profile_Connect_Response 资源
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
| 字段 | 类型 | 说明 | 默认 |
|---|---|---|---|
channel |
Channel
|
无默认应用 |
ScoConnection_Write_Response
在 fuchsia.bluetooth.bredr/sco.fidl 中定义
<EMPTY>
SearchResults_ServiceFound_Response
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
<EMPTY>
枚举
A2dpDirectionPriority strict
类型:uint32
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
AudioDirectionExt 中使用的 A2DP 数据包优先级。只要音频未流式传输,就应使用 NORMAL,并且 SOURCE/SINK 应与音频流式传输的方向一致。
| 名称 | 值 | 说明 |
|---|---|---|
正常 |
1 |
|
SOURCE |
2 |
|
SINK |
3 |
AudioBitsPerSample 灵活
类型:uint8
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
| 名称 | 值 | 说明 |
|---|---|---|
BPS_16 |
1 |
|
BPS_24 |
2 |
|
BPS_32 |
3 |
AudioChannelMode flexible
类型:uint8
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
| 名称 | 值 | 说明 |
|---|---|---|
单色 |
0 |
|
STEREO |
1 |
AudioSamplingFrequency 灵活
类型:uint8
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
| 名称 | 值 | 说明 |
|---|---|---|
HZ_44100 |
1 |
|
HZ_48000 |
2 |
|
HZ_88200 |
3 |
|
HZ_96000 |
4 |
DataPath strict
类型:uint8
在 fuchsia.bluetooth.bredr/sco.fidl 中定义
指明应在同步连接上用于数据的音频传输。
| 名称 | 值 | 说明 |
|---|---|---|
HOST |
1 |
HCI 传输。数据将通过 ScoConnection 协议发送/接收。 |
卸载 |
2 |
直接在控制器和音频硬件之间传输音频数据。 ScoConnection 协议将不会用于发送/接收数据。 |
测试 |
3 |
音频测试模式传输。如需了解详情,请参阅核心规范 v5.2 第 4 卷 E 部分第 7.6.2 节。 |
HfpParameterSet 灵活
类型:uint8
在 fuchsia.bluetooth.bredr/sco.fidl 中定义
免提配置文件规范(v1.8,第 5.7 节)中定义的编解码器参数集。
| 名称 | 值 | 说明 |
|---|---|---|
T1 |
1 |
|
T2 |
2 |
|
S1 |
3 |
|
S2 |
4 |
|
S3 |
5 |
|
S4 |
6 |
|
D0 |
7 |
|
D1 |
8 |
ProtocolIdentifier flexible
类型:uint16
在 fuchsia.bluetooth.bredr/service.fidl 中定义
为协议描述符定义的协议标识符 我们有意省略了已弃用的配置文件标识符。 摘自《Bluetooth Assigned Numbers》(蓝牙分配编号): https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
| 名称 | 值 | 说明 |
|---|---|---|
SDP |
1 |
|
RFCOMM |
3 |
|
ATT |
7 |
|
OBEX |
8 |
|
BNEP |
15 |
|
HIDP |
17 |
|
HARDCOPY_CONTROL_CHANNEL |
18 |
|
HARDCOPY_DATA_CHANNEL |
20 |
|
HARDCOPY_NOTIFICATION |
22 |
|
AVCTP |
23 |
|
AVDTP |
25 |
|
MCAP_CONTROL_CHANNEL |
30 |
|
MCAP_DATA_CHANNEL |
31 |
|
L2CAP |
256 |
RxPacketStatus strict
类型:uint8
在 fuchsia.bluetooth.bredr/sco.fidl 中定义
入站 SCO 数据的 RxPacketStatus 指示可能存在数据丢失或损坏。
| 名称 | 值 | 说明 |
|---|---|---|
CORRECTLY_RECEIVED_DATA |
0 |
控制器将所有数据标记为“良好数据”。 |
POSSIBLY_INVALID_DATA |
1 |
部分数据可能存在错误。 |
NO_DATA_RECEIVED |
2 |
所有数据都已丢失。载荷将为空。 |
DATA_PARTIALLY_LOST |
3 |
部分数据已丢失,丢失的数据区域将设置为 0。 |
ScoErrorCode flexible
类型:uint32
在 fuchsia.bluetooth.bredr/sco.fidl 中定义
| 名称 | 值 | 说明 |
|---|---|---|
失败 |
1 |
|
已取消 |
2 |
|
INVALID_ARGUMENTS |
3 |
|
PARAMETERS_REJECTED |
4 |
ServiceClassProfileIdentifier flexible
类型:uint16
在 fuchsia.bluetooth.bredr/service.fidl 中定义
对蓝牙类别 / 配置文件有效的标识符。 我们有意省略了不受支持、已弃用或预留供 Fuchsia 蓝牙使用的类和配置文件 ID。 这些数字来自 SDP 的蓝牙分配号码。 https://www.bluetooth.com/specifications/assigned-numbers/service-discovery
| 名称 | 值 | 说明 |
|---|---|---|
SERIAL_PORT |
4353 |
串行端口配置文件 (SPP) |
DIALUP_NETWORKING |
4355 |
拨号网络配置文件 (DUN) |
OBEX_OBJECT_PUSH |
4357 |
对象推送配置文件 (OPP) |
OPEX_FILE_TRANSFER |
4358 |
文件传输配置文件 (FTP) |
HEADSET |
4360 |
耳机配置文件 (HSP) |
HEADSET_AUDIO_GATEWAY |
4370 |
|
HEADSET_HS |
4401 |
|
AUDIO_SOURCE |
4362 |
高级音频内容分发配置文件 (A2DP) |
AUDIO_SINK |
4363 |
|
ADVANCED_AUDIO_DISTRIBUTION |
4365 |
|
AV_REMOTE_CONTROL_TARGET |
4364 |
音频/视频远程控制配置文件 (AVRCP) |
AV_REMOTE_CONTROL |
4366 |
|
AV_REMOTE_CONTROL_CONTROLLER |
4367 |
|
PANU |
4373 |
个人局域网 (PAN) |
NAP |
4374 |
|
GN |
4375 |
|
HANDSFREE |
4382 |
免触摸操作配置文件 (HFP) |
HANDSFREE_AUDIO_GATEWAY |
4383 |
|
HUMAN_INTERFACE_DEVICE |
4388 |
人机接口设备配置文件 (HID) |
SIM_ACCESS |
4397 |
SIM 卡访问配置文件 (SAP) |
PHONEBOOK_PCE |
4398 |
电话簿访问配置文件 (PBAP) |
PHONEBOOK_PSE |
4399 |
|
电话簿 |
4400 |
|
MESSAGE_ACCESS_SERVER |
4402 |
消息访问配置文件 (MAP) |
MESSAGE_NOTIFICATION_SERVER |
4403 |
|
MESSAGE_ACCESS_PROFILE |
4404 |
|
MPS_PROFILE |
4410 |
多配置文件规范 (MPS) |
MPS_CLASS |
4411 |
|
PNP_INFORMATION |
4608 |
设备标识配置文件 (DI) |
GENERIC_NETWORKING |
4609 |
通用网络 |
GENERIC_FILE_TRANSFER |
4610 |
通用文件传输 |
GENERIC_AUDIO |
4611 |
通用音频 |
GENERIC_TELEPHONY |
4612 |
通用电话 |
VIDEO_SOURCE |
4867 |
视频分发配置文件 (VDP) |
VIDEO_SINK |
4868 |
|
VIDEO_DISTRIBUTION |
4869 |
|
HDP |
5120 |
健康设备配置文件 (HDP) |
HDP_SOURCE |
5121 |
|
HDP_SINK |
5122 |
TABLES
属性
在 fuchsia.bluetooth.bredr/service.fidl 中定义
通用属性,用于协议信息;
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
id |
uint16
|
必填。 |
2 |
element |
DataElement
|
必填。 |
AudioAacSupport
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
| 序数 | 字段 | 类型 | 说明 |
|---|
AudioOffloadConfiguration
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
codec |
AudioOffloadFeatures
|
|
2 |
max_latency |
uint16
|
|
3 |
scms_t_enable |
bool
|
|
4 |
sampling_frequency |
AudioSamplingFrequency
|
|
5 |
bits_per_sample |
AudioBitsPerSample
|
|
6 |
channel_mode |
AudioChannelMode
|
|
7 |
encoded_bit_rate |
uint32
|
|
8 |
encoder_settings |
AudioEncoderSettings
|
AudioOffloadExt_GetSupportedFeatures_Response
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
audio_offload_features |
vector<AudioOffloadFeatures>
|
AudioSbcSupport
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
| 序数 | 字段 | 类型 | 说明 |
|---|
频道资源
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
向对等节点打开的通道。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
socket |
handle<socket>
|
已弃用。 用于在通道上发送/接收 SDU 的套接字接口。 如果此套接字和连接都关闭,则通道将关闭。 始终存在。 已弃用 - 请改用连接 |
2 |
channel_mode |
ChannelMode
|
对等方接受的信道模式。 始终存在。 |
3 |
max_tx_sdu_size |
uint16
|
对等方能够接受的最大 SDU 大小。 始终存在。 |
4 |
ext_direction |
client_end:AudioDirectionExt
|
音频方向优先级扩展。请参阅 |
5 |
flush_timeout |
zx/Duration
|
|
6 |
ext_l2cap |
client_end:L2capParametersExt
|
L2CAP 参数扩展。请参阅 |
7 |
ext_audio_offload |
client_end:AudioOffloadExt
|
音频分流扩展。请参阅 |
8 |
connection |
client_end:fuchsia.bluetooth/Channel
|
用于在通道上发送/接收 SDU 的协议。
如果存在,关闭此通道和 |
ConnectionReceiver2ConnectedRequest 资源
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
peer_id |
fuchsia.bluetooth/PeerId
|
|
2 |
channel |
Channel
|
|
3 |
protocol |
ProtocolDescriptorList
|
信息
在 fuchsia.bluetooth.bredr/service.fidl 中定义
有关服务的人类可读信息。字符串采用 UTF-8 编码。 请参阅蓝牙规范 v5.2 第 3 卷 B 部分第 5.1.15 至 5.1.17 节
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
language |
string:2
|
此表中其他字段所用的语言。 必须为两个字符,并且是有效的 ICO 639:1988 标识符。 必须存在。 |
2 |
name |
string:1024
|
服务名称 |
3 |
description |
string:1024
|
人类可读的说明 |
4 |
provider |
string:1024
|
此服务的提供商(个人或组织) |
L2capParameters
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
与通过 L2CAP 协议建立的连接相关联的参数。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
psm |
uint16
|
必需。连接的 L2CAP PSM。请参阅 |
2 |
parameters |
ChannelParameters
|
可选。L2CAP 通道参数。 |
ProfileAdvertiseRequest 资源
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
services |
vector<ServiceDefinition>:32
|
描述要注册的服务的一组定义。必填。 |
2 |
receiver |
client_end:ConnectionReceiver
|
接收与通告的服务建立的连接。
必须提供 已弃用:27
|
3 |
parameters |
ChannelParameters
|
用于在 |
4 |
connection_receiver |
client_end:ConnectionReceiver2
|
接收与通告的服务建立的连接。
必须提供 新增:27
|
ProfileConnectScoRequest 资源
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
peer_id |
fuchsia.bluetooth/PeerId
|
必填。 |
2 |
initiator |
bool
|
必填。 |
3 |
params |
vector<ScoConnectionParameters>
|
必填。 |
4 |
connection |
server_end:ScoConnection
|
必填。 |
ProfileDescriptor
在 fuchsia.bluetooth.bredr/service.fidl 中定义
此服务符合的配置文件的说明。 请参阅蓝牙规范 v5.2 第 3 卷 B 部分第 5.1.11 节
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
profile_id |
ServiceClassProfileIdentifier
|
必填。 |
2 |
major_version |
uint8
|
必填。 |
3 |
minor_version |
uint8
|
必填。 |
ProfileSearchRequest 资源
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
service_uuid |
ServiceClassProfileIdentifier
|
必需 - |
2 |
attr_ids |
vector<uint16>:512
|
可选。 |
3 |
results |
client_end:SearchResults
|
必填。 |
4 |
full_uuid |
fuchsia.bluetooth/Uuid
|
必需 - 新增:24
|
Profile_Advertise_Response
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
services |
vector<ServiceDefinition>:32
|
由 SDP 服务器注册的一组服务定义,已更新为包含所请求的动态 PSM 和 RFCOMM 分配的定义。 |
ProtocolDescriptor
在 fuchsia.bluetooth.bredr/service.fidl 中定义
标识通信协议以及协议专用参数。
通常用于描述 ProtocolDescriptorList 中的协议端点。
在 L2CAP 协议专用 params 中使用 PSM_DYNAMIC,以指定动态分配的 PSM。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
protocol |
ProtocolIdentifier
|
必填。 |
2 |
params |
vector<DataElement>:255
|
必填。 |
RfcommParameters
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
与通过 RFCOMM 协议建立的连接相关联的参数。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
channel |
RfcommChannel
|
必需。连接的 RFCOMM 通道。 |
ScoConnectionParameters
在 fuchsia.bluetooth.bredr/sco.fidl 中定义
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
parameter_set |
HfpParameterSet
|
免触摸配置文件规范中的一组 SCO 参数。 必填。 |
2 |
air_coding_format |
fuchsia.bluetooth/AssignedCodingFormat
|
用于传输和接收数据的无线编码格式。 必填。 |
3 |
air_frame_size |
uint16
|
编解码器在无线下载编码环境中生成的帧大小。必填。 |
4 |
io_bandwidth |
uint32
|
主机控制器数据速率(以字节/秒为单位)。 必填。 |
5 |
io_coding_format |
fuchsia.bluetooth/AssignedCodingFormat
|
传输过程中使用的编码格式。 必填。 |
6 |
io_frame_size |
uint16
|
每个数据样本/帧中的位数。 必填。 |
7 |
io_pcm_data_format |
fuchsia.hardware.audio/SampleFormat
|
线性样本在传输过程中的数据格式。 对于非线性编码格式,系统会忽略此字段。 可选。 SIGNED 表示二进制补码符号编码。 不支持 FLOAT。 |
8 |
io_pcm_sample_payload_msb_position |
uint8
|
对于线性样本,指示样本的 MSB 与数据的 MSB 相距多少个位位置。对于非线性编码格式,系统会忽略此字段。 可选。 默认值:0。 |
9 |
path |
DataPath
|
数据传输。 必填。 |
10 |
max_tx_data_size |
uint16
|
表示可发送的数据缓冲区大小上限。 可选。仅在连接成功后才会显示。请求连接时忽略。 |
ScoConnectionWriteRequest
在 fuchsia.bluetooth.bredr/sco.fidl 中定义
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
data |
vector<uint8>
|
ScoConnection_Read_Response
在 fuchsia.bluetooth.bredr/sco.fidl 中定义
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
status_flag |
RxPacketStatus
|
|
2 |
data |
vector<uint8>
|
ServiceDefinition
在 fuchsia.bluetooth.bredr/service.fidl 中定义
定义要通过蓝牙 BR/EDR 通告为可用的服务。
| 序数 | 字段 | 类型 | 说明 |
|---|---|---|---|
1 |
service_class_uuids |
vector<fuchsia.bluetooth/Uuid>:255
|
此服务记录符合的服务类别的 UUID。此字段为必填字段 - 所有通告的服务都必须至少有一个服务类。 |
2 |
protocol_descriptor_list |
ProtocolDescriptorList
|
可用于访问此服务的主要协议的规范,以及其特定于协议的标识符。 此列表按从最低级别(通常为 L2CAP)到最高级别的顺序排列。 |
3 |
additional_protocol_descriptor_lists |
vector<ProtocolDescriptorList>:255
|
其他协议描述符列表(如果服务要求除了主服务之外还需要更多通道)。 |
4 |
profile_descriptors |
vector<ProfileDescriptor>:255
|
此服务支持的蓝牙配置文件。 |
5 |
information |
vector<Information>:85
|
人类可读的服务信息,采用一种或多种语言。 第一组信息会被视为主要语言。 |
6 |
additional_attributes |
vector<Attribute>:65023
|
要包含在特定服务或配置文件的服务定义中的其他属性。 所有这些属性的属性 ID 都应大于 0x0200。 |
UNIONS
AudioDirectionExt_SetPriority_Result strict
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
response |
AudioDirectionExt_SetPriority_Response
|
|
2 |
err |
fuchsia.bluetooth/ErrorCode
|
|
3 |
framework_err |
internal
|
AudioEncoderSettings flexible
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
sbc |
fuchsia.media/SbcEncoderSettings
|
|
2 |
aac |
fuchsia.media/AacEncoderSettings
|
AudioOffloadController_Stop_Result strict
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
response |
AudioOffloadController_Stop_Response
|
|
3 |
framework_err |
internal
|
AudioOffloadExt_GetSupportedFeatures_Result strict
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
response |
AudioOffloadExt_GetSupportedFeatures_Response
|
|
3 |
framework_err |
internal
|
AudioOffloadFeatures 灵活
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
AudioOffloadExt 中使用的音频分流功能。
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
sbc |
AudioSbcSupport
|
|
2 |
aac |
AudioAacSupport
|
ConnectParameters strict
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
连接的渠道和相关参数。
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
l2cap |
L2capParameters
|
L2CAP 连接。 |
2 |
rfcomm |
RfcommParameters
|
RFCOMM 连接。 |
ConnectionReceiver2_Connected_Result strict
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
response |
ConnectionReceiver2_Connected_Response
|
|
3 |
framework_err |
internal
|
灵活的 DataElement
在 fuchsia.bluetooth.bredr/service.fidl 中定义
DataElement 是 SDP 记录中的一个元素。SDP 属性和其他参数在 DataElements 中表示。
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
int8 |
int8
|
|
2 |
int16 |
int16
|
|
3 |
int32 |
int32
|
|
4 |
int64 |
int64
|
|
5 |
uint8 |
uint8
|
|
6 |
uint16 |
uint16
|
|
7 |
uint32 |
uint32
|
|
8 |
uint64 |
uint64
|
|
9 |
str |
vector<uint8>:1024
|
|
10 |
url |
fuchsia.url/Url
|
|
11 |
uuid |
fuchsia.bluetooth/Uuid
|
|
12 |
b |
bool
|
|
13 |
sequence |
vector<DataElement?>:255
|
|
14 |
alternatives |
vector<DataElement?>:255
|
L2capParametersExt_RequestParameters_Result strict
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
response |
L2capParametersExt_RequestParameters_Response
|
|
3 |
framework_err |
internal
|
Profile_Advertise_Result strict
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
response |
Profile_Advertise_Response
|
|
2 |
err |
fuchsia.bluetooth/ErrorCode
|
|
3 |
framework_err |
internal
|
Profile_Connect_Result strict resource
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
response |
Profile_Connect_Response
|
|
2 |
err |
fuchsia.bluetooth/ErrorCode
|
|
3 |
framework_err |
internal
|
ScoConnectionOnConnectionCompleteRequest 灵活
在 fuchsia.bluetooth.bredr/sco.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
connected_params |
ScoConnectionParameters
|
如果成功,则包含用于建立连接的参数。 |
2 |
error |
ScoErrorCode
|
如果失败,则指定连接建立失败的原因。 |
ScoConnection_Read_Result strict
在 fuchsia.bluetooth.bredr/sco.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
response |
ScoConnection_Read_Response
|
|
3 |
framework_err |
internal
|
ScoConnection_Write_Result strict
在 fuchsia.bluetooth.bredr/sco.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
response |
ScoConnection_Write_Response
|
|
3 |
framework_err |
internal
|
SearchResults_ServiceFound_Result strict
在 fuchsia.bluetooth.bredr/profile.fidl 中定义
| 序数 | 变体 | 类型 | 说明 |
|---|---|---|---|
1 |
response |
SearchResults_ServiceFound_Response
|
|
3 |
framework_err |
internal
|
常量
| 名称 | 值 | 类型 | 说明 |
|---|---|---|---|
| ATTR_ADDITIONAL_PROTOCOL_DESCRIPTOR_LIST |
13
|
uint16 |
|
| ATTR_BLUETOOTH_PROFILE_DESCRIPTOR_LIST |
9
|
uint16 |
|
| ATTR_BROWSE_GROUP_LIST |
5
|
uint16 |
|
| ATTR_LANGUAGE_BASE_ATTRIBUTE_ID_LIST |
6
|
uint16 |
|
| ATTR_PROTOCOL_DESCRIPTOR_LIST |
4
|
uint16 |
|
| ATTR_SERVICE_AVAILABILITY |
8
|
uint16 |
|
| ATTR_SERVICE_CLASS_ID_LIST |
1
|
uint16 |
|
| ATTR_SERVICE_ID |
3
|
uint16 |
|
| ATTR_SERVICE_INFO_TIME_TO_LIVE |
7
|
uint16 |
|
| ATTR_SERVICE_RECORD_HANDLE |
0
|
uint16 |
通用属性 ID。 摘自蓝牙规范 v5.2 第 3 卷 B 部分 |
| ATTR_SERVICE_RECORD_STATE |
2
|
uint16 |
|
| MAX_ADDITIONAL_ATTRIBUTES |
65023
|
uint16 |
规范定义的最大附加属性。根据《蓝牙规范》(版本 5.2,第 3 卷,B 部分,第 5 节),所有属性都必须大于 0x0200 |
| MAX_ATTRIBUTES |
512
|
uint16 |
搜索请求中返回或允许的属性数量上限。 |
| MAX_INFORMATION_COUNT |
85
|
uint8 |
SDP 目前支持的语言数量上限。 |
| MAX_SEQUENCE_LENGTH |
255
|
uint8 |
DataElement 列表中支持的序列或备选项集的最大长度。如果对等方提供的列表长度超过此值,则会被截断。 |
| MAX_SERVICES_PER_ADVERTISEMENT |
32
|
uint8 |
一次可通告的服务记录数上限。 |
| MAX_STRING_LENGTH |
1024
|
uint16 |
DataElement 中允许的字符串长度上限。如果对等方发送的 DataElement 字符串长度超过此值,则会被截断。 |
| PSM_3DSP |
33
|
uint16 |
|
| PSM_ATT |
31
|
uint16 |
|
| PSM_AVCTP |
23
|
uint16 |
|
| PSM_AVCTP_BROWSE |
27
|
uint16 |
|
| PSM_AVDTP |
25
|
uint16 |
|
| PSM_BNEP |
15
|
uint16 |
|
| PSM_DYNAMIC |
65535
|
uint16 |
用于请求动态 PSM 的占位 PSM 值。在注册期间,系统会为服务分配一个有效的动态 PSM。 在 DataElement 中用作 L2CAP 的协议参数。 注意:此值本身不是有效的 PSM,也未在蓝牙分配编号中定义。 |
| PSM_HID_CONTROL |
17
|
uint16 |
|
| PSM_HID_INTERRUPT |
19
|
uint16 |
|
| PSM_LE_IPSP |
35
|
uint16 |
|
| PSM_OTS |
37
|
uint16 |
|
| PSM_RFCOMM |
3
|
uint16 |
|
| PSM_SDP |
1
|
uint16 |
来自蓝牙分配编号的已定义 PSM:https://www.bluetooth.com/specifications/assigned-numbers/logical-link-control。在 DataElement 中用作 L2CAP 的协议参数。 |
| PSM_TCSBIN |
5
|
uint16 |
|
| PSM_TCSBIN_CORDLESS |
7
|
uint16 |
别名
| 名称 | 值 | 说明 |
|---|---|---|
| ChannelMode |
fuchsia.bluetooth/ChannelMode |
|
| ChannelParameters |
fuchsia.bluetooth/ChannelParameters |
|
| ProtocolDescriptorList |
vector[MAX_SEQUENCE_LENGTH] |
ProtocolDescriptorList 是“堆栈”中从最低到最高的协议列表,用于指定可连接的特定协议端点。 |
| RfcommChannel |
uint8 |
请求打开通道时使用的 RFCOMM 通道 ID。 在 RFCOMM 中,这称为 ServerChannel。必须在 [1,30] 范围内(含边界值)。请参阅 RFCOMM 5.4。 |