1
0
mirror of https://github.com/mik3y/usb-serial-for-android synced 2025-06-07 16:06:10 +00:00

added support to retrieve the device serial number

This commit is contained in:
bens-unit01 2014-09-09 16:06:28 -04:00 committed by mike wakerly
parent dbdf95525e
commit 09c84a4a3c
2 changed files with 14 additions and 0 deletions

View File

@ -80,6 +80,15 @@ abstract class CommonUsbSerialPort implements UsbSerialPort {
return mPortNumber;
}
/**
* Returns the device serial number
* @return serial number
*/
@Override
public String getSerial() {
return mConnection.getSerial();
}
/**
* Sets the size of the internal buffer used to exchange data with the USB
* stack for read operations. Most users should not need to change this.

View File

@ -91,6 +91,11 @@ public interface UsbSerialPort {
*/
public int getPortNumber();
/**
* The serial number of the underlying UsbDeviceConnection, or {@code null}.
*/
public String getSerial();
/**
* Opens and initializes the port. Upon success, caller must ensure that
* {@link #close()} is eventually called.