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.openhab.binding.enocean.internal.messages.Response;
19 * @author Daniel Weber - Initial contribution
21 public class SMACKTeachInResponse extends Response {
23 // set response time to 250ms
24 static final byte RESPONSE_TIME_HVALUE = 0;
25 static final byte RESPONSE_TIME_LVALUE = (byte) 0xFA;
27 static final byte TEACH_IN = 0x00;
28 static final byte TEACH_OUT = 0x20;
29 static final byte REPEATED_TEACH_IN = 0x01;
30 static final byte NOPLACE_FOR_MAILBOX = 0x12;
31 static final byte BAD_RSSI = 0x14;
33 public SMACKTeachInResponse() {
34 super(4, 0, new byte[] { Response.ResponseType.RET_OK.getValue(), RESPONSE_TIME_HVALUE, RESPONSE_TIME_LVALUE,
38 public void setTeachOutResponse() {
42 public boolean isTeachOut() {
43 return data[3] == TEACH_OUT;
46 public void setRepeatedTeachInResponse() {
47 data[3] = REPEATED_TEACH_IN;
50 public void setNoPlaceForFurtherMailbox() {
51 data[3] = NOPLACE_FOR_MAILBOX;
54 public void setBadRSSI() {
58 public void setTeachIn() {
62 public boolean isTeachIn() {
63 return data[3] == TEACH_IN;