A2DP Sink, AVRCP Controller and HFP Client in Android L
2015-08-25 14:45
1396 查看
The APIs of A2DP sink, AVRCP controller and HFP client are not published in Android L, but the code which implements the profiles is indeed in Android L. You can set the configuration for the car to build the code.
/frameworks/base/core/java/android/bluetooth/BluetoothA2dpSink.java
/packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpSinkService.java
/packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpSinkStateMachine.java
/packages/apps/Bluetooth/jni/com_android_bluetooth_a2dp_sink.cpp
/hardware/libhardware/include/hardware/bt_av.h
AVRCP controller
/frameworks/base/core/java/android/bluetooth/BluetoothAvrcpController.java
/packages/apps/Bluetooth/src/com/android/bluetooth/avrcp/AvrcpControllerService.java
/packages/apps/Bluetooth/jni/com_android_bluetooth_avrcp_controller.cpp
HFP client
/frameworks/base/core/java/android/bluetooth/BluetoothHeadsetClient.java
/frameworks/base/core/java/android/bluetooth/BluetoothHeadsetClientCall.java
/packages/apps/Bluetooth/src/com/android/bluetooth/hfpclient/HeadsetClientHalConstants.java
/packages/apps/Bluetooth/src/com/android/bluetooth/hfpclient/HeadsetClientService.java
/packages/apps/Bluetooth/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java
/packages/apps/Bluetooth/jni/com_android_bluetooth_hfpclient.cpp
/hardware/libhardware/include/hardware/bt_hf_client.h
I does not list the files in bluedroid. You can find the files which are added or modified for A2DP sink, AVRCP controller and HFP client in the layers of BTIF, BTA and BTE(stack directory). An A2DP decoder locates in /external/bluetooth/bluedroid/embdrv/sbc/decoder/.
run 'lunch', and select 'car_hammerhead-userdebug'. Now you can build the image of car_hammerhead and flash the image to Nexus 5.
You can used hcitool and sdptool to browse all available services on Nexus 5 with car_hammerhead image. You should see A2DP sink, AVRCP controller and HFP client in the list of available services. If you want to hear the sound from the speaker of Nexus
5 with car_hammerhead image, you have to develop the App which uses A2DP sink APIs to trigger the audio routing from from BT stack to speaker. If no App registers a listener to bluedroid, the audio data will be discarded before decoder.
Where is the code?
A2DP sink/frameworks/base/core/java/android/bluetooth/BluetoothA2dpSink.java
/packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpSinkService.java
/packages/apps/Bluetooth/src/com/android/bluetooth/a2dp/A2dpSinkStateMachine.java
/packages/apps/Bluetooth/jni/com_android_bluetooth_a2dp_sink.cpp
/hardware/libhardware/include/hardware/bt_av.h
AVRCP controller
/frameworks/base/core/java/android/bluetooth/BluetoothAvrcpController.java
/packages/apps/Bluetooth/src/com/android/bluetooth/avrcp/AvrcpControllerService.java
/packages/apps/Bluetooth/jni/com_android_bluetooth_avrcp_controller.cpp
HFP client
/frameworks/base/core/java/android/bluetooth/BluetoothHeadsetClient.java
/frameworks/base/core/java/android/bluetooth/BluetoothHeadsetClientCall.java
/packages/apps/Bluetooth/src/com/android/bluetooth/hfpclient/HeadsetClientHalConstants.java
/packages/apps/Bluetooth/src/com/android/bluetooth/hfpclient/HeadsetClientService.java
/packages/apps/Bluetooth/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java
/packages/apps/Bluetooth/jni/com_android_bluetooth_hfpclient.cpp
/hardware/libhardware/include/hardware/bt_hf_client.h
I does not list the files in bluedroid. You can find the files which are added or modified for A2DP sink, AVRCP controller and HFP client in the layers of BTIF, BTA and BTE(stack directory). An A2DP decoder locates in /external/bluetooth/bluedroid/embdrv/sbc/decoder/.
How to build the code?
Google develops A2DP sink, AVRCP controller and HFP client for Android Auto. car_hammerhead.mk is added in /device/lge/hammerhead/. You must add the product item 'add_lunch_combo car_hammerhead-userdebug' in /device/lge/hammerhead/vendorsetup.sh. Thenrun 'lunch', and select 'car_hammerhead-userdebug'. Now you can build the image of car_hammerhead and flash the image to Nexus 5.
You can used hcitool and sdptool to browse all available services on Nexus 5 with car_hammerhead image. You should see A2DP sink, AVRCP controller and HFP client in the list of available services. If you want to hear the sound from the speaker of Nexus
5 with car_hammerhead image, you have to develop the App which uses A2DP sink APIs to trigger the audio routing from from BT stack to speaker. If no App registers a listener to bluedroid, the audio data will be discarded before decoder.
相关文章推荐
- 蓝牙天线的一点小资料
- Core Bluetooth for iOS 6
- rtl8723bs移植之打开wifi后系统不断重启
- Ubuntu和Windows双系统蓝牙键盘配对
- Android BLE教程(和单片机通信)
- android Bluetooth连接方式 SCO & ACL
- 一、Bluetooth Native层与协议栈的接口及其初始化过程
- 蓝牙串口通信
- Android-BLE 2. 蓝牙的权限使用
- Android-BLE 1. 基本类的介绍
- 完美解决iphone连电脑蓝牙出现bluetooth外围设备无法正确安装
- 关于Rayeager PX2开发板 Bluetooth不能使用的解决
- 蓝牙音频音质探讨
- 如何理解蓝牙芯片内部逻辑
- 蓝牙物理连接的建立
- Android 4.2蓝牙介绍
- TI低功耗蓝牙(BLE)介绍
- 蓝牙绕过系统Pin弹窗自动匹配,亲测4.0以上没问题
- 关于: 安卓能否与iphone通过蓝牙4.0(BLE)通讯?
- [wordpress搬家]Android Hack — BLE