File: baytech-rpc22.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 (80 lines) | stat: -rw-r--r-- 2,195 bytes parent folder | download | duplicates (3)
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
#
# Baytech RPC22-20
#
# Default config, then disable confirmation, and disable status menu.
#
# Firmware version: F1.10 (C) 2000
#
# Maybe it is accumulated serial noise or some other issue, but this
# model seems to require a little handshake:
#              send "\r\n"
#              expect ".*RPC-22>"
# before each command to avoid dropping the command.
#
specification "baytech-rpc22" {
       timeout         10   # about 5 sec for cycle command

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

       script login {
               send "\r\n"
               expect ".*RPC-22>"
       }
       script logout {
               send "\r\n"
               expect ".*RPC-22>"
               send "exit\r\n"
       }
       script status_all {
               send "\r\n"
               expect ".*RPC-22>"
               send "status\r\n"
               foreachplug {
                       expect "Outlet[ ]+([0-9]+)[^:0-9]+: (On|Off)"
                       setplugstate $1 $2 on="On" off="Off"
               }
               expect "RPC-22>"
       }
       script on {
               send "\r\n"
               expect ".*RPC-22>"
               send "on %s\r\n"
               expect "RPC-22>"
       }
       script on_all {
               send "\r\n"
               expect ".*RPC-22>"
               send "on 0\r\n"
               expect "RPC-22>"
       }
       script off {
               send "\r\n"
               expect ".*RPC-22>"
               send "off %s\r\n"
               expect "RPC-22>"
       }
       script off_all {
               send "\r\n"
               expect ".*RPC-22>"
               send "off 0\r\n"
               expect "RPC-22>"
       }
       script cycle {
               send "\r\n"
               expect ".*RPC-22>"
               send "off %s\r\n"
               expect "RPC-22>"
               delay 2
               send "on %s\r\n"
               expect "RPC-22>"
       }
       script cycle_all {
               send "\r\n"
               expect ".*RPC-22>"
               send "off 0\r\n"
               expect "RPC-22>"
               delay 2
               send "on 0\r\n"
               expect "RPC-22>"
       }
}