Package org.openhab.binding.comfoair.internal

Examples of org.openhab.binding.comfoair.internal.InitializationException


        ComfoAirCommand command = ComfoAirCommandType.getChangeCommand(
            ComfoAirCommandType.ACTIVATE.key, new DecimalType(1));
        sendCommand(command);
      } catch (PortInUseException e) {
        throw new InitializationException(e);
      } catch (UnsupportedCommOperationException e) {
        throw new InitializationException(e);
      } catch (IOException e) {
        throw new InitializationException(e);
      }

    } catch (NoSuchPortException e) {
      StringBuilder sb = new StringBuilder();
      Enumeration portList = CommPortIdentifier.getPortIdentifiers();
      while (portList.hasMoreElements()) {
        CommPortIdentifier id = (CommPortIdentifier) portList
            .nextElement();
        if (id.getPortType() == CommPortIdentifier.PORT_SERIAL) {
          sb.append(id.getName() + "\n");
        }
      }

      throw new InitializationException("Serial port '" + port
          + "' could not be found. Available ports are:\n"
          + sb.toString());
    }
  }
View Full Code Here

TOP

Related Classes of org.openhab.binding.comfoair.internal.InitializationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.