[Pkg-bluetooth-commits] r1387 - in /packages/bluez/trunk/debian: bluez.bluetooth.default bluez.bluetooth.init
iwamatsu at users.alioth.debian.org
iwamatsu at users.alioth.debian.org
Thu Apr 10 00:25:24 UTC 2014
Author: iwamatsu
Date: Thu Apr 10 00:25:23 2014
New Revision: 1387
URL: http://svn.debian.org/wsvn/pkg-bluetooth/?sc=1&rev=1387
Log:
Add function to start hci device at startup in sysvinit
Modified:
packages/bluez/trunk/debian/bluez.bluetooth.default
packages/bluez/trunk/debian/bluez.bluetooth.init
Modified: packages/bluez/trunk/debian/bluez.bluetooth.default
URL: http://svn.debian.org/wsvn/pkg-bluetooth/packages/bluez/trunk/debian/bluez.bluetooth.default?rev=1387&op=diff
==============================================================================
--- packages/bluez/trunk/debian/bluez.bluetooth.default (original)
+++ packages/bluez/trunk/debian/bluez.bluetooth.default Thu Apr 10 00:25:23 2014
@@ -3,6 +3,10 @@
# start bluetooth on boot?
# compatibility note: if this variable is _not_ found bluetooth will start
BLUETOOTH_ENABLED=1
+
+# From bluez 5.x, each HCI device is in invalid state.
+# ACTIVE_HCI_DEVICES_ON_BOOT specifies the HCI device be activated on boot-time.
+ACTIVE_HCI_DEVICES_ON_BOOT="hci0"
# This setting used to switch HID devices (e.g mouse/keyboad) to HCI mode, that
# is you will have bluetooth functionality from your dongle instead of only
Modified: packages/bluez/trunk/debian/bluez.bluetooth.init
URL: http://svn.debian.org/wsvn/pkg-bluetooth/packages/bluez/trunk/debian/bluez.bluetooth.init?rev=1387&op=diff
==============================================================================
--- packages/bluez/trunk/debian/bluez.bluetooth.init (original)
+++ packages/bluez/trunk/debian/bluez.bluetooth.init Thu Apr 10 00:25:23 2014
@@ -141,6 +141,30 @@
fi
}
+start_hci_dev()
+{
+ if [ -z "$ACTIVE_HCI_DEVICES_ON_BOOT" ]; then
+ log_daemon_msg "Please set to ACTIVE_HCI_DEVICES_ON_BOOT the bluetooth host device you want to enable."
+ log_daemon_msg "Please see /etc/default/bluetooth."
+ log_progress_msg "No enable hci device"
+ return
+ fi
+
+ for dev in ${ACTIVE_HCI_DEVICES_ON_BOOT} ; do
+ # NOTE: use dbus.... / hci0
+ # dbus-send --system --type=method_call \
+ # --print-reply=literal --dest=org.bluez /org/bluez/hci0 \
+ # org.freedesktop.DBus.Properties.Set string:org.bluez.Adapter1 \
+ # string:Powered variant:boolean:true
+ if [ "$VERBOSE" != no ]; then
+ log_progress_msg "Enabled ${dev}"
+ hciconfig $dev up || :
+ else
+ hciconfig $dev up > /dev/null 2>&1 || :
+ fi
+ done
+}
+
case $1 in
start)
log_daemon_msg "Starting $DESC"
@@ -153,6 +177,9 @@
start-stop-daemon --start --background $SSD_OPTIONS
log_progress_msg "${DAEMON##*/}"
+
+ # start HCI devices
+ start_hci_dev || :
run_sdptool || :
More information about the Pkg-bluetooth-commits
mailing list