felHR85 / UsbSerial

Usb serial controller for Android
MIT License
1.8k stars 587 forks source link

Ensure findSerialPortDevice() requests access ONLY to a supported device #192

Closed mws-rmain closed 5 years ago

mws-rmain commented 5 years ago

The hashmap returned by usbManager.getDeviceList() contains devices in random order. These changes ensure that access is requested for the first supported device. This fixes an issue when other devices are present, and would sometimes appear ahead of the USB/Serial device in the hashmap, so access was requested for the wrong device.

Other changes add key diagnostic information to the log for debugging purposes.