summaryrefslogtreecommitdiffstats
path: root/pcmcia/bluetooth
blob: ea22ce40b8f691678f87a85d2542d773ea5ed379 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
#
# bluetooth
#
# Initialize a PCMCIA Bluetooth device
# Written by Maxim Krasnyanskiy <maxk@qualcomm.com>
#
# $1 - socket
# $2 - device
# 

LOG="/usr/bin/logger -i -t bluetooth -p daemon.notice"

IDENT="/sbin/cardctl ident $1"

# Check if card is really a Bluetooth card
if ! $IDENT | grep -i 'bluetooth' > /dev/null 2>&1; then
	$LOG "$2 is not a Bluetooth device"
	exit
fi

ID=`$IDENT | awk '/.*id/{print $2 $3}'`
TYPE=`$IDENT | awk '/.*func/{print $2}'`

$LOG "Bluetooth device id $ID type $TYPE $2"

case "$TYPE" in
	# Serial device
	2)
		/sbin/hciattach $DEVICE $ID
		;;
esac

unset LOG IDENT ID TYPE