init进程中和bt相关的部分

  1. #首先是创建了两个文件夹和bluetooth相关  
  2.     mkdir /data/misc/bluetoothd 0770 bluetooth bluetooth  
  3. mkdir /data/misc/bluetooth 0770 system system  
  4. #新建了一个dbus的service,dbus是用于bluez和jni层交互的  
  5. #细心的同学已经发了,他是没有disabled的,所以,会直接启动哦  
  6. #不过dbus只是一个通路而已,我们暂时并不准备去详细地分析  
  7. service dbus /system/bin/dbus-daemon --system --nofork  
  8.     class main  
  9.     socket dbus stream 660 bluetooth bluetooth  
  10.     user bluetooth  
  11.     group bluetooth net_bt_admin  
  12. #新建了bluetoothd的service,这个就是bluez了  
  13. service bluetoothd /system/bin/bluetoothd -n  
  14.     class main  
  15.     socket bluetooth stream 660 bluetooth bluetooth  
  16.     socket dbus_bluetooth stream 660 bluetooth bluetooth  
  17.     # init.rc does not yet support applying capabilities, so run as root and  
  18.     # let bluetoothd drop uid to bluetooth with the right linux capabilities  
  19.     group bluetooth net_bt_admin misc  
  20.     disabled  
  21. #这里就是各个文件的权限配置了  
  22.     chmod 666 /dev/ttyS0  
  23.     chmod 666 /proc/bluetooth/sleep/proto  
  24.     chmod 666 /sys/class/rfkill/rfkill0/state  
  25.     chmod 666 /sys/class/rfkill/rfkill0/type  
  26.     chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state  
  27.     chown bluetooth bluetooth /sys/class/rfkill/rfkill0/type  
  28. #一个hciattach的service,hciattach是bluetooth的一个工具,这里可以用来启动蓝牙  
  29. #涉及到一些vendor的信息后面就写成***了  
  30. service hciattach /system/bin/logwrapper /system/bin/hciattach -n /dev/ttyS0 ***  
  31.     class main  
  32.     user bluetooth  
  33.     group bluetooth net_bt_admin  
  34.     disabled  
  35.     oneshot 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值