OreBolt-OS/overlay/etc/init.d/bt_input_daemon.sh

30 lines
725 B
Bash
Executable File

#!/bin/sh
# bt_input_daemon.sh -- OreBolt OS Bluetooth input daemon
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Brings up hci0, sets the device name, and enables LE advertising so the
# H2 can be paired as an input device. Companion to enable_vault_ble.sh.
case "$1" in
start)
echo "[*] Starting bt_input_daemon..."
hciconfig hci0 up
hciconfig hci0 name "H2-OREBOLT"
hciconfig hci0 piscan
btmgmt power off
btmgmt le on
btmgmt power on
btmgmt advertising on
;;
stop)
btmgmt advertising off
btmgmt power off
hciconfig hci0 down
;;
*)
echo "Usage: $0 {start|stop}"; exit 1
;;
esac
exit 0