Google
  Web www.spinics.net

[SOLVED] Serial buffer corruption [was Re: FTDI usb-serial possible bug]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Accidentally I've replied privately, sorry. Forwarding to ML...

---------- Forwarded message ----------
From: Antonino Ingargiola <tritemio@xxxxxxxxx>
Date: May 4, 2007 11:29 AM
Subject: Re: [SOLVED] Serial buffer corruption [was Re: FTDI
usb-serial possible bug]
To: Oliver Neukum <oliver@xxxxxxxxxx>


On 5/4/07, Oliver Neukum <oliver@xxxxxxxxxx> wrote:
> Am Freitag, 4. Mai 2007 10:38 schrieb Antonino Ingargiola:
> > To solve the problem we must do a complete flush of all the buffer
> > chain. I do this flushing the input multiple times with a small pause
> > between them. In my case 10 flushes separated by a 10ms pause always
> > empties the whole buffer chain, so I get no corruption anymore. I'ts
> > not an elegant solution but it works (10 flushes are an overkill but I
> > want to be _really_ sure to read the correct data).
>
> How do you flush the buffers? Simply reading them out?

Nope. In python I use the flushInput() method of the serial object
defined by the pyserial library[0]. The method does just this system
call:

    termios.tcflush(self.fd, TERMIOS.TCIFLUSH)

that I think is correct.

Cheers,

  ~ Antonio

[0]: http://pyserial.sourceforge.net/ (or python-serial debian package)

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Linux-usb-users@xxxxxxxxxxxxxxxxxxxxx
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

[Linux USB]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Video Projectors]     [PDAs]     [Free Online Dating]     [Hacking TiVo]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Devices]     [Big List of Linux Books]     [16.7MP]