Source:
public Boolean open() { if (logger.isDebugEnabled()) { logger.debug("Port - Opening", this.deviceID); } portState.setState(PortStates.CLOSED); devicesStates.clear(); devicesStates.setStateToAllConfiguredDevices(this.deviceName, DeviceStates.UNKNOWN); connected = false; setWaitingForAnswer(false); try { portId = CommPortIdentifier.getPortIdentifier(this.deviceID); } catch (NoSuchPortException ex) { portState.setState(PortStates.NOT_EXIST); logger.warn("Port not found", this.deviceID); logger.warn("Available ports: " + getCommPortListString()); return false; } if (portId != null) { try { serialPort = portId.open("openHAB", 2000); } catch (PortInUseException e) { portState.setState(PortStates.NOT_AVAILABLE); logger.error("Port is in use", this.deviceID); this.close(); return false; } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { logger.error("Port exception: {}", this.deviceID, e.getMessage()); this.close(); return false; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) { logger.error("Port exception:{}", this.deviceID, e.getMessage()); this.close(); return false; } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { logger.error("Port exception:{}", this.deviceID, e.getMessage()); this.close(); return false; } serialPort.notifyOnDataAvailable(true); if (this.forceRTS) { serialPort.notifyOnOutputEmpty(true); } try { serialPort.setSerialPortParams(baud, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); } catch (UnsupportedCommOperationException e) { logger.error("Port exception: {}", this.deviceID, e.getMessage()); this.close(); return false; } } if (logger.isDebugEnabled()) { logger.debug("Port - opened", this.deviceID); } portState.setState(PortStates.LISTENING); connected = true; return true; }

Target:
public Boolean open() { if (logger.isDebugEnabled()) { logger.debug("{} - Opening", this.toString()); } portState.setState(PortStates.CLOSED); devicesStates.clear(); devicesStates.setStateToAllConfiguredDevices(this.deviceName, DeviceStates.UNKNOWN); connected = false; setWaitingForAnswer(false); try { portId = CommPortIdentifier.getPortIdentifier(this.deviceID); } catch (NoSuchPortException ex) { portState.setState(PortStates.NOT_EXIST); if (!alreadyPortNotFound) { logger.warn("{} not found", this.toString()); logger.info("Available ports: " + getCommPortListString()); alreadyPortNotFound = true; } return false; } alreadyPortNotFound = false; if (portId != null) { try { serialPort = portId.open("openHAB", 2000); } catch (PortInUseException e) { portState.setState(PortStates.NOT_AVAILABLE); logger.error("{} is in use", this.toString()); this.close(); return false; } try { inputStream = serialPort.getInputStream(); } catch (IOException e) { logger.error("{} exception: {}", this.toString(), e.getMessage()); this.close(); return false; } try { outputStream = serialPort.getOutputStream(); } catch (IOException e) { logger.error("{} exception:{}", this.toString(), e.getMessage()); this.close(); return false; } try { serialPort.addEventListener(this); } catch (TooManyListenersException e) { logger.error("{} exception:{}", this.toString(), e.getMessage()); this.close(); return false; } serialPort.notifyOnDataAvailable(true); if (this.forceRTS) { serialPort.notifyOnOutputEmpty(true); } try { serialPort.setSerialPortParams(baud, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); } catch (UnsupportedCommOperationException e) { logger.error("{} exception: {}", this.toString(), e.getMessage()); this.close(); return false; } } if (logger.isDebugEnabled()) { logger.debug("{} - opened", this.toString()); } portState.setState(PortStates.LISTENING); connected = true; return true; }