Examples of EHealthException


Examples of org.openhab.binding.ehealth.internal.EHealthException

        serialPort.addEventListener(this);
        serialPort.notifyOnDataAvailable(true);
        serialPort.setSerialPortParams(BAUD, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);

      } catch (IOException e) {
        throw new EHealthException(e);
      } catch (PortInUseException e) {
        throw new EHealthException(e);
      } catch (UnsupportedCommOperationException e) {
        throw new EHealthException(e);
      } catch (TooManyListenersException e) {
        throw new EHealthException(e);
      }
     
    } else {
      StringBuilder sb = new StringBuilder();
      portList = CommPortIdentifier.getPortIdentifiers();
      while (portList.hasMoreElements()) {
        CommPortIdentifier id = (CommPortIdentifier) portList.nextElement();
        if (id.getPortType() == CommPortIdentifier.PORT_SERIAL) {
          sb.append(id.getName() + "\n");
        }
      }
      throw new EHealthException("Serial port '" + portName + "' could not be found. Available ports are:\n" + sb.toString());
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.