@Override
    public void open(String name) throws ChannelException {
        try {
            if (port == null) {
                port = (SerialPort) commPortIdentifier.open(name, 2000);
            }
            port.setSerialPortParams(
                19200, 
                SerialPort.DATABITS_8, 
                SerialPort.STOPBITS_1, 
                SerialPort.PARITY_NONE);
            port.addEventListener(new Receiver());
            port.notifyOnDataAvailable(true);
            inputStream = port.getInputStream();
            outputStream = port.getOutputStream();
        }
        catch (PortInUseException | UnsupportedCommOperationException | TooManyListenersException | IOException ex) {
            throw new ChannelException(ex);
        }
    }