2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.enocean.internal.messages.responses;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.binding.enocean.internal.messages.Response;
20 * @author Daniel Weber - Initial contribution
23 public class SMACKTeachInResponse extends Response {
25 // set response time to 250ms
26 static final byte RESPONSE_TIME_HVALUE = 0;
27 static final byte RESPONSE_TIME_LVALUE = (byte) 0xFA;
29 static final byte TEACH_IN = 0x00;
30 static final byte TEACH_OUT = 0x20;
31 static final byte REPEATED_TEACH_IN = 0x01;
32 static final byte NOPLACE_FOR_MAILBOX = 0x12;
33 static final byte BAD_RSSI = 0x14;
35 public SMACKTeachInResponse() {
36 super(4, 0, new byte[] { Response.ResponseType.RET_OK.getValue(), RESPONSE_TIME_HVALUE, RESPONSE_TIME_LVALUE,
40 public void setTeachOutResponse() {
44 public boolean isTeachOut() {
45 return data[3] == TEACH_OUT;
48 public void setRepeatedTeachInResponse() {
49 data[3] = REPEATED_TEACH_IN;
52 public void setNoPlaceForFurtherMailbox() {
53 data[3] = NOPLACE_FOR_MAILBOX;
56 public void setBadRSSI() {
60 public void setTeachIn() {
64 public boolean isTeachIn() {
65 return data[3] == TEACH_IN;