]> git.basschouten.com Git - openhab-addons.git/blob
f595fdda111d6bfa64dc516469641c5b3d87df9a
[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 org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.enocean.internal.eep.EEP;
17 import org.openhab.binding.enocean.internal.messages.ERP1Message;
18
19 /**
20  *
21  * @author Daniel Weber - Initial contribution
22  */
23 @NonNullByDefault
24 public abstract class _RPSMessage extends EEP {
25
26     protected boolean t21;
27     protected boolean nu;
28
29     public static final byte T21_FLAG = 0x20;
30     public static final byte NU_FLAG = 0x10;
31
32     public _RPSMessage() {
33         super();
34     }
35
36     public _RPSMessage(ERP1Message packet) {
37         super(packet);
38     }
39
40     public boolean isT21() {
41         return t21;
42     }
43
44     public boolean isNU() {
45         return nu;
46     }
47
48     @Override
49     public EEP setStatus(byte status) {
50         super.setStatus(status);
51         t21 = (status & T21_FLAG) != 0;
52         nu = (status & NU_FLAG) != 0;
53
54         return this;
55     }
56
57     public abstract boolean isValidForTeachIn();
58 }