@Override protected void doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception { RxtxDeviceAddress remote = (RxtxDeviceAddress) remoteAddress; final CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(remote.value()); final CommPort commPort = cpi.open(getClass().getName(), 1000); commPort.enableReceiveTimeout(config().getOption(READ_TIMEOUT)); deviceAddress = remote; serialPort = (SerialPort) commPort; }
@Override protected void doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception { RxtxDeviceAddress remote = (RxtxDeviceAddress) remoteAddress; final CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(remote.value()); final CommPort commPort = cpi.open(getClass().getName(), 1000); commPort.enableReceiveTimeout(config().getOption(READ_TIMEOUT)); deviceAddress = remote; serialPort = (SerialPort) commPort; }
public void close() { if (debug) System.out.println("CommPort:close()"); try { CommPortIdentifier cp = CommPortIdentifier.getPortIdentifier(this); if (cp != null) CommPortIdentifier.getPortIdentifier(this).internalClosePort(); } catch (NoSuchPortException e) { } };
public void close() { if (debug) System.out.println("CommPort:close()"); try { CommPortIdentifier cp = CommPortIdentifier.getPortIdentifier(this); if ( cp != null ) cp.getPortIdentifier(this).internalClosePort(); } catch (NoSuchPortException e) { } };
@SuppressWarnings("static-access") public void close() { if (debug) System.out.println("CommPort:close()"); try { CommPortIdentifier cp = CommPortIdentifier.getPortIdentifier(this); if ( cp != null ) cp.getPortIdentifier(this).internalClosePort(); } catch (NoSuchPortException e) { } };
@SuppressWarnings("static-access") public void close() { if (debug) System.out.println("CommPort:close()"); try { CommPortIdentifier cp = CommPortIdentifier.getPortIdentifier(this); if ( cp != null ) cp.getPortIdentifier(this).internalClosePort(); } catch (NoSuchPortException e) { } };
@Override public @Nullable SerialPortIdentifier getPortIdentifier(URI port) { CommPortIdentifier ident = null; if ((System.getProperty("os.name").toLowerCase().indexOf("linux") != -1)) { SerialPortUtil.appendSerialPortProperty(port.getPath()); } try { ident = CommPortIdentifier.getPortIdentifier(port.getPath()); } catch (gnu.io.NoSuchPortException e) { logger.debug("No SerialPortIdentifier found for: {}", port.getPath()); return null; } return new SerialPortIdentifierImpl(ident); }
@Override public @Nullable SerialPortIdentifier getPortIdentifier(URI port) { CommPortIdentifier ident = null; if ((System.getProperty("os.name").toLowerCase().indexOf("linux") != -1)) { SerialPortUtil.appendSerialPortProperty(port.getPath()); } try { ident = CommPortIdentifier.getPortIdentifier(port.getPath()); } catch (gnu.io.NoSuchPortException e) { logger.debug("No SerialPortIdentifier found for: {}", port.getPath()); return null; } return new SerialPortIdentifierImpl(ident); }
@Override public void connect() throws SwegonVentilationException { try { CommPortIdentifier portIdentifier = CommPortIdentifier .getPortIdentifier(portName); CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000); serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(BAUDRATE, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); in = serialPort.getInputStream(); logger.debug("Swegon ventilation Serial Port message listener started"); } catch (Exception e) { throw new SwegonVentilationException(e); } }
@Override protected void doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception { RxtxDeviceAddress remote = (RxtxDeviceAddress) remoteAddress; final CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(remote.value()); final CommPort commPort = cpi.open(getClass().getName(), 1000); commPort.enableReceiveTimeout(config().getOption(READ_TIMEOUT)); deviceAddress = remote; serialPort = (SerialPort) commPort; }
@Override protected void doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception { RxtxDeviceAddress remote = (RxtxDeviceAddress) remoteAddress; final CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(remote.value()); final CommPort commPort = cpi.open(getClass().getName(), 1000); commPort.enableReceiveTimeout(config().getOption(READ_TIMEOUT)); deviceAddress = remote; serialPort = (SerialPort) commPort; }
@Override protected void doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception { RxtxDeviceAddress remote = (RxtxDeviceAddress) remoteAddress; final CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(remote.value()); final CommPort commPort = cpi.open(getClass().getName(), 1000); commPort.enableReceiveTimeout(config().getOption(READ_TIMEOUT)); deviceAddress = remote; serialPort = (SerialPort) commPort; }
@Override protected void doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception { RxtxDeviceAddress remote = (RxtxDeviceAddress) remoteAddress; final CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(remote.value()); final CommPort commPort = cpi.open(getClass().getName(), 1000); commPort.enableReceiveTimeout(config().getOption(READ_TIMEOUT)); deviceAddress = remote; serialPort = (SerialPort) commPort; }
@Override protected void doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception { RxtxDeviceAddress remote = (RxtxDeviceAddress) remoteAddress; final CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(remote.value()); final CommPort commPort = cpi.open(getClass().getName(), 1000); commPort.enableReceiveTimeout(config().getOption(READ_TIMEOUT)); deviceAddress = remote; serialPort = (SerialPort) commPort; }
@Override protected void doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception { RxtxDeviceAddress remote = (RxtxDeviceAddress) remoteAddress; final CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(remote.value()); final CommPort commPort = cpi.open(getClass().getName(), 1000); commPort.enableReceiveTimeout(config().getOption(READ_TIMEOUT)); deviceAddress = remote; serialPort = (SerialPort) commPort; }
@Override protected void doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception { RxtxDeviceAddress remote = (RxtxDeviceAddress) remoteAddress; final CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(remote.value()); final CommPort commPort = cpi.open(getClass().getName(), 1000); commPort.enableReceiveTimeout(config().getOption(READ_TIMEOUT)); deviceAddress = remote; serialPort = (SerialPort) commPort; }
@Override protected void doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception { RxtxDeviceAddress remote = (RxtxDeviceAddress) remoteAddress; final CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(remote.value()); final CommPort commPort = cpi.open(getClass().getName(), 1000); commPort.enableReceiveTimeout(config().getOption(READ_TIMEOUT)); deviceAddress = remote; serialPort = (SerialPort) commPort; }
@Override protected void doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception { RxtxDeviceAddress remote = (RxtxDeviceAddress) remoteAddress; final CommPortIdentifier cpi = CommPortIdentifier.getPortIdentifier(remote.value()); final CommPort commPort = cpi.open(getClass().getName(), 1000); commPort.enableReceiveTimeout(config().getOption(READ_TIMEOUT)); deviceAddress = remote; serialPort = (SerialPort) commPort; }
@Override public void init() throws Exception { CommPortIdentifier portIdentifier; portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if (portIdentifier.isCurrentlyOwned()) { System.out.println("Error: Port is currently in use"); } else { serialPort = (SerialPort) portIdentifier.open("Serial", 2000); serialPort.setSerialPortParams(speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } }
public void serialinit() throws Exception { CommPortIdentifier portIdentifier; portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if (portIdentifier.isCurrentlyOwned()) { System.out.println("Error: Port is currently in use"); } else { serialPort = (SerialPort) portIdentifier.open("Serial", 2000); serialPort.setSerialPortParams(speed, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE); inputStream = serialPort.getInputStream(); outputStream = serialPort.getOutputStream(); } }