public static void closeRxtxPort(RXTXPort port){ try{ //port.IOLocked = 0; } catch(IllegalAccessError e){ System.out.println(e.getMessage()); } port.close(); } }
/** Finalize the port */ protected void finalize() { if (debug) z.reportln("RXTXPort:finalize()"); if (fd > 0) { if (debug) z.reportln("RXTXPort:calling close()"); close(); } z.finalize(); }
/** Finalize the port */ protected void finalize() { if (debug) z.reportln( "RXTXPort:finalize()"); if( fd > 0 ) { if (debug) z.reportln( "RXTXPort:calling close()"); close(); } z.finalize(); }
/** Finalize the port */ protected void finalize() { if (debug) z.reportln( "RXTXPort:finalize()"); if( fd > 0 ) { if (debug) z.reportln( "RXTXPort:calling close()"); close(); } z.finalize(); }
/** Finalize the port */ protected void finalize() { if (debug) z.reportln( "RXTXPort:finalize()"); if( fd > 0 ) { if (debug) z.reportln( "RXTXPort:calling close()"); close(); } z.finalize(); }
public synchronized void close() throws IOException { if (isClosed()) { return; } try { this.serial0s.closeStream(); this.serialIs.closeStream(); this.rxtxPort.close(); this.serial0s = null; this.serialIs = null; this.rxtxPort = null; } finally { this.closed = true; } }
@Override public void close() { try { if (inputStream != null) { inputStream.close(); inputStream = null; } if (outputStream != null) { outputStream.close(); outputStream = null; } } catch (IOException e) { logger.error(e.getMessage(), e); } synchronized (lock) { if (serialPort != null) { try { serialPort.notifyOnDataAvailable(false); serialPort.removeEventListener(); portIdentifier.removePortOwnershipListener(this); serialPort.close(); serialPort = null; connectionOpen = false; } catch (Exception e) { } } } }
public void disconnect() { try { try { getInputStream().close(); getOutputStream().close(); serial.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e); } serial = null; setConnected(false); } catch (UnsatisfiedLinkError e) { throw new NativeResourceException(e.getMessage()); } }
public void disconnect() { try { try { getInputStream().close(); getOutputStream().close(); serial.close(); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e); } serial = null; setConnected(false); } catch (UnsatisfiedLinkError e) { throw new NativeResourceException(e.getMessage()); } }