mirror of
				https://github.com/mik3y/usb-serial-for-android
				synced 2025-10-31 10:27:27 +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]; |             byte maxPacketSize0 = rawDescriptors[7]; | ||||||
|             if (mDevice.getDeviceClass() == 0x02 || maxPacketSize0 != 64) { |             if (mDevice.getDeviceClass() == 0x02 || maxPacketSize0 != 64) { | ||||||
|                 mDeviceType = DeviceType.DEVICE_TYPE_01; |                 mDeviceType = DeviceType.DEVICE_TYPE_01; | ||||||
|             } else if(deviceVersion == 0x300 && usbVersion == 0x200) { |             } else if(usbVersion == 0x200) { | ||||||
|  |                 if(deviceVersion == 0x300 && testHxStatus()) { | ||||||
|                     mDeviceType = DeviceType.DEVICE_TYPE_T; // TA |                     mDeviceType = DeviceType.DEVICE_TYPE_T; // TA | ||||||
|             } else if(deviceVersion == 0x500) { |                 } else if(deviceVersion == 0x500 && testHxStatus()) { | ||||||
|                     mDeviceType = DeviceType.DEVICE_TYPE_T; // TB |                     mDeviceType = DeviceType.DEVICE_TYPE_T; // TB | ||||||
|             } else if(usbVersion == 0x200 && !testHxStatus()) { |                 } else { | ||||||
|                     mDeviceType = DeviceType.DEVICE_TYPE_HXN; |                     mDeviceType = DeviceType.DEVICE_TYPE_HXN; | ||||||
|  |                 } | ||||||
|             } else { |             } else { | ||||||
|                 mDeviceType = DeviceType.DEVICE_TYPE_HX; |                 mDeviceType = DeviceType.DEVICE_TYPE_HX; | ||||||
|             } |             } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user