summaryrefslogtreecommitdiffstats
path: root/meta-agl/recipes-connectivity/bluez5/bluez5/init
diff options
context:
space:
mode:
authorStephane Desneux <stephane.desneux@iot.bzh>2016-12-05 15:00:00 +0100
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2016-12-13 10:30:30 +0000
commitebb1a102d3a6bfb29f1317f90cf669a53b039f3c (patch)
tree6d4ba02590899abc1be07b7b531f2eb80665d3fb /meta-agl/recipes-connectivity/bluez5/bluez5/init
parent3cfccc1d60b1d4384b8af16610bed7d74005bf09 (diff)
bluez: Upgrade for using BLE features
This version of bluez, a little forward of 5.43,s includes working features for using BLE GATT services and attributes. This is needed for a demo that uses DIGIPASS SecureClick of Vasco. To be removed when yocto upgrades to bluez 5.44 or higher. Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'meta-agl/recipes-connectivity/bluez5/bluez5/init')
-rw-r--r--meta-agl/recipes-connectivity/bluez5/bluez5/init68
1 files changed, 68 insertions, 0 deletions
diff --git a/meta-agl/recipes-connectivity/bluez5/bluez5/init b/meta-agl/recipes-connectivity/bluez5/bluez5/init
new file mode 100644
index 000000000..489e9b9eb
--- /dev/null
+++ b/meta-agl/recipes-connectivity/bluez5/bluez5/init
@@ -0,0 +1,68 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DESC=bluetooth
+
+DAEMON=@LIBEXECDIR@/bluetooth/bluetoothd
+
+# If you want to be ignore error of "org.freedesktop.hostname1",
+# please enable NOPLUGIN_OPTION.
+# NOPLUGIN_OPTION="--noplugin=hostname"
+NOPLUGIN_OPTION=""
+SSD_OPTIONS="--oknodo --quiet --exec $DAEMON -- $NOPLUGIN_OPTION"
+
+test -f $DAEMON || exit 0
+
+# FIXME: any of the sourced files may fail if/with syntax errors
+test -f /etc/default/bluetooth && . /etc/default/bluetooth
+test -f /etc/default/rcS && . /etc/default/rcS
+
+set -e
+
+case $1 in
+ start)
+ echo "Starting $DESC"
+
+ if test "$BLUETOOTH_ENABLED" = 0; then
+ echo "disabled. see /etc/default/bluetooth"
+ exit 0
+ fi
+
+ start-stop-daemon --start --background $SSD_OPTIONS
+ echo "${DAEMON##*/}"
+
+ ;;
+ stop)
+ echo "Stopping $DESC"
+ if test "$BLUETOOTH_ENABLED" = 0; then
+ echo "disabled."
+ exit 0
+ fi
+ start-stop-daemon --stop $SSD_OPTIONS
+ echo "${DAEMON}"
+ ;;
+ restart|force-reload)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ status)
+ pidof ${DAEMON} >/dev/null
+ status=$?
+ if [ $status -eq 0 ]; then
+ echo "bluetooth is running."
+ else
+ echo "bluetooth is not running"
+ fi
+ exit $status
+ ;;
+ *)
+ N=/etc/init.d/bluetooth
+ echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# vim:noet