]> git.basschouten.com Git - openhab-addons.git/blob
77c55c5a43f2000b1fe4e737fc2e1ece6154c1d9
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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.enocean.internal.eep.Base;
14
15 import static org.openhab.binding.enocean.internal.messages.ESP3Packet.*;
16
17 import org.openhab.binding.enocean.internal.eep.EEP;
18 import org.openhab.binding.enocean.internal.messages.ERP1Message;
19
20 /**
21  *
22  * @author Daniel Weber - Initial contribution
23  */
24 public abstract class _SIGMessage extends EEP {
25
26     public static final byte MID_ENERGY_STATUS = 0x06;
27
28     public _SIGMessage() {
29         super();
30     }
31
32     public _SIGMessage(ERP1Message packet) {
33         super(packet);
34     }
35
36     @Override
37     protected int getDataLength() {
38         if (packet != null) {
39             return packet.getPayload().length - ESP3_SENDERID_LENGTH - ESP3_RORG_LENGTH - ESP3_STATUS_LENGTH;
40         } else {
41             return bytes.length;
42         }
43     }
44
45     @Override
46     protected boolean validateData(byte[] bytes) {
47         return true;
48     }
49 }