Here I am sharing my solution to address specific devices by the ftdi_eeprom
utility, in an environment where multiple FTDI devices are connected with the
same VID/PID.
The addressing works through an additional parameter in the config file, named
"description".
Example:
description=d:001/009
When this parameter is given, the ftdi_usb_open_string(ftdi, description)
function is called instead of the ftdi_usb_open(ftdi, vendor_id, product_id).
The ftdi_usb_open_string allows addressing the device in many ways:
"
\param description NULL-terminated description-string, using this format:
\li <tt>d:\<devicenode></tt> path of bus and device-node (e.g.
"003/001") within usb device tree (usually at /proc/bus/usb/)
\li <tt>i:\<vendor>:\<product></tt> first device with given vendor and
product id, ids can be decimal, octal (preceded by "0") or hex (preceded by
"0x")
\li <tt>i:\<vendor>:\<product>:\<index></tt> as above with index being
the number of the device (starting with 0) if there are more than one
\li <tt>s:\<vendor>:\<product>:\<serial></tt> first device with given
vendor id, product id and serial string
"
The modified source file is attached.
Maintainers, please let me know if you have found it worthy.
==========================
This e-mail, including any attachments, is intended for the exclusive use of
the person(s) to which it is addressed and may contain proprietary,
confidential and/or privileged information. If the reader of this e-mail is not
the intended recipient or his or her authorized agent, any review, use,
printing, copying, disclosure, dissemination or distribution of this e-mail is
strictly prohibited. If you think that you have received the e-mail in error,
please notify the sender immediately by return e-mail, delete this
communication and destroy all copies.
==========================
--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx
main.c
Description: main.c
|