Sophie

Sophie

distrib > * > cooker > x86_64 > by-pkgid > 1acc97dcf884c05b37321eab15ec4372 > files > 44

powerman-2.3.9-2.x86_64.rpm

# 
# $Id: vpc.dev 1093 2008-12-02 01:00:05Z garlick $
#
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)\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\n"
		expect "[0-9]* vpc> "
	}
	script on_all {
		send "on *\n"
		expect "[0-9]* OK\n"
		expect "[0-9]* vpc> "
	}
	script off {
		send "off %s\n"
		expect "[0-9]* OK\n"
		expect "[0-9]* vpc> "
	}
	script off_all {
		send "off *\n"
		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_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)\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 {
		send "reset %s\n"
		expect "[0-9]* OK\n"
		expect "[0-9]* vpc> "
	}
}