Hello,
I have a few FTDI USB to COM converters. After attaching one to the
USB port, it is accessible under /dev/cuaU0. When I attach a few of them, they
are accessible under /dev/cuaU0, /dev/cuaU1 and so on. Now I need to identify
which /dev/cuaUX device is assigned to which FTDI device. Each FTDI device has
a unique iSerialNumber.
What I do now, is analizing the output of dmesg and
usbdevs commands.
usbdevs allows me to assign a uftdi device to a physical
FTDI device by its iSerialNumber, i.e.:
usbdevs -dv
port 2 addr 3: full
speed, power 100 mA, config 1, USB To RS-485 High Speed Converter(0x6001),
ATC(0x0403), rev 4.00, iSerialNumber FTRZB4V7
uftdi0
dmesg gives
information about which uftdi device is connected to which ucom device, i.e.:
dmesg
uftdi0 at uhub3 port 2 "ATC USB To RS-485 High Speed Converter" rev
2.00/4.00 addr 3
ucom1 at uftdi0 portno 1
Is there a more proper and
elegant way to do this? What I need is to write a simple shell script or C
program doing this task.
Thanks in advance for any suggestions.