/** Close the serial port. */ public void delete() { // Close the serial port try { if (inputStream != null) inputStream.close(); outputStream.close(); } catch (IOException e) { } mbedSerialPort.removeEventListener(); mbedSerialPort.close(); mbedPort.close(); }