]> git.basschouten.com Git - openhab-addons.git/blob
27dbc2d780e01cf09333b625006d02c2c1db63d7
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.powermax.internal.message;
14
15 /**
16  * Used to map messages to be sent to the Visonic alarm panel to a ENUM value
17  *
18  * @author Laurent Garnier - Initial contribution
19  */
20 public enum PowermaxSendType {
21
22     INIT(new byte[] { (byte) 0xAB, 0x0A, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43 }, null, null),
23     ZONESNAME(new byte[] { (byte) 0xA3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43 }, null,
24             PowermaxReceiveType.ZONESNAME),
25     ZONESTYPE(new byte[] { (byte) 0xA6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43 }, null,
26             PowermaxReceiveType.ZONESTYPE),
27     X10NAMES(new byte[] { (byte) 0xAC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43 }, null, null),
28     RESTORE(new byte[] { (byte) 0xAB, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43 }, null,
29             PowermaxReceiveType.STATUS),
30     ENROLL(new byte[] { (byte) 0xAB, 0x0A, 0x00, 0x00, 'O', 'H', 0x00, 0x00, 0x00, 0x00, 0x00, 0x43 }, null, null),
31     EVENTLOG(new byte[] { (byte) 0xA0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43 }, 4,
32             PowermaxReceiveType.EVENT_LOG),
33     ARM(new byte[] { (byte) 0xA1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43 }, 3, null),
34     STATUS(new byte[] { (byte) 0xA2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43 }, null,
35             PowermaxReceiveType.STATUS),
36     BYPASSTAT(new byte[] { (byte) 0xA2, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43 }, null,
37             PowermaxReceiveType.STATUS),
38     X10PGM(new byte[] { (byte) 0xA4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43 }, 6, null),
39     BYPASS(new byte[] { (byte) 0xAA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43 }, 1, null),
40     DOWNLOAD(new byte[] { 0x24, 0x00, 0x00, 'O', 'H', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
41             PowermaxReceiveType.INFO),
42     SETTIME(new byte[] { 0x46, (byte) 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, (byte) 0xFF, (byte) 0xFF }, 3,
43             null),
44     DL_TIME(new byte[] { 0x3E, (byte) 0xF8, 0x00, 0x06, 0x00, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
45             PowermaxReceiveType.SETTINGS_ITEM),
46     DL_COMMDEF(new byte[] { 0x3E, 0x01, 0x01, 0x1E, 0x00, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
47             PowermaxReceiveType.SETTINGS_ITEM),
48     DL_PHONENRS(new byte[] { 0x3E, 0x36, 0x01, 0x20, 0x00, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
49             PowermaxReceiveType.SETTINGS_ITEM),
50     DL_PINCODES(new byte[] { 0x3E, (byte) 0xFA, 0x01, 0x10, 0x00, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
51             PowermaxReceiveType.SETTINGS_ITEM),
52     DL_PGMX10(new byte[] { 0x3E, 0x14, 0x02, (byte) 0xD5, 0x00, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
53             PowermaxReceiveType.SETTINGS_ITEM),
54     DL_PARTITIONS(new byte[] { 0x3E, 0x00, 0x03, (byte) 0xF0, 0x00, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
55             PowermaxReceiveType.SETTINGS_ITEM),
56     DL_PANELFW(new byte[] { 0x3E, 0x00, 0x04, 0x20, 0x00, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
57             PowermaxReceiveType.SETTINGS_ITEM),
58     DL_SERIAL(new byte[] { 0x3E, 0x30, 0x04, 0x08, 0x00, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
59             PowermaxReceiveType.SETTINGS_ITEM),
60     DL_ZONES(new byte[] { 0x3E, 0x00, 0x09, 0x78, 0x00, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
61             PowermaxReceiveType.SETTINGS_ITEM),
62     DL_KEYFOBS(new byte[] { 0x3E, 0x78, 0x09, 0x40, 0x00, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
63             PowermaxReceiveType.SETTINGS_ITEM),
64     DL_2WKEYPAD(new byte[] { 0x3E, 0x00, 0x0A, 0x08, 0x00, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
65             PowermaxReceiveType.SETTINGS_ITEM),
66     DL_1WKEYPAD(new byte[] { 0x3E, 0x20, 0x0A, 0x40, 0x00, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
67             PowermaxReceiveType.SETTINGS_ITEM),
68     DL_SIRENS(new byte[] { 0x3E, 0x60, 0x0A, 0x08, 0x00, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
69             PowermaxReceiveType.SETTINGS_ITEM),
70     DL_X10NAMES(new byte[] { 0x3E, 0x30, 0x0B, 0x10, 0x00, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
71             PowermaxReceiveType.SETTINGS_ITEM),
72     DL_ZONENAMES(new byte[] { 0x3E, 0x40, 0x0B, 0x1E, 0x00, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
73             PowermaxReceiveType.SETTINGS_ITEM),
74     DL_EVENTLOG(new byte[] { 0x3E, (byte) 0xDF, 0x04, 0x28, 0x03, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
75             PowermaxReceiveType.SETTINGS_ITEM),
76     DL_ZONESTR(new byte[] { 0x3E, 0x00, 0x19, 0x00, 0x02, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
77             PowermaxReceiveType.SETTINGS_ITEM),
78     DL_ZONECUSTOM(new byte[] { 0x3E, (byte) 0xA0, 0x1A, 0x50, 0x00, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
79             PowermaxReceiveType.SETTINGS_ITEM),
80     DL_MR_ZONENAMES(new byte[] { 0x3E, 0x60, 0x09, 0x40, 0x00, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
81             PowermaxReceiveType.SETTINGS_ITEM),
82     DL_MR_PINCODES(new byte[] { 0x3E, (byte) 0x98, 0x0A, 0x60, 0x00, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
83             PowermaxReceiveType.SETTINGS_ITEM),
84     DL_MR_SIRENS(new byte[] { 0x3E, (byte) 0xE2, (byte) 0xB6, 0x50, 0x00, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 },
85             null, PowermaxReceiveType.SETTINGS_ITEM),
86     DL_MR_KEYPADS(new byte[] { 0x3E, 0x32, (byte) 0xB7, 0x40, 0x01, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
87             PowermaxReceiveType.SETTINGS_ITEM),
88     DL_MR_ZONES(new byte[] { 0x3E, 0x72, (byte) 0xB8, (byte) 0x80, 0x02, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 },
89             null, PowermaxReceiveType.SETTINGS_ITEM),
90     DL_MR_SIRKEYZON(
91             new byte[] { 0x3E, (byte) 0xE2, (byte) 0xB6, 0x10, 0x04, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
92             PowermaxReceiveType.SETTINGS_ITEM),
93     DL_ALL(new byte[] { 0x3E, 0x00, 0x00, 0x00, (byte) 0xFF, (byte) 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
94             PowermaxReceiveType.SETTINGS_ITEM),
95     SER_TYPE(new byte[] { 0x5A, 0x30, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, null,
96             PowermaxReceiveType.SETTINGS),
97     START(new byte[] { 0x0A }, null, PowermaxReceiveType.SETTINGS),
98     EXIT(new byte[] { 0x0F }, null, null),
99     POWERMASTER_ZONE_STAT1(
100             new byte[] { (byte) 0xB0, 0x01, 0x04, 0x06, 0x02, (byte) 0xFF, 0x08, 0x03, 0x00, 0x00, 0x43 }, null,
101             PowermaxReceiveType.POWERMASTER),
102     POWERMASTER_ZONE_STAT2(
103             new byte[] { (byte) 0xB0, 0x01, 0x07, 0x06, 0x02, (byte) 0xFF, 0x08, 0x03, 0x00, 0x00, 0x43 }, null,
104             PowermaxReceiveType.POWERMASTER),
105     POWERMASTER_ZONE_NAME(new byte[] { (byte) 0xB0, 0x01, 0x21, 0x02, 0x05, 0x00, 0x43 }, null,
106             PowermaxReceiveType.POWERMASTER),
107     POWERMASTER_ZONE_TYPE1(new byte[] { (byte) 0xB0, 0x01, 0x2D, 0x02, 0x05, 0x00, 0x43 }, null,
108             PowermaxReceiveType.POWERMASTER);
109
110     private byte[] message;
111     private Integer paramPosition;
112     private PowermaxReceiveType expectedResponseType;
113
114     private PowermaxSendType(byte[] message, Integer paramPosition, PowermaxReceiveType expectedResponseType) {
115         this.message = message;
116         this.paramPosition = paramPosition;
117         this.expectedResponseType = expectedResponseType;
118     }
119
120     /**
121      * @return the message buffer, preamble and postamble not included
122      */
123     public byte[] getMessage() {
124         return message;
125     }
126
127     /**
128      * @return the position of the parameter in the message buffer
129      */
130     public Integer getParamPosition() {
131         return paramPosition;
132     }
133
134     /**
135      * @return the ENUM value of the expected message as response
136      */
137     public PowermaxReceiveType getExpectedResponseType() {
138         return expectedResponseType;
139     }
140 }