File: vpc.dev

package info (click to toggle)
powerman 2.4.4-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,432 kB
  • sloc: ansic: 19,458; sh: 7,225; yacc: 694; makefile: 455; lex: 272
file content (148 lines) | stat: -rw-r--r-- 3,255 bytes parent folder | download | duplicates (2)
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#
# $Id$
#
specification "vpc" {
	timeout 	5.0

	plug name { "0" "1" "2" "3" "4" "5" "6" "7" "8"
		    "9" "10" "11" "12" "13" "14" "15" }

	script login {
		send "login\n"
		expect "[0-9]* OK\n"
		expect "[0-9]* vpc> "
	}
	script logout {
		send "logoff\n"
		expect "[0-9]* OK\n"
	}
	script status_all {
		send "stat *\n"
		foreachplug {
			expect "plug ([0-9]+): (ON|OFF|ERROR)\n"
			setplugstate $1 $2 on="ON" off="OFF"
		}
		expect "[0-9]* OK\n"
		expect "[0-9]* vpc> "
	}
	script on {
		send "on %s\n"
		expect "([0-9]+): (OK|ERROR)\n"
		setresult $1 $2 success="OK"
		expect "[0-9]* OK\n"
		expect "[0-9]* vpc> "
	}
	script on_ranged {
		send "on %s\n"
                foreachplug {
			expect "([0-9]+): (OK|ERROR)\n"
			setresult $1 $2 success="OK"
                }
		expect "[0-9]* OK\n"
		expect "[0-9]* vpc> "
	}
	script on_all {
		send "on *\n"
                foreachplug {
			expect "([0-9]+): (OK|ERROR)\n"
			setresult $1 $2 success="OK"
                }
		expect "[0-9]* OK\n"
		expect "[0-9]* vpc> "
	}
	script off {
		send "off %s\n"
		expect "([0-9]+): (OK|ERROR)\n"
		setresult $1 $2 success="OK"
		expect "[0-9]* OK\n"
		expect "[0-9]* vpc> "
	}
	script off_ranged {
		send "off %s\n"
                foreachplug {
			expect "([0-9]+): (OK|ERROR)\n"
			setresult $1 $2 success="OK"
                }
		expect "[0-9]* OK\n"
		expect "[0-9]* vpc> "
	}
	script off_all {
		send "off *\n"
                foreachplug {
			expect "([0-9]+): (OK|ERROR)\n"
			setresult $1 $2 success="OK"
                }
		expect "[0-9]* OK\n"
		expect "[0-9]* vpc> "
	}
	script cycle {
		send "off %s\n"
		expect "[0-9]* OK\n"
		expect "[0-9]* vpc> "
		delay 1.0
		send "on %s\n"
		expect "[0-9]* OK\n"
		expect "[0-9]* vpc> "
	}
	script cycle_ranged {
		send "off %s\n"
		expect "[0-9]* OK\n"
		expect "[0-9]* vpc> "
		delay 1.0
		send "on %s\n"
		expect "[0-9]* OK\n"
		expect "[0-9]* vpc> "
	}
	script cycle_all {
		send "off *\n"
		expect "[0-9]* OK\n"
		expect "[0-9]* vpc> "
		delay 1.0
		send "on *\n"
		expect "[0-9]* OK\n"
		expect "[0-9]* vpc> "
	}
        script beacon_on {
                send "flash %s\n"
                expect "[0-9]* OK\n"
                expect "[0-9]* vpc> "
        }
        script beacon_off {
                send "unflash %s\n"
                expect "[0-9]* OK\n"
                expect "[0-9]* vpc> "
        }
        script status_beacon_all {
                send "beacon *\n"
                foreachplug {
                        expect "plug ([0-9]+): (ON|OFF|ERROR)\n"
                        setplugstate $1 $2 on="ON" off="OFF"
                }
                expect "[0-9]* OK\n"
                expect "[0-9]* vpc> "
        }
        script status_temp_all {
                send "temp *\n"
                foreachplug {
                        expect "plug ([0-9]+): ([0-9]+)\n"
                        setplugstate $1 $2
                }
                expect "[0-9]* OK\n"
                expect "[0-9]* vpc> "
        }
	script reset_all {
		send "reset *\n"
		expect "[0-9]* OK\n"
		expect "[0-9]* vpc> "
	}
	script reset_ranged {
		send "reset %s\n"
		expect "[0-9]* OK\n"
		expect "[0-9]* vpc> "
	}
	script reset {
		send "reset %s\n"
		expect "[0-9]* OK\n"
		expect "[0-9]* vpc> "
	}
}