4f1cbddc12
remove pseudo-device btdev(4) and inherent limitations add bthub(4) which autoconfigures at bluetooth controllers as they are enabled. bluetooth devices now attach here. btdevctl(8) and its cache is updated to handle new semantics etc/rc.d/btdevctl is updated to configure devices from a list in /etc/bluetooth/btdevctl.conf
40 lines
723 B
Bash
40 lines
723 B
Bash
#!/bin/sh
|
|
#
|
|
# $NetBSD: btdevctl,v 1.3 2006/09/10 15:45:55 plunky Exp $
|
|
#
|
|
|
|
# PROVIDE: btdevctl
|
|
# REQUIRE: bluetooth
|
|
# BEFORE: LOGIN
|
|
|
|
$_rc_subr_loaded . /etc/rc.subr
|
|
|
|
name="btdevctl"
|
|
rcvar=${name}
|
|
required_files="/etc/bluetooth/btdevctl.conf"
|
|
start_cmd='do_btdevctl "-A" "Attaching"'
|
|
stop_cmd='do_btdevctl "-D" "Detaching"'
|
|
|
|
do_btdevctl()
|
|
{
|
|
echo "${2} Bluetooth devices:"
|
|
|
|
while read -r service address device junk; do
|
|
case ${service} in
|
|
\#*|"")
|
|
continue
|
|
;;
|
|
esac
|
|
|
|
if [ -z ${device} -o ${junk} ]; then
|
|
echo "${name}: invalid entry"
|
|
return 1
|
|
fi
|
|
|
|
/usr/sbin/btdevctl ${1} "-a" ${address} "-d" ${device} "-s" ${service}
|
|
done < /etc/bluetooth/btdevctl.conf
|
|
}
|
|
|
|
load_rc_config ${name}
|
|
run_rc_command "$1"
|