#
# 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> "
	}
}
