UsbSerialForAndroid icon indicating copy to clipboard operation
UsbSerialForAndroid copied to clipboard

IOException for Prolific PL2303GT (prodId 9155 / 0x23c3)

Open elynden opened this issue 1 year ago • 1 comments

Device in title is not recognized as the correct device type of HXN, but rather type T. This results in an IOException. It's because it does not do the TestHxStatus() check if deviceVersion == 0x300 & usbVersion ==0x200. The original Java code does do this check.

Method is Open(UsbDeviceConnection connection). Currently lines 373 to 392.

The following code in ProlificSerialDriver.cs needs to be replaced: if (mDevice.DeviceClass == UsbClass.Comm || 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 { mDeviceType = DeviceType.DEVICE_TYPE_HX; }

Replace with: if (mDevice.DeviceClass == UsbClass.Comm || maxPacketSize0 != 64) { mDeviceType = DeviceType.DEVICE_TYPE_01; } else if (usbVersion == 0x200) { if ((deviceVersion == 0x300 || deviceVersion == 0x500) && TestHxStatus()) { mDeviceType = DeviceType.DEVICE_TYPE_T; // TA & TB } else { mDeviceType = DeviceType.DEVICE_TYPE_HXN; } } else { mDeviceType = DeviceType.DEVICE_TYPE_HX; }

elynden avatar Feb 29 '24 19:02 elynden

If your suggested change works with your hardware, please submit a pull request for that change.

anotherlab avatar Mar 01 '24 17:03 anotherlab