blob: edd3c260d3a40dda3ef511f1a59ca94d4edba46b [file] [log] [blame]
The Android Open Source Projecte943f2f2008-12-17 18:04:04 -08001
2<p><span class="lh2"><a name="androidHeader"></a></span>
3
4<html>
5<head>
6<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
7<title>Android - Porting Guide</title>
8<script src="http://www.google.com/uds/api?file=uds.js&amp;v=1.0&amp;key=internal-codesite" type="text/javascript"></script>
9<script src="http://code.google.com/js/jquery.js" type="text/javascript"></script>
10<script type="text/javascript">var _tocPath_ = 'http://code.google.com/android/_toc.ezt';</script>
11<script src="http://code.google.com/js/codesite.pack.01312008.js" type="text/javascript"></script>
12<script language="JavaScript">
13function resizeHeight() {
14 if(document.getElementById && !(document.all)) {
15 height= document.getElementById('doxygen').contentDocument.body.scrollHeight + 20;
16 document.getElementById('doxygen').style.height = height;
17 }
18 else if(document.all) {
19 height= document.frames('doxygen').document.body.scrollHeight + 20;
20 document.all.doxygen.style.height = height;
21 }
22}
23</script>
24<link href="http://code.google.com/css/codesite.pack.01312008.css" type="text/css" rel="stylesheet">
25</link>
26
27<!--[if IE]><link rel="stylesheet" type="text/css" href="/css/iehacks.css" /><![endif]-->
28<script src="http://code.google.com/android/assets/search_autocomplete.js"></script>
29<link rel="stylesheet" type="text/css" href="http://code.google.com/css/semantic_headers.css" />
30<link rel="stylesheet" type="text/css" href="http://code.google.com/android/assets/style.css" />
31<script>
32 jQuery(document).ready(function() {
33 jQuery("pre").addClass("prettyprint");
34 });
35 </script>
36<style type="text/css">
37<!--
38h1,h2,h3 {
39 color: #000000;
40}
41-->
42</style>
43</head>
44<body class="gc-documentation">
45<div id="gc-container">
46<a name="top"></a>
47<div id="skipto"> </div>
48<div id="langpref">
49 <!--<a class="dropdown" href="/">English</a> <span>|</span> <a href="/more/">Site Directory</a> -->
50
51</div>
52<div id="gc-header">
53 <div id="logo"><a href="http://code.google.com/android/index.html"><img src="http://code.google.com/android/images/logo_android.gif" alt="Android"/></a></div>
54 <div id="search" style="inline">
55 <div id="searchForm" class="searchForm" style="height: 44px;">
56 <!--previously form was here-->
57 </div>
58 <!-- end searchForm -->
59 <noscript>
60 <style type="text/css">
61 .searchForm {
62 display : none !important;
63 }
64 .searchForm2 {
65 display : inline !important;
66 }
67 </style>
68 </noscript>
69
70 <div id="searchForm2" class="searchForm2" style="display:none">
71 <form id="searchbox_001456098540849067467:6whlsytkdqg" action="http://www.google.com/cse">
72 <input type="hidden" name="cx" value="001456098540849067467:6whlsytkdqg" />
73 <input type="hidden" name="cof" value="FORID:0" />
74 <input type="text" name="q" maxlength="2048" size="41" autocomplete="off" title="Google Code Search"/>
75 <input type="submit" name="sa" value="Search" title="Search"/>
76 <br/>
77 <div class="greytext">e.g. "ajax apis" or "open source"</div>
78
79 </form>
80 </div>
81 <!-- end searchForm2 -->
82 </div>
83 <!-- end search -->
84</div>
85<!-- end gc-header -->
86<div id="searchControl" class="search-control"></div>
87<!--[if IE]><iframe id="backiFrame" name="backiFrame" src='/dummy.html' style="display:none"></iframe><![endif]-->
88<div id="codesiteContent">
89<a name="gc-topnav-anchor"></a>
90<div id="gc-topnav">
91
92 <h1>Android Platform Development Kit</h1>
93 <ul class="gc-topnav-tabs">
94 <li id="sdk_link"> <a href="http://code.google.com/android/index.html" title="Android Software Development Kit">SDK</a> </li>
95 <li id="docs_link"> <a href="index.html" title="Official Android documentation">Docs</a> </li>
96 <li id="faq_link"> <a href="http://code.google.com/android/kb/index.html" title="Answers to frequently asked questions about Android">FAQ</a> </li>
97
98 <li> <a href="http://android-developers.blogspot.com/" title="Official Android blog">Blog</a> </li>
99 <li> <a href="http://code.google.com/android/groups.html" title="Android developer forum">Group</a> </li>
100 <li> <a href="http://code.google.com/android/terms.html" title="Android terms of service">Terms</a> </li>
101 <li> <a href="mailto:android-pdk-feedback@google.com?subject=PDK%20Feedback&body=(filed%20from:%20bluetooth.html%20v0.6%20-%2025%20November%202008)%0D%0A%0D%0ASUMMARY:%0D%0A%0D%0A%0D%0A%0D%0ASTEPS%20TO%20REPRODUCE:%0D%0A%0D%0A%0D%0A%0D%0AADDITIONAL%20NOTES:">Report a Problem</a> </li>
102
103 </ul>
104</div>
105<!-- end gc-topnav -->
106<div class="g-section g-tpl-180">
107<a name="gc-toc"></a>
108<div class="g-unit g-first" id="gc-toc">
109 <ul>
110 <li>
111 <h1><a href="index.html">Documentation</a></h1>
112 <ul>
113 <li> <strong>Introduction</strong>
114
115 <ul>
116 <li><a href="system_requirements.html">Device Requirements</a></li>
117 </ul>
118 </li>
119 <li> <strong>Dev Environment Setup</strong>
120 <ul>
121 <li><a href="build_system.html">Build System</a></li>
122 </ul>
123 </li>
124 <li> <strong>Basic Bring up</strong>
125
126 <ul>
127 <li><a href="build_new_device.html">Building New Device</a></li>
128 <li><a href="bring_up.html">Bring up</a></li>
129 <li><a href="keymaps_keyboard_input.html">Keymaps and Keyboard</a></li>
130 <li><a href="display_drivers.html">Display Drivers</a></li>
131 </ul>
132 </li>
133
134 <li> <strong>Multimedia</strong>
135 <ul>
136 <li><a href="audio_sub_system.html">Audio</a></li>
137 <li><a href="camera.html">Camera</a></li>
138 </ul>
139 </li>
140 <li> <strong>Power Management</strong>
141
142 <ul>
143 <li><a href="power_management.html">Power Management</a></li>
144 </ul>
145 </li>
146
147 <li> <strong>Networking</strong>
148 <ul>
149 <li><a href="wifi.html">Wi-Fi</a></li>
150 <li><a href="gps.html">GPS</a></li>
151 <li><a href="bluetooth.html">Bluetooth</a></li>
152 </ul>
153 </li>
154
155 <li> <strong>Telephony</strong>
156 <ul>
157 <li><a href="telephony.html">Radio Interface Layer</a></li>
158
159 </ul>
160 </li>
161 <li> <strong>Testing</strong>
162 <ul>
163 <li><a href="instrumentation_testing.html">Instrumentation Testing</a></li>
164 </ul>
165
166 </li>
167 </ul>
168 </li>
169 </ul>
170</div>
171<a name="gc-pagecontent"></a>
172<div class="g-unit" id="gc-pagecontent">
173<div id="jd-content">
174<div class="jd-descr">
175
176
177<a name="androidBluetoothTitle"></a><h1>Bluetooth</h1>
178
179
180
181<a name="toc"/>
182<div style="padding:10px">
183<a href="#androidBluetoothIntro">Introduction</a><br/>
184<a href="#androidBluetoothPorting">Porting</a><br/><div style="padding-left:40px">
185
186<a href="#androidBluetoothPortingDriver">UART Driver</a><br/>
187<a href="#androidBluetoothPortingPowerOnOff">Bluetooth Power On / Off</a><br/></div>
188<a href="#androidBluetoothTools">Tools</a><br/></div></font></div>
189
190<a name="androidBluetoothIntro"></a><h2>Introduction</h2>
191
192<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>
193
194<p>Bluez is GPL licensed, so the Android framework interacts with userspace bluez code through D-BUS IPC to avoid proprietary code.</p>
195
196<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>
197
198<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>
199
200<p><img src="androidBluetooth.gif"></p>
201
202Solid elements represent Android blocks and dashed elements represent partner-specific blocks.
203
204
205
206<a name="androidBluetoothPorting"></a><h2>Porting</h2>
207
208<p>BlueZ is Bluetooth 2.0 compatible and should work with any 2.0 chipset. There are two integration points:</p>
209<p><ul>
210<li>UART driver</li>
211<li>Bluetooth Power On / Off</li>
212</ul>
213</p>
214
215
216<a name="androidBluetoothPortingDriver"></a><h3>UART Driver</h3>
217
218<p>The BlueZ kernel sub-system attaches to your hardware-specific UART driver using the <code>hciattach</code> daemon.</p>
219<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>
220
221
222<a name="androidBluetoothPortingPowerOnOff"></a><h3>Bluetooth Power On / Off</h3>
223
224<p>The method for powering on and off your bluetooth chip varies from Android V 1.0 to post 1.0.</p>
225
226<p><ul>
227<li><b>1.0</b>: Android framework writes a 0 or 1 to <code>/sys/modules/board_[PLATFORM]/parameters/bluetooth_power_on</code>.</li>
228
229<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>
230</ul>
231</p>
232
233
234<a name="androidBluetoothTools"></a><h2>Tools</h2>
235
236<p>BlueZ provides a rich set of command line tools for debugging and interacting with the Bluetooth sub-system, including:</p>
237<p><ul>
238<li><code>hciconfig</code></li>
239<li><code>hcitool</code></li>
240<li><code>hcidump</code></li>
241<li><code>sdptool</code></li>
242<li><code>dbus-send</code></li>
243<li><code>dbus-monitor</code></li>
244</ul>
245</p>
246
247
248<p><span class="lh2"><a name="androidFooter"></a></span>
249
250 </div>
251 </div>
252 <!-- end gc-pagecontent -->
253 </div>
254 <!-- end gooey wrapper -->
255 </div>
256 <!-- end codesearchresults -->
257 <div id="gc-footer" dir="ltr">
258 <div class="text"> &copy;2008 Google<!-- - <a href="/">Code Home</a> - <a href="http://www.google.com/accounts/TOS">Site Terms of Service</a> - <a href="http://www.google.com/privacy.html">Privacy Policy</a> - <a href="/more">Site Directory</a> --></div>
259 </div>
260 <!-- end gc-footer -->
261</div>
262<!-- end gc-containter -->
263<script src="http://www.google-analytics.com/ga.js" type="text/javascript">
264</script>
265<script type="text/javascript">
266 try {
267 var pageTracker = _gat._getTracker("UA-18071-1");
268 pageTracker._setAllowAnchor(true);
269 pageTracker._initData();
270 pageTracker._trackPageview();
271 } catch(e) {}
272</script>
273<div id="jd-build-id"> v0.6 - 25 November 2008</div>
274</div></div></div></body>
275</html>
276