bluetooth overview for android QC



BlueZ Startup Procedure (Host BlueZ (Android Bluetooth host stack) )


Call flow on enabling/disabling Bluetooth in UI settings → Wireless control
Functions bt_enable, bt_disable in android/system/bluetooth/
bluedroid/bluetooth.c are entry points to enable/disable Bluetooth
■ Related services are declared in android/system/core/rootdir/
   etc/init.qcom.rc
■ Modify arguments for hci_qcomm_init in android/system/core/rootdir/
   etc/init.qcom.bt.sh for your platform dependency
■ Bttest test tool enables/disables Bluetooth device

bttest enable and bttest disable commands in ADB shell
Reference source code – android/system/bluetooth/bluedroid/bttest.c

Startup scripts
/etc/init.qcom.rc and /etc/init.qcom.bt.sh are scripts for Android Bluetooth startup
procedure

Bluetooth SoC Initialization – hci_qcomm_init (cont.)

Code flow of hci_qcomm_init application

1.bt_hci_pfal_init_uart("/dev/ttyHS0")
Open UART device as /dev/ttyHS0
b. Set flow control attributes
c. Set baud rate as 115200 bps; later, speed is changed to 3.0 Mbps for data transfer

2.bt_hci_qcomm_init()
a.  Set NVM tags according to hardware reference clock and clock-sharing features
c. Download NVM tags using vendor-specific HCI command
d. Set baud rate as 460800 bps, or 3.0 Mbps for HS-UART
e. Initialize by sending vendor-specific HCI command to Bluetooth SoC
Reset HCI command to start with new NVM tags

hciattach – Register BlueZ TTY line discipline driver and set UART protocol to
interface between UARTDM and BlueZ kernel module
Set up BlueZ TTY line discipline – android/kernel/drivers/bluetooth/hci_ldisc.c
■ For out-of-band sleep, H4 protocol is used – android/kernel/drivers/hci_h4.c
■ For software in-band sleep, IBS protocol is used – android/kernel/drivers/hci_ibs.c


BlueZ Source Directories
BlueZ kernel drivers

BlueZ utilities
android/external/bluetooth/bluez
JNI APIs (to interface with DBUS and BlueZ Bluetooth daemon)

android/kernel/net/bluetooth

android/frameworks/base/core/jni
Java APIs

android/frameworks/base/core/java/android/bluetooth
android/frameworks/base/core/java/android/server
Bluetooth settings application
android/packages/apps/Settings/src/com/android/settings/bluetooth


BTS402x only supports
out-of- band sleep, using two
additional pins

HOST_WAKE – From BTS to
 MSM to wake-up BTS
EXT_WAKE – From MSM to BTS to wake-up BTS

RTS/CTS act as wake line
acknowledgement


New software in-band sleep UART protocol (HCI_UART_IBS) is
registered to hci_ldisc
■ Source code is located in android/kernel/drivers/bluetooth/hci_ibs.c



你可能感兴趣的:(bluetooth)