bluez5: use node status to trigger bluetooth initialization

Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
This commit is contained in:
Arturo Buzarra 2019-06-24 10:43:11 +02:00
parent 086db36811
commit 401867f9e6
4 changed files with 20 additions and 12 deletions

View File

@ -67,9 +67,11 @@ bluetooth_init() {
case "$1" in
start)
if [ -d "/proc/device-tree/bluetooth" ]; then
echo -n "Starting bluetooth hardware: "
bluetooth_init
echo "${BT_ERROR:-done.}"
if [ "$(tr -d '\0' 2>/dev/null </proc/device-tree/bluetooth/status)" != "disabled" ]; then
echo -n "Starting bluetooth hardware: "
bluetooth_init
echo "${BT_ERROR:-done.}"
fi
fi
;;
stop)

View File

@ -111,9 +111,11 @@ bluetooth_init() {
case "$1" in
start)
if [ -d "/proc/device-tree/bluetooth" ]; then
echo -n "Starting bluetooth hardware: "
bluetooth_init
echo "done."
if [ "$(tr -d '\0' 2>/dev/null </proc/device-tree/bluetooth/status)" != "disabled" ]; then
echo -n "Starting bluetooth hardware: "
bluetooth_init
echo "${BT_ERROR:-done.}"
fi
fi
;;
stop)

View File

@ -93,9 +93,11 @@ bluetooth_init() {
case "$1" in
start)
if [ -d "/proc/device-tree/bluetooth" ]; then
echo -n "Starting bluetooth hardware: "
bluetooth_init
echo "${BT_ERROR:-done.}"
if [ "$(tr -d '\0' 2>/dev/null </proc/device-tree/bluetooth/status)" != "disabled" ]; then
echo -n "Starting bluetooth hardware: "
bluetooth_init
echo "${BT_ERROR:-done.}"
fi
fi
;;
stop)

View File

@ -42,9 +42,11 @@ bluetooth_init() {
case "$1" in
start)
if [ -d "/proc/device-tree/bluetooth" ]; then
echo -n "Starting bluetooth hardware: "
bluetooth_init
echo "${BT_ERROR:-done.}"
if [ "$(tr -d '\0' 2>/dev/null </proc/device-tree/bluetooth/status)" != "disabled" ]; then
echo -n "Starting bluetooth hardware: "
bluetooth_init
echo "${BT_ERROR:-done.}"
fi
fi
;;
stop)