forked from tklab-tud/uscxml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.sh
executable file
·99 lines (93 loc) · 2.32 KB
/
demo.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#!/bin/sh
if [ $# -lt 1 ]
then
echo "Usage : $0 TimCommandID Write(1)/Read(0)"
exit
fi
TIM="127.0.0.1"
PORT="1502"
case "$1" in
-1) echo "Initializing Interpreter"
ping $TIM
;;
0) echo "Sending command $1"
if [ "$2" -eq "1" ] ; then
/usr/local/bin/modpoll -0 -1 -t0 -o4 -p $PORT -r1 -c1 $TIM 1
else
/usr/local/bin/modpoll -0 -1 -t0 -o4 -p $PORT -r2 -c1 $TIM
fi
;;
1) echo "Sending command $1"
if [ "$2" -eq "1" ] ; then
echo "Write Mode is Not Supported"
else
/usr/local/bin/modpoll -0 -1 -t4 -o4 -p $PORT -r76 -c76 $TIM
fi
;;
2) echo "Sending command $1"
if [ "$2" -eq "1" ] ; then
echo "Write Mode is Not Supported"
else
/usr/local/bin/modpoll -0 -1 -t4 -o4 -p $PORT -r413 -c56 $TIM
fi
;;
3) echo "Sending command $1"
if [ "$2" -eq "1" ] ; then
echo "Write Mode is Not Supported"
else
/usr/local/bin/modpoll -0 -1 -t4 -o4 -p $PORT -r663 -c114 $TIM
fi
;;
4) echo "Sending command $1"
if [ "$2" -eq "1" ] ; then
echo "Write Mode is Not Supported"
else
/usr/local/bin/modpoll -0 -1 -t4 -o4 -p $PORT -r1043 -c1 $TIM
fi
;;
5) echo "Sending command $1"
if [ "$2" -eq "1" ] ; then
echo "Write Mode is Not Supported"
else
/usr/local/bin/modpoll -0 -1 -t4 -o4 -p $PORT -r1044 -c23 $TIM
fi
;;
6) echo "Sending command $1"
if [ "$2" -eq "1" ] ; then
/usr/local/bin/modpoll -0 -1 -t4 -o4 -p $PORT -r1123 -c1 $TIM 18
else
/usr/local/bin/modpoll -0 -1 -t4 -o4 -p $PORT -r1067 -c29 $TIM
fi
;;
7) echo "Sending command $1"
if [ "$2" -eq "1" ] ; then
/usr/local/bin/modpoll -0 -1 -t4 -o4 -p $PORT -r1459 -c1 $TIM 1
else
/usr/local/bin/modpoll -0 -1 -t4 -o4 -p $PORT -r1377 -c84 $TIM
fi
;;
8) echo "Sending command $1"
if [ "$2" -eq "1" ] ; then
/usr/local/bin/modpoll -0 -1 -t4 -o4 -p $PORT -r1687 -c1 $TIM 1
else
/usr/local/bin/modpoll -0 -1 -t4 -o4 -p $PORT -r1677 -c23 $TIM
fi
;;
9) echo "Sending command $1"
if [ "$2" -eq "1" ] ; then
echo "Write Mode is Not Supported"
else
/usr/local/bin/modpoll -0 -1 -t4 -o4 -p $PORT -r1802 -c29 $TIM
fi
;;
10) echo "Sending command $1"
if [ "$2" -eq "1" ] ; then
echo "Write Mode is Not Supported"
else
/usr/local/bin/modpoll -0 -1 -t4 -o4 -p $PORT -r2089 -c32 $TIM
fi
;;
*) echo "Signal number $1 is not supported"
;;
esac
# comando 3 read