Expose isOpen on CommonUsbSerialPort

pull/281/head
Behxhet Sadiku 2020-05-19 20:50:42 +02:00
rodzic ca78840144
commit 37324c6b0f
2 zmienionych plików z 9 dodań i 0 usunięć

Wyświetl plik

@ -221,6 +221,10 @@ public abstract class CommonUsbSerialPort implements UsbSerialPort {
return offset;
}
@Override
public boolean isOpen() {
return mConnection != null;
}
@Override
public abstract void setParameters(int baudRate, int dataBits, int stopBits, int parity) throws IOException;

Wyświetl plik

@ -226,4 +226,9 @@ public interface UsbSerialPort extends Closeable {
*/
public boolean purgeHwBuffers(boolean purgeWriteBuffers, boolean purgeReadBuffers) throws IOException;
/**
* @return the current state of the connection
*/
public boolean isOpen();
}