Files
android_development/pdk/docs/bluetooth.jd
Mike Ritter 4ba021dfe8 AI 144207: am: CL 144166 am: CL 144164 Adding droiddocs/javadocs usage to Pdk-docs to get correct style.
Original author: mritter
  Merged from: //branches/cupcake/...
  Original author: android-build
  Merged from: //branches/donutburger/...

Automated import of CL 144207
2009-04-02 10:36:49 -07:00

83 lines
2.7 KiB
Plaintext
Executable File

page.title=Bluetooth
@jd:body
<div id="qv-wrapper">
<div id="qv">
<a name="toc"/>
<h2>In this document</h2>
<ol>
<li><a href="#androidBluetoothIntro">Introduction</a></li>
<li><a href="#androidBluetoothPorting">Porting</a>
<ol>
<li><a href="#androidBluetoothPortingDriver">UART Driver</a></li>
<li><a href="#androidBluetoothPortingPowerOnOff">Bluetooth Power On / Off</a></li>
</ol>
</li>
<li><a href="#androidBluetoothTools">Tools</a></li>
</ol>
</div>
</div>
<a name="androidBluetoothIntro"></a><h2>Introduction</h2>
<p>Android's Bluetooth stack uses BlueZ version 3.36 for GAP, SDP, and RFCOMM profiles, and is a SIG-qualified Bluetooth 2.0 host stack.</p>
<p>Bluez is GPL licensed, so the Android framework interacts with userspace bluez code through D-BUS IPC to avoid proprietary code.</p>
<p>Headset and Handsfree (v1.5) profiles are implemented in the Android framework and are both tightly coupled with the Phone App. These profiles are also SIG qualified.</p>
<p>The diagram below offers a library-oriented view of the Bluetooth stack. Click <a href="bluetooth_process.html">Bluetooth Process Diagram</a> for a process-oriented view.</p>
<p><img src="androidBluetooth.gif"></p>
Solid elements represent Android blocks and dashed elements represent partner-specific blocks.
<a name="androidBluetoothPorting"></a><h2>Porting</h2>
<p>BlueZ is Bluetooth 2.0 compatible and should work with any 2.0 chipset. There are two integration points:</p>
<p><ul>
<li>UART driver</li>
<li>Bluetooth Power On / Off</li>
</ul>
</p>
<a name="androidBluetoothPortingDriver"></a><h3>UART Driver</h3>
<p>The BlueZ kernel sub-system attaches to your hardware-specific UART driver using the <code>hciattach</code> daemon.</p>
<p>For example, for MSM7201A, this is <code>drivers/serial/msm_serial.c</code>. You may also need to edit command line options to <code>hciattach</code> via <code>init.rc</code>.</p>
<a name="androidBluetoothPortingPowerOnOff"></a><h3>Bluetooth Power On / Off</h3>
<p>The method for powering on and off your bluetooth chip varies from Android V 1.0 to post 1.0.</p>
<p><ul>
<li><b>1.0</b>: Android framework writes a 0 or 1 to <code>/sys/modules/board_[PLATFORM]/parameters/bluetooth_power_on</code>.</li>
<li><b>Post 1.0</b>: Android framework uses the linux <code>rfkill</code> API. See <code>arch/arm/mach-msm/board-trout-rfkill.c</code> for an example.</li>
</ul>
</p>
<a name="androidBluetoothTools"></a><h2>Tools</h2>
<p>BlueZ provides a rich set of command line tools for debugging and interacting with the Bluetooth sub-system, including:</p>
<p><ul>
<li><code>hciconfig</code></li>
<li><code>hcitool</code></li>
<li><code>hcidump</code></li>
<li><code>sdptool</code></li>
<li><code>dbus-send</code></li>
<li><code>dbus-monitor</code></li>
</ul>
</p>