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