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



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)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: Pre-buffering in Dshow
    ... COutputQueue) and wait in pause till its done...... ... source filter, which is a push model source filter. ... Renderers do not complete the ... source filter until you have reached a certain buffer level. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: cin.get() does not work if there is a previous cin?
    ... >According to Josuttis, 'sync' will sync the buffer, ... >it clears characters from the buffer. ... >inline void Pause() ... Dietmar Khuel, Angelica Langer and Nico Josuttis, I still failed to find ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Reading audio samples
    ... samples could be stored in a buffer for the next reading ... needs to call SetPositions() every time to set the new stop position. ... mechanism we discussed so that you can use pause instead of stop. ...
    (microsoft.public.win32.programmer.directx.audio)
  • Re: Purging print job problems.
    ... Some printers have a control panel that will allow you to pause the job at ... also be able to also flush the printer spool buffer. ... and the other via a wireless print server. ... Is there anyway to manually dlete things ...
    (microsoft.public.windowsxp.print_fax)
  • Re: Masters Slideshow in a Flash!
    ... slideshow into a more viewable format. ... You may have to pause it and let it buffer in for a few seconds. ...
    (rec.sport.golf)