-
Notifications
You must be signed in to change notification settings - Fork 0
/
bt.sh
executable file
·77 lines (67 loc) · 1.58 KB
/
bt.sh
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/system/bin/sh
# Program:
# Program creates by Vane and it is BT Test Mode only.
# History:
# 2012/03/23 Vane Jorjin release
FOOLPROOF=0
#***********************************************************
# Error type
#***********************************************************
error_type(){
echo "
Error type, Please try again!!!!!"
sleep 1
busybox clear
}
#-------------------------------------- Main --------------------------------------
while [ 1 ]
do
echo "
++++++++++++++++++++++++++++++++++++++++++++++++++
MAIN NENU -> BT NENU
++++++++++++++++++++++++++++++++++++++++++++++++++
1) - Entering BT Test Mode
2) - Disable BT
Q) - Exit"
echo -n "====> "
read BT
case "$BT" in
1)
if [ $FOOLPROOF == "0" ]; then
bttest enable
sleep 1
hcitool cmd 0x3f 0x10c 0x00 0x00 0x00 0xff 0xff 0xff 0xff 0x64 #make BT don't enter deep sleep mode.
hcitool cmd 0x03 0x1a 0x03
hcitool cmd 0x03 0x05 0x02 0x00 0x03
hcitool cmd 0x06 0x03
sleep 1
echo "----------------------------------------"
echo "- BlueTooth Test Mode Start !!! -"
echo "----------------------------------------"
#todo : if I enable BT twice, then make user can't type the second times.
FOOLPROOF=1
else
echo " Sorry !! You can't Enable BT twice!! "
fi
continue
;;
2)
bttest disable
sleep 1
echo "----------------------------------------"
echo "- BlueTooth Test Mode Disable !!! -"
echo "----------------------------------------"
FOOLPROOF=0
continue
;;
q|Q)
bttest disable
echo " BlueTooth is closing now !!! "
sleep 1
break
;;
*)
error_type
;;
esac
done