`
shaopengxiang
  • 浏览: 5086 次
  • 性别: Icon_minigender_1
  • 来自: 北京
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论
阅读更多
Bluetooth FAQ
This FAQ refers to the Android Open Source codebase, and is written for platform developers with root access on devices such as the Androd Developer Phone.

Q. How do I compile Android with Bluetooth support enabled?
A. Add this to your BoardConfig.mk:
BOARD_HAVE_BLUETOOTH := true

Q. Does the emulator support Bluetooth?
A. Sorry, not at this time. This would make a nice project if someone wants to take this on.

Q. Bluetooth doesn't work on my device. How should I debug?
A. First step - read the logs (adb logcat)! In particular look for ERROR or WARNING level messages regarding Bluetooth.
Andoird uses Bluez, which comes with some very useful debugging tools. Here are some examples, in the rough order I use to debug BT.
hciconfig -a  # print BT chipset address and features. Useful to check if you can communicate with your BT chipset.
hcidump -XVt  # print live HCI UART traffic.
hcitool scan  # scan for local devices. Useful to check if RX/TX works.
l2ping ADDRESS  # ping another BT device. Useful to check if RX/TX works.
sdptool records ADDRESS # request the SDP records of another BT device.

Q. Where are the logs for the Bluetooth deamons hcid and hciattach?
A. Like all Android system daemons, the STDOUT and STDERR are sent to /dev/null by default. If you want to view these logs you can run the daemons under logwrapper which redirects there output to logcat. Edit init.rc and init.PLATFORM.rc to run these daemons under logwrapper.

Q. I compiled my own system.img for the Android Developer Phone, and hciconfig -a works, but hcitool scan does not. Whats going on?
A. You probably need to install the firmware for the Bluetooth chipset. Unfortunately this firmware is not yet in the open source codebase. However you can adb pull and then adb push it from a stock T-Mobile G1. The location is.
/etc/firmware/brf6300.bin

Q. What Bluetooth Core version does Android support?
A. Bluetooth 2.0 + EDR.

Q. What is the architecture of Bluetooth in Android?
A. We are based on Bluez version 3.36. The diagram below shows our 1.0 layout:


Q. When will Java Bluetooth API's be released in an SDK?
A. We are not ready to announce a release target for Bluetooth API's. We do understand there is demand for a Bluetooth API, and it is a top priority for the Android Bluetooth team.

Q. What is needed for Bluetooth 2.1 and Simple Pairing support?
A. We need to move to a Bluez 4.x version.

Profile Support
Q. What is the status of Headset and Handsfree?
A. Android 1.0 is qualified for both HFP and HSP (in the AG role) profiles. We are gladly taking bug fixes on any remaining issues. The one significant feature we lack is eSCO support.

Q. What is the status of A2DP and AVRCP?
A. A2DP and AVRCP work is ongoing for the 'cupcake' release. We are using the Bluez audio plugin and Bluez SBC codec, with a custom audio path designed for the Android Audio sub-system. Qualificiation is not yet complete.

Q. What is the status of HID?
A. Some very early work is in cupcake - Bluez has an HID plugin which we compile:
external/bluez/utils/input/Android.mk
You can interact directly with this plugin using dbus-send and dbus-monitor. With a little study of the Bluez HID plugin API and some luck and you should be able to connect and use a HID keyboard or mouse. A lot of work remains to be done before we could officially claim HID is supported by the platform. For example we need to plumb the plugin API up in the Android Java framework. And the Android framework needs better support for HID input methods - new keymaps and mouse support. We do not yet have a release targetted for official HID support.

Q. What is the status for tethering - DUN and PAN.
A. Similar to HID, some very early work is in cupcake. Bluez has DUN and PAN daemons which we compile.
external/bluez/utils/dun/Android.mk
external/bluez/utils/pan/Android.mk
BNEP support is compiled into the kernel with cupcake. With a little experimentation running these daemons (dund or pand) and using pppd or iptables you can test tethering support. A lot of integration work remains before we could officially claim that DUN or PAN is supported by the platform. Like HID, we would need to plumb the DBUS API's to these daemons up into the Android Java framework, and add code to setup the network paths via pppd and/or iptables. We do not yet have a release targetted for official DUN or PAN support.
分享到:
评论

相关推荐

    Android省市区三级联动滚轮选择——Cascade_Master

    该组件是基于开源库`Android-wheel`实现的,`Android-wheel`是一个适用于Android的滚轮选择器,它可以创建类似于iOS中PickerView的效果,让用户通过滚动来选取所需的数据。在省市区三级联动中,当用户在一级(省)...

    Android串口通信(Android Studio)

    在Android开发中,串口通信(Serial Port Communication)是一种重要的技术,它允许设备之间通过串行接口进行数据交换。在Android Studio环境下实现串口通信,开发者可以构建与硬件设备交互的应用,例如读取传感器...

    android 经典代码例子

    在Android开发领域,经典代码例子是开发者学习和提升技能的重要资源。这些例子涵盖了各种关键功能和组件的实现,有助于深入理解Android应用的工作原理。在这个压缩包中,我们可能找到了多个有关Android编程的示例...

    Android小项目——新闻APP(源码)

    Android小项目——新闻APP(源码),一个很简单的可以练手的Android Demo Ps:下载之前可以先看一下这篇文章——https://blog.csdn.net/qq_34149526/article/details/80992341

    Android自定义日期选择器源码

    在Android开发中,系统默认的日期和时间选择器虽然实用,但往往无法满足所有场景的需求。因此,开发者经常需要自定义日期选择器来提供更符合应用风格或特定功能的交互体验。这篇内容将深入探讨如何在Android中创建一...

    android XMPP openfire

    Android XMPP(Extensible Messaging and Presence Protocol)是用于在Android平台上实现即时通讯(IM)的一种技术,它基于开放源码的XMPP协议栈。Openfire是XMPP服务器的一个实现,用Java编写,提供了实时、双向的...

    Android Studio 3.5安装包

    **Android Studio 3.5 安装包** Android Studio 是Google官方推出的集成开发环境(IDE),专为Android应用开发设计。版本3.5是该工具的一个稳定版本,提供了许多优化和改进,旨在提升开发者的工作效率和应用质量。...

    Android组件设计思想

    Android应用开发的哲学是把一切都看作是组件。把应用程序组件化的好处是降低模块间的耦合性,同时提高模块的复用性。Android的组件设计思想与传统的组件设计思想最大的区别在于,前者不依赖于进程。也就是说,进程...

    Android小项目集合100多个

    1. **Android SDK**:Android软件开发工具包(SDK)是开发Android应用的基础,包含了开发、调试和发布应用所需的所有工具,如Android Studio IDE、Java Development Kit(JDK)、模拟器以及各种版本的Android平台库...

    3568 Android 11 GMS包

    可直接配合 教程使用 内置mk文件

    Android通讯录管理(获取联系人、通话记录、短信消息)

    在Android系统中,通讯录管理是一项重要的功能,它涉及到用户个人信息的存储和访问。这篇教程将深入探讨如何在Android应用中获取联系人信息、通话记录以及短信消息。首先,我们来了解一下基本概念。 1. **获取联系...

    Android实现个人中心

    Android实现个人中心列表效果,以及个人中心的圆形图像和磨砂头像背景,Android实现个人中心列表效果,以及个人中心的圆形图像和磨砂头像背景Android实现个人中心列表效果,以及个人中心的圆形图像和磨砂头像背景

    Android开发入门60个小案例+源代码

    在Android开发领域,初学者经常会面临许多挑战,如理解Android应用程序的基本架构、学习XML布局、掌握Java或Kotlin编程语言,以及如何与设备硬件交互等。"Android开发入门60个小案例+源代码"这个资源提供了丰富的...

    Android经典源码全集

    《Android经典源码全集》是一份集合了众多Android系统及应用开发中关键代码的资源库,对于深入理解Android的工作原理、优化应用性能以及提升开发技能具有极高的学习价值。这个压缩包包含了丰富的源码示例,涵盖了...

    AndroidStudio————实战演练——仿美团外卖菜单

    在本项目中,"AndroidStudio————实战演练——仿美团外卖菜单"是一个专注于使用Android Studio开发的应用程序实战案例,目标是创建一个类似于美团外卖的菜单功能。这个项目涵盖了多个Android开发的关键知识点,...

    Android studio 通讯录开发

    使用Android开发 简单 强悍 适合初学者,代码具有登录界面,注册界面,添加通讯录联系人,修改联系人,删除联系人,查询联系人等多个功能,简单使用十分适合初学者练习 参考使用 内有apk 可直接在手机上运行

    Android串口通信实例

    在Android开发中,串口通信(Serial Port Communication)是一种重要的技术,它允许设备间通过串行数据线进行双向通信。这个“Android串口通信实例”项目是基于Android Studio的一个实战项目,已经过测试,能够有效...

    Android实现ListView的A-Z字母排序和过滤搜索功能完整实例源码

    Android实现ListView的A-Z字母排序和过滤搜索功能,完整源码,小伙伴需要的来CSDN下载吧!项目详情http://blog.csdn.net/xiaanming/article/details/12684155

Global site tag (gtag.js) - Google Analytics