]> git.basschouten.com Git - openhab-addons.git/blob
409f64e33bbfea4c5d554f1dc36e67639042ebe7
[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 _VLDMessage extends EEP {
25
26     public _VLDMessage() {
27         super();
28     }
29
30     public _VLDMessage(ERP1Message packet) {
31         super(packet);
32     }
33
34     @Override
35     protected int getDataLength() {
36         if (packet != null) {
37             return packet.getPayload().length - ESP3_SENDERID_LENGTH - ESP3_RORG_LENGTH - ESP3_STATUS_LENGTH;
38         } else {
39             return bytes.length;
40         }
41     }
42
43     @Override
44     protected boolean validateData(byte[] bytes) {
45         return true;
46     }
47 }