用於廣告、搜尋及連線至 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 設定檔註冊服務定義的方法,讓對等互連裝置可偵測到設定檔。已註冊的服務可以接收對 advertised 記錄建立的 L2CAP 連線,並可在對等互連上開啟新連線。
刊登廣告
註冊一組服務。
這些服務可透過服務探索通訊協定伺服器探索。必須一次新增所有宣傳相同管道的服務。如果服務已在任何宣傳的管道上註冊,註冊就會失敗,接收器會關閉並顯示 ZX_ERR_ALREADY_BOUND,並傳回錯誤。ConnectionReceiver 會收到連線呼叫,連線到所宣傳服務中 protocol_descriptor 或 alternative_protocol_descriptors 包含的管道。如果廣告發生錯誤,接收器就會關閉。
如有需要,ConnectionReceiver::OnRevoke 事件可用於同步撤銷廣告。關閉 ConnectionReceiver 通訊協定也會停止 advertise 這些服務。
如果因任何原因無法建立廣告,系統會傳回 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 是找到服務的對等點。如果服務記錄中存在 ProtocolDescriptorList,protocol 會包含該清單 (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 彈性
類型:uint8
定義於 fuchsia.bluetooth.bredr/profile.fidl
| 名稱 | 值 | 說明 |
|---|---|---|
MONO |
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 |
音訊測試模式傳輸。詳情請參閱 Core Spec v5.2, Vol 4, Part E, Section 7.6.2。 |
HfpParameterSet flexible
類型: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
通訊協定描述元的已定義通訊協定 ID 我們刻意省略已淘汰的設定檔 ID。 來自藍牙指派編號: 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 彈性
類型:uint32
定義於 fuchsia.bluetooth.bredr/sco.fidl
| 名稱 | 值 | 說明 |
|---|---|---|
錯誤 |
1 |
|
已取消 |
2 |
|
INVALID_ARGUMENTS |
3 |
|
PARAMETERS_REJECTED |
4 |
ServiceClassProfileIdentifier flexible
類型:uint16
定義於 fuchsia.bluetooth.bredr/service.fidl
適用於藍牙類別 / 設定檔的 ID。 我們刻意省略不支援、已淘汰或保留給 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) |
耳機 |
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 編碼。請參閱藍牙規格 5.2 版第 3 卷 B 部分第 5.1.15 至 5.1.17 節
| 序數 | 欄位 | 類型 | 說明 |
|---|---|---|---|
1 |
language |
string:2
|
這個表格中其他欄位使用的語言。長度必須為兩個字元,且為有效的 ICO 639:1988 ID。這是必填欄位。 |
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
這項服務符合的設定檔說明。請參閱藍牙規格 5.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 表示 2 的補數符號編碼。不支援 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
|
可用於存取這項服務的主要通訊協定規格,以及通訊協定專屬 ID。由最低層級 (通常是 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
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
response |
AudioDirectionExt_SetPriority_Response
|
|
2 |
err |
fuchsia.bluetooth/ErrorCode
|
|
3 |
framework_err |
internal
|
AudioEncoderSettings 彈性
定義於 fuchsia.bluetooth.bredr/profile.fidl
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
sbc |
fuchsia.media/SbcEncoderSettings
|
|
2 |
aac |
fuchsia.media/AacEncoderSettings
|
AudioOffloadController_Stop_Result strict
定義於 fuchsia.bluetooth.bredr/profile.fidl
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
response |
AudioOffloadController_Stop_Response
|
|
3 |
framework_err |
internal
|
AudioOffloadExt_GetSupportedFeatures_Result strict
定義於 fuchsia.bluetooth.bredr/profile.fidl
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
response |
AudioOffloadExt_GetSupportedFeatures_Response
|
|
3 |
framework_err |
internal
|
AudioOffloadFeatures 彈性
定義於 fuchsia.bluetooth.bredr/profile.fidl
AudioOffloadExt 中使用的音訊卸載功能。
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
sbc |
AudioSbcSupport
|
|
2 |
aac |
AudioAacSupport
|
ConnectParameters strict
定義於 fuchsia.bluetooth.bredr/profile.fidl
連線的管道和相關參數。
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
l2cap |
L2capParameters
|
L2CAP 連線。 |
2 |
rfcomm |
RfcommParameters
|
RFCOMM 連線。 |
ConnectionReceiver2_Connected_Result strict
定義於 fuchsia.bluetooth.bredr/profile.fidl
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
response |
ConnectionReceiver2_Connected_Response
|
|
3 |
framework_err |
internal
|
彈性資料元素
定義於 fuchsia.bluetooth.bredr/service.fidl
DataElement 是 SDP 記錄中的一個元素。SDP 屬性和其他參數會以 DataElements 表示。
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
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
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
response |
L2capParametersExt_RequestParameters_Response
|
|
3 |
framework_err |
internal
|
Profile_Advertise_Result strict
定義於 fuchsia.bluetooth.bredr/profile.fidl
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
response |
Profile_Advertise_Response
|
|
2 |
err |
fuchsia.bluetooth/ErrorCode
|
|
3 |
framework_err |
internal
|
Profile_Connect_Result strict resource
定義於 fuchsia.bluetooth.bredr/profile.fidl
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
response |
Profile_Connect_Response
|
|
2 |
err |
fuchsia.bluetooth/ErrorCode
|
|
3 |
framework_err |
internal
|
ScoConnectionOnConnectionCompleteRequest 彈性
定義於 fuchsia.bluetooth.bredr/sco.fidl
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
connected_params |
ScoConnectionParameters
|
如果成功,則包含用於建立連線的參數。 |
2 |
error |
ScoErrorCode
|
如果失敗,則會指定連線建立失敗的原因。 |
ScoConnection_Read_Result strict
定義於 fuchsia.bluetooth.bredr/sco.fidl
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
response |
ScoConnection_Read_Response
|
|
3 |
framework_err |
internal
|
ScoConnection_Write_Result strict
定義於 fuchsia.bluetooth.bredr/sco.fidl
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
1 |
response |
ScoConnection_Write_Response
|
|
3 |
framework_err |
internal
|
SearchResults_ServiceFound_Result strict
定義於 fuchsia.bluetooth.bredr/profile.fidl
| 序數 | Variant | 類型 | 說明 |
|---|---|---|---|
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。 Bluetooth 規格 5.2 版,第 3 卷,B 部分 |
| ATTR_SERVICE_RECORD_STATE |
2
|
uint16 |
|
| MAX_ADDITIONAL_ATTRIBUTES |
65023
|
uint16 |
規格定義的額外屬性數量上限。根據 Bluetooth 規格 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 之間 (含 1 和 30)。請參閱 RFCOMM 5.4。 |