2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.satel.internal.types;
16 * Supported memory of troubles.
18 * @author Krzysztof Goworek - Initial contribution
20 public enum TroubleMemoryState implements StateType {
22 TECHNICAL_ZONE(0x20, 47, 0, 16),
23 EXPANDER_AC(0x20, 47, 16, 8),
24 EXPANDER_BATT(0x20, 47, 24, 8),
25 EXPANDER_NOBATT(0x20, 47, 32, 8),
26 SYSTEM(0x20, 47, 40, 3),
27 PTSA_AC(0x20, 47, 43, 1),
28 PTSA_BATT(0x20, 47, 44, 1),
29 PTSA_NOBATT(0x20, 47, 45, 1),
30 ETHM1(0x20, 47, 46, 1),
32 PROXIMITY_A(0x21, 39, 0, 8),
33 PROXIMITY_B(0x21, 39, 8, 8),
34 EXPANDER_OVERLOAD(0x21, 39, 16, 8),
35 JAMMED_ACU100(0x21, 39, 24, 2),
36 LCD_RESTART(0x21, 39, 26, 1),
37 EXPANDER_RESTART(0x21, 39, 27, 8),
39 DEVICE_LOBATT(0x22, 60, 15, 15),
40 DEVICE_NOCOMM(0x22, 60, 30, 15),
41 OUTPUT_NOCOMM(0x22, 60, 45, 15),
43 EXPANDER_NOCOMM(0x23, 30, 0, 8),
44 EXPANDER_SWITCHEROOED(0x23, 30, 8, 8),
45 KEYPAD_NOCOMM(0x23, 30, 16, 1),
46 KEYPAD_SWITCHEROOED(0x23, 30, 17, 1),
47 ETHM1_NOLAN(0x23, 30, 18, 1),
48 EXPANDER_TAMPER(0x23, 30, 19, 8),
49 KEYPAD_TAMPER(0x23, 30, 27, 1),
50 KEYPAD_INIT(0x23, 30, 28, 1),
51 AUXILIARY_STM(0x23, 30, 29, 1),
53 LONG_VIOLATION(0x24, 48, 0, 16),
54 NO_VIOLATION(0x24, 48, 16, 16),
55 ZONE_TAMPER(0x24, 48, 32, 16),
57 TECHNICAL_ZONE1(0x2d, 47, 16, 16),
59 DEVICE_LOBATT1(0x2e, 45, 0, 15),
60 DEVICE_NOCOMM1(0x2e, 45, 15, 15),
61 OUTPUT_NOCOMM1(0x2e, 45, 30, 15),
63 LONG_VIOLATION1(0x2f, 48, 0, 16),
64 NO_VIOLATION1(0x2f, 48, 16, 16),
65 ZONE_TAMPER1(0x2f, 48, 32, 16),;
67 private byte refreshCommand;
68 private int payloadLength;
69 private int startByte;
70 private int bytesCount;
72 TroubleMemoryState(int refreshCommand, int payloadLength, int startByte, int bytesCount) {
73 this.refreshCommand = (byte) refreshCommand;
74 this.payloadLength = payloadLength;
75 this.startByte = startByte;
76 this.bytesCount = bytesCount;
80 public byte getRefreshCommand() {
81 return refreshCommand;
85 public int getPayloadLength(boolean extendedCmd) {
90 public ObjectType getObjectType() {
91 return ObjectType.TROUBLE_MEMORY;
95 public int getStartByte() {
100 public int getBytesCount(boolean isExtended) {