Dissect Bluedroid From A2DP: Part v: Key Components

1 Interface and implementation

bt_interface_t: Android defined, Bluedroid implemented as bluetoothInterface in external/bluetooth/bluedroid/btif/src/bluetooth.c: System control BT adapter.

btav_interface_t: Android defined, Bluedroid implemented as bt_av_interface in external/bluetooth/bluedroid/btif/src/btif_av.c: System control A2DP service.

audio_hw_device and audio_stream_out: Android defined, Bluedroid implemented in external/bluetooth/bluedroid/audio_a2dp_hw/audio_a2dp_hw.c: AudioFlinger use A2DP client as audio output device.

bt_vendor_interface_t: Bluedroid defined, BRCM implemented as BLUETOOTH_VENDOR_LIB_INTERFACE in device/common/libbt/src/bt_vendor_brcm.c: Bluedroid talk to BT char device driver, internal usage only.

tHCI_IF: Bluedroid defined, Bluedroid implemented as hci_h4_func_table in external/bluetooth/bluedroid/hci/src/hci_h4.c: Bluedroid HCI interface (data/cmd/evt in/out), internal usage only.

bt_hc_interface_t: Bluedroid defined, Bluedroid implemented as bluetoothHCLibInterface in external/bluetooth/bluedroid/hci/src/bt_hci_bdroid.c: Wrapper of tHCI_IF, has bt_hc_worker_thread to serialize downcoming HCI commands and read upcoming data/evt from HCI device.

L2CAP layer API, in external/bluetooth/bluedroid/stack/include/l2c_api.h, internal usage only.

LMP API, in external/bluetooth/bluedroid/stack/include/btm_api.h, internal usage only.

2 Tasks/Roles/Layers

btif_task, managing all messages being passed Android Bluetooth HAL and BTA.

btu_task, the main task of the Bluetooth Upper Layers unit, routing in/out BT cmd/event/data, processing timeout events.

bt_hc_worker_thread, HCI worker thread, all HCI traffic come through this thread.

userial_read_thread, monitoring incoming packets from BT char device driver, transfering these to bt_hc_worker_thread.

btif_media_task, task for A2DP SBC encoder.

uipc_read_task, A2DP server thread, receive audio input data from A2DP client, feed into btif_media_task.

UIPC/A2DP_CTRL_PATH/A2DP_DATA_PATH, socket based IPC, for A2DP client connect/control to A2DP server.

AVDT_CHAN_SIG/AVDT_CHAN_MEDIA/AVDT_CHAN_REPORT, A2DP channels, communicate with remote device.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值