-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure_trace_modem
132 lines (128 loc) · 4.71 KB
/
configure_trace_modem
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/system/xbin/ash
###############################################################################
# configure trace level for mts
#
# configure_trace_modem -d -t1 : USB CDC ACM, first level trace
# configure_trace_modem -d -t2 : USB CDC ACM, second level trace
# configure_trace_modem -d -t3 : USB CDC ACM, third level trace
# configure_trace_modem -h -t1 : HSI, first level trace
# configure_trace_modem -h -t2 : HSI, second level trace
# configure_trace_modem -h -t3 : HSI, third level trace
# configure_trace_modem -u -t0 : USB CDC ACM and HSI disabled, trace disabled
#
###############################################################################
#############################
# Check numbers of arguments
#############################
if [ $# != 2 ]
then
echo "USAGE: configure_trace_modem [-d|-h -t1|-t2|-t3]"
echo "USAGE: configure_trace_modem [-u -t0]"
echo " -u: disable USB CDC ACM and HSI"
echo " -d: default USB CDC ACM"
echo " -h: HSI"
echo " -t0: disable trace"
echo " -t1: first level trace (bb_sw)"
echo " -t2: second level trace (bb_sw & 3g_sw)"
echo " -t3: third level trace (bb_sw & 3g_sw & digrf)"
exit 0
else
setprop persist.service.mts.input ""
setprop persist.service.mts.output ""
setprop persist.service.mts.output_type ""
setprop persist.service.mts.rotate_num ""
setprop persist.service.mts.rotate_size ""
setprop persist.service.mts.name ""
setprop persist.service.mtsp.enable 0
stop mtso
fi
##############
# Check speed
##############
if [ "$1" = "-d" ] && ( [ "$2" = "-t1" ] || [ "$2" = "-t2" ] || [ "$2" = "-t3" ] )
then
echo "Default USB CDC ACM"
setprop persist.service.mts.input "/dev/ttyACM1"
echo -e -r "at+xsio=1\r\n" > /dev/gsmtty19
sleep 1;
elif [ "$1" = "-h" ] && ( [ "$2" = "-t1" ] || [ "$2" = "-t2" ] || [ "$2" = "-t3" ] )
then
echo "HSI"
setprop persist.service.mts.input "/dev/mdmTrace"
echo -e -r "at+xsio=4\r\n" > /dev/gsmtty19
sleep 1;
elif [ "$1" = "-u" ] && [ "$2" = "-t0" ]
then
echo "Disable USB CDC ACM and HSI"
setprop persist.service.mts.input ""
echo -e -r "at+xsio=0\r\n" > /dev/gsmtty19
sleep 1;
else
echo "USAGE: configure_trace_modem [-d|-h -t1|-t2|-t3]"
echo "USAGE: configure_trace_modem [-u -t0]"
echo " -u: disable USB CDC ACM and HSI"
echo " -d: default USB CDC ACM"
echo " -h: HSI"
echo " -t0: disable trace"
echo " -t1: first level trace (bb_sw)"
echo " -t2: second level trace (bb_sw & 3g_sw)"
echo " -t3: third level trace (bb_sw & 3g_sw & digrf)"
exit 0
fi
####################
# Check level trace
####################
if ( [ "$1" = "-d" ] || [ "$1" = "-h" ] ) && [ "$2" = "-t1" ]
then
echo "Enable first level trace (bb_sw)"
echo -e -r "at+trace=,115200,\"st=1,pr=1,bt=1,ap=0,db=1,lt=0,li=1,ga=0,ae=0\"\r\n" > /dev/gsmtty19 &
sleep 1;
echo -e -r "at+xsystrace=1,\"bb_sw=1\",,\"oct=4\"\r\n" > /dev/gsmtty19
sleep 2;
echo "configure_trace_modem" $1 $2 "SUCCESS. Your board needs a HARDWARE reboot"
exit 0
elif ( [ "$1" = "-d" ] || [ "$1" = "-h" ] ) && [ "$2" = "-t2" ]
then
echo "Enable second level trace (bb_sw & 3g_sw)"
echo -e -r "at+trace=,115200,\"st=1,pr=1,bt=1,ap=0,db=1,lt=0,li=1,ga=0,ae=0\"\r\n" > /dev/gsmtty19 &
sleep 1;
echo -e -r "at+xsystrace=1,\"bb_sw=1;3g_sw=1\",,\"oct=4\"\r\n" > /dev/gsmtty19 &
sleep 2;
echo "configure_trace_modem" $1 $2 "SUCCESS. Your board needs a HARDWARE reboot"
exit 0
elif ( [ "$1" = "-d" ] || [ "$1" = "-h" ] ) && [ "$2" = "-t3" ]
then
echo "Enable third level trace (bb_sw & 3g_sw & digrf)"
echo -e -r "at+trace=,115200,\"st=1,pr=1,bt=1,ap=0,db=1,lt=0,li=1,ga=0,ae=0\"\r\n" > /dev/gsmtty19 &
sleep 1;
echo -e -r "at+xsystrace=1,\"digrf=1;bb_sw=1;3g_sw=1\",\"digrf=0x84\",\"oct=4\"\r\n" > /dev/gsmtty19 &
sleep 2;
echo "configure_trace_modem" $1 $2 "SUCCESS. Your board needs a HARDWARE reboot"
exit 0
elif [ "$1" = "-u" ] && [ "$2" = "-t0" ]
then
echo "Disable trace"
setprop persist.service.mts.input ""
setprop persist.service.mts.output ""
setprop persist.service.mts.output_type ""
setprop persist.service.mts.rotate_num ""
setprop persist.service.mts.rotate_size ""
setprop persist.service.mts.name "disable"
echo -e -r "at+trace=0\r\n" > /dev/gsmtty19
sleep 1;
echo -e -r "at+xsystrace=0\r\n" > /dev/gsmtty19 &
sleep 2;
echo "configure_trace_modem" $1 $2 "SUCCESS. Your board needs a HARDWARE reboot"
exit 0
else
echo "USAGE: configure_trace_modem [-d|-h -t1|-t2|-t3]"
echo "USAGE: configure_trace_modem [-u -t0]"
echo " -u: disable USB CDC ACM and HSI"
echo " -d: default USB CDC ACM"
echo " -h: HSI"
echo " -t0: disable trace"
echo " -t1: first level trace (bb_sw)"
echo " -t2: second level trace (bb_sw & 3g_sw)"
echo " -t3: third level trace (bb_sw & 3g_sw & digrf)"
exit 0
fi