mirror of
https://github.com/mik3y/usb-serial-for-android
synced 2025-07-16 06:26:06 +00:00
added support to retrieve the device serial number
This commit is contained in:
parent
dbdf95525e
commit
09c84a4a3c
usbSerialForAndroid/src/main/java/com/hoho/android/usbserial/driver
@ -79,6 +79,15 @@ abstract class CommonUsbSerialPort implements UsbSerialPort {
|
|||||||
public int getPortNumber() {
|
public int getPortNumber() {
|
||||||
return mPortNumber;
|
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
|
* Sets the size of the internal buffer used to exchange data with the USB
|
||||||
|
@ -90,6 +90,11 @@ public interface UsbSerialPort {
|
|||||||
* Port number within driver.
|
* Port number within driver.
|
||||||
*/
|
*/
|
||||||
public int getPortNumber();
|
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
|
* Opens and initializes the port. Upon success, caller must ensure that
|
||||||
|
Loading…
x
Reference in New Issue
Block a user