gt:             str += ", RFU6 packets = " + enableImagintronixOpusPackets;
context: /**
   * Copyright (c) 2010-2017 by the respective copyright holders.
   *
   * All rights reserved. This program and the accompanying materials
   * are made available under the terms of the Eclipse Public License v1.0
   * which accompanies this distribution, and is available at
   * http://www.eclipse.org/legal/epl-v10.html
   */
  package org.openhab.binding.rfxcom.internal.messages;
  
  import java.io.UnsupportedEncodingException;
  import java.util.List;
  
  import org.eclipse.smarthome.core.types.State;
  import org.eclipse.smarthome.core.types.Type;
  import org.openhab.binding.rfxcom.RFXComValueSelector;
  import org.openhab.binding.rfxcom.internal.exceptions.RFXComException;
  import org.openhab.binding.rfxcom.internal.exceptions.RFXComUnsupportedValueException;
  
  /**
   * RFXCOM data class for interface message.
   *
   * @author Pauli Anttila - Initial contribution
   * @author Ivan Martinez - Older firmware support (OH1)
   */
  public class RFXComInterfaceMessage extends RFXComBaseMessage {
  
      public enum SubType {
          UNKNOWN_COMMAND(-1),
          RESPONSE(0),
          UNKNOWN_RTS_REMOTE(1),
          NO_EXTENDED_HW_PRESENT(2),
          LIST_RFY_REMOTES(3),
          LIST_ASA_REMOTES(4),
          START_RECEIVER(7);
  
          private final int subType;
  
          SubType(int subType) {
              this.subType = subType;
          }
  
          SubType(byte subType) {
              this.subType = subType;
          }
  
          public byte toByte() {
              return (byte) subType;
          }
  
          public static SubType fromByte(int input) throws RFXComUnsupportedValueException {
              for (SubType subType : SubType.values()) {
                  if (subType.subType == input) {
                      return subType;
                  }
              }
  
              throw new RFXComUnsupportedValueException(SubType.class, input);
          }
      }
  
      public enum Commands {
          RESET(0), // Reset the receiver/transceiver. No answer is transmitted!
          GET_STATUS(2), // Get Status, return firmware versions and configuration of the interface
          SET_MODE(3), // Set mode msg1-msg5, return firmware versions and configuration of the interface
          ENABLE_ALL(4), // Enable all receiving modes of the receiver/transceiver
          ENABLE_UNDECODED_PACKETS(5), // Enable reporting of undecoded packets
          SAVE_RECEIVING_MODES(6), // Save receiving modes of the receiver/transceiver in non-volatile memory
          START_RECEIVER(7), // Start RFXtrx receiver
          T1(8), // For internal use by RFXCOM
          T2(9), // For internal use by RFXCOM
  
          UNSUPPORTED_COMMAND(-1); // wrong command received from the application
  
          private final int command;
  
          Commands(int command) {
              this.command = command;
          }
  
          public byte toByte() {
              return (byte) command;
          }
  
          public static Commands fromByte(int input) throws RFXComUnsupportedValueException {
              for (Commands command : Commands.values()) {
                  if (command.command == input) {
                      return command;
                  }
              }
  
              throw new RFXComUnsupportedValueException(Commands.class, input);
          }
      }
  
      public enum TransceiverType {
          _310MHZ(80),
          _315MHZ(81),
          _433_92MHZ_RECEIVER_ONLY(82),
          _433_92MHZ_TRANSCEIVER(83),
          _868_00MHZ(85),
          _868_00MHZ_FSK(86),
          _868_30MHZ(87),
          _868_30MHZ_FSK(88),
          _868_35MHZ(89),
          _868_35MHZ_FSK(90),
          _868_95MHZ_FSK(91);
  
          private final int type;
  
          TransceiverType(int type) {
              this.type = type;
          }
  
          TransceiverType(byte type) {
              this.type = type;
          }
  
          public byte toByte() {
              return (byte) type;
          }
  
          public static TransceiverType fromByte(int input) throws RFXComUnsupportedValueException {
              for (TransceiverType type : TransceiverType.values()) {
                  if (type.type == input) {
                      return type;
                  }
              }
  
              throw new RFXComUnsupportedValueException(TransceiverType.class, input);
          }
      }
  
      public enum FirmwareType {
          TYPE1_RX_ONLY(0),
          TYPE1(1),
          TYPE2(2),
          EXT(3),
          EXT2(4);
  
          private final int type;
  
          FirmwareType(int type) {
              this.type = type;
          }
  
          FirmwareType(byte type) {
              this.type = type;
          }
  
          public byte toByte() {
              return (byte) type;
          }
  
          public static FirmwareType fromByte(int input) throws RFXComUnsupportedValueException {
              for (FirmwareType type : FirmwareType.values()) {
                  if (type.type == input) {
                      return type;
                  }
              }
  
              throw new RFXComUnsupportedValueException(FirmwareType.class, input);
          }
      }
  
      public SubType subType;
      public Commands command;
      public String text = "";
  
      public TransceiverType transceiverType;
      public int firmwareVersion;
  
      public boolean enableUndecodedPackets; // 0x80 - Undecoded packets
      public boolean enableImagintronixOpusPackets; // 0x40 - Imagintronix/Opus (433.92)
      public boolean enableByronSXPackets; // 0x20 - Byron SX (433.92)
      public boolean enableRSLPackets; // 0x10 - RSL (433.92)
      public boolean enableLighting4Packets; // 0x08 - Lighting4 (433.92)
      public boolean enableFineOffsetPackets; // 0x04 - FineOffset / Viking (433.92)
      public boolean enableRubicsonPackets; // 0x02 - Rubicson (433.92)
      public boolean enableAEPackets; // 0x01 - AE (433.92)
  
      public boolean enableBlindsT1T2T3T4Packets; // 0x80 - BlindsT1/T2/T3/T4 (433.92)
      public boolean enableBlindsT0Packets; // 0x40 - BlindsT0 (433.92)
      public boolean enableProGuardPackets; // 0x20 - ProGuard (868.35 FSK)
      public boolean enableFS20Packets; // 0x10 - FS20 (868.35)
      public boolean enableLaCrossePackets; // 0x08 - La Crosse (433.92/868.30)
      public boolean enableHidekiUPMPackets; // 0x04 - Hideki/UPM (433.92)
      public boolean enableADPackets; // 0x02 - AD LightwaveRF (433.92)
      public boolean enableMertikPackets; // 0x01 - Mertik (433.92)
  
      public boolean enableVisonicPackets; // 0x80 - Visonic (315/868.95)
      public boolean enableATIPackets; // 0x40 - ATI (433.92)
      public boolean enableOregonPackets; // 0x20 - Oregon Scientific (433.92)
      public boolean enableMeiantechPackets; // 0x10 - Meiantech (433.92)
      public boolean enableHomeEasyPackets; // 0x08 - HomeEasy EU (433.92)
      public boolean enableACPackets; // 0x04 - AC (433.92)
      public boolean enableARCPackets; // 0x02 - ARC (433.92)
      public boolean enableX10Packets; // 0x01 - X10 (310/433.92)
  
      public boolean enableHomeConfortPackets; // 0x02 - HomeConfort (433.92)
      public boolean enableKEELOQPackets; // 0x01 - KEELOQ (433.92)
  
      public byte hardwareVersion1;
      public byte hardwareVersion2;
  
      public int outputPower; // -18dBm to +13dBm. N.B. maximum allowed is +10dBm
  
      public FirmwareType firmwareType;
  
      public RFXComInterfaceMessage(byte[] data) throws RFXComException {
          encodeMessage(data);
      }
  
      @Override
      public String toString() {
          String str = "";
  
          str += super.toString();
          str += ", Sub type = " + subType;
          str += ", Command = " + command;
  
          if (subType == SubType.RESPONSE) {
  
              str += ", Transceiver type = " + transceiverType;
              str += ", Hardware version = " + hardwareVersion1 + "." + hardwareVersion2;
              str += ", Firmware type = " + (firmwareType != null ? firmwareType : "unknown");
              str += ", Firmware version = " + firmwareVersion;
              str += ", Output power = " + outputPower + "dBm";
              str += ", Undecoded packets = " + enableUndecodedPackets;
  