目錄
1)profile_supported_a2dp / profile_supported_a2dp_sink
2)profile_supported_avrcp_controller
1.profile是什麼?
我也是初學者,不能保證解釋通俗易懂,所以爲了能深入淺出的讓讀者明白其概念,不至於誤人子弟,我還是拋磚引玉,先用一句話概括一下什麼是profile,詳細介紹可以參考 《對於藍牙Profile的理解》,本文側重說明不同profile的使用場景。
用一句話概括就是:藍牙的每一個profile對應於一個具體的應用場景,也就是說profile是爲了實現某種功能而採用的一組自下而上的協議的稱呼。
2.藍牙中有哪些profile
Android源碼中關於藍牙profile的配置文件路徑是 \packages\apps\Bluetooth\res\values\config.xml,內容如下
<resources>
<bool name="profile_supported_a2dp">true</bool>
<bool name="profile_supported_a2dp_sink">false</bool>
<bool name="profile_supported_hdp">true</bool>
<bool name="profile_supported_hs_hfp">true</bool>
<bool name="profile_supported_hfpclient">false</bool>
<bool name="profile_supported_hid">true</bool>
<bool name="profile_supported_opp">true</bool>
<bool name="profile_supported_pan">true</bool>
<bool name="profile_supported_pbap">true</bool>
<bool name="profile_supported_gatt">true</bool>
<bool name="pbap_include_photos_in_vcard">false</bool>
<bool name="pbap_use_profile_for_owner_vcard">true</bool>
<bool name="profile_supported_map">true</bool>
<bool name="profile_supported_avrcp_controller">false</bool>
</resources>
3.不同profile的使用場景
1)profile_supported_a2dp / profile_supported_a2dp_sink
這兩個profile是一組,也可以單獨配置他們。
profile_supported_a2dp表示媒體音頻輸出端,也叫source端。(案例:MP3播放器)
profile_supported_a2dp_sink表示媒體音頻輸入端,也叫sink端。 (案例:音箱)
使用場景:播放設備將音頻信息通過藍牙傳輸給音箱進行播放,這裏的播放設備就是source端,profile_supported_a2dp必須配置爲true,這裏的音箱就是sink端,profile_supported_a2dp_sink必須配置爲true。
2)profile_supported_avrcp_controller
profile_supported_avrcp_controller 表示音樂視頻控制協議。(案例:遙控端 )
使用場景:Android平板做爲一個音響的功能使用(已經移植 BT 的 a2dp sink 的功能),現在需要加上平板控制手機的聲音播放,暫停,音量大小等功能,這時平板就需要用到profile_supported_avrcp_controller協議,並且配置爲true.
3)其它(盡情期待...)
後續有時間會繼續增加,盡情期待...