Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > db8d50b45fb15e865b7becf99650beea > files > 58

powerman-2.3.25-1.mga7.armv7hl.rpm

#
# $Id$
#
# WTI RPS-10
#
# Master configured for 9600 baud:
# if 9600 - wait 0.5 sec before sending next command
# if 2400 - wait 1.5 sec before sending next command
# Format of commands is ^X^X^B^X^X^B^X^XPC\r
#   where P is port number (0-9) and C is command (0,1,T,?)
#
# N.B. The 0.5 sec delays mentioned in the documentation don't seem to be 
# needed on my setup...
#
specification  "wti-rps10" {
	timeout 	5

	plug name { "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" }

	script login {
		delay 2
	}
	script status {
		send "\030\030\002\030\030\002\030\030%s?\r"
		expect "Plug ([0-9]) (On|Off)"
		setplugstate $1 $2 off="Off" on="On"
		expect "Complete"
	}
	script on {
		send "\030\030\002\030\030\002\030\030%s1\r"
		expect "Plug [0-9] On"
		expect "Complete"
	}
	script off {
		send "\030\030\002\030\030\002\030\030%s0\r"
		expect "Plug [0-9] Off"
		expect "Complete"
	}
# The T command is dip switch configurable for 5 or 10 second delay
# Shorter delays have to be done in s/w.
	script cycle {
		send "\030\030\002\030\030\002\030\030%s0\r"
		expect "Plug [0-9] Off"
		expect "Complete"

		delay 4

		send "\030\030\002\030\030\002\030\030%s1\r"
		expect "Plug [0-9] On"
		expect "Complete"
	}
}