device/generic/common
修訂 | 8d0b51fcb6cd7d59365cb90dd283491339a4fd36 (tree) |
---|---|
時間 | 2016-10-12 21:50:06 |
作者 | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
Support BT HCI UART devices
Set appropriate properties to start btattach service.
Add BT related tools and remove obsolete code for BlueZ.
@@ -48,6 +48,7 @@ function init_hal_bluetooth() | ||
48 | 48 | case "$PRODUCT" in |
49 | 49 | T10*TA|HP*Omni*) |
50 | 50 | BTUART_PORT=/dev/ttyS1 |
51 | + set_property hal.bluetooth.uart.proto bcm | |
51 | 52 | ;; |
52 | 53 | MacBookPro8*) |
53 | 54 | rmmod b43 |
@@ -68,15 +69,13 @@ function init_hal_bluetooth() | ||
68 | 69 | for bt in $(lsusb -v | awk ' /Class:.E0/ { print $9 } '); do |
69 | 70 | chown 1002.1002 $bt && chmod 660 $bt |
70 | 71 | done |
71 | - modprobe btusb | |
72 | 72 | ;; |
73 | 73 | esac |
74 | 74 | |
75 | 75 | if [ -n "$BTUART_PORT" ]; then |
76 | 76 | set_property hal.bluetooth.uart $BTUART_PORT |
77 | 77 | chown bluetooth.bluetooth $BTUART_PORT |
78 | - start btattach:-B$BTUART_PORT | |
79 | - log -t hciconfig -p i "`hciconfig`" | |
78 | + start btattach | |
80 | 79 | fi |
81 | 80 | } |
82 | 81 |
@@ -405,16 +404,6 @@ function do_bootcomplete() | ||
405 | 404 | post_bootcomplete |
406 | 405 | } |
407 | 406 | |
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 | - | |
418 | 407 | PATH=/sbin:/system/bin:/system/xbin |
419 | 408 | |
420 | 409 | DMIPATH=/sys/class/dmi/id |
@@ -455,9 +444,6 @@ case "$1" in | ||
455 | 444 | bootcomplete) |
456 | 445 | do_bootcomplete |
457 | 446 | ;; |
458 | - hci) | |
459 | - do_hci | |
460 | - ;; | |
461 | 447 | init|"") |
462 | 448 | do_init |
463 | 449 | ;; |
@@ -1,4 +1,3 @@ | ||
1 | -import /init.bluetooth.rc | |
2 | 1 | import /init.superuser.rc |
3 | 2 | |
4 | 3 | on early-init |
@@ -101,7 +100,7 @@ service powerbtnd /system/bin/powerbtnd | ||
101 | 100 | service logcat /system/bin/logcat -v threadtime -f /data/log.txt |
102 | 101 | class debug |
103 | 102 | |
104 | -service btattach /system/bin/btattach -Pbcm | |
103 | +service btattach /system/bin/btattach | |
105 | 104 | class main |
106 | 105 | disabled |
107 | 106 | oneshot |
@@ -127,12 +126,6 @@ on property:sys.boot_completed=1 | ||
127 | 126 | write /proc/sys/kernel/ctrl-alt-del 0 |
128 | 127 | exec -- /system/bin/logwrapper /system/bin/sh /system/etc/init.sh bootcomplete |
129 | 128 | |
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 | - | |
136 | 129 | on property:net.dns1=* |
137 | 130 | exec -- /system/bin/logwrapper /system/bin/sh /system/etc/init.sh netconsole |
138 | 131 |
@@ -80,6 +80,11 @@ PRODUCT_PACKAGES += \ | ||
80 | 80 | resize2fs \ |
81 | 81 | tune2fs \ |
82 | 82 | |
83 | +PRODUCT_PACKAGES += \ | |
84 | + btattach \ | |
85 | + hciconfig \ | |
86 | + hcitool \ | |
87 | + | |
83 | 88 | # Third party apps |
84 | 89 | PRODUCT_PACKAGES += \ |
85 | 90 | CMFileManager \ |