mirror of
https://github.com/mik3y/usb-serial-for-android
synced 2025-06-07 07:56:20 +00:00
improve PL2303 device type detection (#439)
This commit is contained in:
parent
b0e956c5b3
commit
1091b4d88b
@ -299,12 +299,14 @@ public class ProlificSerialDriver implements UsbSerialDriver {
|
||||
byte maxPacketSize0 = rawDescriptors[7];
|
||||
if (mDevice.getDeviceClass() == 0x02 || maxPacketSize0 != 64) {
|
||||
mDeviceType = DeviceType.DEVICE_TYPE_01;
|
||||
} else if(deviceVersion == 0x300 && usbVersion == 0x200) {
|
||||
mDeviceType = DeviceType.DEVICE_TYPE_T; // TA
|
||||
} else if(deviceVersion == 0x500) {
|
||||
mDeviceType = DeviceType.DEVICE_TYPE_T; // TB
|
||||
} else if(usbVersion == 0x200 && !testHxStatus()) {
|
||||
mDeviceType = DeviceType.DEVICE_TYPE_HXN;
|
||||
} else if(usbVersion == 0x200) {
|
||||
if(deviceVersion == 0x300 && testHxStatus()) {
|
||||
mDeviceType = DeviceType.DEVICE_TYPE_T; // TA
|
||||
} else if(deviceVersion == 0x500 && testHxStatus()) {
|
||||
mDeviceType = DeviceType.DEVICE_TYPE_T; // TB
|
||||
} else {
|
||||
mDeviceType = DeviceType.DEVICE_TYPE_HXN;
|
||||
}
|
||||
} else {
|
||||
mDeviceType = DeviceType.DEVICE_TYPE_HX;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user