• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

device/generic/common


Commit MetaInfo

修訂8d0b51fcb6cd7d59365cb90dd283491339a4fd36 (tree)
時間2016-10-12 21:50:06
作者Chih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

Support BT HCI UART devices

Set appropriate properties to start btattach service.

Add BT related tools and remove obsolete code for BlueZ.

Change Summary

差異

--- a/init.sh
+++ b/init.sh
@@ -48,6 +48,7 @@ function init_hal_bluetooth()
4848 case "$PRODUCT" in
4949 T10*TA|HP*Omni*)
5050 BTUART_PORT=/dev/ttyS1
51+ set_property hal.bluetooth.uart.proto bcm
5152 ;;
5253 MacBookPro8*)
5354 rmmod b43
@@ -68,15 +69,13 @@ function init_hal_bluetooth()
6869 for bt in $(lsusb -v | awk ' /Class:.E0/ { print $9 } '); do
6970 chown 1002.1002 $bt && chmod 660 $bt
7071 done
71- modprobe btusb
7272 ;;
7373 esac
7474
7575 if [ -n "$BTUART_PORT" ]; then
7676 set_property hal.bluetooth.uart $BTUART_PORT
7777 chown bluetooth.bluetooth $BTUART_PORT
78- start btattach:-B$BTUART_PORT
79- log -t hciconfig -p i "`hciconfig`"
78+ start btattach
8079 fi
8180 }
8281
@@ -405,16 +404,6 @@ function do_bootcomplete()
405404 post_bootcomplete
406405 }
407406
408-function do_hci()
409-{
410- local hci=`hciconfig | grep ^hci | cut -d: -f1`
411- local btd="`getprop init.svc.bluetoothd`"
412- log -t bluetoothd -p i "$btd ($hci)"
413- if [ -n "`getprop hal.bluetooth.uart`" ]; then
414- [ "`getprop init.svc.bluetoothd`" = "running" ] && hciconfig $hci up
415- fi
416-}
417-
418407 PATH=/sbin:/system/bin:/system/xbin
419408
420409 DMIPATH=/sys/class/dmi/id
@@ -455,9 +444,6 @@ case "$1" in
455444 bootcomplete)
456445 do_bootcomplete
457446 ;;
458- hci)
459- do_hci
460- ;;
461447 init|"")
462448 do_init
463449 ;;
--- a/init.x86.rc
+++ b/init.x86.rc
@@ -1,4 +1,3 @@
1-import /init.bluetooth.rc
21 import /init.superuser.rc
32
43 on early-init
@@ -101,7 +100,7 @@ service powerbtnd /system/bin/powerbtnd
101100 service logcat /system/bin/logcat -v threadtime -f /data/log.txt
102101 class debug
103102
104-service btattach /system/bin/btattach -Pbcm
103+service btattach /system/bin/btattach
105104 class main
106105 disabled
107106 oneshot
@@ -127,12 +126,6 @@ on property:sys.boot_completed=1
127126 write /proc/sys/kernel/ctrl-alt-del 0
128127 exec -- /system/bin/logwrapper /system/bin/sh /system/etc/init.sh bootcomplete
129128
130-on property:init.svc.bluetoothd=running
131- exec -- /system/bin/logwrapper /system/bin/sh /system/etc/init.sh hci
132-
133-on property:init.svc.bluetoothd=stopped
134- exec -- /system/bin/logwrapper /system/bin/sh /system/etc/init.sh hci
135-
136129 on property:net.dns1=*
137130 exec -- /system/bin/logwrapper /system/bin/sh /system/etc/init.sh netconsole
138131
--- a/packages.mk
+++ b/packages.mk
@@ -80,6 +80,11 @@ PRODUCT_PACKAGES += \
8080 resize2fs \
8181 tune2fs \
8282
83+PRODUCT_PACKAGES += \
84+ btattach \
85+ hciconfig \
86+ hcitool \
87+
8388 # Third party apps
8489 PRODUCT_PACKAGES += \
8590 CMFileManager \