2 * Copyright (c) 2010-2024 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.rfxcom.internal.messages;
15 import org.openhab.binding.rfxcom.internal.config.RFXComBridgeConfiguration;
16 import org.openhab.core.types.Type;
19 * RFXCOM data class for control message.
21 * @author Pauli Anttila - Initial contribution
24 public class RFXComInterfaceControlMessage extends RFXComBaseMessage {
25 private byte[] data = new byte[14];
27 public RFXComInterfaceControlMessage(RFXComInterfaceMessage.TransceiverType transceiverType,
28 RFXComBridgeConfiguration configuration) {
30 data[1] = RFXComBaseMessage.PacketType.INTERFACE_CONTROL.toByte();
33 data[4] = RFXComInterfaceMessage.Commands.SET_MODE.toByte();
34 data[5] = transceiverType.toByte();
35 data[6] = (byte) (configuration.transmitPower + 18);
38 * These are actually dependent on the type of device and
39 * firmware, this list is mainly for RFXtrx443 at 433.92MHz,
40 * which most of our users use.
42 * TODO: At some point, we should reconcile this with the SDK
43 * and accommodate for other devices and protocols. This is
44 * probably not worth doing until someone needs it and has
45 * suitable devices to test with!
50 (configuration.enableUndecoded ? 0x80 : 0x00)
51 | (configuration.enableImagintronixOpus ? 0x40 : 0x00)
52 | (configuration.enableByronSX ? 0x20 : 0x00)
53 | (configuration.enableRSL ? 0x10 : 0x00)
54 | (configuration.enableLighting4 ? 0x08 : 0x00)
55 | (configuration.enableFineOffsetViking ? 0x04 : 0x00)
56 | (configuration.enableRubicson ? 0x02 : 0x00)
57 | (configuration.enableAEBlyss ? 0x01 : 0x00));
60 (configuration.enableBlindsT1T2T3T4 ? 0x80 : 0x00)
61 | (configuration.enableBlindsT0 ? 0x40 : 0x00)
62 | (configuration.enableProGuard ? 0x20 : 0x00)
63 | (configuration.enableFS20 ? 0x10 : 0x00)
64 | (configuration.enableLaCrosse ? 0x08 : 0x00)
65 | (configuration.enableHidekiUPM ? 0x04 : 0x00)
66 | (configuration.enableADLightwaveRF ? 0x02 : 0x00)
67 | (configuration.enableMertik ? 0x01 : 0x00));
70 (configuration.enableVisonic ? 0x80 : 0x00)
71 | (configuration.enableATI ? 0x40 : 0x00)
72 | (configuration.enableOregonScientific ? 0x20 : 0x00)
73 | (configuration.enableMeiantech ? 0x10 : 0x00)
74 | (configuration.enableHomeEasyEU ? 0x08 : 0x00)
75 | (configuration.enableAC ? 0x04 : 0x00)
76 | (configuration.enableARC ? 0x02 : 0x00)
77 | (configuration.enableX10 ? 0x01 : 0x00));
80 (configuration.enableHomeConfort ? 0x02 : 0x00)
81 | (configuration.enableKEELOQ ? 0x01 : 0x00));
89 public RFXComInterfaceControlMessage(byte[] data) {
90 // We should never receive control messages
91 throw new UnsupportedOperationException();
95 public byte[] decodeMessage() {
100 public void encodeMessage(byte[] data) {
101 throw new UnsupportedOperationException();
105 public void convertFromState(String channelId, Type type) {
106 throw new UnsupportedOperationException();