]> git.basschouten.com Git - openhab-addons.git/blob
61b7762baae602f264cad430b4342230df8d932a
[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.messages.ERP1Message;
19 import org.openhab.binding.enocean.internal.messages.ERP1Message.RORG;
20
21 /**
22  *
23  * @author Dominik Vorreiter - Initial contribution
24  */
25 @NonNullByDefault
26 public class _4BSTeachInVariation3Response extends _4BSMessage {
27
28     public _4BSTeachInVariation3Response(ERP1Message packet, boolean teachIn) {
29         byte[] payload = packet.getPayload(ESP3_RORG_LENGTH, RORG._4BS.getDataLength());
30
31         payload[3] = (byte) (teachIn ? 0xF0 : 0xD0); // telegram with EEP number and Manufacturer ID,
32                                                      // EEP supported, Sender ID stored or deleted, Response
33
34         setData(payload);
35         setDestinationId(packet.getSenderId());
36         setSuppressRepeating(false);
37         setStatus((byte) 0x00);
38     }
39 }