File: hp3488.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 (39 lines) | stat: -rw-r--r-- 761 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
#
# HP3488 switch/control unit using 'hp3488' utility from gpib-utils project.
#
#   device "hp0" "hp3488" "/usr/bin/hp3488 --shell|&"
#
# "Plug" names for this device are three digit values consisting of
# a single digit slot number (1-5) followed by two digit channel number.
#
specification "hp3488" {
	timeout 	5

	script login {
		expect "hp3488> "
	}
	script logout {
		send "quit\n"
	}
	script status {
		send "query %s\n"
		expect "([1-5][0-9]{2}): ([01])\n"
		setplugstate $1 $2 off="0" on="1"
		expect "hp3488> "
	}
	script on_ranged {
		send "on %s\n"
		expect "hp3488> "
	}
	script off_ranged {
		send "off %s\n"
		expect "hp3488> "
	}
	script cycle_ranged {
		send "off %s\n"
		expect "hp3488> "
		delay 4
		send "on %s\n"
		expect "hp3488> "
	}
}