现在的位置: 首页 > 综合 > 正文

A10 JBM146 usb蓝牙模块调试心得

2013年06月25日 ⁄ 综合 ⁄ 共 1969字 ⁄ 字号 评论关闭

1.首先A10 的kernel 没有把usb 蓝牙的驱动打开

配置内核支持Bluetooth,

1.1 make menuconfig

[*] Networking support  --->                

<*>   Bluetooth subsystem support  --->    //蓝牙子系统必须选择

<*>   L2CAP protocol suppor       //逻辑链路控制和适配协议。

<*>   SCO links support           //蓝牙语音和耳机支持

<*>   RFCOMM protocol suppor      //面向流的传输协议,支持拨号网络等

[*]   RFCOMM TTY support          //

<*>   BNEP protocol support       //蓝牙网络封装协议,自组网支持

[*]   Multicast filter support    //蓝牙多播,支持支持BNEP

[*]   Protocol filter support //蓝牙多播,支持支持支持BNEP

<*>   HIDP protocol support       //基本支持协议

Bluetooth device drivers  --->

<*> HCI USB driver              //USB蓝牙模块支持

<M>HCI UART driver              //基于串口,CF卡或PCMCIA的蓝牙

<*> HCI BlueFRITZ! USB driver

<*> HCI VHCI (Virtual HCI device) driver

2.android层:

2.1加bluetooth权限:在/device/softwinner/crane-common/ProductCommon.mk

frameworks/base/data/etc/android.hardware.bluetooth.xml:system/etc/permissions/android.hardware.bluetooth.xml

android.hardware.bluetooth.xml

<permissions>
    <feature name="android.hardware.bluetooth" />
</permissions>

2.2加usb host权限

 frameworks/base/data/etc/android.hardware.usb.host.xml:system/etc/permissions/android.hardware.usb.host.xml 

android.hardware.usb.host.xml 里写:

<permissions>
    <feature name="android.hardware.usb.host" />
</permissions>

2.3 在/device/softwinner/crane-common/tablet_core_hardware.xml:

  <feature name="android.hardware.bluetooth" />
    <feature name="android.hardware.usb.host" />


3.init.sun4i.rc

# change rfkill permissions for bluetooth power management
chmod 0666 /sys/class/rfkill/rfkill0/state
chmod 0666 /sys/class/rfkill/rfkill0/type
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
write /sys/class/rfkill/rfkill0/state 0
setprop rw.bluetooth.status "0"




4.device\softwinner\apollo-mele\BoardConfig.mk

BOARD_HAVE_BLUETOOTH := true

5.蓝牙设备默认名字修改:external\bluetooth\bluez\src\main.c下

static void init_defaults(void)
{
/* Default HCId settings */
memset(&main_opts, 0, sizeof(main_opts));
main_opts.mode= MODE_CONNECTABLE;
main_opts.name= g_strdup("BlueZ");

....

把BlueZ 改成你想要改成的名字就行了。 

抱歉!评论已关闭.