CubieBoard中文论坛

 找回密码
 立即注册
搜索
热搜: unable
查看: 10023|回复: 1

CB1 android增加USB蓝牙支持

[复制链接]
发表于 2014-12-19 14:27:59 | 显示全部楼层 |阅读模式
本帖最后由 jiangdou 于 2014-12-29 09:53 编辑

USB蓝牙:http://item.taobao.com/item.htm? ... 9&qq-pf-to=pcqq.c2c


bluetooth.png
  1. 配置内核支持Bluetooth,

  2. 1.1 make menuconfig

  3. --- Bluetooth subsystem support                                                                           
  4.        [*]   L2CAP protocol support                                                                             
  5.        [*]   SCO links support                                                                                   
  6.        <*>   RFCOMM protocol support                                                                           
  7.        [*]     RFCOMM TTY support                                                                                
  8.        <*>   BNEP protocol support                                                                           
  9.        [*]     Multicast filter support                                                                          
  10.        [*]     Protocol filter support                                                                     
  11.        <*>   HIDP protocol support                                                                              
  12.           Bluetooth device drivers  --->        
  13.                <*> HCI USB driver                                                      
  14.                                                                            

  15. 2.android层:

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

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

  18. 在android.hardware.bluetooth.xml:

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

  22. 2.2加usb host权限

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

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

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

  28. 2.3 在/device/softwinner/crane-common/tablet_core_hardware.xml:
  29. <feature name="android.hardware.bluetooth" />
  30.     <feature name="android.hardware.usb.host" />
  31. 3.init.sun4i.rc

  32. # change rfkill permissions for bluetooth power management
  33. chmod 0666 /sys/class/rfkill/rfkill0/state
  34. chmod 0666 /sys/class/rfkill/rfkill0/type
  35. chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
  36. chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type
  37. write /sys/class/rfkill/rfkill0/state 0
  38. setprop rw.bluetooth.status "0"

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

  40. BOARD_HAVE_BLUETOOTH := true

  41. 5. bluetooh name modify :external\bluetooth\bluez\src\main.c

  42. static void init_defaults(void)
  43. {
  44. /* Default HCId settings */
  45. memset(&main_opts, 0, sizeof(main_opts));
  46. main_opts.mode= MODE_CONNECTABLE;
  47. main_opts.name= g_strdup("BlueZ");//modify to BlueZ -> cubieb1



复制代码
亲测可以用
usb蓝牙设备节点在,,/sys/class/rfkill/rf

root@android:/ # cat /sys/class/rfkill/rfkill1/                                
claim      hard       name       power/     state      type      
device/    index      persistent soft       subsystem/ uevent     
/rfkill/rfkill1/device/address                                                <
00:15:83:0C:BF:EB
root@android:/ # hciconfig                                                     
hci0:    Type: BR/EDR  Bus: USB
    BD Address: 00:15:83:0C:BF:EB  ACL MTU: 339:8  SCO MTU: 128:2
    UP RUNNING PSCAN
    RX bytes:2286 acl:0 sco:0 events:77 errors:0
    TX bytes:787 acl:0 sco:0 commands:64 errors:1

root@android:/ #


评分

参与人数 1威望 +7 收起 理由
lin + 7 很给力!

查看全部评分

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|粤ICP备13051116号|cubie.cc---深刻的嵌入式技术讨论社区

GMT+8, 2024-3-29 18:35 , Processed in 0.023981 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2012 Comsenz Inc. | Style by Coxxs

返回顶部