[Lunar-commits] <moonbase> bluetooth: In case you want to use pcmcia+serial bluetooth stuff.

Dennis `stumbles` Veatch stumbles at lunar-linux.org
Tue Sep 15 11:03:27 CEST 2009


commit 80b180c18d2b18ec6433ff3a3ceda97fe51cc3b0
Author: Dennis `stumbles` Veatch <stumbles at lunar-linux.org>
Date:   Tue Sep 15 05:03:27 2009 -0400

    bluetooth: In case you want to use pcmcia+serial bluetooth stuff.
---
 bluetooth/bluez/init.d/bluetooth_serial |   39 +++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/bluetooth/bluez/init.d/bluetooth_serial b/bluetooth/bluez/init.d/bluetooth_serial
new file mode 100644
index 0000000..6250624
--- /dev/null
+++ b/bluetooth/bluez/init.d/bluetooth_serial
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# chkconfig: 345 80 20
+# description: Startup/shutdown script for Bluetooth serial PCMCIA card initialization
+
+ . /lib/lsb/init-functions $1
+
+start_serial()
+{
+	if [ ! -x /bin/setserial -o ! -x /usr/sbin/hciattach ]; then
+		logger "$0: setserial or hciattach not executable, cannot start $DEVNAME"
+		return 1
+	fi
+
+	if [ "$BAUDBASE" != "" ]; then
+		/bin/setserial $DEVNAME baud_base $BAUDBASE
+	fi
+
+	/usr/sbin/hciattach $DEVNAME $HCIOPTS 2>&1 | logger -t hciattach
+}
+
+stop_serial()
+{
+	[ -x /bin/fuser ] || return 1 
+
+	/bin/fuser -k -HUP $DEVNAME > /dev/null
+}
+
+case "$ACTION" in
+   add)
+	start_serial
+	;;
+   remove)
+	stop_serial
+	;;
+   *)
+	logger "Unknown action received $0: $ACTION"
+	;;
+esac


More information about the Lunar-commits mailing list