mirror of
				https://github.com/mik3y/usb-serial-for-android
				synced 2025-10-30 18:07:21 +00:00 
			
		
		
		
	Merge pull request #281 from bensadiku/master
Expose a isOpen method to check on the current state of the connection
This commit is contained in:
		
						commit
						33149b66fd
					
				| @ -221,6 +221,10 @@ public abstract class CommonUsbSerialPort implements UsbSerialPort { | |||||||
|         return offset; |         return offset; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     @Override | ||||||
|  |     public boolean isOpen() { | ||||||
|  |         return mConnection != null; | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|     @Override |     @Override | ||||||
|     public abstract void setParameters(int baudRate, int dataBits, int stopBits, int parity) throws IOException; |     public abstract void setParameters(int baudRate, int dataBits, int stopBits, int parity) throws IOException; | ||||||
|  | |||||||
| @ -226,4 +226,9 @@ public interface UsbSerialPort extends Closeable { | |||||||
|      */ |      */ | ||||||
|     public boolean purgeHwBuffers(boolean purgeWriteBuffers, boolean purgeReadBuffers) throws IOException; |     public boolean purgeHwBuffers(boolean purgeWriteBuffers, boolean purgeReadBuffers) throws IOException; | ||||||
| 
 | 
 | ||||||
|  |     /** | ||||||
|  |      * @return the current state of the connection | ||||||
|  |      */ | ||||||
|  |     public boolean isOpen(); | ||||||
|  | 
 | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user