diff --git a/Troubleshooting.mediawiki b/Troubleshooting.mediawiki index 1d20f7c..0cc4a54 100644 --- a/Troubleshooting.mediawiki +++ b/Troubleshooting.mediawiki @@ -38,6 +38,17 @@ Most Arduinos with CDC driver use the DTR line to determine serial channel readi You don't. /dev/tty* is the Linux kernel's driver interface to various serial devices. Certain devices and custom ROMs ''may'' expose serial devices this way, but this library does not use this interface. +== Can I open multiple connections in one application? == + +You can connect to multiple devices and to multiple ports of a multi-port device in one App. + +* When connecting to different ports in a multi-port device, each connection needs it's own UsbDeviceConnection, else the first close will also close all other ports. +* When using SerialInputOutputManager, each has to run in it's own Executor. +* Distinguishing identical devices has some challenges: +** Use devices with different VIDs/PIDs or where they can be programmed like FTDI or CP210x . +** Use UsbDevice.getSerialNumber() and devices that come with a unique serial or where it can be programmed like FTDI or CP210x.
'''Note:''' Starting with Android 10, the serial number is only accessible after device access permission has been granted. +** Using UsbDevice.getDeviceName() or UsbDevice.getDeviceId() is not an option as the numbers increase when re-attaching a device. + == When reading a message, why don't all bytes arrive at the same time? == The protocol layer does not guarantee that all bytes will arrive in a single message. In fact the protocol layer doesn't have any knowledge of what your "message" is — it is just an interface for sending a serial stream of bytes.