]> git.basschouten.com Git - openhab-addons.git/blob
fcfa1bc6450a6ea1d6d1480792bd7ad9ba49a85f
[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.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.binding.enocean.internal.eep.EEP;
19 import org.openhab.binding.enocean.internal.messages.ERP1Message;
20
21 /**
22  *
23  * @author Daniel Weber - Initial contribution
24  */
25 @NonNullByDefault
26 public abstract class _VLDMessage extends EEP {
27
28     public _VLDMessage() {
29         super();
30     }
31
32     public _VLDMessage(ERP1Message packet) {
33         super(packet);
34     }
35
36     @Override
37     protected int getDataLength() {
38         ERP1Message localPacket = packet;
39         if (localPacket != null) {
40             return localPacket.getPayload().length - ESP3_SENDERID_LENGTH - ESP3_RORG_LENGTH - ESP3_STATUS_LENGTH;
41         }
42         return bytes.length;
43     }
44
45     @Override
46     protected boolean validateData(byte[] bytes) {
47         return true;
48     }
49 }