libftdi Archives

Subject: RE: Writing and reading to a FT232R

From: Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Mon, 7 Nov 2011 16:17:32 +0100
>>>>> "Ampt,Maurice" == Ampt,Maurice M L <m.ampt@xxxxxxxxxxxxxxxxx> writes:

    Ampt,Maurice> After looking into (lib)udev I found out that what I
    Ampt,Maurice> wanted in my situation isn't possible.  I wanted to see
    Ampt,Maurice> what VID/PID belong to which /dev/ttyUSB device so I could
    Ampt,Maurice> use my working open/read/write /dev/ttyUSB code to
    Ampt,Maurice> dynamically pick the right /dev/ttyUSB device since this
    Ampt,Maurice> can be 0,1 and many more.

    Ampt,Maurice> This sadly isn't possible in my situation because the USB
    Ampt,Maurice> devices are FTDI chips which from the USB perspective all
    Ampt,Maurice> are the same (same VID/PID/description).

You can programm VID/PID/Vendor/Description/Serial. I tried something like
SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", ATTRS{product}=="QM07", NAME="qm07_%n"
in
/etc/udev/rules.d/10-udev.rules
and even so udev was not happy with my syntax, the devices/links were
created.

    Ampt,Maurice> I'd like to thank you very much for helping me with your
    Ampt,Maurice> knowledge, even though I wasn't very clear at some times
    Ampt,Maurice> and had a bad mail format in the beginning in your opinion
    Ampt,Maurice> combined with only a small amount of knowledge of Linux.

If you still need to go with libftdi, check the return value for every call
and decipher all failed call. For the write function, print out the return
value in all cases, to see if you have a partial write. If there is no
eye-opener there, perhaps use usbmon to see what pakets go on the usb wire.

Bye
-- 
Uwe Bonnes                bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread